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,IAAIskE,EAAWv4E,EAAQw4E,aACvBx4E,EAAQw4E,aAAeD,EAAW,GAAG1qE,OAAO0qE,EAAUb,GAAQ,CAACA,EACjE,CAGF,MAAO,CACLp8E,QAAS87E,EACTp3E,QAASA,EAEb,CCxFA,IAAIgzE,EAAY,EACd,EACAnwE,EACAm0E,GACA,EACA,KACA,KACA,MAIF,EAAehE,EAAiB,QChBhC,GACEyF,QAASA,CAACC,EAAK14E,KACb04E,EAAI1F,UAAU,UAAW2F,EAAQ,GCFrC,G","sources":["webpack://GuChart/webpack/universalModuleDefinition","webpack://GuChart/./node_modules/vue-class-component/dist/vue-class-component.esm.js","webpack://GuChart/./node_modules/vue-property-decorator/lib/helpers/metadata.js","webpack://GuChart/./node_modules/ag-charts-community/dist/es6/util/padding.js","webpack://GuChart/./node_modules/ag-charts-community/dist/es6/scene/node.js","webpack://GuChart/./node_modules/ag-charts-community/dist/es6/scene/bbox.js","webpack://GuChart/./node_modules/ag-charts-community/dist/es6/scene/matrix.js","webpack://GuChart/./node_modules/ag-charts-community/dist/es6/util/id.js","webpack://GuChart/./node_modules/ag-charts-community/dist/es6/util/object.js","webpack://GuChart/./node_modules/ag-charts-community/dist/es6/scene/shape/shape.js","webpack://GuChart/./node_modules/ag-charts-community/dist/es6/canvas/hdpiCanvas.js","webpack://GuChart/./node_modules/ag-charts-community/dist/es6/scene/shape/text.js","webpack://GuChart/./node_modules/ag-charts-community/dist/es6/util/observable.js","webpack://GuChart/./node_modules/ag-charts-community/dist/es6/caption.js","webpack://GuChart/./node_modules/ag-charts-community/dist/es6/interpolate/constant.js","webpack://GuChart/./node_modules/ag-charts-community/dist/es6/interpolate/number.js","webpack://GuChart/./node_modules/ag-charts-community/dist/es6/interpolate/date.js","webpack://GuChart/./node_modules/ag-charts-community/dist/es6/interpolate/array.js","webpack://GuChart/./node_modules/ag-charts-community/dist/es6/interpolate/object.js","webpack://GuChart/./node_modules/ag-charts-community/dist/es6/util/color.js","webpack://GuChart/./node_modules/ag-charts-community/dist/es6/interpolate/color.js","webpack://GuChart/./node_modules/ag-charts-community/dist/es6/interpolate/value.js","webpack://GuChart/./node_modules/ag-charts-community/dist/es6/util/compare.js","webpack://GuChart/./node_modules/ag-charts-community/dist/es6/util/bisect.js","webpack://GuChart/./node_modules/ag-charts-community/dist/es6/scale/continuousScale.js","webpack://GuChart/./node_modules/ag-charts-community/dist/es6/util/ticks.js","webpack://GuChart/./node_modules/ag-charts-community/dist/es6/util/numberFormat.js","webpack://GuChart/./node_modules/ag-charts-community/dist/es6/scale/linearScale.js","webpack://GuChart/./node_modules/ag-charts-community/dist/es6/scene/group.js","webpack://GuChart/./node_modules/ag-charts-community/dist/es6/scene/selection.js","webpack://GuChart/./node_modules/ag-charts-community/dist/es6/scene/shape/line.js","webpack://GuChart/./node_modules/ag-charts-community/dist/es6/scene/polyRoots.js","webpack://GuChart/./node_modules/ag-charts-community/dist/es6/scene/intersection.js","webpack://GuChart/./node_modules/ag-charts-community/dist/es6/scene/path2D.js","webpack://GuChart/./node_modules/ag-charts-community/dist/es6/scene/shape/path.js","webpack://GuChart/./node_modules/ag-charts-community/dist/es6/util/angle.js","webpack://GuChart/./node_modules/ag-charts-community/dist/es6/util/number.js","webpack://GuChart/./node_modules/ag-charts-community/dist/es6/scene/shape/arc.js","webpack://GuChart/./node_modules/ag-charts-community/dist/es6/axis.js","webpack://GuChart/./node_modules/ag-charts-community/dist/es6/chart/chartAxis.js","webpack://GuChart/./node_modules/ag-charts-community/dist/es6/chart/axis/numberAxis.js","webpack://GuChart/./node_modules/ag-charts-community/dist/es6/scale/bandScale.js","webpack://GuChart/./node_modules/ag-charts-community/dist/es6/chart/axis/categoryAxis.js","webpack://GuChart/./node_modules/ag-charts-community/dist/es6/util/array.js","webpack://GuChart/./node_modules/ag-charts-community/dist/es6/layout/tree.js","webpack://GuChart/./node_modules/ag-charts-community/dist/es6/chart/axis/groupedCategoryAxis.js","webpack://GuChart/./node_modules/ag-charts-community/dist/es6/util/time/interval.js","webpack://GuChart/./node_modules/ag-charts-community/dist/es6/util/time/millisecond.js","webpack://GuChart/./node_modules/ag-charts-community/dist/es6/util/time/duration.js","webpack://GuChart/./node_modules/ag-charts-community/dist/es6/util/time/second.js","webpack://GuChart/./node_modules/ag-charts-community/dist/es6/util/time/minute.js","webpack://GuChart/./node_modules/ag-charts-community/dist/es6/util/time/hour.js","webpack://GuChart/./node_modules/ag-charts-community/dist/es6/util/time/day.js","webpack://GuChart/./node_modules/ag-charts-community/dist/es6/util/time/week.js","webpack://GuChart/./node_modules/ag-charts-community/dist/es6/util/time/month.js","webpack://GuChart/./node_modules/ag-charts-community/dist/es6/util/time/year.js","webpack://GuChart/./node_modules/ag-charts-community/dist/es6/util/time/utcDay.js","webpack://GuChart/./node_modules/ag-charts-community/dist/es6/util/time/utcYear.js","webpack://GuChart/./node_modules/ag-charts-community/dist/es6/util/time/utcWeek.js","webpack://GuChart/./node_modules/ag-charts-community/dist/es6/util/time/format/locale.js","webpack://GuChart/./node_modules/ag-charts-community/dist/es6/util/time/format/defaultLocale.js","webpack://GuChart/./node_modules/ag-charts-community/dist/es6/scale/timeScale.js","webpack://GuChart/./node_modules/ag-charts-community/dist/es6/scene/shape/rect.js","webpack://GuChart/./node_modules/ag-charts-community/dist/es6/chart/axis/timeAxis.js","webpack://GuChart/./node_modules/ag-charts-community/dist/es6/scene/scene.js","webpack://GuChart/./node_modules/ag-charts-community/dist/es6/scene/gradient/gradient.js","webpack://GuChart/./node_modules/ag-charts-community/dist/es6/scene/gradient/linearGradient.js","webpack://GuChart/./node_modules/ag-charts-community/dist/es6/chart/marker/marker.js","webpack://GuChart/./node_modules/ag-charts-community/dist/es6/chart/marker/square.js","webpack://GuChart/./node_modules/ag-charts-community/dist/es6/chart/markerLabel.js","webpack://GuChart/./node_modules/ag-charts-community/dist/es6/chart/marker/circle.js","webpack://GuChart/./node_modules/ag-charts-community/dist/es6/chart/marker/cross.js","webpack://GuChart/./node_modules/ag-charts-community/dist/es6/chart/marker/diamond.js","webpack://GuChart/./node_modules/ag-charts-community/dist/es6/chart/marker/heart.js","webpack://GuChart/./node_modules/ag-charts-community/dist/es6/chart/marker/plus.js","webpack://GuChart/./node_modules/ag-charts-community/dist/es6/chart/marker/triangle.js","webpack://GuChart/./node_modules/ag-charts-community/dist/es6/chart/marker/util.js","webpack://GuChart/./node_modules/ag-charts-community/dist/es6/chart/legend.js","webpack://GuChart/./node_modules/ag-charts-community/dist/es6/util/sizeMonitor.js","webpack://GuChart/./node_modules/ag-charts-community/dist/es6/chart/series/series.js","webpack://GuChart/./node_modules/ag-charts-community/dist/es6/chart/series/seriesMarker.js","webpack://GuChart/./node_modules/ag-charts-community/dist/es6/chart/series/cartesian/cartesianSeries.js","webpack://GuChart/./node_modules/ag-charts-community/dist/es6/chart/chart.js","webpack://GuChart/./node_modules/ag-charts-community/dist/es6/scene/clipRect.js","webpack://GuChart/./node_modules/ag-charts-community/dist/es6/chart/shapes/rangeHandle.js","webpack://GuChart/./node_modules/ag-charts-community/dist/es6/chart/shapes/rangeMask.js","webpack://GuChart/./node_modules/ag-charts-community/dist/es6/chart/shapes/rangeSelector.js","webpack://GuChart/./node_modules/ag-charts-community/dist/es6/chart/navigator/navigatorMask.js","webpack://GuChart/./node_modules/ag-charts-community/dist/es6/chart/navigator/navigatorHandle.js","webpack://GuChart/./node_modules/ag-charts-community/dist/es6/chart/navigator/navigator.js","webpack://GuChart/./node_modules/ag-charts-community/dist/es6/chart/cartesianChart.js","webpack://GuChart/./node_modules/ag-charts-community/dist/es6/chart/hierarchyChart.js","webpack://GuChart/./node_modules/ag-charts-community/dist/es6/chart/groupedCategoryChart.js","webpack://GuChart/./node_modules/ag-charts-community/dist/es6/chart/series/polar/polarSeries.js","webpack://GuChart/./node_modules/ag-charts-community/dist/es6/chart/polarChart.js","webpack://GuChart/./node_modules/ag-charts-community/dist/es6/util/equal.js","webpack://GuChart/./node_modules/ag-charts-community/dist/es6/util/string.js","webpack://GuChart/./node_modules/ag-charts-community/dist/es6/chart/series/cartesian/areaSeries.js","webpack://GuChart/./node_modules/ag-charts-community/dist/es6/chart/series/cartesian/barSeries.js","webpack://GuChart/./node_modules/ag-charts-community/dist/es6/chart/label.js","webpack://GuChart/./node_modules/ag-charts-community/dist/es6/chart/series/cartesian/histogramSeries.js","webpack://GuChart/./node_modules/ag-charts-community/dist/es6/chart/series/cartesian/lineSeries.js","webpack://GuChart/./node_modules/ag-charts-community/dist/es6/chart/series/cartesian/scatterSeries.js","webpack://GuChart/./node_modules/ag-charts-community/dist/es6/chart/series/hierarchy/hierarchySeries.js","webpack://GuChart/./node_modules/ag-charts-community/dist/es6/scene/dropShadow.js","webpack://GuChart/./node_modules/ag-charts-community/dist/es6/layout/treemap.js","webpack://GuChart/./node_modules/ag-charts-community/dist/es6/layout/hierarchy.js","webpack://GuChart/./node_modules/ag-charts-community/dist/es6/chart/series/hierarchy/treemapSeries.js","webpack://GuChart/./node_modules/ag-charts-community/dist/es6/chart/series/polar/pieSeries.js","webpack://GuChart/./node_modules/ag-charts-community/dist/es6/scene/shape/sector.js","webpack://GuChart/./node_modules/ag-charts-community/dist/es6/util/time/utcMinute.js","webpack://GuChart/./node_modules/ag-charts-community/dist/es6/util/time/utcHour.js","webpack://GuChart/./node_modules/ag-charts-community/dist/es6/util/time/utcMonth.js","webpack://GuChart/./node_modules/ag-charts-community/dist/es6/chart/themes/chartTheme.js","webpack://GuChart/./node_modules/ag-charts-community/dist/es6/chart/themes/darkTheme.js","webpack://GuChart/./node_modules/ag-charts-community/dist/es6/chart/agChartMappings.js","webpack://GuChart/./node_modules/ag-charts-community/dist/es6/chart/themes/materialLight.js","webpack://GuChart/./node_modules/ag-charts-community/dist/es6/chart/themes/materialDark.js","webpack://GuChart/./node_modules/ag-charts-community/dist/es6/chart/themes/pastelLight.js","webpack://GuChart/./node_modules/ag-charts-community/dist/es6/chart/themes/pastelDark.js","webpack://GuChart/./node_modules/ag-charts-community/dist/es6/chart/themes/solarLight.js","webpack://GuChart/./node_modules/ag-charts-community/dist/es6/chart/themes/solarDark.js","webpack://GuChart/./node_modules/ag-charts-community/dist/es6/chart/themes/vividLight.js","webpack://GuChart/./node_modules/ag-charts-community/dist/es6/chart/themes/vividDark.js","webpack://GuChart/./node_modules/ag-charts-community/dist/es6/scale/logScale.js","webpack://GuChart/./node_modules/ag-charts-community/dist/es6/chart/axis/logAxis.js","webpack://GuChart/./node_modules/ag-charts-community/dist/es6/chart/agChart.js","webpack://GuChart/./node_modules/ag-charts-community/dist/es6/main.js","webpack://GuChart/./node_modules/ag-charts-vue/lib/AgChartsVue.js","webpack://GuChart/./node_modules/ag-charts-vue/main.js","webpack://GuChart/external umd \"Vue\"","webpack://GuChart/webpack/bootstrap","webpack://GuChart/webpack/runtime/compat get default export","webpack://GuChart/webpack/runtime/define property getters","webpack://GuChart/webpack/runtime/hasOwnProperty shorthand","webpack://GuChart/webpack/runtime/make namespace object","webpack://GuChart/webpack/runtime/publicPath","webpack://GuChart/./node_modules/@vue/cli-service/lib/commands/build/setPublicPath.js","webpack://GuChart/./src/components/GuChart.vue","webpack://GuChart/src/components/GuChart.vue","webpack://GuChart/./src/components/GuChart.vue?79b6","webpack://GuChart/./node_modules/@vue/vue-loader-v15/lib/runtime/componentNormalizer.js","webpack://GuChart/./src/components/GuChart.vue?0f0d","webpack://GuChart/./src/plugins/GuChart.js","webpack://GuChart/./node_modules/@vue/cli-service/lib/commands/build/entry-lib.js"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"Vue\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"Vue\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"GuChart\"] = factory(require(\"Vue\"));\n\telse\n\t\troot[\"GuChart\"] = factory(root[\"Vue\"]);\n})((typeof self !== 'undefined' ? self : this), function(__WEBPACK_EXTERNAL_MODULE__740__) {\nreturn ","/**\n * vue-class-component v7.2.6\n * (c) 2015-present Evan You\n * @license MIT\n */\nimport Vue from 'vue';\n\nfunction _typeof(obj) {\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n _typeof = function (obj) {\n return typeof obj;\n };\n } else {\n _typeof = function (obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n }\n\n return _typeof(obj);\n}\n\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nfunction _toConsumableArray(arr) {\n return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread();\n}\n\nfunction _arrayWithoutHoles(arr) {\n if (Array.isArray(arr)) {\n for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) arr2[i] = arr[i];\n\n return arr2;\n }\n}\n\nfunction _iterableToArray(iter) {\n if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === \"[object Arguments]\") return Array.from(iter);\n}\n\nfunction _nonIterableSpread() {\n throw new TypeError(\"Invalid attempt to spread non-iterable instance\");\n}\n\n// The rational behind the verbose Reflect-feature check below is the fact that there are polyfills\n// which add an implementation for Reflect.defineMetadata but not for Reflect.getOwnMetadataKeys.\n// Without this check consumers will encounter hard to track down runtime errors.\nfunction reflectionIsSupported() {\n return typeof Reflect !== 'undefined' && Reflect.defineMetadata && Reflect.getOwnMetadataKeys;\n}\nfunction copyReflectionMetadata(to, from) {\n forwardMetadata(to, from);\n Object.getOwnPropertyNames(from.prototype).forEach(function (key) {\n forwardMetadata(to.prototype, from.prototype, key);\n });\n Object.getOwnPropertyNames(from).forEach(function (key) {\n forwardMetadata(to, from, key);\n });\n}\n\nfunction forwardMetadata(to, from, propertyKey) {\n var metaKeys = propertyKey ? Reflect.getOwnMetadataKeys(from, propertyKey) : Reflect.getOwnMetadataKeys(from);\n metaKeys.forEach(function (metaKey) {\n var metadata = propertyKey ? Reflect.getOwnMetadata(metaKey, from, propertyKey) : Reflect.getOwnMetadata(metaKey, from);\n\n if (propertyKey) {\n Reflect.defineMetadata(metaKey, metadata, to, propertyKey);\n } else {\n Reflect.defineMetadata(metaKey, metadata, to);\n }\n });\n}\n\nvar fakeArray = {\n __proto__: []\n};\nvar hasProto = fakeArray instanceof Array;\nfunction createDecorator(factory) {\n return function (target, key, index) {\n var Ctor = typeof target === 'function' ? target : target.constructor;\n\n if (!Ctor.__decorators__) {\n Ctor.__decorators__ = [];\n }\n\n if (typeof index !== 'number') {\n index = undefined;\n }\n\n Ctor.__decorators__.push(function (options) {\n return factory(options, key, index);\n });\n };\n}\nfunction mixins() {\n for (var _len = arguments.length, Ctors = new Array(_len), _key = 0; _key < _len; _key++) {\n Ctors[_key] = arguments[_key];\n }\n\n return Vue.extend({\n mixins: Ctors\n });\n}\nfunction isPrimitive(value) {\n var type = _typeof(value);\n\n return value == null || type !== 'object' && type !== 'function';\n}\nfunction warn(message) {\n if (typeof console !== 'undefined') {\n console.warn('[vue-class-component] ' + message);\n }\n}\n\nfunction collectDataFromConstructor(vm, Component) {\n // override _init to prevent to init as Vue instance\n var originalInit = Component.prototype._init;\n\n Component.prototype._init = function () {\n var _this = this;\n\n // proxy to actual vm\n var keys = Object.getOwnPropertyNames(vm); // 2.2.0 compat (props are no longer exposed as self properties)\n\n if (vm.$options.props) {\n for (var key in vm.$options.props) {\n if (!vm.hasOwnProperty(key)) {\n keys.push(key);\n }\n }\n }\n\n keys.forEach(function (key) {\n Object.defineProperty(_this, key, {\n get: function get() {\n return vm[key];\n },\n set: function set(value) {\n vm[key] = value;\n },\n configurable: true\n });\n });\n }; // should be acquired class property values\n\n\n var data = new Component(); // restore original _init to avoid memory leak (#209)\n\n Component.prototype._init = originalInit; // create plain data object\n\n var plainData = {};\n Object.keys(data).forEach(function (key) {\n if (data[key] !== undefined) {\n plainData[key] = data[key];\n }\n });\n\n if (process.env.NODE_ENV !== 'production') {\n if (!(Component.prototype instanceof Vue) && Object.keys(plainData).length > 0) {\n warn('Component class must inherit Vue or its descendant class ' + 'when class property is used.');\n }\n }\n\n return plainData;\n}\n\nvar $internalHooks = ['data', 'beforeCreate', 'created', 'beforeMount', 'mounted', 'beforeDestroy', 'destroyed', 'beforeUpdate', 'updated', 'activated', 'deactivated', 'render', 'errorCaptured', 'serverPrefetch' // 2.6\n];\nfunction componentFactory(Component) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n options.name = options.name || Component._componentTag || Component.name; // prototype props.\n\n var proto = Component.prototype;\n Object.getOwnPropertyNames(proto).forEach(function (key) {\n if (key === 'constructor') {\n return;\n } // hooks\n\n\n if ($internalHooks.indexOf(key) > -1) {\n options[key] = proto[key];\n return;\n }\n\n var descriptor = Object.getOwnPropertyDescriptor(proto, key);\n\n if (descriptor.value !== void 0) {\n // methods\n if (typeof descriptor.value === 'function') {\n (options.methods || (options.methods = {}))[key] = descriptor.value;\n } else {\n // typescript decorated data\n (options.mixins || (options.mixins = [])).push({\n data: function data() {\n return _defineProperty({}, key, descriptor.value);\n }\n });\n }\n } else if (descriptor.get || descriptor.set) {\n // computed properties\n (options.computed || (options.computed = {}))[key] = {\n get: descriptor.get,\n set: descriptor.set\n };\n }\n });\n (options.mixins || (options.mixins = [])).push({\n data: function data() {\n return collectDataFromConstructor(this, Component);\n }\n }); // decorate options\n\n var decorators = Component.__decorators__;\n\n if (decorators) {\n decorators.forEach(function (fn) {\n return fn(options);\n });\n delete Component.__decorators__;\n } // find super\n\n\n var superProto = Object.getPrototypeOf(Component.prototype);\n var Super = superProto instanceof Vue ? superProto.constructor : Vue;\n var Extended = Super.extend(options);\n forwardStaticMembers(Extended, Component, Super);\n\n if (reflectionIsSupported()) {\n copyReflectionMetadata(Extended, Component);\n }\n\n return Extended;\n}\nvar reservedPropertyNames = [// Unique id\n'cid', // Super Vue constructor\n'super', // Component options that will be used by the component\n'options', 'superOptions', 'extendOptions', 'sealedOptions', // Private assets\n'component', 'directive', 'filter'];\nvar shouldIgnore = {\n prototype: true,\n arguments: true,\n callee: true,\n caller: true\n};\n\nfunction forwardStaticMembers(Extended, Original, Super) {\n // We have to use getOwnPropertyNames since Babel registers methods as non-enumerable\n Object.getOwnPropertyNames(Original).forEach(function (key) {\n // Skip the properties that should not be overwritten\n if (shouldIgnore[key]) {\n return;\n } // Some browsers does not allow reconfigure built-in properties\n\n\n var extendedDescriptor = Object.getOwnPropertyDescriptor(Extended, key);\n\n if (extendedDescriptor && !extendedDescriptor.configurable) {\n return;\n }\n\n var descriptor = Object.getOwnPropertyDescriptor(Original, key); // If the user agent does not support `__proto__` or its family (IE <= 10),\n // the sub class properties may be inherited properties from the super class in TypeScript.\n // We need to exclude such properties to prevent to overwrite\n // the component options object which stored on the extended constructor (See #192).\n // If the value is a referenced value (object or function),\n // we can check equality of them and exclude it if they have the same reference.\n // If it is a primitive value, it will be forwarded for safety.\n\n if (!hasProto) {\n // Only `cid` is explicitly exluded from property forwarding\n // because we cannot detect whether it is a inherited property or not\n // on the no `__proto__` environment even though the property is reserved.\n if (key === 'cid') {\n return;\n }\n\n var superDescriptor = Object.getOwnPropertyDescriptor(Super, key);\n\n if (!isPrimitive(descriptor.value) && superDescriptor && superDescriptor.value === descriptor.value) {\n return;\n }\n } // Warn if the users manually declare reserved properties\n\n\n if (process.env.NODE_ENV !== 'production' && reservedPropertyNames.indexOf(key) >= 0) {\n warn(\"Static property name '\".concat(key, \"' declared on class '\").concat(Original.name, \"' \") + 'conflicts with reserved property name of Vue internal. ' + 'It may cause unexpected behavior of the component. Consider renaming the property.');\n }\n\n Object.defineProperty(Extended, key, descriptor);\n });\n}\n\nfunction Component(options) {\n if (typeof options === 'function') {\n return componentFactory(options);\n }\n\n return function (Component) {\n return componentFactory(Component, options);\n };\n}\n\nComponent.registerHooks = function registerHooks(keys) {\n $internalHooks.push.apply($internalHooks, _toConsumableArray(keys));\n};\n\nexport default Component;\nexport { createDecorator, mixins };\n","/** @see {@link https://github.com/vuejs/vue-class-component/blob/master/src/reflect.ts} */\nvar reflectMetadataIsSupported = typeof Reflect !== 'undefined' && typeof Reflect.getMetadata !== 'undefined';\nexport function applyMetadata(options, target, key) {\n if (reflectMetadataIsSupported) {\n if (!Array.isArray(options) &&\n typeof options !== 'function' &&\n !options.hasOwnProperty('type') &&\n typeof options.type === 'undefined') {\n var type = Reflect.getMetadata('design:type', target, key);\n if (type !== Object) {\n options.type = type;\n }\n }\n }\n}\n","var Padding = /** @class */ (function () {\n function Padding(top, right, bottom, left) {\n if (top === void 0) { top = 0; }\n if (right === void 0) { right = top; }\n if (bottom === void 0) { bottom = top; }\n if (left === void 0) { left = right; }\n this.top = top;\n this.right = right;\n this.bottom = bottom;\n this.left = left;\n }\n Padding.prototype.clear = function () {\n this.top = this.right = this.bottom = this.left = 0;\n };\n return Padding;\n}());\nexport { Padding };\n","import { Matrix } from \"./matrix\";\nimport { createId } from \"../util/id\";\nexport var PointerEvents;\n(function (PointerEvents) {\n PointerEvents[PointerEvents[\"All\"] = 0] = \"All\";\n PointerEvents[PointerEvents[\"None\"] = 1] = \"None\";\n})(PointerEvents || (PointerEvents = {}));\n/**\n * Abstract scene graph node.\n * Each node can have zero or one parent and belong to zero or one scene.\n */\nvar Node = /** @class */ (function () {\n function Node() {\n /**\n * Unique node ID in the form `ClassName-NaturalNumber`.\n */\n this.id = createId(this);\n /**\n * Some number to identify this node, typically within a `Group` node.\n * Usually this will be some enum value used as a selector.\n */\n this.tag = NaN;\n /**\n * To simplify the type system (especially in Selections) we don't have the `Parent` node\n * (one that has children). Instead, we mimic HTML DOM, where any node can have children.\n * But we still need to distinguish regular leaf nodes from container leafs somehow.\n */\n this.isContainerNode = false;\n this._children = [];\n // Used to check for duplicate nodes.\n this.childSet = {}; // new Set()\n // These matrices may need to have package level visibility\n // for performance optimization purposes.\n this.matrix = new Matrix();\n this.inverseMatrix = new Matrix();\n this._dirtyTransform = false;\n this._scalingX = 1;\n this._scalingY = 1;\n /**\n * The center of scaling.\n * The default value of `null` means the scaling center will be\n * determined automatically, as the center of the bounding box\n * of a node.\n */\n this._scalingCenterX = null;\n this._scalingCenterY = null;\n this._rotationCenterX = null;\n this._rotationCenterY = null;\n /**\n * Rotation angle in radians.\n * The value is set as is. No normalization to the [-180, 180) or [0, 360)\n * interval is performed.\n */\n this._rotation = 0;\n this._translationX = 0;\n this._translationY = 0;\n /**\n * Each time a property of the node that effects how it renders changes\n * the `dirty` property of the node should be set to `true`. The change\n * to the `dirty` property of the node will propagate up to its parents\n * and eventually to the scene, at which point an animation frame callback\n * will be scheduled to rerender the scene and its nodes and reset the `dirty`\n * flags of all nodes and the {@link Scene._dirty | Scene} back to `false`.\n * Since changes to node properties are not rendered immediately, it's possible\n * to change as many properties on as many nodes as needed and the rendering\n * will still only happen once in the next animation frame callback.\n * The animation frame callback is only scheduled if it hasn't been already.\n */\n this._dirty = true;\n this._visible = true;\n this.pointerEvents = PointerEvents.All;\n }\n /**\n * This is meaningfully faster than `instanceof` and should be the preferred way\n * of checking inside loops.\n * @param node\n */\n Node.isNode = function (node) {\n return node ? node.matrix !== undefined : false;\n };\n Node.prototype._setScene = function (value) {\n this._scene = value;\n var children = this.children;\n var n = children.length;\n for (var i = 0; i < n; i++) {\n children[i]._setScene(value);\n }\n };\n Object.defineProperty(Node.prototype, \"scene\", {\n get: function () {\n return this._scene;\n },\n enumerable: true,\n configurable: true\n });\n Node.prototype._setParent = function (value) {\n this._parent = value;\n };\n Object.defineProperty(Node.prototype, \"parent\", {\n get: function () {\n return this._parent;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Node.prototype, \"children\", {\n get: function () {\n return this._children;\n },\n enumerable: true,\n configurable: true\n });\n Node.prototype.countChildren = function (depth) {\n if (depth === void 0) { depth = Node.MAX_SAFE_INTEGER; }\n if (depth <= 0) {\n return 0;\n }\n var children = this.children;\n var n = children.length;\n var size = n;\n for (var i = 0; i < n; i++) {\n size += children[i].countChildren(depth - 1);\n }\n return size;\n };\n /**\n * Appends one or more new node instances to this parent.\n * If one needs to:\n * - move a child to the end of the list of children\n * - move a child from one parent to another (including parents in other scenes)\n * one should use the {@link insertBefore} method instead.\n * @param nodes A node or nodes to append.\n */\n Node.prototype.append = function (nodes) {\n // Passing a single parameter to an open-ended version of `append`\n // would be 30-35% slower than this.\n if (Node.isNode(nodes)) {\n nodes = [nodes];\n }\n // The function takes an array rather than having open-ended\n // arguments like `...nodes: Node[]` because the latter is\n // transpiled to a function where the `arguments` object\n // is copied to a temporary array inside a loop.\n // So an array is created either way. And if we already have\n // an array of nodes we want to add, we have to use the prohibitively\n // expensive spread operator to pass it to the function,\n // and, on top of that, the copy of the `arguments` is still made.\n var n = nodes.length;\n for (var i = 0; i < n; i++) {\n var node = nodes[i];\n if (node.parent) {\n throw new Error(node + \" already belongs to another parent: \" + node.parent + \".\");\n }\n if (node.scene) {\n throw new Error(node + \" already belongs a scene: \" + node.scene + \".\");\n }\n if (this.childSet[node.id]) {\n // Cast to `any` to avoid `Property 'name' does not exist on type 'Function'`.\n throw new Error(\"Duplicate \" + node.constructor.name + \" node: \" + node);\n }\n this._children.push(node);\n this.childSet[node.id] = true;\n node._setParent(this);\n node._setScene(this.scene);\n }\n this.dirty = true;\n };\n Node.prototype.appendChild = function (node) {\n if (node.parent) {\n throw new Error(node + \" already belongs to another parent: \" + node.parent + \".\");\n }\n if (node.scene) {\n throw new Error(node + \" already belongs a scene: \" + node.scene + \".\");\n }\n if (this.childSet[node.id]) {\n // Cast to `any` to avoid `Property 'name' does not exist on type 'Function'`.\n throw new Error(\"Duplicate \" + node.constructor.name + \" node: \" + node);\n }\n this._children.push(node);\n this.childSet[node.id] = true;\n node._setParent(this);\n node._setScene(this.scene);\n this.dirty = true;\n return node;\n };\n Node.prototype.removeChild = function (node) {\n if (node.parent === this) {\n var i = this.children.indexOf(node);\n if (i >= 0) {\n this._children.splice(i, 1);\n delete this.childSet[node.id];\n node._setParent();\n node._setScene();\n this.dirty = true;\n return node;\n }\n }\n throw new Error(\"The node to be removed is not a child of this node.\");\n };\n /**\n * Inserts the node `node` before the existing child node `nextNode`.\n * If `nextNode` is null, insert `node` at the end of the list of children.\n * If the `node` belongs to another parent, it is first removed.\n * Returns the `node`.\n * @param node\n * @param nextNode\n */\n Node.prototype.insertBefore = function (node, nextNode) {\n var parent = node.parent;\n if (node.parent) {\n node.parent.removeChild(node);\n }\n if (nextNode && nextNode.parent === this) {\n var i = this.children.indexOf(nextNode);\n if (i >= 0) {\n this._children.splice(i, 0, node);\n this.childSet[node.id] = true;\n node._setParent(this);\n node._setScene(this.scene);\n }\n else {\n throw new Error(nextNode + \" has \" + parent + \" as the parent, \"\n + \"but is not in its list of children.\");\n }\n this.dirty = true;\n }\n else {\n this.append(node);\n }\n return node;\n };\n Object.defineProperty(Node.prototype, \"nextSibling\", {\n get: function () {\n var parent = this.parent;\n if (parent) {\n var children = parent.children;\n var index = children.indexOf(this);\n if (index >= 0 && index <= children.length - 1) {\n return children[index + 1];\n }\n }\n },\n enumerable: true,\n configurable: true\n });\n Node.prototype.transformPoint = function (x, y) {\n var matrix = Matrix.flyweight(this.matrix);\n var parent = this.parent;\n while (parent) {\n matrix.preMultiplySelf(parent.matrix);\n parent = parent.parent;\n }\n return matrix.invertSelf().transformPoint(x, y);\n };\n Node.prototype.inverseTransformPoint = function (x, y) {\n var matrix = Matrix.flyweight(this.matrix);\n var parent = this.parent;\n while (parent) {\n matrix.preMultiplySelf(parent.matrix);\n parent = parent.parent;\n }\n return matrix.transformPoint(x, y);\n };\n Object.defineProperty(Node.prototype, \"dirtyTransform\", {\n get: function () {\n return this._dirtyTransform;\n },\n set: function (value) {\n this._dirtyTransform = value;\n if (value) {\n this.dirty = true;\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Node.prototype, \"scalingX\", {\n get: function () {\n return this._scalingX;\n },\n set: function (value) {\n if (this._scalingX !== value) {\n this._scalingX = value;\n this.dirtyTransform = true;\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Node.prototype, \"scalingY\", {\n get: function () {\n return this._scalingY;\n },\n set: function (value) {\n if (this._scalingY !== value) {\n this._scalingY = value;\n this.dirtyTransform = true;\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Node.prototype, \"scalingCenterX\", {\n get: function () {\n return this._scalingCenterX;\n },\n set: function (value) {\n if (this._scalingCenterX !== value) {\n this._scalingCenterX = value;\n this.dirtyTransform = true;\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Node.prototype, \"scalingCenterY\", {\n get: function () {\n return this._scalingCenterY;\n },\n set: function (value) {\n if (this._scalingCenterY !== value) {\n this._scalingCenterY = value;\n this.dirtyTransform = true;\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Node.prototype, \"rotationCenterX\", {\n get: function () {\n return this._rotationCenterX;\n },\n set: function (value) {\n if (this._rotationCenterX !== value) {\n this._rotationCenterX = value;\n this.dirtyTransform = true;\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Node.prototype, \"rotationCenterY\", {\n get: function () {\n return this._rotationCenterY;\n },\n set: function (value) {\n if (this._rotationCenterY !== value) {\n this._rotationCenterY = value;\n this.dirtyTransform = true;\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Node.prototype, \"rotation\", {\n get: function () {\n return this._rotation;\n },\n set: function (value) {\n if (this._rotation !== value) {\n this._rotation = value;\n this.dirtyTransform = true;\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Node.prototype, \"rotationDeg\", {\n get: function () {\n return this.rotation / Math.PI * 180;\n },\n /**\n * For performance reasons the rotation angle's internal representation\n * is in radians. Therefore, don't expect to get the same number you set.\n * Even with integer angles about a quarter of them from 0 to 359 cannot\n * be converted to radians and back without precision loss.\n * For example:\n *\n * node.rotationDeg = 11;\n * console.log(node.rotationDeg); // 10.999999999999998\n *\n * @param value Rotation angle in degrees.\n */\n set: function (value) {\n this.rotation = value / 180 * Math.PI;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Node.prototype, \"translationX\", {\n get: function () {\n return this._translationX;\n },\n set: function (value) {\n if (this._translationX !== value) {\n this._translationX = value;\n this.dirtyTransform = true;\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Node.prototype, \"translationY\", {\n get: function () {\n return this._translationY;\n },\n set: function (value) {\n if (this._translationY !== value) {\n this._translationY = value;\n this.dirtyTransform = true;\n }\n },\n enumerable: true,\n configurable: true\n });\n Node.prototype.containsPoint = function (x, y) {\n return false;\n };\n /**\n * Hit testing method.\n * Recursively checks if the given point is inside this node or any of its children.\n * Returns the first matching node or `undefined`.\n * Nodes that render later (show on top) are hit tested first.\n * @param x\n * @param y\n */\n Node.prototype.pickNode = function (x, y) {\n if (!this.visible || this.pointerEvents === PointerEvents.None || !this.containsPoint(x, y)) {\n return;\n }\n var children = this.children;\n if (children.length) {\n // Nodes added later should be hit-tested first,\n // as they are rendered on top of the previously added nodes.\n for (var i = children.length - 1; i >= 0; i--) {\n var hit = children[i].pickNode(x, y);\n if (hit) {\n return hit;\n }\n }\n }\n else if (!this.isContainerNode) { // a leaf node, but not a container leaf\n return this;\n }\n };\n Node.prototype.computeBBox = function () { return; };\n Node.prototype.computeBBoxCenter = function () {\n var bbox = this.computeBBox && this.computeBBox();\n if (bbox) {\n return [\n bbox.x + bbox.width * 0.5,\n bbox.y + bbox.height * 0.5\n ];\n }\n return [0, 0];\n };\n Node.prototype.computeTransformMatrix = function () {\n // TODO: transforms without center of scaling and rotation correspond directly\n // to `setAttribute('transform', 'translate(tx, ty) rotate(rDeg) scale(sx, sy)')`\n // in SVG. Our use cases will mostly require positioning elements (rects, circles)\n // within a group, rotating groups at right angles (e.g. for axis) and translating\n // groups. We shouldn't even need `scale(1, -1)` (invert vertically), since this\n // can be done using D3-like scales already by inverting the output range.\n // So for now, just assume that centers of scaling and rotation are at the origin.\n // const [bbcx, bbcy] = this.computeBBoxCenter();\n var _a = [0, 0], bbcx = _a[0], bbcy = _a[1];\n var sx = this.scalingX;\n var sy = this.scalingY;\n var scx;\n var scy;\n if (sx === 1 && sy === 1) {\n scx = 0;\n scy = 0;\n }\n else {\n scx = this.scalingCenterX === null ? bbcx : this.scalingCenterX;\n scy = this.scalingCenterY === null ? bbcy : this.scalingCenterY;\n }\n var r = this.rotation;\n var cos = Math.cos(r);\n var sin = Math.sin(r);\n var rcx;\n var rcy;\n if (r === 0) {\n rcx = 0;\n rcy = 0;\n }\n else {\n rcx = this.rotationCenterX === null ? bbcx : this.rotationCenterX;\n rcy = this.rotationCenterY === null ? bbcy : this.rotationCenterY;\n }\n var tx = this.translationX;\n var ty = this.translationY;\n // The transform matrix `M` is a result of the following transformations:\n // 1) translate the center of scaling to the origin\n // 2) scale\n // 3) translate back\n // 4) translate the center of rotation to the origin\n // 5) rotate\n // 6) translate back\n // 7) translate\n // (7) (6) (5) (4) (3) (2) (1)\n // | 1 0 tx | | 1 0 rcx | | cos -sin 0 | | 1 0 -rcx | | 1 0 scx | | sx 0 0 | | 1 0 -scx |\n // M = | 0 1 ty | * | 0 1 rcy | * | sin cos 0 | * | 0 1 -rcy | * | 0 1 scy | * | 0 sy 0 | * | 0 1 -scy |\n // | 0 0 1 | | 0 0 1 | | 0 0 1 | | 0 0 1 | | 0 0 1 | | 0 0 0 | | 0 0 1 |\n // Translation after steps 1-4 above:\n var tx4 = scx * (1 - sx) - rcx;\n var ty4 = scy * (1 - sy) - rcy;\n this.dirtyTransform = false;\n this.matrix.setElements([\n cos * sx, sin * sx,\n -sin * sy, cos * sy,\n cos * tx4 - sin * ty4 + rcx + tx,\n sin * tx4 + cos * ty4 + rcy + ty\n ]).inverseTo(this.inverseMatrix);\n };\n Object.defineProperty(Node.prototype, \"dirty\", {\n get: function () {\n return this._dirty;\n },\n set: function (value) {\n // TODO: check if we are already dirty (e.g. if (this._dirty !== value))\n // if we are, then all parents and the scene have been\n // notified already, and we are doing redundant work\n // (but test if this is indeed the case)\n this._dirty = value;\n if (value) {\n if (this.parent) {\n this.parent.dirty = true;\n }\n else if (this.scene) {\n this.scene.dirty = true;\n }\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Node.prototype, \"visible\", {\n get: function () {\n return this._visible;\n },\n set: function (value) {\n if (this._visible !== value) {\n this._visible = value;\n this.dirty = true;\n }\n },\n enumerable: true,\n configurable: true\n });\n Node.MAX_SAFE_INTEGER = Math.pow(2, 53) - 1; // Number.MAX_SAFE_INTEGER\n return Node;\n}());\nexport { Node };\n","// For small data structs like a bounding box, objects are superior to arrays\n// in terms of performance (by 3-4% in Chrome 71, Safari 12 and by 20% in Firefox 64).\n// They are also self descriptive and harder to abuse.\n// For example, one has to do:\n// `ctx.strokeRect(bbox.x, bbox.y, bbox.width, bbox.height);`\n// rather than become enticed by the much slower:\n// `ctx.strokeRect(...bbox);`\n// https://jsperf.com/array-vs-object-create-access\nvar BBox = /** @class */ (function () {\n function BBox(x, y, width, height) {\n this.x = x;\n this.y = y;\n this.width = width;\n this.height = height;\n }\n BBox.prototype.isValid = function () {\n return isFinite(this.x) && isFinite(this.y) && isFinite(this.width) && isFinite(this.height);\n };\n BBox.prototype.dilate = function (value) {\n this.x -= value;\n this.y -= value;\n this.width += value * 2;\n this.height += value * 2;\n };\n BBox.prototype.containsPoint = function (x, y) {\n return x >= this.x && x <= (this.x + this.width)\n && y >= this.y && y <= (this.y + this.height);\n };\n BBox.prototype.render = function (ctx, params) {\n if (params === void 0) { params = BBox.noParams; }\n ctx.save();\n if (params.resetTransform) {\n ctx.setTransform(1, 0, 0, 1, 0, 0);\n }\n ctx.strokeStyle = params.strokeStyle || 'cyan';\n ctx.lineWidth = params.lineWidth || 1;\n ctx.strokeRect(this.x, this.y, this.width, this.height);\n if (params.label) {\n ctx.fillStyle = params.fillStyle || 'black';\n ctx.textBaseline = 'bottom';\n ctx.fillText(params.label, this.x, this.y);\n }\n ctx.restore();\n };\n BBox.noParams = {};\n return BBox;\n}());\nexport { BBox };\n","import { BBox } from \"./bbox\";\n/**\n * As of Jan 8, 2019, Firefox still doesn't implement\n * `getTransform(): DOMMatrix;`\n * `setTransform(transform?: DOMMatrix2DInit)`\n * in the `CanvasRenderingContext2D`.\n * Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=928150\n * IE11 and Edge 44 also don't have the support.\n * Thus this class, to keep track of the current transform and\n * combine transformations.\n * Standards:\n * https://html.spec.whatwg.org/dev/canvas.html\n * https://www.w3.org/TR/geometry-1/\n */\nvar Matrix = /** @class */ (function () {\n function Matrix(elements) {\n if (elements === void 0) { elements = [1, 0, 0, 1, 0, 0]; }\n this.elements = elements;\n }\n Matrix.prototype.setElements = function (elements) {\n var e = this.elements;\n // `this.elements = elements.slice()` is 4-5 times slower\n // (in Chrome 71 and FF 64) than manually copying elements,\n // since slicing allocates new memory.\n // The performance of passing parameters individually\n // vs as an array is about the same in both browsers, so we\n // go with a single (array of elements) parameter, because\n // `setElements(elements)` and `setElements([a, b, c, d, e, f])`\n // calls give us roughly the same performance, versus\n // `setElements(...elements)` and `setElements(a, b, c, d, e, f)`,\n // where the spread operator causes a 20-30x performance drop\n // (30x when compiled to ES5's `.apply(this, elements)`\n // 20x when used natively).\n e[0] = elements[0];\n e[1] = elements[1];\n e[2] = elements[2];\n e[3] = elements[3];\n e[4] = elements[4];\n e[5] = elements[5];\n return this;\n };\n Matrix.prototype.setIdentityElements = function () {\n var e = this.elements;\n e[0] = 1;\n e[1] = 0;\n e[2] = 0;\n e[3] = 1;\n e[4] = 0;\n e[5] = 0;\n return this;\n };\n Object.defineProperty(Matrix.prototype, \"identity\", {\n get: function () {\n var e = this.elements;\n return e[0] === 1 && e[1] === 0 && e[2] === 0 &&\n e[3] === 1 && e[4] === 0 && e[5] === 0;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Matrix.prototype, \"a\", {\n get: function () {\n return this.elements[0];\n },\n set: function (value) {\n this.elements[0] = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Matrix.prototype, \"b\", {\n get: function () {\n return this.elements[1];\n },\n set: function (value) {\n this.elements[1] = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Matrix.prototype, \"c\", {\n get: function () {\n return this.elements[2];\n },\n set: function (value) {\n this.elements[2] = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Matrix.prototype, \"d\", {\n get: function () {\n return this.elements[3];\n },\n set: function (value) {\n this.elements[3] = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Matrix.prototype, \"e\", {\n get: function () {\n return this.elements[4];\n },\n set: function (value) {\n this.elements[4] = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Matrix.prototype, \"f\", {\n get: function () {\n return this.elements[5];\n },\n set: function (value) {\n this.elements[5] = value;\n },\n enumerable: true,\n configurable: true\n });\n /**\n * Performs the AxB matrix multiplication and saves the result\n * to `C`, if given, or to `A` otherwise.\n */\n Matrix.prototype.AxB = function (A, B, C) {\n var m11 = A[0], m12 = A[1], m21 = A[2], m22 = A[3], m31 = A[4], m32 = A[5];\n var o11 = B[0], o12 = B[1], o21 = B[2], o22 = B[3], o31 = B[4], o32 = B[5];\n C = C || A;\n C[0] = m11 * o11 + m21 * o12;\n C[1] = m12 * o11 + m22 * o12;\n C[2] = m11 * o21 + m21 * o22;\n C[3] = m12 * o21 + m22 * o22;\n C[4] = m11 * o31 + m21 * o32 + m31;\n C[5] = m12 * o31 + m22 * o32 + m32;\n };\n /**\n * The `other` matrix gets post-multiplied to the current matrix.\n * Returns the current matrix.\n * @param other\n */\n Matrix.prototype.multiplySelf = function (other) {\n this.AxB(this.elements, other.elements);\n return this;\n };\n /**\n * The `other` matrix gets post-multiplied to the current matrix.\n * Returns a new matrix.\n * @param other\n */\n Matrix.prototype.multiply = function (other) {\n var elements = new Array(6);\n this.AxB(this.elements, other.elements, elements);\n return new Matrix(elements);\n };\n Matrix.prototype.preMultiplySelf = function (other) {\n this.AxB(other.elements, this.elements, this.elements);\n return this;\n };\n /**\n * Returns the inverse of this matrix as a new matrix.\n */\n Matrix.prototype.inverse = function () {\n var _a = this.elements, a = _a[0], b = _a[1], c = _a[2], d = _a[3], e = _a[4], f = _a[5];\n var rD = 1 / (a * d - b * c); // reciprocal of determinant\n a *= rD;\n b *= rD;\n c *= rD;\n d *= rD;\n return new Matrix([d, -b, -c, a, c * f - d * e, b * e - a * f]);\n };\n /**\n * Save the inverse of this matrix to the given matrix.\n */\n Matrix.prototype.inverseTo = function (other) {\n var _a = this.elements, a = _a[0], b = _a[1], c = _a[2], d = _a[3], e = _a[4], f = _a[5];\n var rD = 1 / (a * d - b * c); // reciprocal of determinant\n a *= rD;\n b *= rD;\n c *= rD;\n d *= rD;\n other.setElements([d, -b, -c, a, c * f - d * e, b * e - a * f]);\n return this;\n };\n Matrix.prototype.invertSelf = function () {\n var elements = this.elements;\n var a = elements[0], b = elements[1], c = elements[2], d = elements[3], e = elements[4], f = elements[5];\n var rD = 1 / (a * d - b * c); // reciprocal of determinant\n a *= rD;\n b *= rD;\n c *= rD;\n d *= rD;\n elements[0] = d;\n elements[1] = -b;\n elements[2] = -c;\n elements[3] = a;\n elements[4] = c * f - d * e;\n elements[5] = b * e - a * f;\n return this;\n };\n Matrix.prototype.clone = function () {\n return new Matrix(this.elements.slice());\n };\n Matrix.prototype.transformPoint = function (x, y) {\n var e = this.elements;\n return {\n x: x * e[0] + y * e[2] + e[4],\n y: x * e[1] + y * e[3] + e[5]\n };\n };\n Matrix.prototype.transformBBox = function (bbox, radius, target) {\n if (radius === void 0) { radius = 0; }\n var elements = this.elements;\n var xx = elements[0];\n var xy = elements[1];\n var yx = elements[2];\n var yy = elements[3];\n var h_w = bbox.width * 0.5;\n var h_h = bbox.height * 0.5;\n var cx = bbox.x + h_w;\n var cy = bbox.y + h_h;\n var w, h;\n if (radius) {\n h_w -= radius;\n h_h -= radius;\n var sx = Math.sqrt(xx * xx + yx * yx);\n var sy = Math.sqrt(xy * xy + yy * yy);\n w = Math.abs(h_w * xx) + Math.abs(h_h * yx) + Math.abs(sx * radius);\n h = Math.abs(h_w * xy) + Math.abs(h_h * yy) + Math.abs(sy * radius);\n }\n else {\n w = Math.abs(h_w * xx) + Math.abs(h_h * yx);\n h = Math.abs(h_w * xy) + Math.abs(h_h * yy);\n }\n if (!target) {\n target = new BBox(0, 0, 0, 0);\n }\n target.x = cx * xx + cy * yx + elements[4] - w;\n target.y = cx * xy + cy * yy + elements[5] - h;\n target.width = w + w;\n target.height = h + h;\n return target;\n };\n Matrix.prototype.toContext = function (ctx) {\n // It's fair to say that matrix multiplications are not cheap.\n // However, updating path definitions on every frame isn't either, so\n // it may be cheaper to just translate paths. It's also fair to\n // say, that most paths will have to be re-rendered anyway, say\n // rectangle paths in a bar chart, where an animation would happen when\n // the data set changes and existing bars are morphed into new ones.\n // Or a pie chart, where old sectors are also morphed into new ones.\n // Same for the line chart. The only plausible case where translating\n // existing paths would be enough, is the scatter chart, where marker\n // icons, typically circles, stay the same size. But if circle radii\n // are bound to some data points, even circle paths would have to be\n // updated. And thus it makes sense to optimize for fewer matrix\n // transforms, where transform matrices of paths are mostly identity\n // matrices and `x`/`y`, `centerX`/`centerY` and similar properties\n // are used to define a path at specific coordinates. And only groups\n // are used to collectively apply a transform to a set of nodes.\n // If the matrix is mostly identity (95% of the time),\n // the `if (this.isIdentity)` check can make this call 3-4 times\n // faster on average: https://jsperf.com/matrix-check-first-vs-always-set\n if (this.identity) {\n return;\n }\n var e = this.elements;\n ctx.transform(e[0], e[1], e[2], e[3], e[4], e[5]);\n };\n Matrix.flyweight = function (elements) {\n if (elements) {\n if (elements instanceof Matrix) {\n Matrix.matrix.setElements(elements.elements);\n }\n else {\n Matrix.matrix.setElements(elements);\n }\n }\n else {\n Matrix.matrix.setIdentityElements();\n }\n return Matrix.matrix;\n };\n Matrix.matrix = new Matrix();\n return Matrix;\n}());\nexport { Matrix };\n","export function createId(instance) {\n var constructor = instance.constructor;\n var className = constructor.className;\n if (!className) {\n throw new Error(\"The \" + constructor + \" is missing the 'className' property.\");\n }\n return className + '-' + (constructor.id = (constructor.id || 0) + 1);\n}\n","/**\n * Creates a new object with a `parent` as its prototype\n * and copies properties from the `child` into it.\n * @param parent\n * @param child\n */\nexport function chainObjects(parent, child) {\n var obj = Object.create(parent);\n for (var prop in child) {\n if (child.hasOwnProperty(prop)) {\n obj[prop] = child[prop];\n }\n }\n return obj;\n}\nexport function getValue(object, path, defaultValue) {\n var parts = Array.isArray(path) ? path : path.split('.');\n var value = object;\n try {\n parts.forEach(function (part) {\n value = value[part];\n });\n }\n catch (e) {\n if (arguments.length === 3) {\n value = defaultValue;\n }\n else {\n throw e;\n }\n }\n return value;\n}\nfunction emptyTarget(value) {\n return Array.isArray(value) ? [] : {};\n}\nfunction cloneUnlessOtherwiseSpecified(value, options) {\n return (options.clone !== false && options.isMergeableObject(value))\n ? deepMerge(emptyTarget(value), value, options)\n : value;\n}\nfunction defaultArrayMerge(target, source, options) {\n return target.concat(source).map(function (element) {\n return cloneUnlessOtherwiseSpecified(element, options);\n });\n}\nfunction getMergeFunction(key, options) {\n if (!options.customMerge) {\n return deepMerge;\n }\n var customMerge = options.customMerge(key);\n return typeof customMerge === 'function' ? customMerge : deepMerge;\n}\nfunction getEnumerableOwnPropertySymbols(target) {\n return Object.getOwnPropertySymbols\n ? Object.getOwnPropertySymbols(target).filter(function (symbol) {\n return target.propertyIsEnumerable(symbol);\n })\n : [];\n}\nfunction getKeys(target) {\n return Object.keys(target).concat(getEnumerableOwnPropertySymbols(target));\n}\nfunction propertyIsOnObject(object, property) {\n try {\n return property in object;\n }\n catch (_) {\n return false;\n }\n}\n// Protects from prototype poisoning and unexpected merging up the prototype chain.\nfunction propertyIsUnsafe(target, key) {\n return propertyIsOnObject(target, key) // Properties are safe to merge if they don't exist in the target yet,\n && !(Object.hasOwnProperty.call(target, key) // unsafe if they exist up the prototype chain,\n && Object.propertyIsEnumerable.call(target, key)); // and also unsafe if they're nonenumerable.\n}\nfunction mergeObject(target, source, options) {\n var destination = {};\n if (options.isMergeableObject(target)) {\n getKeys(target).forEach(function (key) {\n destination[key] = cloneUnlessOtherwiseSpecified(target[key], options);\n });\n }\n getKeys(source).forEach(function (key) {\n if (propertyIsUnsafe(target, key)) {\n return;\n }\n if (propertyIsOnObject(target, key) && options.isMergeableObject(source[key])) {\n destination[key] = getMergeFunction(key, options)(target[key], source[key], options);\n }\n else {\n destination[key] = cloneUnlessOtherwiseSpecified(source[key], options);\n }\n });\n return destination;\n}\nfunction defaultIsMergeableObject(value) {\n return isNonNullObject(value) && !isSpecial(value);\n}\nfunction isNonNullObject(value) {\n return !!value && typeof value === 'object';\n}\nfunction isSpecial(value) {\n var stringValue = Object.prototype.toString.call(value);\n return stringValue === '[object RegExp]' || stringValue === '[object Date]';\n}\nexport function deepMerge(target, source, options) {\n options = options || {};\n options.arrayMerge = options.arrayMerge || defaultArrayMerge;\n options.isMergeableObject = options.isMergeableObject || defaultIsMergeableObject;\n // cloneUnlessOtherwiseSpecified is added to `options` so that custom arrayMerge()\n // implementations can use it. The caller may not replace it.\n options.cloneUnlessOtherwiseSpecified = cloneUnlessOtherwiseSpecified;\n var sourceIsArray = Array.isArray(source);\n var targetIsArray = Array.isArray(target);\n var sourceAndTargetTypesMatch = sourceIsArray === targetIsArray;\n if (!sourceAndTargetTypesMatch) {\n return cloneUnlessOtherwiseSpecified(source, options);\n }\n else if (sourceIsArray) {\n return options.arrayMerge(target, source, options);\n }\n else {\n return mergeObject(target, source, options);\n }\n}\nexport function isObject(value) {\n return typeof value === 'object' && !Array.isArray(value);\n}\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { Node } from \"../node\";\nimport { chainObjects } from \"../../util/object\";\nvar Shape = /** @class */ (function (_super) {\n __extends(Shape, _super);\n function Shape() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.lastInstanceId = 0;\n _this._fillOpacity = 1;\n _this._strokeOpacity = 1;\n _this._fill = Shape.defaultStyles.fill;\n /**\n * Note that `strokeStyle = null` means invisible stroke,\n * while `lineWidth = 0` means no stroke, and sometimes this can mean different things.\n * For example, a rect shape with an invisible stroke may not align to the pixel grid\n * properly because the stroke affects the rules of alignment, and arc shapes forming\n * a pie chart will have a gap between them if they have an invisible stroke, whereas\n * there would be not gap if there was no stroke at all.\n * The preferred way of making the stroke invisible is setting the `lineWidth` to zero,\n * unless specific looks that is achieved by having an invisible stroke is desired.\n */\n _this._stroke = Shape.defaultStyles.stroke;\n _this._strokeWidth = Shape.defaultStyles.strokeWidth;\n _this._lineDash = Shape.defaultStyles.lineDash;\n _this._lineDashOffset = Shape.defaultStyles.lineDashOffset;\n _this._lineCap = Shape.defaultStyles.lineCap;\n _this._lineJoin = Shape.defaultStyles.lineJoin;\n _this._opacity = Shape.defaultStyles.opacity;\n _this.onShadowChange = function () {\n _this.dirty = true;\n };\n _this._fillShadow = Shape.defaultStyles.fillShadow;\n _this._strokeShadow = Shape.defaultStyles.strokeShadow;\n return _this;\n }\n /**\n * Creates a light-weight instance of the given shape (that serves as a template).\n * The created instance only stores the properites set on the instance itself\n * and the rest of the properties come via the prototype chain from the template.\n * This can greatly reduce memory usage in cases where one has many simular shapes,\n * for example, circles of different size, position and color. The exact memory usage\n * reduction will depend on the size of the template and the number of own properties\n * set on its lightweight instances, but will typically be around an order of magnitude\n * or more.\n *\n * Note: template shapes are not supposed to be part of the scene graph (they should not\n * have a parent).\n *\n * @param template\n */\n Shape.createInstance = function (template) {\n var shape = Object.create(template);\n shape._setParent(undefined);\n shape.id = template.id + '-Instance-' + String(++template.lastInstanceId);\n return shape;\n };\n /**\n * Restores the default styles introduced by this subclass.\n */\n Shape.prototype.restoreOwnStyles = function () {\n var styles = this.constructor.defaultStyles;\n var keys = Object.getOwnPropertyNames(styles);\n // getOwnPropertyNames is about 2.5 times faster than\n // for..in with the hasOwnProperty check and in this\n // case, where most properties are inherited, can be\n // more then an order of magnitude faster.\n for (var i = 0, n = keys.length; i < n; i++) {\n var key = keys[i];\n this[key] = styles[key];\n }\n };\n Shape.prototype.restoreAllStyles = function () {\n var styles = this.constructor.defaultStyles;\n for (var property in styles) {\n this[property] = styles[property];\n }\n };\n /**\n * Restores the base class default styles that have been overridden by this subclass.\n */\n Shape.prototype.restoreOverriddenStyles = function () {\n var styles = this.constructor.defaultStyles;\n var protoStyles = Object.getPrototypeOf(styles);\n for (var property in styles) {\n if (styles.hasOwnProperty(property) && protoStyles.hasOwnProperty(property)) {\n this[property] = styles[property];\n }\n }\n };\n Object.defineProperty(Shape.prototype, \"fillOpacity\", {\n get: function () {\n return this._fillOpacity;\n },\n set: function (value) {\n if (this._fillOpacity !== value) {\n this._fillOpacity = value;\n this.dirty = true;\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Shape.prototype, \"strokeOpacity\", {\n get: function () {\n return this._strokeOpacity;\n },\n set: function (value) {\n if (this._strokeOpacity !== value) {\n this._strokeOpacity = value;\n this.dirty = true;\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Shape.prototype, \"fill\", {\n get: function () {\n return this._fill;\n },\n set: function (value) {\n if (this._fill !== value) {\n this._fill = value;\n this.dirty = true;\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Shape.prototype, \"stroke\", {\n get: function () {\n return this._stroke;\n },\n set: function (value) {\n if (this._stroke !== value) {\n this._stroke = value;\n this.dirty = true;\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Shape.prototype, \"strokeWidth\", {\n get: function () {\n return this._strokeWidth;\n },\n set: function (value) {\n if (this._strokeWidth !== value) {\n this._strokeWidth = value;\n this.dirty = true;\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Shape.prototype, \"alignment\", {\n // An offset value to align to the pixel grid.\n get: function () {\n return Math.floor(this.strokeWidth) % 2 / 2;\n },\n enumerable: true,\n configurable: true\n });\n // Returns the aligned `start` or `length` value.\n // For example: `start` could be `y` and `length` could be `height` of a rectangle.\n Shape.prototype.align = function (alignment, start, length) {\n if (length != undefined) {\n return Math.floor(length) + Math.floor(start % 1 + length % 1);\n }\n return Math.floor(start) + alignment;\n };\n Object.defineProperty(Shape.prototype, \"lineDash\", {\n get: function () {\n return this._lineDash;\n },\n set: function (value) {\n var oldValue = this._lineDash;\n if (oldValue !== value) {\n if (oldValue && value && oldValue.length === value.length) {\n var identical = true;\n var n = value.length;\n for (var i = 0; i < n; i++) {\n if (oldValue[i] !== value[i]) {\n identical = false;\n break;\n }\n }\n if (identical) {\n return;\n }\n }\n this._lineDash = value;\n this.dirty = true;\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Shape.prototype, \"lineDashOffset\", {\n get: function () {\n return this._lineDashOffset;\n },\n set: function (value) {\n if (this._lineDashOffset !== value) {\n this._lineDashOffset = value;\n this.dirty = true;\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Shape.prototype, \"lineCap\", {\n get: function () {\n return this._lineCap;\n },\n set: function (value) {\n if (this._lineCap !== value) {\n this._lineCap = value;\n this.dirty = true;\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Shape.prototype, \"lineJoin\", {\n get: function () {\n return this._lineJoin;\n },\n set: function (value) {\n if (this._lineJoin !== value) {\n this._lineJoin = value;\n this.dirty = true;\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Shape.prototype, \"opacity\", {\n get: function () {\n return this._opacity;\n },\n set: function (value) {\n value = Math.min(1, Math.max(0, value));\n if (this._opacity !== value) {\n this._opacity = value;\n this.dirty = true;\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Shape.prototype, \"fillShadow\", {\n get: function () {\n return this._fillShadow;\n },\n set: function (value) {\n var oldValue = this._fillShadow;\n if (oldValue !== value) {\n if (oldValue) {\n oldValue.removeEventListener('change', this.onShadowChange);\n }\n if (value) {\n value.addEventListener('change', this.onShadowChange);\n }\n this._fillShadow = value;\n this.dirty = true;\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Shape.prototype, \"strokeShadow\", {\n get: function () {\n return this._strokeShadow;\n },\n set: function (value) {\n var oldValue = this._strokeShadow;\n if (oldValue !== value) {\n if (oldValue) {\n oldValue.removeEventListener('change', this.onShadowChange);\n }\n if (value) {\n value.addEventListener('change', this.onShadowChange);\n }\n this._strokeShadow = value;\n this.dirty = true;\n }\n },\n enumerable: true,\n configurable: true\n });\n Shape.prototype.fillStroke = function (ctx) {\n if (!this.scene) {\n return;\n }\n var pixelRatio = this.scene.canvas.pixelRatio || 1;\n if (this.fill) {\n ctx.fillStyle = this.fill;\n ctx.globalAlpha = this.opacity * this.fillOpacity;\n // The canvas context scaling (depends on the device's pixel ratio)\n // has no effect on shadows, so we have to account for the pixel ratio\n // manually here.\n var fillShadow = this.fillShadow;\n if (fillShadow && fillShadow.enabled) {\n ctx.shadowColor = fillShadow.color;\n ctx.shadowOffsetX = fillShadow.xOffset * pixelRatio;\n ctx.shadowOffsetY = fillShadow.yOffset * pixelRatio;\n ctx.shadowBlur = fillShadow.blur * pixelRatio;\n }\n ctx.fill();\n }\n ctx.shadowColor = 'rgba(0, 0, 0, 0)';\n if (this.stroke && this.strokeWidth) {\n ctx.strokeStyle = this.stroke;\n ctx.globalAlpha = this.opacity * this.strokeOpacity;\n ctx.lineWidth = this.strokeWidth;\n if (this.lineDash) {\n ctx.setLineDash(this.lineDash);\n }\n if (this.lineDashOffset) {\n ctx.lineDashOffset = this.lineDashOffset;\n }\n if (this.lineCap) {\n ctx.lineCap = this.lineCap;\n }\n if (this.lineJoin) {\n ctx.lineJoin = this.lineJoin;\n }\n var strokeShadow = this.strokeShadow;\n if (strokeShadow && strokeShadow.enabled) {\n ctx.shadowColor = strokeShadow.color;\n ctx.shadowOffsetX = strokeShadow.xOffset * pixelRatio;\n ctx.shadowOffsetY = strokeShadow.yOffset * pixelRatio;\n ctx.shadowBlur = strokeShadow.blur * pixelRatio;\n }\n ctx.stroke();\n }\n };\n Shape.prototype.containsPoint = function (x, y) {\n return this.isPointInPath(x, y);\n };\n /**\n * Defaults for style properties. Note that properties that affect the position\n * and shape of the node are not considered style properties, for example:\n * `x`, `y`, `width`, `height`, `radius`, `rotation`, etc.\n * Can be used to reset to the original styling after some custom styling\n * has been applied (using the `restoreOwnStyles` and `restoreAllStyles` methods).\n * These static defaults are meant to be inherited by subclasses.\n */\n Shape.defaultStyles = chainObjects({}, {\n fill: 'black',\n stroke: undefined,\n strokeWidth: 0,\n lineDash: undefined,\n lineDashOffset: 0,\n lineCap: undefined,\n lineJoin: undefined,\n opacity: 1,\n fillShadow: undefined,\n strokeShadow: undefined\n });\n return Shape;\n}(Node));\nexport { Shape };\n","/**\n * Wraps the native Canvas element and overrides its CanvasRenderingContext2D to\n * provide resolution independent rendering based on `window.devicePixelRatio`.\n */\nvar HdpiCanvas = /** @class */ (function () {\n // The width/height attributes of the Canvas element default to\n // 300/150 according to w3.org.\n function HdpiCanvas(document, width, height) {\n if (document === void 0) { document = window.document; }\n if (width === void 0) { width = 600; }\n if (height === void 0) { height = 300; }\n this._container = undefined;\n // `NaN` is deliberate here, so that overrides are always applied\n // and the `resetTransform` inside the `resize` method works in IE11.\n this._pixelRatio = NaN;\n this.document = document;\n this.element = document.createElement('canvas');\n this.context = this.element.getContext('2d');\n this.element.style.userSelect = 'none';\n this.element.style.display = 'block';\n this.setPixelRatio();\n this.resize(width, height);\n }\n Object.defineProperty(HdpiCanvas.prototype, \"container\", {\n get: function () {\n return this._container;\n },\n set: function (value) {\n if (this._container !== value) {\n this.remove();\n if (value) {\n value.appendChild(this.element);\n }\n this._container = value;\n }\n },\n enumerable: true,\n configurable: true\n });\n HdpiCanvas.prototype.remove = function () {\n var parentNode = this.element.parentNode;\n if (parentNode != null) {\n parentNode.removeChild(this.element);\n }\n };\n HdpiCanvas.prototype.destroy = function () {\n this.element.remove();\n this._canvas = undefined;\n Object.freeze(this);\n };\n HdpiCanvas.prototype.toImage = function () {\n var img = this.document.createElement('img');\n img.src = this.getDataURL();\n return img;\n };\n HdpiCanvas.prototype.getDataURL = function (type) {\n return this.element.toDataURL(type);\n };\n /**\n * @param options.fileName The `.png` extension is going to be added automatically.\n * @param [options.background] Defaults to `white`.\n */\n HdpiCanvas.prototype.download = function (fileName) {\n fileName = ((fileName || '').trim() || 'image') + '.png';\n // Chart images saved as JPEG are a few times larger at 50% quality than PNG images,\n // so we don't support saving to JPEG.\n var type = 'image/png';\n var dataUrl = this.getDataURL(type);\n var document = this.document;\n if (navigator.msSaveOrOpenBlob) { // IE11\n var binary = atob(dataUrl.split(',')[1]); // strip the `data:image/png;base64,` part\n var array = [];\n for (var i = 0, n = binary.length; i < n; i++) {\n array.push(binary.charCodeAt(i));\n }\n var blob = new Blob([new Uint8Array(array)], { type: type });\n navigator.msSaveOrOpenBlob(blob, fileName);\n }\n else {\n var a = document.createElement('a');\n a.href = dataUrl;\n a.download = fileName;\n a.style.display = 'none';\n document.body.appendChild(a); // required for the `click` to work in Firefox\n a.click();\n document.body.removeChild(a);\n }\n };\n Object.defineProperty(HdpiCanvas.prototype, \"pixelRatio\", {\n get: function () {\n return this._pixelRatio;\n },\n enumerable: true,\n configurable: true\n });\n /**\n * Changes the pixel ratio of the Canvas element to the given value,\n * or uses the window.devicePixelRatio (default), then resizes the Canvas\n * element accordingly (default).\n */\n HdpiCanvas.prototype.setPixelRatio = function (ratio) {\n var pixelRatio = ratio || window.devicePixelRatio;\n if (pixelRatio === this.pixelRatio) {\n return;\n }\n HdpiCanvas.overrideScale(this.context, pixelRatio);\n this._pixelRatio = pixelRatio;\n this.resize(this.width, this.height);\n };\n Object.defineProperty(HdpiCanvas.prototype, \"pixelated\", {\n get: function () {\n return this.element.style.imageRendering === 'pixelated';\n },\n set: function (value) {\n this.element.style.imageRendering = value ? 'pixelated' : 'auto';\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(HdpiCanvas.prototype, \"width\", {\n get: function () {\n return this._width;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(HdpiCanvas.prototype, \"height\", {\n get: function () {\n return this._height;\n },\n enumerable: true,\n configurable: true\n });\n HdpiCanvas.prototype.resize = function (width, height) {\n var _a = this, element = _a.element, context = _a.context, pixelRatio = _a.pixelRatio;\n element.width = Math.round(width * pixelRatio);\n element.height = Math.round(height * pixelRatio);\n element.style.width = width + 'px';\n element.style.height = height + 'px';\n context.resetTransform();\n this._width = width;\n this._height = height;\n };\n Object.defineProperty(HdpiCanvas, \"textMeasuringContext\", {\n get: function () {\n if (this._textMeasuringContext) {\n return this._textMeasuringContext;\n }\n var canvas = document.createElement('canvas');\n return this._textMeasuringContext = canvas.getContext('2d');\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(HdpiCanvas, \"svgText\", {\n get: function () {\n if (this._svgText) {\n return this._svgText;\n }\n var xmlns = 'http://www.w3.org/2000/svg';\n var svg = document.createElementNS(xmlns, 'svg');\n svg.setAttribute('width', '100');\n svg.setAttribute('height', '100');\n // Add a descriptive class name in case someone sees this SVG element\n // in devtools and wonders about its purpose:\n if (svg.classList) {\n svg.classList.add('text-measuring-svg');\n }\n else {\n svg.setAttribute('class', 'text-measuring-svg');\n }\n svg.style.position = 'absolute';\n svg.style.top = '-1000px';\n svg.style.visibility = 'hidden';\n var svgText = document.createElementNS(xmlns, 'text');\n svgText.setAttribute('x', '0');\n svgText.setAttribute('y', '30');\n svgText.setAttribute('text', 'black');\n svg.appendChild(svgText);\n document.body.appendChild(svg);\n this._svgText = svgText;\n return svgText;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(HdpiCanvas, \"has\", {\n get: function () {\n if (this._has) {\n return this._has;\n }\n var isChrome = navigator.userAgent.indexOf('Chrome') > -1;\n var isFirefox = navigator.userAgent.indexOf('Firefox') > -1;\n var isSafari = !isChrome && navigator.userAgent.indexOf('Safari') > -1;\n return this._has = Object.freeze({\n textMetrics: this.textMeasuringContext.measureText('test').actualBoundingBoxDescent !== undefined\n // Firefox implemented advanced TextMetrics object in v74:\n // https://bugzilla.mozilla.org/show_bug.cgi?id=1102584\n // but it's buggy, so we'll keed using the SVG for text measurement in Firefox for now.\n && !isFirefox && !isSafari,\n getTransform: this.textMeasuringContext.getTransform !== undefined\n });\n },\n enumerable: true,\n configurable: true\n });\n HdpiCanvas.measureText = function (text, font, textBaseline, textAlign) {\n var ctx = this.textMeasuringContext;\n ctx.font = font;\n ctx.textBaseline = textBaseline;\n ctx.textAlign = textAlign;\n return ctx.measureText(text);\n };\n /**\n * Returns the width and height of the measured text.\n * @param text The single-line text to measure.\n * @param font The font shorthand string.\n */\n HdpiCanvas.getTextSize = function (text, font) {\n if (this.has.textMetrics) {\n var ctx = this.textMeasuringContext;\n ctx.font = font;\n var metrics = ctx.measureText(text);\n return {\n width: metrics.width,\n height: metrics.actualBoundingBoxAscent + metrics.actualBoundingBoxDescent\n };\n }\n else {\n return this.measureSvgText(text, font);\n }\n };\n HdpiCanvas.measureSvgText = function (text, font) {\n var cache = this.textSizeCache;\n var fontCache = cache[font];\n // Note: consider not caching the size of numeric strings.\n // For example: if (isNaN(+text)) { // skip\n if (fontCache) {\n var size_1 = fontCache[text];\n if (size_1) {\n return size_1;\n }\n }\n else {\n cache[font] = {};\n }\n var svgText = this.svgText;\n svgText.style.font = font;\n svgText.textContent = text;\n // `getBBox` returns an instance of `SVGRect` with the same `width` and `height`\n // measurements as `DOMRect` instance returned by the `getBoundingClientRect`.\n // But the `SVGRect` instance has half the properties of the `DOMRect`,\n // so we use the `getBBox` method.\n var bbox = svgText.getBBox();\n var size = {\n width: bbox.width,\n height: bbox.height\n };\n cache[font][text] = size;\n return size;\n };\n HdpiCanvas.overrideScale = function (ctx, scale) {\n var depth = 0;\n var overrides = {\n save: function () {\n this.$save();\n depth++;\n },\n restore: function () {\n if (depth > 0) {\n this.$restore();\n depth--;\n }\n },\n setTransform: function (a, b, c, d, e, f) {\n this.$setTransform(a * scale, b * scale, c * scale, d * scale, e * scale, f * scale);\n },\n resetTransform: function () {\n // As of Jan 8, 2019, `resetTransform` is still an \"experimental technology\",\n // and doesn't work in IE11 and Edge 44.\n this.$setTransform(scale, 0, 0, scale, 0, 0);\n this.save();\n depth = 0;\n // The scale above will be impossible to restore,\n // because we override the `ctx.restore` above and\n // check `depth` there.\n }\n };\n for (var name_1 in overrides) {\n if (overrides.hasOwnProperty(name_1)) {\n // Save native methods under prefixed names,\n // if this hasn't been done by the previous overrides already.\n if (!ctx['$' + name_1]) {\n ctx['$' + name_1] = ctx[name_1];\n }\n // Replace native methods with overrides,\n // or previous overrides with the new ones.\n ctx[name_1] = overrides[name_1];\n }\n }\n };\n HdpiCanvas.textSizeCache = {};\n return HdpiCanvas;\n}());\nexport { HdpiCanvas };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { Shape } from \"./shape\";\nimport { chainObjects } from \"../../util/object\";\nimport { BBox } from \"../bbox\";\nimport { HdpiCanvas } from \"../../canvas/hdpiCanvas\";\nvar Text = /** @class */ (function (_super) {\n __extends(Text, _super);\n function Text() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this._x = 0;\n _this._y = 0;\n _this.lineBreakRegex = /\\r?\\n/g;\n _this.lines = [];\n _this._text = '';\n _this._dirtyFont = true;\n _this._fontSize = 10;\n _this._fontFamily = 'sans-serif';\n _this._textAlign = Text.defaultStyles.textAlign;\n _this._textBaseline = Text.defaultStyles.textBaseline;\n _this._lineHeight = 14;\n return _this;\n }\n Object.defineProperty(Text.prototype, \"x\", {\n get: function () {\n return this._x;\n },\n set: function (value) {\n if (this._x !== value) {\n this._x = value;\n this.dirty = true;\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Text.prototype, \"y\", {\n get: function () {\n return this._y;\n },\n set: function (value) {\n if (this._y !== value) {\n this._y = value;\n this.dirty = true;\n }\n },\n enumerable: true,\n configurable: true\n });\n Text.prototype.splitText = function () {\n this.lines = this._text.split(this.lineBreakRegex);\n };\n Object.defineProperty(Text.prototype, \"text\", {\n get: function () {\n return this._text;\n },\n set: function (value) {\n var str = String(value); // `value` can be an object here\n if (this._text !== str) {\n this._text = str;\n this.splitText();\n this.dirty = true;\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Text.prototype, \"font\", {\n get: function () {\n if (this.dirtyFont) {\n this.dirtyFont = false;\n this._font = [\n this.fontStyle || '',\n this.fontWeight || '',\n this.fontSize + 'px',\n this.fontFamily\n ].join(' ').trim();\n }\n return this._font;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Text.prototype, \"dirtyFont\", {\n get: function () {\n return this._dirtyFont;\n },\n set: function (value) {\n if (this._dirtyFont !== value) {\n this._dirtyFont = value;\n if (value) {\n this.dirty = true;\n }\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Text.prototype, \"fontStyle\", {\n get: function () {\n return this._fontStyle;\n },\n set: function (value) {\n if (this._fontStyle !== value) {\n this._fontStyle = value;\n this.dirtyFont = true;\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Text.prototype, \"fontWeight\", {\n get: function () {\n return this._fontWeight;\n },\n set: function (value) {\n if (this._fontWeight !== value) {\n this._fontWeight = value;\n this.dirtyFont = true;\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Text.prototype, \"fontSize\", {\n get: function () {\n return this._fontSize;\n },\n set: function (value) {\n if (!isFinite(value)) {\n value = 10;\n }\n if (this._fontSize !== value) {\n this._fontSize = value;\n this.dirtyFont = true;\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Text.prototype, \"fontFamily\", {\n get: function () {\n return this._fontFamily;\n },\n set: function (value) {\n if (this._fontFamily !== value) {\n this._fontFamily = value;\n this.dirtyFont = true;\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Text.prototype, \"textAlign\", {\n get: function () {\n return this._textAlign;\n },\n set: function (value) {\n if (this._textAlign !== value) {\n this._textAlign = value;\n this.dirty = true;\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Text.prototype, \"textBaseline\", {\n get: function () {\n return this._textBaseline;\n },\n set: function (value) {\n if (this._textBaseline !== value) {\n this._textBaseline = value;\n this.dirty = true;\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Text.prototype, \"lineHeight\", {\n get: function () {\n return this._lineHeight;\n },\n set: function (value) {\n // Multi-line text is complicated because:\n // - Canvas does not support it natively, so we have to implement it manually\n // - need to know the height of each line -> need to parse the font shorthand ->\n // generally impossible to do because font size may not be in pixels\n // - so, need to measure the text instead, each line individually -> expensive\n // - or make the user provide the line height manually for multi-line text\n // - computeBBox should use the lineHeight for multi-line text but ignore it otherwise\n // - textBaseline kind of loses its meaning for multi-line text\n if (this._lineHeight !== value) {\n this._lineHeight = value;\n this.dirty = true;\n }\n },\n enumerable: true,\n configurable: true\n });\n Text.prototype.computeBBox = function () {\n return HdpiCanvas.has.textMetrics\n ? this.getPreciseBBox()\n : this.getApproximateBBox();\n };\n Text.prototype.getPreciseBBox = function () {\n var metrics = HdpiCanvas.measureText(this.text, this.font, this.textBaseline, this.textAlign);\n return new BBox(this.x - metrics.actualBoundingBoxLeft, this.y - metrics.actualBoundingBoxAscent, metrics.width, metrics.actualBoundingBoxAscent + metrics.actualBoundingBoxDescent);\n };\n Text.prototype.getApproximateBBox = function () {\n var size = HdpiCanvas.getTextSize(this.text, this.font);\n var _a = this, x = _a.x, y = _a.y;\n switch (this.textAlign) {\n case 'end':\n case 'right':\n x -= size.width;\n break;\n case 'center':\n x -= size.width / 2;\n }\n switch (this.textBaseline) {\n case 'alphabetic':\n y -= size.height * 0.7;\n break;\n case 'middle':\n y -= size.height * 0.45;\n break;\n case 'ideographic':\n y -= size.height;\n break;\n case 'hanging':\n y -= size.height * 0.2;\n break;\n case 'bottom':\n y -= size.height;\n break;\n }\n return new BBox(x, y, size.width, size.height);\n };\n Text.prototype.isPointInPath = function (x, y) {\n var point = this.transformPoint(x, y);\n var bbox = this.computeBBox();\n return bbox ? bbox.containsPoint(point.x, point.y) : false;\n };\n Text.prototype.isPointInStroke = function (x, y) {\n return false;\n };\n Text.prototype.render = function (ctx) {\n if (!this.lines.length || !this.scene) {\n return;\n }\n if (this.dirtyTransform) {\n this.computeTransformMatrix();\n }\n // this.matrix.transformBBox(this.computeBBox!()).render(ctx); // debug\n this.matrix.toContext(ctx);\n var _a = this, fill = _a.fill, stroke = _a.stroke, strokeWidth = _a.strokeWidth;\n ctx.font = this.font;\n ctx.textAlign = this.textAlign;\n ctx.textBaseline = this.textBaseline;\n var pixelRatio = this.scene.canvas.pixelRatio || 1;\n if (fill) {\n ctx.fillStyle = fill;\n ctx.globalAlpha = this.opacity * this.fillOpacity;\n var _b = this, fillShadow = _b.fillShadow, text = _b.text, x = _b.x, y = _b.y;\n if (fillShadow && fillShadow.enabled) {\n ctx.shadowColor = fillShadow.color;\n ctx.shadowOffsetX = fillShadow.xOffset * pixelRatio;\n ctx.shadowOffsetY = fillShadow.yOffset * pixelRatio;\n ctx.shadowBlur = fillShadow.blur * pixelRatio;\n }\n ctx.fillText(text, x, y);\n }\n if (stroke && strokeWidth) {\n ctx.strokeStyle = stroke;\n ctx.lineWidth = strokeWidth;\n ctx.globalAlpha = this.opacity * this.strokeOpacity;\n var _c = this, lineDash = _c.lineDash, lineDashOffset = _c.lineDashOffset, lineCap = _c.lineCap, lineJoin = _c.lineJoin, strokeShadow = _c.strokeShadow, text = _c.text, x = _c.x, y = _c.y;\n if (lineDash) {\n ctx.setLineDash(lineDash);\n }\n if (lineDashOffset) {\n ctx.lineDashOffset = lineDashOffset;\n }\n if (lineCap) {\n ctx.lineCap = lineCap;\n }\n if (lineJoin) {\n ctx.lineJoin = lineJoin;\n }\n if (strokeShadow && strokeShadow.enabled) {\n ctx.shadowColor = strokeShadow.color;\n ctx.shadowOffsetX = strokeShadow.xOffset * pixelRatio;\n ctx.shadowOffsetY = strokeShadow.yOffset * pixelRatio;\n ctx.shadowBlur = strokeShadow.blur * pixelRatio;\n }\n ctx.strokeText(text, x, y);\n }\n this.dirty = false;\n };\n Text.className = 'Text';\n Text.defaultStyles = chainObjects(Shape.defaultStyles, {\n textAlign: 'start',\n fontStyle: undefined,\n fontWeight: undefined,\n fontSize: 10,\n fontFamily: 'sans-serif',\n textBaseline: 'alphabetic'\n });\n return Text;\n}(Shape));\nexport { Text };\n","var __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar Observable = /** @class */ (function () {\n function Observable() {\n // Note that these maps can't be specified generically, so they are kept untyped.\n // Some methods in this class only need generics in their signatures, the generics inside the methods\n // are just for clarity. The generics in signatures allow for static type checking of user provided\n // listeners and for type inference, so that the users wouldn't have to specify the type of parameters\n // of their inline lambdas.\n this.allPropertyListeners = new Map(); // property name => property change listener => scopes\n this.allEventListeners = new Map(); // event type => event listener => scopes\n }\n Observable.prototype.addPropertyListener = function (name, listener, scope) {\n if (scope === void 0) { scope = this; }\n var allPropertyListeners = this.allPropertyListeners;\n var propertyListeners = allPropertyListeners.get(name);\n if (!propertyListeners) {\n propertyListeners = new Map();\n allPropertyListeners.set(name, propertyListeners);\n }\n if (!propertyListeners.has(listener)) {\n var scopes_1 = new Set();\n propertyListeners.set(listener, scopes_1);\n }\n var scopes = propertyListeners.get(listener);\n if (scopes) {\n scopes.add(scope);\n }\n };\n Observable.prototype.removePropertyListener = function (name, listener, scope) {\n if (scope === void 0) { scope = this; }\n var allPropertyListeners = this.allPropertyListeners;\n var propertyListeners = allPropertyListeners.get(name);\n if (propertyListeners) {\n if (listener) {\n var scopes = propertyListeners.get(listener);\n if (scopes) {\n scopes.delete(scope);\n if (!scopes.size) {\n propertyListeners.delete(listener);\n }\n }\n }\n else {\n propertyListeners.clear();\n }\n }\n };\n Observable.prototype.notifyPropertyListeners = function (name, oldValue, value) {\n var _this = this;\n var allPropertyListeners = this.allPropertyListeners;\n var propertyListeners = allPropertyListeners.get(name);\n if (propertyListeners) {\n propertyListeners.forEach(function (scopes, listener) {\n scopes.forEach(function (scope) { return listener.call(scope, { type: name, source: _this, value: value, oldValue: oldValue }); });\n });\n }\n };\n Observable.prototype.addEventListener = function (type, listener, scope) {\n if (scope === void 0) { scope = this; }\n var allEventListeners = this.allEventListeners;\n var eventListeners = allEventListeners.get(type);\n if (!eventListeners) {\n eventListeners = new Map();\n allEventListeners.set(type, eventListeners);\n }\n if (!eventListeners.has(listener)) {\n var scopes_2 = new Set();\n eventListeners.set(listener, scopes_2);\n }\n var scopes = eventListeners.get(listener);\n if (scopes) {\n scopes.add(scope);\n }\n };\n Observable.prototype.removeEventListener = function (type, listener, scope) {\n if (scope === void 0) { scope = this; }\n var allEventListeners = this.allEventListeners;\n var eventListeners = allEventListeners.get(type);\n if (eventListeners) {\n if (listener) {\n var scopes = eventListeners.get(listener);\n if (scopes) {\n scopes.delete(scope);\n if (!scopes.size) {\n eventListeners.delete(listener);\n }\n }\n }\n else {\n eventListeners.clear();\n }\n }\n };\n Observable.prototype.notifyEventListeners = function (types) {\n var _this = this;\n var allEventListeners = this.allEventListeners;\n types.forEach(function (type) {\n var listeners = allEventListeners.get(type);\n if (listeners) {\n listeners.forEach(function (scopes, listener) {\n scopes.forEach(function (scope) { return listener.call(scope, { type: type, source: _this }); });\n });\n }\n });\n };\n // 'source' is added automatically and is always the object this method belongs to.\n Observable.prototype.fireEvent = function (event) {\n var _this = this;\n var listeners = this.allEventListeners.get(event.type);\n if (listeners) {\n listeners.forEach(function (scopes, listener) {\n scopes.forEach(function (scope) { return listener.call(scope, __assign(__assign({}, event), { source: _this })); });\n });\n }\n };\n Observable.privateKeyPrefix = '_';\n return Observable;\n}());\nexport { Observable };\nexport function reactive() {\n var events = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n events[_i] = arguments[_i];\n }\n var debug = events.indexOf('debugger') >= 0;\n return function (target, key) {\n // `target` is either a constructor (static member) or prototype (instance member)\n var privateKey = Observable.privateKeyPrefix + key;\n var privateKeyEvents = privateKey + 'Events';\n if (!target[key]) {\n if (events) {\n target[privateKeyEvents] = events;\n }\n Object.defineProperty(target, key, {\n set: function (value) {\n var oldValue = this[privateKey];\n // This is a way to stop inside the setter by adding the special\n // 'debugger' event to a reactive property, for example:\n // @reactive('layoutChange', 'debugger') title?: Caption;\n if (debug) { // DO NOT REMOVE\n debugger;\n }\n if (value !== oldValue || (typeof value === 'object' && value !== null)) {\n this[privateKey] = value;\n this.notifyPropertyListeners(key, oldValue, value);\n var events_1 = this[privateKeyEvents];\n if (events_1) {\n this.notifyEventListeners(events_1);\n }\n }\n },\n get: function () {\n return this[privateKey];\n },\n enumerable: true,\n configurable: true\n });\n }\n };\n}\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n 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;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nimport { Padding } from \"./util/padding\";\nimport { Text } from \"./scene/shape/text\";\nimport { PointerEvents } from \"./scene/node\";\nimport { Observable, reactive } from \"./util/observable\";\nvar Caption = /** @class */ (function (_super) {\n __extends(Caption, _super);\n function Caption() {\n var _this = _super.call(this) || this;\n _this.node = new Text();\n _this.enabled = false;\n _this.padding = new Padding(10);\n var node = _this.node;\n node.textAlign = 'center';\n node.textBaseline = 'top';\n node.pointerEvents = PointerEvents.None;\n return _this;\n }\n Object.defineProperty(Caption.prototype, \"text\", {\n get: function () {\n return this.node.text;\n },\n set: function (value) {\n if (this.node.text !== value) {\n this.node.text = value;\n this.fireEvent({ type: 'change' });\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Caption.prototype, \"fontStyle\", {\n get: function () {\n return this.node.fontStyle;\n },\n set: function (value) {\n if (this.node.fontStyle !== value) {\n this.node.fontStyle = value;\n this.fireEvent({ type: 'change' });\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Caption.prototype, \"fontWeight\", {\n get: function () {\n return this.node.fontWeight;\n },\n set: function (value) {\n if (this.node.fontWeight !== value) {\n this.node.fontWeight = value;\n this.fireEvent({ type: 'change' });\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Caption.prototype, \"fontSize\", {\n get: function () {\n return this.node.fontSize;\n },\n set: function (value) {\n if (this.node.fontSize !== value) {\n this.node.fontSize = value;\n this.fireEvent({ type: 'change' });\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Caption.prototype, \"fontFamily\", {\n get: function () {\n return this.node.fontFamily;\n },\n set: function (value) {\n if (this.node.fontFamily !== value) {\n this.node.fontFamily = value;\n this.fireEvent({ type: 'change' });\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Caption.prototype, \"color\", {\n get: function () {\n return this.node.fill;\n },\n set: function (value) {\n if (this.node.fill !== value) {\n this.node.fill = value;\n this.fireEvent({ type: 'change' });\n }\n },\n enumerable: true,\n configurable: true\n });\n __decorate([\n reactive('change')\n ], Caption.prototype, \"enabled\", void 0);\n __decorate([\n reactive('change')\n ], Caption.prototype, \"padding\", void 0);\n return Caption;\n}(Observable));\nexport { Caption };\n","export default (function (x) { return function () { return x; }; });\n","export default function (a, b) {\n a = +a;\n b = +b;\n return function (t) { return a * (1 - t) + b * t; };\n}\n","export default function (a, b) {\n var date = new Date;\n var msA = +a;\n var msB = +b;\n return function (t) {\n date.setTime(msA * (1 - t) + msB * t);\n return date;\n };\n}\n","import value from \"./value\";\nexport default function (a, b) {\n var nb = b ? b.length : 0;\n var na = a ? Math.min(nb, a.length) : 0;\n var x = new Array(na);\n var c = new Array(nb);\n var i;\n for (i = 0; i < na; ++i) {\n x[i] = value(a[i], b[i]);\n }\n for (; i < nb; ++i) {\n c[i] = b[i];\n }\n return function (t) {\n for (i = 0; i < na; ++i) {\n c[i] = x[i](t);\n }\n return c;\n };\n}\n","import value from \"./value\";\nexport default function (a, b) {\n var i = {};\n var c = {};\n var k;\n if (a === null || typeof a !== 'object') {\n a = {};\n }\n if (b === null || typeof b !== 'object') {\n b = {};\n }\n for (k in b) {\n if (k in a) {\n i[k] = value(a[k], b[k]);\n }\n else {\n c[k] = b[k];\n }\n }\n return function (t) {\n for (k in i) {\n c[k] = i[k](t);\n }\n return c;\n };\n}\n","var Color = /** @class */ (function () {\n /**\n * Every color component should be in the [0, 1] range.\n * Some easing functions (such as elastic easing) can overshoot the target value by some amount.\n * So, when animating colors, if the source or target color components are already near\n * or at the edge of the allowed [0, 1] range, it is possible for the intermediate color\n * component value to end up outside of that range mid-animation. For this reason the constructor\n * performs range checking/constraining.\n * @param r Red component.\n * @param g Green component.\n * @param b Blue component.\n * @param a Alpha (opacity) component.\n */\n function Color(r, g, b, a) {\n if (a === void 0) { a = 1; }\n // NaN is treated as 0.\n this.r = Math.min(1, Math.max(0, r || 0));\n this.g = Math.min(1, Math.max(0, g || 0));\n this.b = Math.min(1, Math.max(0, b || 0));\n this.a = Math.min(1, Math.max(0, a || 0));\n }\n /**\n * The given string can be in one of the following formats:\n * - #rgb\n * - #rrggbb\n * - rgb(r, g, b)\n * - rgba(r, g, b, a)\n * - CSS color name such as 'white', 'orange', 'cyan', etc.\n * @param str\n */\n Color.fromString = function (str) {\n // hexadecimal notation\n if (str.indexOf('#') >= 0) { // there can be some leading whitespace\n return Color.fromHexString(str);\n }\n // color name\n var hex = Color.nameToHex[str];\n if (hex) {\n return Color.fromHexString(hex);\n }\n // rgb(a) notation\n if (str.indexOf('rgb') >= 0) {\n return Color.fromRgbaString(str);\n }\n throw new Error(\"Invalid color string: '\" + str + \"'\");\n };\n // Using separate RegExp for the short hex notation because strings like `#abcd`\n // are matched as ['#abcd', 'ab', 'c', 'd', undefined] when the `{1,2}` quantifier is used.\n Color.fromHexString = function (str) {\n var values = str.match(Color.hexRe);\n if (values) {\n var r = parseInt(values[1], 16);\n var g = parseInt(values[2], 16);\n var b = parseInt(values[3], 16);\n var a = values[4] !== undefined ? parseInt(values[4], 16) : 255;\n return new Color(r / 255, g / 255, b / 255, a / 255);\n }\n values = str.match(Color.shortHexRe);\n if (values) {\n var r = parseInt(values[1], 16);\n var g = parseInt(values[2], 16);\n var b = parseInt(values[3], 16);\n var a = values[4] !== undefined ? parseInt(values[4], 16) : 15;\n r += r * 16;\n g += g * 16;\n b += b * 16;\n a += a * 16;\n return new Color(r / 255, g / 255, b / 255, a / 255);\n }\n throw new Error(\"Malformed hexadecimal color string: '\" + str + \"'\");\n };\n Color.fromRgbaString = function (str) {\n var values = str.match(Color.rgbRe);\n if (values) {\n return new Color(+values[1] / 255, +values[2] / 255, +values[3] / 255);\n }\n values = str.match(Color.rgbaRe);\n if (values) {\n return new Color(+values[1] / 255, +values[2] / 255, +values[3] / 255, +values[4]);\n }\n throw new Error(\"Malformed rgb/rgba color string: '\" + str + \"'\");\n };\n Color.fromArray = function (arr) {\n if (arr.length === 4) {\n return new Color(arr[0], arr[1], arr[2], arr[3]);\n }\n if (arr.length === 3) {\n return new Color(arr[0], arr[1], arr[2]);\n }\n throw new Error('The given array should contain 3 or 4 color components (numbers).');\n };\n Color.fromHSB = function (h, s, b, alpha) {\n if (alpha === void 0) { alpha = 1; }\n var rgb = Color.HSBtoRGB(h, s, b);\n return new Color(rgb[0], rgb[1], rgb[2], alpha);\n };\n Color.padHex = function (str) {\n // Can't use `padStart(2, '0')` here because of IE.\n return str.length === 1 ? '0' + str : str;\n };\n Color.prototype.toHexString = function () {\n var hex = '#'\n + Color.padHex(Math.round(this.r * 255).toString(16))\n + Color.padHex(Math.round(this.g * 255).toString(16))\n + Color.padHex(Math.round(this.b * 255).toString(16));\n if (this.a < 1) {\n hex += Color.padHex(Math.round(this.a * 255).toString(16));\n }\n return hex;\n };\n Color.prototype.toRgbaString = function (fractionDigits) {\n if (fractionDigits === void 0) { fractionDigits = 3; }\n var components = [\n Math.round(this.r * 255),\n Math.round(this.g * 255),\n Math.round(this.b * 255)\n ];\n var k = Math.pow(10, fractionDigits);\n if (this.a !== 1) {\n components.push(Math.round(this.a * k) / k);\n return \"rgba(\" + components.join(', ') + \")\";\n }\n return \"rgb(\" + components.join(', ') + \")\";\n };\n Color.prototype.toString = function () {\n if (this.a === 1) {\n return this.toHexString();\n }\n return this.toRgbaString();\n };\n Color.prototype.toHSB = function () {\n return Color.RGBtoHSB(this.r, this.g, this.b);\n };\n /**\n * Converts the given RGB triple to an array of HSB (HSV) components.\n * The hue component will be `NaN` for achromatic colors.\n */\n Color.RGBtoHSB = function (r, g, b) {\n var min = Math.min(r, g, b);\n var max = Math.max(r, g, b);\n var S = max !== 0 ? (max - min) / max : 0;\n var H = NaN;\n // min == max, means all components are the same\n // and the color is a shade of gray with no hue (H is NaN)\n if (min !== max) {\n var delta = max - min;\n var rc = (max - r) / delta;\n var gc = (max - g) / delta;\n var bc = (max - b) / delta;\n if (r === max) {\n H = bc - gc;\n }\n else if (g === max) {\n H = 2.0 + rc - bc;\n }\n else {\n H = 4.0 + gc - rc;\n }\n H /= 6.0;\n if (H < 0) {\n H = H + 1.0;\n }\n }\n return [H * 360, S, max];\n };\n /**\n * Converts the given HSB (HSV) triple to an array of RGB components.\n */\n Color.HSBtoRGB = function (H, S, B) {\n if (isNaN(H)) {\n H = 0;\n }\n H = (((H % 360) + 360) % 360) / 360; // normalize hue to [0, 360] interval, then scale to [0, 1]\n var r = 0;\n var g = 0;\n var b = 0;\n if (S === 0) {\n r = g = b = B;\n }\n else {\n var h = (H - Math.floor(H)) * 6;\n var f = h - Math.floor(h);\n var p = B * (1 - S);\n var q = B * (1 - S * f);\n var t = B * (1 - (S * (1 - f)));\n switch (h >> 0) { // discard the floating point part of the number\n case 0:\n r = B;\n g = t;\n b = p;\n break;\n case 1:\n r = q;\n g = B;\n b = p;\n break;\n case 2:\n r = p;\n g = B;\n b = t;\n break;\n case 3:\n r = p;\n g = q;\n b = B;\n break;\n case 4:\n r = t;\n g = p;\n b = B;\n break;\n case 5:\n r = B;\n g = p;\n b = q;\n break;\n }\n }\n return [r, g, b];\n };\n Color.prototype.derive = function (hueShift, saturationFactor, brightnessFactor, opacityFactor) {\n var hsb = Color.RGBtoHSB(this.r, this.g, this.b);\n var b = hsb[2];\n if (b == 0 && brightnessFactor > 1.0) {\n b = 0.05;\n }\n var h = (((hsb[0] + hueShift) % 360) + 360) % 360;\n var s = Math.max(Math.min(hsb[1] * saturationFactor, 1.0), 0.0);\n b = Math.max(Math.min(b * brightnessFactor, 1.0), 0.0);\n var a = Math.max(Math.min(this.a * opacityFactor, 1.0), 0.0);\n var rgba = Color.HSBtoRGB(h, s, b);\n rgba.push(a);\n return Color.fromArray(rgba);\n };\n Color.prototype.brighter = function () {\n return this.derive(0, 1.0, 1.0 / 0.7, 1.0);\n };\n Color.prototype.darker = function () {\n return this.derive(0, 1.0, 0.7, 1.0);\n };\n // See https://drafts.csswg.org/css-color/#hex-notation\n Color.hexRe = /\\s*#([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})?\\s*$/;\n Color.shortHexRe = /\\s*#([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])?\\s*$/;\n Color.rgbRe = /\\s*rgb\\((\\d+),\\s*(\\d+),\\s*(\\d+)\\)\\s*/;\n Color.rgbaRe = /\\s*rgba\\((\\d+),\\s*(\\d+),\\s*(\\d+),\\s*([.\\d]+)\\)\\s*/;\n /**\n * CSS Color Module Level 4:\n * https://drafts.csswg.org/css-color/#named-colors\n */\n Color.nameToHex = Object.freeze({\n aliceblue: '#F0F8FF',\n antiquewhite: '#FAEBD7',\n aqua: '#00FFFF',\n aquamarine: '#7FFFD4',\n azure: '#F0FFFF',\n beige: '#F5F5DC',\n bisque: '#FFE4C4',\n black: '#000000',\n blanchedalmond: '#FFEBCD',\n blue: '#0000FF',\n blueviolet: '#8A2BE2',\n brown: '#A52A2A',\n burlywood: '#DEB887',\n cadetblue: '#5F9EA0',\n chartreuse: '#7FFF00',\n chocolate: '#D2691E',\n coral: '#FF7F50',\n cornflowerblue: '#6495ED',\n cornsilk: '#FFF8DC',\n crimson: '#DC143C',\n cyan: '#00FFFF',\n darkblue: '#00008B',\n darkcyan: '#008B8B',\n darkgoldenrod: '#B8860B',\n darkgray: '#A9A9A9',\n darkgreen: '#006400',\n darkgrey: '#A9A9A9',\n darkkhaki: '#BDB76B',\n darkmagenta: '#8B008B',\n darkolivegreen: '#556B2F',\n darkorange: '#FF8C00',\n darkorchid: '#9932CC',\n darkred: '#8B0000',\n darksalmon: '#E9967A',\n darkseagreen: '#8FBC8F',\n darkslateblue: '#483D8B',\n darkslategray: '#2F4F4F',\n darkslategrey: '#2F4F4F',\n darkturquoise: '#00CED1',\n darkviolet: '#9400D3',\n deeppink: '#FF1493',\n deepskyblue: '#00BFFF',\n dimgray: '#696969',\n dimgrey: '#696969',\n dodgerblue: '#1E90FF',\n firebrick: '#B22222',\n floralwhite: '#FFFAF0',\n forestgreen: '#228B22',\n fuchsia: '#FF00FF',\n gainsboro: '#DCDCDC',\n ghostwhite: '#F8F8FF',\n gold: '#FFD700',\n goldenrod: '#DAA520',\n gray: '#808080',\n green: '#008000',\n greenyellow: '#ADFF2F',\n grey: '#808080',\n honeydew: '#F0FFF0',\n hotpink: '#FF69B4',\n indianred: '#CD5C5C',\n indigo: '#4B0082',\n ivory: '#FFFFF0',\n khaki: '#F0E68C',\n lavender: '#E6E6FA',\n lavenderblush: '#FFF0F5',\n lawngreen: '#7CFC00',\n lemonchiffon: '#FFFACD',\n lightblue: '#ADD8E6',\n lightcoral: '#F08080',\n lightcyan: '#E0FFFF',\n lightgoldenrodyellow: '#FAFAD2',\n lightgray: '#D3D3D3',\n lightgreen: '#90EE90',\n lightgrey: '#D3D3D3',\n lightpink: '#FFB6C1',\n lightsalmon: '#FFA07A',\n lightseagreen: '#20B2AA',\n lightskyblue: '#87CEFA',\n lightslategray: '#778899',\n lightslategrey: '#778899',\n lightsteelblue: '#B0C4DE',\n lightyellow: '#FFFFE0',\n lime: '#00FF00',\n limegreen: '#32CD32',\n linen: '#FAF0E6',\n magenta: '#FF00FF',\n maroon: '#800000',\n mediumaquamarine: '#66CDAA',\n mediumblue: '#0000CD',\n mediumorchid: '#BA55D3',\n mediumpurple: '#9370DB',\n mediumseagreen: '#3CB371',\n mediumslateblue: '#7B68EE',\n mediumspringgreen: '#00FA9A',\n mediumturquoise: '#48D1CC',\n mediumvioletred: '#C71585',\n midnightblue: '#191970',\n mintcream: '#F5FFFA',\n mistyrose: '#FFE4E1',\n moccasin: '#FFE4B5',\n navajowhite: '#FFDEAD',\n navy: '#000080',\n oldlace: '#FDF5E6',\n olive: '#808000',\n olivedrab: '#6B8E23',\n orange: '#FFA500',\n orangered: '#FF4500',\n orchid: '#DA70D6',\n palegoldenrod: '#EEE8AA',\n palegreen: '#98FB98',\n paleturquoise: '#AFEEEE',\n palevioletred: '#DB7093',\n papayawhip: '#FFEFD5',\n peachpuff: '#FFDAB9',\n peru: '#CD853F',\n pink: '#FFC0CB',\n plum: '#DDA0DD',\n powderblue: '#B0E0E6',\n purple: '#800080',\n rebeccapurple: '#663399',\n red: '#FF0000',\n rosybrown: '#BC8F8F',\n royalblue: '#4169E1',\n saddlebrown: '#8B4513',\n salmon: '#FA8072',\n sandybrown: '#F4A460',\n seagreen: '#2E8B57',\n seashell: '#FFF5EE',\n sienna: '#A0522D',\n silver: '#C0C0C0',\n skyblue: '#87CEEB',\n slateblue: '#6A5ACD',\n slategray: '#708090',\n slategrey: '#708090',\n snow: '#FFFAFA',\n springgreen: '#00FF7F',\n steelblue: '#4682B4',\n tan: '#D2B48C',\n teal: '#008080',\n thistle: '#D8BFD8',\n tomato: '#FF6347',\n turquoise: '#40E0D0',\n violet: '#EE82EE',\n wheat: '#F5DEB3',\n white: '#FFFFFF',\n whitesmoke: '#F5F5F5',\n yellow: '#FFFF00',\n yellowgreen: '#9ACD32'\n });\n return Color;\n}());\nexport { Color };\n","import number from \"./number\";\nimport { Color } from \"../util/color\";\nexport default function (a, b) {\n if (typeof a === 'string') {\n try {\n a = Color.fromString(a);\n }\n catch (e) {\n a = Color.fromArray([0, 0, 0]);\n }\n }\n if (typeof b === 'string') {\n try {\n b = Color.fromString(b);\n }\n catch (e) {\n b = Color.fromArray([0, 0, 0]);\n }\n }\n var red = number(a.r, b.r);\n var green = number(a.g, b.g);\n var blue = number(a.b, b.b);\n var alpha = number(a.a, b.a);\n return function (t) {\n return Color.fromArray([red(t), green(t), blue(t), alpha(t)]).toRgbaString();\n };\n}\n","import constant from \"./constant\";\nimport number from \"./number\";\nimport date from \"./date\";\nimport array from \"./array\";\nimport object from \"./object\";\nimport color from \"./color\";\nimport { Color } from \"../util/color\";\nexport default function (a, b) {\n var t = typeof b;\n var c;\n if (b == null || t === 'boolean') {\n return constant(b);\n }\n if (t === 'number') {\n return number(a, b);\n }\n if (t === 'string') {\n try {\n c = Color.fromString(b);\n b = c;\n return color(a, b);\n }\n catch (e) {\n // return string(a, b);\n }\n }\n if (b instanceof Color) {\n return color(a, b);\n }\n if (b instanceof Date) {\n return date(a, b);\n }\n if (Array.isArray(b)) {\n return array(a, b);\n }\n if (typeof b.valueOf !== 'function' && typeof b.toString !== 'function' || isNaN(b)) {\n return object(a, b);\n }\n return number(a, b);\n}\n","export function ascending(a, b) {\n return a < b ? -1 : a > b ? 1 : a >= b ? 0 : NaN;\n}\n","import { ascending } from \"./compare\";\n/**\n * Returns the insertion point for `x` in array to maintain sorted order.\n * The arguments `lo` and `hi` may be used to specify a subset of the array which should be considered;\n * by default the entire array is used. If `x` is already present in array, the insertion point will be before\n * (to the left of) any existing entries. The return value is suitable for use as the first argument to `splice`\n * assuming that array is already sorted. The returned insertion point `i` partitions the array into two halves\n * so that all `v < x` for `v` in `array.slice(lo, i)` for the left side and all `v >= x` for `v` in `array.slice(i, hi)`\n * for the right side.\n * @param list\n * @param x\n * @param comparator\n * @param lo\n * @param hi\n */\nexport function bisectLeft(list, x, comparator, lo, hi) {\n if (lo === void 0) { lo = 0; }\n if (hi === void 0) { hi = list.length; }\n while (lo < hi) {\n var mid = (lo + hi) >>> 1;\n if (comparator(list[mid], x) < 0) { // list[mid] < x\n lo = mid + 1;\n }\n else {\n hi = mid;\n }\n }\n return lo;\n}\nexport function bisectRight(list, x, comparator, lo, hi) {\n if (lo === void 0) { lo = 0; }\n if (hi === void 0) { hi = list.length; }\n while (lo < hi) {\n var mid = (lo + hi) >>> 1;\n if (comparator(list[mid], x) > 0) { // list[mid] > x\n hi = mid;\n }\n else {\n lo = mid + 1;\n }\n }\n return lo;\n}\n/**\n * A specialized version of `bisectLeft` that works with the arrays whose elements cannot be compared directly.\n * The map function is used instead to produce a comparable value for a given array element, then the values\n * returned by the map are compared using the `ascendingComparator`.\n * @param list\n * @param x\n * @param map\n * @param lo\n * @param hi\n */\nexport function complexBisectLeft(list, x, map, lo, hi) {\n if (lo === void 0) { lo = 0; }\n if (hi === void 0) { hi = list.length; }\n var comparator = ascendingComparator(map);\n while (lo < hi) {\n var mid = (lo + hi) >>> 1;\n if (comparator(list[mid], x) < 0) {\n lo = mid + 1;\n }\n else {\n hi = mid;\n }\n }\n return lo;\n}\nexport function complexBisectRight(list, x, map, lo, hi) {\n if (lo === void 0) { lo = 0; }\n if (hi === void 0) { hi = list.length; }\n var comparator = ascendingComparator(map);\n while (lo < hi) {\n var mid = (lo + hi) >>> 1;\n if (comparator(list[mid], x) < 0) {\n lo = mid + 1;\n }\n else {\n hi = mid;\n }\n }\n return lo;\n}\nfunction ascendingComparator(map) {\n return function (item, x) {\n return ascending(map(item), x);\n };\n}\n","import interpolateValue from \"../interpolate/value\";\nimport interpolateNumber from \"../interpolate/number\";\nimport { bisectRight } from \"../util/bisect\";\nimport { ascending } from \"../util/compare\";\nexport var constant = function (x) { return function () { return x; }; };\nexport var identity = function (x) { return x; };\nfunction clamper(domain) {\n var _a;\n var a = domain[0];\n var b = domain[domain.length - 1];\n if (a > b) {\n _a = [b, a], a = _a[0], b = _a[1];\n }\n return function (x) { return Math.max(a, Math.min(b, x)); };\n}\nvar ContinuousScale = /** @class */ (function () {\n function ContinuousScale() {\n /**\n * The output value of the scale for `undefined` or `NaN` input values.\n */\n this.unknown = undefined;\n this._clamp = identity;\n this._domain = [0, 1];\n this._range = [0, 1];\n this.transform = identity; // transforms domain value\n this.untransform = identity; // untransforms domain value\n this._interpolate = interpolateValue;\n this.rescale();\n }\n Object.defineProperty(ContinuousScale.prototype, \"clamp\", {\n get: function () {\n return this._clamp !== identity;\n },\n set: function (value) {\n this._clamp = value ? clamper(this.domain) : identity;\n },\n enumerable: true,\n configurable: true\n });\n ContinuousScale.prototype.setDomain = function (values) {\n this._domain = Array.prototype.map.call(values, function (v) { return +v; });\n if (this._clamp !== identity) {\n this._clamp = clamper(this.domain);\n }\n this.rescale();\n };\n ContinuousScale.prototype.getDomain = function () {\n return this._domain.slice();\n };\n Object.defineProperty(ContinuousScale.prototype, \"domain\", {\n get: function () {\n return this.getDomain();\n },\n set: function (values) {\n this.setDomain(values);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(ContinuousScale.prototype, \"range\", {\n get: function () {\n return this._range.slice();\n },\n set: function (values) {\n this._range = Array.prototype.slice.call(values);\n this.rescale();\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(ContinuousScale.prototype, \"interpolate\", {\n get: function () {\n return this._interpolate;\n },\n set: function (value) {\n this._interpolate = value;\n this.rescale();\n },\n enumerable: true,\n configurable: true\n });\n ContinuousScale.prototype.rescale = function () {\n if (Math.min(this.domain.length, this.range.length) > 2) {\n this.piecewise = this.polymap;\n }\n else {\n this.piecewise = this.bimap;\n }\n this.output = undefined;\n this.input = undefined;\n };\n /**\n * Returns a function that converts `x` in `[a, b]` to `t` in `[0, 1]`. Non-clamping.\n * @param a\n * @param b\n */\n ContinuousScale.prototype.normalize = function (a, b) {\n return (b -= (a = +a))\n ? function (x) { return (x - a) / b; }\n : constant(isNaN(b) ? NaN : 0.5);\n };\n ContinuousScale.prototype.bimap = function (domain, range, interpolate) {\n var x0 = domain[0];\n var x1 = domain[1];\n var y0 = range[0];\n var y1 = range[1];\n var xt;\n var ty;\n if (x1 < x0) {\n xt = this.normalize(x1, x0);\n ty = interpolate(y1, y0);\n }\n else {\n xt = this.normalize(x0, x1);\n ty = interpolate(y0, y1);\n }\n return function (x) { return ty(xt(x)); }; // domain value x --> t in [0, 1] --> range value y\n };\n ContinuousScale.prototype.polymap = function (domain, range, interpolate) {\n var _this = this;\n // number of segments in the polylinear scale\n var n = Math.min(domain.length, range.length) - 1;\n if (domain[n] < domain[0]) {\n domain = domain.slice().reverse();\n range = range.slice().reverse();\n }\n // deinterpolators from domain segment value to t\n var dt = Array.from({ length: n }, function (_, i) { return _this.normalize(domain[i], domain[i + 1]); });\n // reinterpolators from t to range segment value\n var tr = Array.from({ length: n }, function (_, i) { return interpolate(range[i], range[i + 1]); });\n return function (x) {\n var i = bisectRight(domain, x, ascending, 1, n) - 1; // Find the domain segment that `x` belongs to.\n // This also tells us which deinterpolator/reinterpolator pair to use.\n return tr[i](dt[i](x));\n };\n };\n ContinuousScale.prototype.convert = function (x) {\n x = +x;\n if (isNaN(x)) {\n return this.unknown;\n }\n else {\n if (!this.output) {\n this.output = this.piecewise(this.domain.map(this.transform), this.range, this.interpolate);\n }\n return this.output(this.transform(this._clamp(x)));\n }\n };\n ContinuousScale.prototype.invert = function (y) {\n if (!this.input) {\n this.input = this.piecewise(this.range, this.domain.map(this.transform), interpolateNumber);\n }\n return this._clamp(this.untransform(this.input(y)));\n };\n return ContinuousScale;\n}());\nexport default ContinuousScale;\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nexport default function (a, b, count) {\n var step = tickStep(a, b, count);\n a = Math.ceil(a / step) * step;\n b = Math.floor(b / step) * step + step / 2;\n // Add half a step here so that the array returned by `range` includes the last tick.\n return range(a, b, step);\n}\nvar e10 = Math.sqrt(50);\nvar e5 = Math.sqrt(10);\nvar e2 = Math.sqrt(2);\nexport function tickStep(a, b, count) {\n var rawStep = Math.abs(b - a) / Math.max(0, count);\n var step = Math.pow(10, Math.floor(Math.log(rawStep) / Math.LN10)); // = Math.log10(rawStep)\n var error = rawStep / step;\n if (error >= e10) {\n step *= 10;\n }\n else if (error >= e5) {\n step *= 5;\n }\n else if (error >= e2) {\n step *= 2;\n }\n return b < a ? -step : step;\n}\nexport function tickIncrement(a, b, count) {\n var rawStep = (b - a) / Math.max(0, count);\n var power = Math.floor(Math.log(rawStep) / Math.LN10);\n var error = rawStep / Math.pow(10, power);\n return power >= 0\n ? (error >= e10 ? 10 : error >= e5 ? 5 : error >= e2 ? 2 : 1) * Math.pow(10, power)\n : -Math.pow(10, -power) / (error >= e10 ? 10 : error >= e5 ? 5 : error >= e2 ? 2 : 1);\n}\nvar NumericTicks = /** @class */ (function (_super) {\n __extends(NumericTicks, _super);\n function NumericTicks(fractionDigits, elements) {\n var _this = _super.call(this) || this;\n if (elements) {\n for (var i = 0, n = elements.length; i < n; i++) {\n _this[i] = elements[i];\n }\n }\n _this.fractionDigits = fractionDigits;\n return _this;\n }\n return NumericTicks;\n}(Array));\nexport { NumericTicks };\nfunction range(a, b, step) {\n if (step === void 0) { step = 1; }\n var absStep = Math.abs(step);\n var fractionDigits = (absStep > 0 && absStep < 1)\n ? Math.abs(Math.floor(Math.log(absStep) / Math.LN10))\n : 0;\n var f = Math.pow(10, fractionDigits);\n var n = Math.max(0, Math.ceil((b - a) / step)) || 0;\n var values = new NumericTicks(fractionDigits);\n for (var i = 0; i < n; i++) {\n var value = a + step * i;\n values[i] = Math.round(value * f) / f;\n }\n return values;\n}\n","import { tickStep } from './ticks';\nvar formatTypes = {\n // Multiply by 100, and then decimal notation with a percent sign.\n '%': function (x, p) { return (x * 100).toFixed(p); },\n // Binary notation, rounded to integer.\n 'b': function (x) { return Math.round(x).toString(2); },\n // Converts the integer to the corresponding unicode character before printing.\n 'c': function (x) { return String(x); },\n // Decimal notation, rounded to integer.\n 'd': formatDecimal,\n // Exponent notation.\n 'e': function (x, p) { return x.toExponential(p); },\n // Fixed point notation.\n 'f': function (x, p) { return x.toFixed(p); },\n // Either decimal or exponent notation, rounded to significant digits.\n 'g': function (x, p) { return x.toPrecision(p); },\n // Octal notation, rounded to integer.\n 'o': function (x) { return Math.round(x).toString(8); },\n // Multiply by 100, round to significant digits, and then decimal notation with a percent sign.\n 'p': function (x, p) { return formatRounded(x * 100, p); },\n // Decimal notation, rounded to significant digits.\n 'r': formatRounded,\n // Decimal notation with a SI prefix, rounded to significant digits.\n 's': formatPrefixAuto,\n // Hexadecimal notation, using upper-case letters, rounded to integer.\n 'X': function (x) { return Math.round(x).toString(16).toUpperCase(); },\n // Hexadecimal notation, using lower-case letters, rounded to integer.\n 'x': function (x) { return Math.round(x).toString(16); }\n};\nvar prefixes = ['y', 'z', 'a', 'f', 'p', 'n', '\\xB5', 'm', '', 'k', 'M', 'G', 'T', 'P', 'E', 'Z', 'Y'];\n/**\n * [[fill]align][sign][#][0][width][grouping_option][.precision][type]\n */\nvar FormatSpecifier = /** @class */ (function () {\n function FormatSpecifier(specifier) {\n if (specifier instanceof FormatSpecifier) {\n this.fill = specifier.fill;\n this.align = specifier.align;\n this.sign = specifier.sign;\n this.symbol = specifier.symbol;\n this.zero = specifier.zero;\n this.width = specifier.width;\n this.comma = specifier.comma;\n this.precision = specifier.precision;\n this.trim = specifier.trim;\n this.type = specifier.type;\n this.string = specifier.string;\n }\n else {\n this.fill = specifier.fill === undefined ? ' ' : String(specifier.fill);\n this.align = specifier.align === undefined ? '>' : String(specifier.align);\n this.sign = specifier.sign === undefined ? '-' : String(specifier.sign);\n this.symbol = specifier.symbol === undefined ? '' : String(specifier.symbol);\n this.zero = !!specifier.zero;\n this.width = specifier.width === undefined ? undefined : +specifier.width;\n this.comma = !!specifier.comma;\n this.precision = specifier.precision === undefined ? undefined : +specifier.precision;\n this.trim = !!specifier.trim;\n this.type = specifier.type === undefined ? '' : String(specifier.type);\n this.string = specifier.string;\n }\n }\n return FormatSpecifier;\n}());\nexport { FormatSpecifier };\n// [[fill]align][sign][symbol][0][width][,][.precision][~][type]\nvar formatRegEx = /^(?:(.)?([<>=^]))?([+\\-( ])?([$#])?(0)?(\\d+)?(,)?(\\.\\d+)?(~)?([a-z%])?$/i;\nvar interpolateRegEx = /(#\\{(.*?)\\})/g;\nexport function makeFormatSpecifier(specifier) {\n if (specifier instanceof FormatSpecifier) {\n return new FormatSpecifier(specifier);\n }\n var found = false;\n var string = specifier.replace(interpolateRegEx, function () {\n if (!found) {\n specifier = arguments[2];\n found = true;\n }\n return '#{}';\n });\n var match = formatRegEx.exec(specifier);\n if (!match) {\n throw new Error(\"Invalid format: \" + specifier);\n }\n return new FormatSpecifier({\n fill: match[1],\n align: match[2],\n sign: match[3],\n symbol: match[4],\n zero: match[5],\n width: match[6],\n comma: match[7],\n precision: match[8] && match[8].slice(1),\n trim: match[9],\n type: match[10],\n string: found ? string : undefined\n });\n}\nexport function tickFormat(start, stop, count, specifier) {\n var step = tickStep(start, stop, count);\n var formatSpecifier = makeFormatSpecifier(specifier == undefined ? ',f' : specifier);\n switch (formatSpecifier.type) {\n case 's': {\n var value = Math.max(Math.abs(start), Math.abs(stop));\n if (formatSpecifier.precision == null) {\n var precision = precisionPrefix(step, value);\n if (!isNaN(precision)) {\n formatSpecifier.precision = precision;\n }\n }\n return formatPrefix(formatSpecifier, value);\n }\n case '':\n case 'e':\n case 'g':\n case 'p':\n case 'r': {\n if (formatSpecifier.precision == null) {\n var precision = precisionRound(step, Math.max(Math.abs(start), Math.abs(stop)));\n if (!isNaN(precision)) {\n formatSpecifier.precision = precision - Number(formatSpecifier.type === 'e');\n }\n }\n break;\n }\n case 'f':\n case '%': {\n if (formatSpecifier.precision == null) {\n var precision = precisionFixed(step);\n if (!isNaN(precision)) {\n formatSpecifier.precision = precision - Number(formatSpecifier.type === '%') * 2;\n }\n }\n break;\n }\n }\n return format(formatSpecifier);\n}\nvar prefixExponent;\nfunction formatPrefixAuto(x, p) {\n var d = formatDecimalParts(x, p);\n if (!d) {\n return String(x);\n }\n var coefficient = d[0];\n var exponent = d[1];\n prefixExponent = Math.max(-8, Math.min(8, Math.floor(exponent / 3))) * 3;\n var i = exponent - prefixExponent + 1;\n var n = coefficient.length;\n if (i === n) {\n return coefficient;\n }\n else {\n if (i > n) {\n return coefficient + new Array(i - n + 1).join('0');\n }\n if (i > 0) {\n return coefficient.slice(0, i) + '.' + coefficient.slice(i);\n }\n else {\n var parts = formatDecimalParts(x, Math.max(0, p + i - 1));\n return '0.' + new Array(1 - i).join('0') + parts[0]; // less than 1y!\n }\n }\n}\nfunction formatDecimal(x) {\n return Math.abs(x = Math.round(x)) >= 1e21\n ? x.toLocaleString('en').replace(/,/g, '')\n : x.toString(10);\n}\nfunction formatGroup(grouping, thousands) {\n return function (value, width) {\n var t = [];\n var i = value.length;\n var j = 0;\n var g = grouping[0];\n var length = 0;\n while (i > 0 && g > 0) {\n if (length + g + 1 > width) {\n g = Math.max(1, width - length);\n }\n t.push(value.substring(i -= g, i + g));\n if ((length += g + 1) > width) {\n break;\n }\n g = grouping[j = (j + 1) % grouping.length];\n }\n return t.reverse().join(thousands);\n };\n}\nexport function formatNumerals(numerals) {\n return function (value) { return value.replace(/[0-9]/g, function (i) { return numerals[+i]; }); };\n}\n// Trim insignificant zeros.\nfunction formatTrim(s) {\n var n = s.length;\n var i = 1;\n var i0 = -1;\n var i1 = NaN;\n out: for (; i < n; i++) {\n switch (s[i]) {\n case '.':\n i0 = i1 = i;\n break;\n case '0':\n if (i0 === 0) {\n i0 = i;\n i1 = i;\n }\n break;\n default:\n if (!+s[i]) {\n break out;\n }\n if (i0 > 0) {\n i0 = 0;\n break;\n }\n }\n }\n return i0 > 0 ? s.slice(0, i0) + s.slice(i1 + 1) : s;\n}\nfunction formatRounded(x, p) {\n var d = formatDecimalParts(x, p);\n if (!d) {\n return String(x);\n }\n var coefficient = d[0];\n var exponent = d[1];\n if (exponent < 0) {\n return '0.' + new Array(-exponent).join('0') + coefficient;\n }\n else {\n if (coefficient.length > exponent + 1) {\n return coefficient.slice(0, exponent + 1) + '.' + coefficient.slice(exponent + 1);\n }\n else {\n return coefficient + new Array(exponent - coefficient.length + 2).join('0');\n }\n }\n}\n// Computes the decimal coefficient and exponent of the specified number x with\n// significant digits p, where x is positive and p is in [1, 21] or undefined.\n// For example, formatDecimalParts(1.23) returns ['123', 0].\nexport function formatDecimalParts(x, p) {\n var sx = p ? x.toExponential(p - 1) : x.toExponential();\n var i = sx.indexOf('e');\n if (i < 0) { // NaN, ±Infinity\n return undefined;\n }\n var coefficient = sx.slice(0, i);\n // The string returned by toExponential either has the form \\d\\.\\d+e[-+]\\d+\n // (e.g., 1.2e+3) or the form \\de[-+]\\d+ (e.g., 1e+3).\n return [\n coefficient.length > 1 ? coefficient[0] + coefficient.slice(2) : coefficient,\n +sx.slice(i + 1)\n ];\n}\nfunction identity(x) {\n return x;\n}\nexport var formatDefaultLocale;\nexport var format;\nexport var formatPrefix;\ndefaultLocale({\n thousands: ',',\n grouping: [3],\n currency: ['$', '']\n});\nfunction defaultLocale(definition) {\n formatDefaultLocale = formatLocale(definition);\n format = formatDefaultLocale.format;\n formatPrefix = formatDefaultLocale.formatPrefix;\n}\nfunction exponent(x) {\n var parts = formatDecimalParts(Math.abs(x));\n if (parts) {\n return parts[1];\n }\n return NaN;\n}\nfunction precisionFixed(step) {\n return Math.max(0, -exponent(Math.abs(step)));\n}\nfunction precisionPrefix(step, value) {\n var x = Math.floor(exponent(value) / 3);\n x = Math.min(8, x);\n x = Math.max(-8, x);\n return Math.max(0, x * 3 - exponent(Math.abs(step)));\n}\nfunction precisionRound(step, max) {\n step = Math.abs(step);\n max = Math.abs(max) - step;\n return Math.max(0, exponent(max) - exponent(step)) + 1;\n}\nexport function formatLocale(locale) {\n var group = locale.grouping === undefined || locale.thousands === undefined\n ? identity\n : formatGroup(Array.prototype.map.call(locale.grouping, Number), String(locale.thousands));\n var currencyPrefix = locale.currency === undefined ? '' : String(locale.currency[0]);\n var currencySuffix = locale.currency === undefined ? '' : String(locale.currency[1]);\n var decimal = locale.decimal === undefined ? '.' : String(locale.decimal);\n var numerals = locale.numerals === undefined\n ? identity\n : formatNumerals(Array.prototype.map.call(locale.numerals, String));\n var percent = locale.percent === undefined ? '%' : String(locale.percent);\n var minus = locale.minus === undefined ? '\\u2212' : String(locale.minus);\n var nan = locale.nan === undefined ? 'NaN' : String(locale.nan);\n function newFormat(specifier) {\n var formatSpecifier = makeFormatSpecifier(specifier);\n var fill = formatSpecifier.fill;\n var align = formatSpecifier.align;\n var sign = formatSpecifier.sign;\n var symbol = formatSpecifier.symbol;\n var zero = formatSpecifier.zero;\n var width = formatSpecifier.width;\n var comma = formatSpecifier.comma;\n var precision = formatSpecifier.precision;\n var trim = formatSpecifier.trim;\n var type = formatSpecifier.type;\n // The 'n' type is an alias for ',g'.\n if (type === 'n') {\n comma = true;\n type = 'g';\n }\n else if (!type || !formatTypes[type]) { // The '' type, and any invalid type, is an alias for '.12~g'.\n if (precision === undefined) {\n precision = 12;\n }\n trim = true;\n type = 'g';\n }\n // If zero fill is specified, padding goes after sign and before digits.\n if (zero || (fill === '0' && align === '=')) {\n zero = true;\n fill = '0';\n align = '=';\n }\n // Compute the prefix and suffix.\n // For SI-prefix, the suffix is lazily computed.\n var prefix = symbol === '$' ? currencyPrefix : symbol === '#' && /[boxX]/.test(type) ? '0' + type.toLowerCase() : '';\n var suffix = symbol === '$' ? currencySuffix : /[%p]/.test(type) ? percent : '';\n // What format function should we use?\n // Is this an integer type?\n // Can this type generate exponential notation?\n var formatType = formatTypes[type];\n var maybeSuffix = /[defgprs%]/.test(type);\n // Set the default precision if not specified,\n // or clamp the specified precision to the supported range.\n // For significant precision, it must be in [1, 21].\n // For fixed precision, it must be in [0, 20].\n if (precision === undefined) {\n precision = 6;\n }\n else if (/[gprs]/.test(type)) {\n precision = Math.max(1, Math.min(21, precision));\n }\n else {\n precision = Math.max(0, Math.min(20, precision));\n }\n function format(x) {\n var valuePrefix = prefix;\n var valueSuffix = suffix;\n var value;\n if (type === 'c') {\n valueSuffix = formatType(x) + valueSuffix;\n value = '';\n }\n else {\n x = +x;\n // Determine the sign. -0 is not less than 0, but 1 / -0 is!\n var valueNegative = x < 0 || 1 / x < 0;\n // Perform the initial formatting.\n value = isNaN(x) ? nan : formatType(Math.abs(x), precision);\n // Trim insignificant zeros.\n if (trim) {\n value = formatTrim(value);\n }\n // If a negative value rounds to zero after formatting, and no explicit positive sign is requested, hide the sign.\n if (valueNegative && +value === 0 && sign !== '+') {\n valueNegative = false;\n }\n // Compute the prefix and suffix.\n var signPrefix = valueNegative\n ? (sign === '(' ? sign : minus)\n : (sign === '-' || sign === '(' ? '' : sign);\n var signSuffix = valueNegative && sign === '(' ? ')' : '';\n valuePrefix = signPrefix + valuePrefix;\n valueSuffix = (type === 's' ? prefixes[8 + prefixExponent / 3] : '') + valueSuffix + signSuffix;\n // Break the formatted value into the integer “value” part that can be\n // grouped, and fractional or exponential “suffix” part that is not.\n if (maybeSuffix) {\n for (var i = 0, n = value.length; i < n; i++) {\n var c = value.charCodeAt(i);\n if (48 > c || c > 57) {\n valueSuffix = (c === 46 ? decimal + value.slice(i + 1) : value.slice(i)) + valueSuffix;\n value = value.slice(0, i);\n break;\n }\n }\n }\n }\n // If the fill character is not '0', grouping is applied before padding.\n if (comma && !zero)\n value = group(value, Infinity);\n // Compute the padding.\n var length = valuePrefix.length + value.length + valueSuffix.length;\n var padding = length < width ? new Array(width - length + 1).join(fill) : '';\n // If the fill character is '0', grouping is applied after padding.\n if (comma && zero) {\n value = group(padding + value, padding.length ? width - valueSuffix.length : Infinity);\n padding = '';\n }\n // Reconstruct the final output based on the desired alignment.\n switch (align) {\n case '<':\n value = valuePrefix + value + valueSuffix + padding;\n break;\n case '=':\n value = valuePrefix + padding + value + valueSuffix;\n break;\n case '^':\n value = padding.slice(0, length = padding.length >> 1) + valuePrefix + value + valueSuffix + padding.slice(length);\n break;\n default:\n value = padding + valuePrefix + value + valueSuffix;\n break;\n }\n var string = formatSpecifier.string;\n if (string) {\n return string.replace(interpolateRegEx, function () { return numerals(value); });\n }\n return numerals(value);\n }\n return format;\n }\n function formatPrefix(specifier, value) {\n var formatSpecifier = makeFormatSpecifier(specifier);\n formatSpecifier.type = 'f';\n var f = newFormat(formatSpecifier);\n var e = Math.max(-8, Math.min(8, Math.floor(exponent(value) / 3))) * 3;\n var k = Math.pow(10, -e);\n var prefix = prefixes[8 + e / 3];\n return function (value) {\n return f(k * value) + prefix;\n };\n }\n return {\n format: newFormat,\n formatPrefix: formatPrefix\n };\n}\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport ContinuousScale from \"./continuousScale\";\nimport ticks, { tickIncrement } from \"../util/ticks\";\nimport { tickFormat } from \"../util/numberFormat\";\n/**\n * Maps continuous domain to a continuous range.\n */\nvar LinearScale = /** @class */ (function (_super) {\n __extends(LinearScale, _super);\n function LinearScale() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = 'linear';\n return _this;\n }\n LinearScale.prototype.ticks = function (count) {\n if (count === void 0) { count = 10; }\n var d = this._domain;\n return ticks(d[0], d[d.length - 1], count);\n };\n /**\n * Extends the domain so that it starts and ends on nice round values.\n * @param count Tick count.\n */\n LinearScale.prototype.nice = function (count) {\n if (count === void 0) { count = 10; }\n var d = this.domain;\n var i0 = 0;\n var i1 = d.length - 1;\n var start = d[i0];\n var stop = d[i1];\n var step;\n if (stop < start) {\n step = start;\n start = stop;\n stop = step;\n step = i0;\n i0 = i1;\n i1 = step;\n }\n step = tickIncrement(start, stop, count);\n if (step > 0) {\n start = Math.floor(start / step) * step;\n stop = Math.ceil(stop / step) * step;\n step = tickIncrement(start, stop, count);\n }\n else if (step < 0) {\n start = Math.ceil(start * step) / step;\n stop = Math.floor(stop * step) / step;\n step = tickIncrement(start, stop, count);\n }\n if (step > 0) {\n d[i0] = Math.floor(start / step) * step;\n d[i1] = Math.ceil(stop / step) * step;\n this.domain = d;\n }\n else if (step < 0) {\n d[i0] = Math.ceil(start * step) / step;\n d[i1] = Math.floor(stop * step) / step;\n this.domain = d;\n }\n };\n LinearScale.prototype.tickFormat = function (count, specifier) {\n var d = this.domain;\n return tickFormat(d[0], d[d.length - 1], count == undefined ? 10 : count, specifier);\n };\n return LinearScale;\n}(ContinuousScale));\nexport { LinearScale };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { Node } from \"./node\";\nimport { BBox } from \"./bbox\";\nimport { Matrix } from \"./matrix\";\nvar Group = /** @class */ (function (_super) {\n __extends(Group, _super);\n function Group() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.isContainerNode = true;\n return _this;\n }\n // We consider a group to be boundless, thus any point belongs to it.\n Group.prototype.containsPoint = function (x, y) {\n return true;\n };\n Group.prototype.computeBBox = function () {\n var left = Infinity;\n var right = -Infinity;\n var top = Infinity;\n var bottom = -Infinity;\n if (this.dirtyTransform) {\n this.computeTransformMatrix();\n }\n this.children.forEach(function (child) {\n if (!child.visible) {\n return;\n }\n var bbox = child.computeBBox();\n if (!bbox) {\n return;\n }\n if (!(child instanceof Group)) {\n if (child.dirtyTransform) {\n child.computeTransformMatrix();\n }\n var matrix = Matrix.flyweight(child.matrix);\n var parent_1 = child.parent;\n while (parent_1) {\n matrix.preMultiplySelf(parent_1.matrix);\n parent_1 = parent_1.parent;\n }\n matrix.transformBBox(bbox, 0, bbox);\n }\n var x = bbox.x;\n var y = bbox.y;\n if (x < left) {\n left = x;\n }\n if (y < top) {\n top = y;\n }\n if (x + bbox.width > right) {\n right = x + bbox.width;\n }\n if (y + bbox.height > bottom) {\n bottom = y + bbox.height;\n }\n });\n return new BBox(left, top, right - left, bottom - top);\n };\n Group.prototype.render = function (ctx) {\n // A group can have `scaling`, `rotation`, `translation` properties\n // that are applied to the canvas context before children are rendered,\n // so all children can be transformed at once.\n if (this.dirtyTransform) {\n this.computeTransformMatrix();\n }\n this.matrix.toContext(ctx);\n var children = this.children;\n var n = children.length;\n for (var i = 0; i < n; i++) {\n ctx.save();\n var child = children[i];\n if (child.visible) {\n child.render(ctx);\n }\n ctx.restore();\n }\n // debug\n // this.computeBBox().render(ctx, {\n // label: this.id,\n // resetTransform: true,\n // fillStyle: 'rgba(0, 0, 0, 0.5)'\n // });\n };\n Group.className = 'Group';\n return Group;\n}(Node));\nexport { Group };\n","import { Node } from \"./node\";\nvar EnterNode = /** @class */ (function () {\n function EnterNode(parent, datum) {\n this.next = null;\n this.scene = parent.scene;\n this.parent = parent;\n this.datum = datum;\n }\n EnterNode.prototype.appendChild = function (node) {\n // This doesn't work without the `strict: true` in the `tsconfig.json`,\n // so we must have two `if` checks below, instead of this single one.\n // if (this.next && !Node.isNode(this.next)) {\n // throw new Error(`${this.next} is not a Node.`);\n // }\n if (this.next === null) {\n return this.parent.insertBefore(node, null);\n }\n if (!Node.isNode(this.next)) {\n throw new Error(this.next + \" is not a Node.\");\n }\n return this.parent.insertBefore(node, this.next);\n };\n EnterNode.prototype.insertBefore = function (node, nextNode) {\n return this.parent.insertBefore(node, nextNode);\n };\n return EnterNode;\n}());\nexport { EnterNode };\n/**\n * G - type of the selected node(s).\n * GDatum - type of the datum of the selected node(s).\n * P - type of the parent node(s).\n * PDatum - type of the datum of the parent node(s).\n */\nvar Selection = /** @class */ (function () {\n function Selection(groups, parents) {\n this.groups = groups;\n this.parents = parents;\n }\n Selection.select = function (node) {\n return new Selection([[typeof node === 'function' ? node() : node]], [undefined]);\n };\n Selection.selectAll = function (nodes) {\n return new Selection([nodes == null ? [] : nodes], [undefined]);\n };\n /**\n * Creates new nodes, appends them to the nodes of this selection and returns them\n * as a new selection. The created nodes inherit the datums and the parents of the nodes\n * they replace.\n * @param Class The constructor function to use to create the new nodes.\n */\n Selection.prototype.append = function (Class) {\n return this.select(function (node) {\n return node.appendChild(new Class());\n });\n };\n /**\n * Same as the {@link append}, but accepts a custom creator function with the\n * {@link NodeSelector} signature rather than a constructor function.\n * @param creator\n */\n Selection.prototype.appendFn = function (creator) {\n return this.select(function (node, data, index, group) {\n return node.appendChild(creator(node, data, index, group));\n });\n };\n /**\n * Runs the given selector that returns a single node for every node in each group.\n * The original nodes are then replaced by the nodes returned by the selector\n * and returned as a new selection.\n * The selected nodes inherit the datums and the parents of the original nodes.\n */\n Selection.prototype.select = function (selector) {\n var groups = this.groups;\n var numGroups = groups.length;\n var subgroups = [];\n for (var j = 0; j < numGroups; j++) {\n var group = groups[j];\n var groupSize = group.length;\n var subgroup = subgroups[j] = new Array(groupSize);\n for (var i = 0; i < groupSize; i++) {\n var node = group[i];\n if (node) {\n var subnode = selector(node, node.datum, i, group);\n if (subnode) {\n subnode.datum = node.datum;\n }\n subgroup[i] = subnode;\n }\n // else this can be a group of the `enter` selection,\n // for example, with no nodes at the i-th position,\n // only nodes at the end of the group\n }\n }\n return new Selection(subgroups, this.parents);\n };\n /**\n * Same as {@link select}, but uses the given {@param Class} (constructor) as a selector.\n * @param Class The constructor function to use to find matching nodes.\n */\n Selection.prototype.selectByClass = function (Class) {\n return this.select(function (node) {\n if (Node.isNode(node)) {\n var children = node.children;\n var n = children.length;\n for (var i = 0; i < n; i++) {\n var child = children[i];\n if (child instanceof Class) {\n return child;\n }\n }\n }\n });\n };\n Selection.prototype.selectByTag = function (tag) {\n return this.select(function (node) {\n if (Node.isNode(node)) {\n var children = node.children;\n var n = children.length;\n for (var i = 0; i < n; i++) {\n var child = children[i];\n if (child.tag === tag) {\n return child;\n }\n }\n }\n });\n };\n Selection.prototype.selectAllByClass = function (Class) {\n return this.selectAll(function (node) {\n var nodes = [];\n if (Node.isNode(node)) {\n var children = node.children;\n var n = children.length;\n for (var i = 0; i < n; i++) {\n var child = children[i];\n if (child instanceof Class) {\n nodes.push(child);\n }\n }\n }\n return nodes;\n });\n };\n Selection.prototype.selectAllByTag = function (tag) {\n return this.selectAll(function (node) {\n var nodes = [];\n if (Node.isNode(node)) {\n var children = node.children;\n var n = children.length;\n for (var i = 0; i < n; i++) {\n var child = children[i];\n if (child.tag === tag) {\n nodes.push(child);\n }\n }\n }\n return nodes;\n });\n };\n Selection.prototype.selectNone = function () {\n return [];\n };\n /**\n * Runs the given selector that returns a group of nodes for every node in each group.\n * The original nodes are then replaced by the groups of nodes returned by the selector\n * and returned as a new selection. The original nodes become the parent nodes for each\n * group in the new selection. The selected nodes do not inherit the datums of the original nodes.\n * If called without any parameters, creates a new selection with an empty group for each\n * node in this selection.\n */\n Selection.prototype.selectAll = function (selectorAll) {\n if (!selectorAll) {\n selectorAll = this.selectNone;\n }\n // Each subgroup is populated with the selector (run on each group node) results.\n var subgroups = [];\n // In the new selection that we return, subgroups become groups,\n // and group nodes become parents.\n var parents = [];\n var groups = this.groups;\n var groupCount = groups.length;\n for (var j = 0; j < groupCount; j++) {\n var group = groups[j];\n var groupLength = group.length;\n for (var i = 0; i < groupLength; i++) {\n var node = group[i];\n if (node) {\n subgroups.push(selectorAll(node, node.datum, i, group));\n parents.push(node);\n }\n }\n }\n return new Selection(subgroups, parents);\n };\n /**\n * Runs the given callback for every node in this selection and returns this selection.\n * @param cb\n */\n Selection.prototype.each = function (cb) {\n var groups = this.groups;\n var numGroups = groups.length;\n for (var j = 0; j < numGroups; j++) {\n var group = groups[j];\n var groupSize = group.length;\n for (var i = 0; i < groupSize; i++) {\n var node = group[i];\n if (node) {\n cb(node, node.datum, i, group);\n }\n }\n }\n return this;\n };\n Selection.prototype.remove = function () {\n return this.each(function (node) {\n if (Node.isNode(node)) {\n var parent_1 = node.parent;\n if (parent_1) {\n parent_1.removeChild(node);\n }\n }\n });\n };\n Selection.prototype.merge = function (other) {\n var groups0 = this.groups;\n var groups1 = other.groups;\n var m0 = groups0.length;\n var m1 = groups1.length;\n var m = Math.min(m0, m1);\n var merges = new Array(m0);\n var j = 0;\n for (; j < m; j++) {\n var group0 = groups0[j];\n var group1 = groups1[j];\n var n = group0.length;\n var merge = merges[j] = new Array(n);\n for (var i = 0; i < n; i++) {\n var node = group0[i] || group1[i];\n merge[i] = node || undefined;\n }\n }\n for (; j < m0; j++) {\n merges[j] = groups0[j];\n }\n return new Selection(merges, this.parents);\n };\n /**\n * Return the first non-null element in this selection.\n * If the selection is empty, returns null.\n */\n Selection.prototype.node = function () {\n var groups = this.groups;\n var numGroups = groups.length;\n for (var j = 0; j < numGroups; j++) {\n var group = groups[j];\n var groupSize = group.length;\n for (var i = 0; i < groupSize; i++) {\n var node = group[i];\n if (node) {\n return node;\n }\n }\n }\n return null;\n };\n Selection.prototype.attr = function (name, value) {\n this.each(function (node) {\n node[name] = value;\n });\n return this;\n };\n Selection.prototype.attrFn = function (name, value) {\n this.each(function (node, datum, index, group) {\n node[name] = value(node, datum, index, group);\n });\n return this;\n };\n /**\n * Invokes the given function once, passing in this selection.\n * Returns this selection. Facilitates method chaining.\n * @param cb\n */\n Selection.prototype.call = function (cb) {\n cb(this);\n return this;\n };\n Object.defineProperty(Selection.prototype, \"size\", {\n /**\n * Returns the total number of nodes in this selection.\n */\n get: function () {\n var size = 0;\n this.each(function () { return size++; });\n return size;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Selection.prototype, \"data\", {\n /**\n * Returns the array of data for the selected elements.\n */\n get: function () {\n var data = [];\n this.each(function (_, datum) { return data.push(datum); });\n return data;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Selection.prototype, \"enter\", {\n get: function () {\n return new Selection(this.enterGroups ? this.enterGroups : [[]], this.parents);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Selection.prototype, \"exit\", {\n get: function () {\n return new Selection(this.exitGroups ? this.exitGroups : [[]], this.parents);\n },\n enumerable: true,\n configurable: true\n });\n /**\n * Binds the given value to each selected node and returns this selection\n * with its {@link GDatum} type changed to the type of the given value.\n * This method doesn't compute a join and doesn't affect indexes or the enter and exit selections.\n * This method can also be used to clear bound data.\n * @param value\n */\n Selection.prototype.setDatum = function (value) {\n return this.each(function (node) {\n node.datum = value;\n });\n };\n Object.defineProperty(Selection.prototype, \"datum\", {\n /**\n * Returns the bound datum for the first non-null element in the selection.\n * This is generally useful only if you know the selection contains exactly one element.\n */\n get: function () {\n var node = this.node();\n return node ? node.datum : null;\n },\n enumerable: true,\n configurable: true\n });\n /**\n * Binds the specified array of values with the selected nodes, returning a new selection\n * that represents the _update_ selection: the nodes successfully bound to the values.\n * Also defines the {@link enter} and {@link exit} selections on the returned selection,\n * which can be used to add or remove the nodes to correspond to the new data.\n * The `values` is an array of values of a particular type, or a function that returns\n * an array of values for each group.\n * When values are assigned to the nodes, they are stored in the {@link Node.datum} property.\n * @param values\n * @param key\n */\n Selection.prototype.setData = function (values, key) {\n if (typeof values !== 'function') {\n var data_1 = values;\n values = function () { return data_1; };\n }\n var groups = this.groups;\n var parents = this.parents;\n var numGroups = groups.length;\n var updateGroups = new Array(numGroups);\n var enterGroups = new Array(numGroups);\n var exitGroups = new Array(numGroups);\n for (var j = 0; j < numGroups; j++) {\n var group = groups[j];\n var parent_2 = parents[j];\n if (!parent_2) {\n throw new Error(\"Group #\" + j + \" has no parent: \" + group);\n }\n var groupSize = group.length;\n var data = values(parent_2, parent_2.datum, j, parents);\n var dataSize = data.length;\n var enterGroup = enterGroups[j] = new Array(dataSize);\n var updateGroup = updateGroups[j] = new Array(dataSize);\n var exitGroup = exitGroups[j] = new Array(groupSize);\n if (key) {\n this.bindKey(parent_2, group, enterGroup, updateGroup, exitGroup, data, key);\n }\n else {\n this.bindIndex(parent_2, group, enterGroup, updateGroup, exitGroup, data);\n }\n // Now connect the enter nodes to their following update node, such that\n // appendChild can insert the materialized enter node before this node,\n // rather than at the end of the parent node.\n for (var i0 = 0, i1 = 0; i0 < dataSize; i0++) {\n var previous = enterGroup[i0];\n if (previous) {\n if (i0 >= i1) {\n i1 = i0 + 1;\n }\n var next = void 0;\n while (!(next = updateGroup[i1]) && i1 < dataSize) {\n i1++;\n }\n previous.next = next || null;\n }\n }\n }\n var result = new Selection(updateGroups, parents);\n result.enterGroups = enterGroups;\n result.exitGroups = exitGroups;\n return result;\n };\n Selection.prototype.bindIndex = function (parent, group, enter, update, exit, data) {\n var groupSize = group.length;\n var dataSize = data.length;\n var i = 0;\n for (; i < dataSize; i++) {\n var node = group[i];\n if (node) {\n node.datum = data[i];\n update[i] = node;\n }\n else { // more datums than group nodes\n enter[i] = new EnterNode(parent, data[i]);\n }\n }\n // more group nodes than datums\n for (; i < groupSize; i++) {\n var node = group[i];\n if (node) {\n exit[i] = node;\n }\n }\n };\n Selection.prototype.bindKey = function (parent, group, enter, update, exit, data, key) {\n var groupSize = group.length;\n var dataSize = data.length;\n var keyValues = new Array(groupSize);\n var nodeByKeyValue = {};\n // Compute the key for each node.\n // If multiple nodes have the same key, the duplicates are added to exit.\n for (var i = 0; i < groupSize; i++) {\n var node = group[i];\n if (node) {\n var keyValue = keyValues[i] = Selection.keyPrefix + key(node, node.datum, i, group);\n if (keyValue in nodeByKeyValue) {\n exit[i] = node;\n }\n else {\n nodeByKeyValue[keyValue] = node;\n }\n }\n }\n // Compute the key for each datum.\n // If there is a node associated with this key, join and add it to update.\n // If there is not (or the key is a duplicate), add it to enter.\n for (var i = 0; i < dataSize; i++) {\n var keyValue = Selection.keyPrefix + key(parent, data[i], i, data);\n var node = nodeByKeyValue[keyValue];\n if (node) {\n update[i] = node;\n node.datum = data[i];\n nodeByKeyValue[keyValue] = undefined;\n }\n else {\n enter[i] = new EnterNode(parent, data[i]);\n }\n }\n // Add any remaining nodes that were not bound to data to exit.\n for (var i = 0; i < groupSize; i++) {\n var node = group[i];\n if (node && (nodeByKeyValue[keyValues[i]] === node)) {\n exit[i] = node;\n }\n }\n };\n Selection.keyPrefix = '$'; // Protect against keys like '__proto__'.\n return Selection;\n}());\nexport { Selection };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { Shape } from \"./shape\";\nimport { chainObjects } from \"../../util/object\";\nimport { BBox } from \"../bbox\";\nvar Line = /** @class */ (function (_super) {\n __extends(Line, _super);\n function Line() {\n var _this = _super.call(this) || this;\n _this._x1 = 0;\n _this._y1 = 0;\n _this._x2 = 0;\n _this._y2 = 0;\n _this.restoreOwnStyles();\n return _this;\n }\n Object.defineProperty(Line.prototype, \"x1\", {\n get: function () {\n // TODO: Investigate getter performance further in the context\n // of the scene graph.\n // In isolated benchmarks using a getter has the same\n // performance as a direct property access in Firefox 64.\n // But in Chrome 71 the getter is 60% slower than direct access.\n // Direct read is 4.5+ times slower in Chrome than it is in Firefox.\n // Property access and direct read have the same performance\n // in Safari 12, which is 2+ times faster than Firefox at this.\n // https://jsperf.com/es5-getters-setters-versus-getter-setter-methods/18\n // This is a know Chrome issue. They say it's not a regression, since\n // the behavior is observed since M60, but jsperf.com history shows the\n // 10x slowdown happened between Chrome 48 and Chrome 57.\n // https://bugs.chromium.org/p/chromium/issues/detail?id=908743\n return this._x1;\n },\n set: function (value) {\n if (this._x1 !== value) {\n this._x1 = value;\n this.dirty = true;\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Line.prototype, \"y1\", {\n get: function () {\n return this._y1;\n },\n set: function (value) {\n if (this._y1 !== value) {\n this._y1 = value;\n this.dirty = true;\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Line.prototype, \"x2\", {\n get: function () {\n return this._x2;\n },\n set: function (value) {\n if (this._x2 !== value) {\n this._x2 = value;\n this.dirty = true;\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Line.prototype, \"y2\", {\n get: function () {\n return this._y2;\n },\n set: function (value) {\n if (this._y2 !== value) {\n this._y2 = value;\n this.dirty = true;\n }\n },\n enumerable: true,\n configurable: true\n });\n Line.prototype.computeBBox = function () {\n return new BBox(this.x1, this.y1, this.x2 - this.x1, this.y2 - this.y1);\n };\n Line.prototype.isPointInPath = function (x, y) {\n return false;\n };\n Line.prototype.isPointInStroke = function (x, y) {\n return false;\n };\n Line.prototype.render = function (ctx) {\n if (this.dirtyTransform) {\n this.computeTransformMatrix();\n }\n this.matrix.toContext(ctx);\n var x1 = this.x1;\n var y1 = this.y1;\n var x2 = this.x2;\n var y2 = this.y2;\n // Align to the pixel grid if the line is strictly vertical\n // or horizontal (but not both, i.e. a dot).\n if (x1 === x2) {\n var x = Math.round(x1) + Math.floor(this.strokeWidth) % 2 / 2;\n x1 = x;\n x2 = x;\n }\n else if (y1 === y2) {\n var y = Math.round(y1) + Math.floor(this.strokeWidth) % 2 / 2;\n y1 = y;\n y2 = y;\n }\n ctx.beginPath();\n ctx.moveTo(x1, y1);\n ctx.lineTo(x2, y2);\n this.fillStroke(ctx);\n this.dirty = false;\n };\n Line.className = 'Line';\n Line.defaultStyles = chainObjects(Shape.defaultStyles, {\n fill: undefined,\n strokeWidth: 1\n });\n return Line;\n}(Shape));\nexport { Line };\n","// @ts-ignore Suppress tsc error: Property 'sign' does not exist on type 'Math'\nvar sign = Math.sign ? Math.sign : function (x) {\n x = +x;\n if (x === 0 || isNaN(x)) {\n return x;\n }\n return x > 0 ? 1 : -1;\n};\n/**\n * Finds the roots of a parametric linear equation in `t`,\n * where `t` lies in the interval of `[0,1]`.\n */\nexport function linearRoot(a, b) {\n var t = -b / a;\n return (a !== 0 && t >= 0 && t <= 1) ? [t] : [];\n}\n/**\n * Finds the roots of a parametric quadratic equation in `t`,\n * where `t` lies in the interval of `[0,1]`.\n */\nexport function quadraticRoots(a, b, c) {\n if (a === 0) {\n return linearRoot(b, c);\n }\n var D = b * b - 4 * a * c; // The polynomial's discriminant.\n var roots = [];\n if (D === 0) { // A single real root.\n var t = -b / (2 * a);\n if (t >= 0 && t <= 1) {\n roots.push(t);\n }\n }\n else if (D > 0) { // A pair of distinct real roots.\n var rD = Math.sqrt(D);\n var t1 = (-b - rD) / (2 * a);\n var t2 = (-b + rD) / (2 * a);\n if (t1 >= 0 && t1 <= 1) {\n roots.push(t1);\n }\n if (t2 >= 0 && t2 <= 1) {\n roots.push(t2);\n }\n }\n // else -> Complex roots.\n return roots;\n}\n/**\n * Finds the roots of a parametric cubic equation in `t`,\n * where `t` lies in the interval of `[0,1]`.\n * Returns an array of parametric intersection locations along the cubic,\n * excluding out-of-bounds intersections (before or after the end point\n * or in the imaginary plane).\n * An adaptation of http://www.particleincell.com/blog/2013/cubic-line-intersection/\n */\nexport function cubicRoots(a, b, c, d) {\n if (a === 0) {\n return quadraticRoots(b, c, d);\n }\n var A = b / a;\n var B = c / a;\n var C = d / a;\n var Q = (3 * B - A * A) / 9;\n var R = (9 * A * B - 27 * C - 2 * A * A * A) / 54;\n var D = Q * Q * Q + R * R; // The polynomial's discriminant.\n var third = 1 / 3;\n var roots = [];\n if (D >= 0) { // Complex or duplicate roots.\n var rD = Math.sqrt(D);\n var S = sign(R + rD) * Math.pow(Math.abs(R + rD), third);\n var T = sign(R - rD) * Math.pow(Math.abs(R - rD), third);\n var Im = Math.abs(Math.sqrt(3) * (S - T) / 2); // Complex part of the root pair.\n var t = -third * A + (S + T); // A real root.\n if (t >= 0 && t <= 1) {\n roots.push(t);\n }\n if (Im === 0) {\n var t_1 = -third * A - (S + T) / 2; // The real part of a complex root.\n if (t_1 >= 0 && t_1 <= 1) {\n roots.push(t_1);\n }\n }\n }\n else { // Distinct real roots.\n var theta = Math.acos(R / Math.sqrt(-Q * Q * Q));\n var thirdA = third * A;\n var twoSqrtQ = 2 * Math.sqrt(-Q);\n var t1 = twoSqrtQ * Math.cos(third * theta) - thirdA;\n var t2 = twoSqrtQ * Math.cos(third * (theta + 2 * Math.PI)) - thirdA;\n var t3 = twoSqrtQ * Math.cos(third * (theta + 4 * Math.PI)) - thirdA;\n if (t1 >= 0 && t1 <= 1) {\n roots.push(t1);\n }\n if (t2 >= 0 && t2 <= 1) {\n roots.push(t2);\n }\n if (t3 >= 0 && t3 <= 1) {\n roots.push(t3);\n }\n }\n return roots;\n}\n","import { cubicRoots } from \"./polyRoots\";\n/**\n * Returns the intersection point for the given pair of line segments, or null,\n * if the segments are parallel or don't intersect.\n * Based on http://paulbourke.net/geometry/pointlineplane/\n */\nexport function segmentIntersection(ax1, ay1, ax2, ay2, bx1, by1, bx2, by2) {\n var d = (ax2 - ax1) * (by2 - by1) - (ay2 - ay1) * (bx2 - bx1);\n if (d === 0) { // The lines are parallel.\n return null;\n }\n var ua = ((bx2 - bx1) * (ay1 - by1) - (ax1 - bx1) * (by2 - by1)) / d;\n var ub = ((ax2 - ax1) * (ay1 - by1) - (ay2 - ay1) * (ax1 - bx1)) / d;\n if (ua >= 0 && ua <= 1 && ub >= 0 && ub <= 1) {\n return {\n x: ax1 + ua * (ax2 - ax1),\n y: ay1 + ua * (ay2 - ay1)\n };\n }\n return null; // The intersection point is outside either or both segments.\n}\n/**\n * Returns intersection points of the given cubic curve and the line segment.\n * Takes in x/y components of cubic control points and line segment start/end points\n * as parameters.\n */\nexport function cubicSegmentIntersections(px1, py1, px2, py2, px3, py3, px4, py4, x1, y1, x2, y2) {\n var intersections = [];\n // Find line equation coefficients.\n var A = y1 - y2;\n var B = x2 - x1;\n var C = x1 * (y2 - y1) - y1 * (x2 - x1);\n // Find cubic Bezier curve equation coefficients from control points.\n var bx = bezierCoefficients(px1, px2, px3, px4);\n var by = bezierCoefficients(py1, py2, py3, py4);\n var a = A * bx[0] + B * by[0]; // t^3\n var b = A * bx[1] + B * by[1]; // t^2\n var c = A * bx[2] + B * by[2]; // t\n var d = A * bx[3] + B * by[3] + C; // 1\n var roots = cubicRoots(a, b, c, d);\n // Verify that the roots are within bounds of the linear segment.\n for (var i = 0; i < roots.length; i++) {\n var t = roots[i];\n var tt = t * t;\n var ttt = t * tt;\n // Find the cartesian plane coordinates for the parametric root `t`.\n var x = bx[0] * ttt + bx[1] * tt + bx[2] * t + bx[3];\n var y = by[0] * ttt + by[1] * tt + by[2] * t + by[3];\n // The parametric cubic roots we found are intersection points\n // with an infinite line, and so the x/y coordinates above are as well.\n // Make sure the x/y is also within the bounds of the given segment.\n var s = void 0;\n if (x1 !== x2) {\n s = (x - x1) / (x2 - x1);\n }\n else { // the line is vertical\n s = (y - y1) / (y2 - y1);\n }\n if (s >= 0 && s <= 1) {\n intersections.push({ x: x, y: y });\n }\n }\n return intersections;\n}\n/**\n * Returns the given coordinates vector multiplied by the coefficient matrix\n * of the parametric cubic Bézier equation.\n */\nexport function bezierCoefficients(P1, P2, P3, P4) {\n return [\n -P1 + 3 * P2 - 3 * P3 + P4,\n 3 * P1 - 6 * P2 + 3 * P3,\n -3 * P1 + 3 * P2,\n P1 // | 1 0 0 0| |P4|\n ];\n}\n","import { cubicSegmentIntersections, segmentIntersection } from \"./intersection\";\nvar Path2D = /** @class */ (function () {\n function Path2D() {\n // The methods of this class will likely be called many times per animation frame,\n // and any allocation can trigger a GC cycle during animation, so we attempt\n // to minimize the number of allocations.\n this.commands = [];\n this.params = [];\n this._closedPath = false;\n }\n Path2D.prototype.moveTo = function (x, y) {\n if (this.xy) {\n this.xy[0] = x;\n this.xy[1] = y;\n }\n else {\n this.xy = [x, y];\n }\n this.commands.push('M');\n this.params.push(x, y);\n };\n Path2D.prototype.lineTo = function (x, y) {\n if (this.xy) {\n this.commands.push('L');\n this.params.push(x, y);\n this.xy[0] = x;\n this.xy[1] = y;\n }\n else {\n this.moveTo(x, y);\n }\n };\n Path2D.prototype.rect = function (x, y, width, height) {\n this.moveTo(x, y);\n this.lineTo(x + width, y);\n this.lineTo(x + width, y + height);\n this.lineTo(x, y + height);\n this.closePath();\n };\n /**\n * Adds an arc segment to the path definition.\n * https://www.w3.org/TR/SVG11/paths.html#PathDataEllipticalArcCommands\n * @param rx The major-axis radius.\n * @param ry The minor-axis radius.\n * @param rotation The x-axis rotation, expressed in radians.\n * @param fA The large arc flag. `1` to use angle > π.\n * @param fS The sweep flag. `1` for the arc that goes to `x`/`y` clockwise.\n * @param x2 The x coordinate to arc to.\n * @param y2 The y coordinate to arc to.\n */\n Path2D.prototype.arcTo = function (rx, ry, rotation, fA, fS, x2, y2) {\n // Convert from endpoint to center parametrization:\n // https://www.w3.org/TR/SVG/implnote.html#ArcImplementationNotes\n var xy = this.xy;\n if (!xy) {\n return;\n }\n if (rx < 0) {\n rx = -rx;\n }\n if (ry < 0) {\n ry = -ry;\n }\n var x1 = xy[0];\n var y1 = xy[1];\n var hdx = (x1 - x2) / 2;\n var hdy = (y1 - y2) / 2;\n var sinPhi = Math.sin(rotation);\n var cosPhi = Math.cos(rotation);\n var xp = cosPhi * hdx + sinPhi * hdy;\n var yp = -sinPhi * hdx + cosPhi * hdy;\n var ratX = xp / rx;\n var ratY = yp / ry;\n var lambda = ratX * ratX + ratY * ratY;\n var cx = (x1 + x2) / 2;\n var cy = (y1 + y2) / 2;\n var cpx = 0;\n var cpy = 0;\n if (lambda >= 1) {\n lambda = Math.sqrt(lambda);\n rx *= lambda;\n ry *= lambda;\n // me gives lambda == cpx == cpy == 0;\n }\n else {\n lambda = Math.sqrt(1 / lambda - 1);\n if (fA === fS) {\n lambda = -lambda;\n }\n cpx = lambda * rx * ratY;\n cpy = -lambda * ry * ratX;\n cx += cosPhi * cpx - sinPhi * cpy;\n cy += sinPhi * cpx + cosPhi * cpy;\n }\n var theta1 = Math.atan2((yp - cpy) / ry, (xp - cpx) / rx);\n var deltaTheta = Math.atan2((-yp - cpy) / ry, (-xp - cpx) / rx) - theta1;\n // if (fS) {\n // if (deltaTheta <= 0) {\n // deltaTheta += Math.PI * 2;\n // }\n // }\n // else {\n // if (deltaTheta >= 0) {\n // deltaTheta -= Math.PI * 2;\n // }\n // }\n this.cubicArc(cx, cy, rx, ry, rotation, theta1, theta1 + deltaTheta, 1 - fS);\n };\n /**\n * Approximates an elliptical arc with up to four cubic Bézier curves.\n * @param commands The string array to write SVG command letters to.\n * @param params The number array to write SVG command parameters (cubic control points) to.\n * @param cx The x-axis coordinate for the ellipse's center.\n * @param cy The y-axis coordinate for the ellipse's center.\n * @param rx The ellipse's major-axis radius.\n * @param ry The ellipse's minor-axis radius.\n * @param phi The rotation for this ellipse, expressed in radians.\n * @param theta1 The starting angle, measured clockwise from the positive x-axis and expressed in radians.\n * @param theta2 The ending angle, measured clockwise from the positive x-axis and expressed in radians.\n * @param anticlockwise The arc control points are always placed clockwise from `theta1` to `theta2`,\n * even when `theta1 > theta2`, unless this flag is set to `1`.\n */\n Path2D.cubicArc = function (commands, params, cx, cy, rx, ry, phi, theta1, theta2, anticlockwise) {\n if (anticlockwise) {\n var temp = theta1;\n theta1 = theta2;\n theta2 = temp;\n }\n var start = params.length;\n // See https://pomax.github.io/bezierinfo/#circles_cubic\n // Arc of unit circle (start angle = 0, end angle <= π/2) in cubic Bézier coordinates:\n // S = [1, 0]\n // C1 = [1, f]\n // C2 = [cos(θ) + f * sin(θ), sin(θ) - f * cos(θ)]\n // E = [cos(θ), sin(θ)]\n // f = 4/3 * tan(θ/4)\n var f90 = 0.5522847498307935; // f for θ = π/2 is 4/3 * (Math.sqrt(2) - 1)\n var sinTheta1 = Math.sin(theta1);\n var cosTheta1 = Math.cos(theta1);\n var sinPhi = Math.sin(phi);\n var cosPhi = Math.cos(phi);\n var rightAngle = Math.PI / 2;\n // Since we know how to draw an arc of a unit circle with a cubic Bézier,\n // to draw an elliptical arc with arbitrary rotation and radii we:\n // 1) rotate the Bézier coordinates that represent a circular arc by θ\n // 2) scale the circular arc separately along the x/y axes, making it elliptical\n // 3) rotate elliptical arc by φ\n // |cos(φ) -sin(φ)| |sx 0| |cos(θ) -sin(θ)| -> |xx xy|\n // |sin(φ) cos(φ)| | 0 sy| |sin(θ) cos(θ)| -> |yx yy|\n var xx = cosPhi * cosTheta1 * rx - sinPhi * sinTheta1 * ry;\n var yx = sinPhi * cosTheta1 * rx + cosPhi * sinTheta1 * ry;\n var xy = -cosPhi * sinTheta1 * rx - sinPhi * cosTheta1 * ry;\n var yy = -sinPhi * sinTheta1 * rx + cosPhi * cosTheta1 * ry;\n // TODO: what if delta between θ1 and θ2 is greater than 2π?\n // Always draw clockwise from θ1 to θ2.\n theta2 -= theta1;\n if (theta2 < 0) {\n theta2 += Math.PI * 2;\n }\n // Multiplying each point [x, y] by:\n // |xx xy cx| |x|\n // |yx yy cy| |y|\n // | 0 0 1| |1|\n // TODO: This move command may be redundant, if we are already at this point.\n // The coordinates of the point calculated here may differ ever so slightly\n // because of precision error.\n commands.push('M');\n params.push(xx + cx, yx + cy);\n while (theta2 >= rightAngle) {\n theta2 -= rightAngle;\n commands.push('C');\n // Temp workaround for https://bugs.chromium.org/p/chromium/issues/detail?id=993330\n // Revert this commit when fixed ^^.\n var lastX = xy + cx;\n params.push(xx + xy * f90 + cx, yx + yy * f90 + cy, xx * f90 + xy + cx, yx * f90 + yy + cy, Math.abs(lastX) < 1e-8 ? 0 : lastX, yy + cy);\n // Prepend π/2 rotation matrix.\n // |xx xy| | 0 1| -> | xy -xx|\n // |yx yy| |-1 0| -> | yy -yx|\n // [xx, yx, xy, yy] = [xy, yy, -xx, -yx];\n // Compared to swapping with a temp variable, destructuring is:\n // - 10% faster in Chrome 70\n // - 99% slower in Firefox 63\n // Temp variable solution is 45% faster in FF than Chrome.\n // https://jsperf.com/multi-swap\n // https://bugzilla.mozilla.org/show_bug.cgi?id=1165569\n var temp = xx;\n xx = xy;\n xy = -temp;\n temp = yx;\n yx = yy;\n yy = -temp;\n }\n if (theta2) {\n var f = 4 / 3 * Math.tan(theta2 / 4);\n var sinPhi2 = Math.sin(theta2);\n var cosPhi2 = Math.cos(theta2);\n var C2x = cosPhi2 + f * sinPhi2;\n var C2y = sinPhi2 - f * cosPhi2;\n commands.push('C');\n // Temp workaround for https://bugs.chromium.org/p/chromium/issues/detail?id=993330\n // Revert this commit when fixed ^^.\n var lastX = xx * cosPhi2 + xy * sinPhi2 + cx;\n params.push(xx + xy * f + cx, yx + yy * f + cy, xx * C2x + xy * C2y + cx, yx * C2x + yy * C2y + cy, Math.abs(lastX) < 1e-8 ? 0 : lastX, yx * cosPhi2 + yy * sinPhi2 + cy);\n }\n if (anticlockwise) {\n for (var i = start, j = params.length - 2; i < j; i += 2, j -= 2) {\n var temp = params[i];\n params[i] = params[j];\n params[j] = temp;\n temp = params[i + 1];\n params[i + 1] = params[j + 1];\n params[j + 1] = temp;\n }\n }\n };\n Path2D.prototype.cubicArc = function (cx, cy, rx, ry, phi, theta1, theta2, anticlockwise) {\n var commands = this.commands;\n var params = this.params;\n var start = commands.length;\n Path2D.cubicArc(commands, params, cx, cy, rx, ry, phi, theta1, theta2, anticlockwise);\n var x = params[params.length - 2];\n var y = params[params.length - 1];\n if (this.xy) {\n commands[start] = 'L';\n this.xy[0] = x;\n this.xy[1] = y;\n }\n else {\n this.xy = [x, y];\n }\n };\n /**\n * Returns the `[x, y]` coordinates of the curve at `t`.\n * @param points `(n + 1) * 2` control point coordinates for a Bézier curve of n-th order.\n * @param t\n */\n Path2D.prototype.deCasteljau = function (points, t) {\n var n = points.length;\n if (n < 2 || n % 2 === 1) {\n throw new Error('Fewer than two points or not an even count.');\n }\n else if (n === 2 || t === 0) {\n return points.slice(0, 2);\n }\n else if (t === 1) {\n return points.slice(-2);\n }\n else {\n var newPoints = [];\n var last = n - 2;\n for (var i = 0; i < last; i += 2) {\n newPoints.push((1 - t) * points[i] + t * points[i + 2], // x\n (1 - t) * points[i + 1] + t * points[i + 3] // y\n );\n }\n return this.deCasteljau(newPoints, t);\n }\n };\n /**\n * Approximates the given curve using `n` line segments.\n * @param points `(n + 1) * 2` control point coordinates for a Bézier curve of n-th order.\n * @param n\n */\n Path2D.prototype.approximateCurve = function (points, n) {\n var xy = this.deCasteljau(points, 0);\n this.moveTo(xy[0], xy[1]);\n var step = 1 / n;\n for (var t = step; t <= 1; t += step) {\n var xy_1 = this.deCasteljau(points, t);\n this.lineTo(xy_1[0], xy_1[1]);\n }\n };\n /**\n * Adds a quadratic curve segment to the path definition.\n * Note: the given quadratic segment is converted and stored as a cubic one.\n * @param cx x-component of the curve's control point\n * @param cy y-component of the curve's control point\n * @param x x-component of the end point\n * @param y y-component of the end point\n */\n Path2D.prototype.quadraticCurveTo = function (cx, cy, x, y) {\n if (!this.xy) {\n this.moveTo(cx, cy);\n }\n // See https://pomax.github.io/bezierinfo/#reordering\n this.cubicCurveTo((this.xy[0] + 2 * cx) / 3, (this.xy[1] + 2 * cy) / 3, // 1/3 start + 2/3 control\n (2 * cx + x) / 3, (2 * cy + y) / 3, // 2/3 control + 1/3 end\n x, y);\n };\n Path2D.prototype.cubicCurveTo = function (cx1, cy1, cx2, cy2, x, y) {\n if (!this.xy) {\n this.moveTo(cx1, cy1);\n }\n this.commands.push('C');\n this.params.push(cx1, cy1, cx2, cy2, x, y);\n this.xy[0] = x;\n this.xy[1] = y;\n };\n Object.defineProperty(Path2D.prototype, \"closedPath\", {\n get: function () {\n return this._closedPath;\n },\n enumerable: true,\n configurable: true\n });\n Path2D.prototype.closePath = function () {\n if (this.xy) {\n this.xy = undefined;\n this.commands.push('Z');\n this._closedPath = true;\n }\n };\n Path2D.prototype.clear = function () {\n this.commands.length = 0;\n this.params.length = 0;\n this.xy = undefined;\n this._closedPath = false;\n };\n Path2D.prototype.isPointInPath = function (x, y) {\n var commands = this.commands;\n var params = this.params;\n var cn = commands.length;\n // Hit testing using ray casting method, where the ray's origin is some point\n // outside the path. In this case, an offscreen point that is remote enough, so that\n // even if the path itself is large and is partially offscreen, the ray's origin\n // will likely be outside the path anyway. To test if the given point is inside the\n // path or not, we cast a ray from the origin to the given point and check the number\n // of intersections of this segment with the path. If the number of intersections is\n // even, then the ray both entered and exited the path an equal number of times,\n // therefore the point is outside the path, and inside the path, if the number of\n // intersections is odd. Since the path is compound, we check if the ray segment\n // intersects with each of the path's segments, which can be either a line segment\n // (one or no intersection points) or a Bézier curve segment (up to 3 intersection\n // points).\n var ox = -10000;\n var oy = -10000;\n // the starting point of the current path\n var sx = NaN;\n var sy = NaN;\n // the previous point of the current path\n var px = 0;\n var py = 0;\n var intersectionCount = 0;\n for (var ci = 0, pi = 0; ci < cn; ci++) {\n switch (commands[ci]) {\n case 'M':\n if (!isNaN(sx)) {\n if (segmentIntersection(sx, sy, px, py, ox, oy, x, y)) {\n intersectionCount++;\n }\n }\n sx = px = params[pi++];\n sy = py = params[pi++];\n break;\n case 'L':\n if (segmentIntersection(px, py, px = params[pi++], py = params[pi++], ox, oy, x, y)) {\n intersectionCount++;\n }\n break;\n case 'C':\n intersectionCount += cubicSegmentIntersections(px, py, params[pi++], params[pi++], params[pi++], params[pi++], px = params[pi++], py = params[pi++], ox, oy, x, y).length;\n break;\n case 'Z':\n if (!isNaN(sx)) {\n if (segmentIntersection(sx, sy, px, py, ox, oy, x, y)) {\n intersectionCount++;\n }\n }\n break;\n }\n }\n return intersectionCount % 2 === 1;\n };\n Path2D.fromString = function (value) {\n var path = new Path2D();\n path.setFromString(value);\n return path;\n };\n /**\n * Split the SVG path at command letters,\n * then extract the command letter and parameters from each substring.\n * @param value\n */\n Path2D.parseSvgPath = function (value) {\n return value.trim().split(Path2D.splitCommandsRe).map(function (part) {\n var strParams = part.match(Path2D.matchParamsRe);\n return {\n command: part.substr(0, 1),\n params: strParams ? strParams.map(parseFloat) : []\n };\n });\n };\n Path2D.prettifySvgPath = function (value) {\n return Path2D.parseSvgPath(value).map(function (d) { return d.command + d.params.join(','); }).join('\\n');\n };\n /**\n * See https://www.w3.org/TR/SVG11/paths.html\n * @param value\n */\n Path2D.prototype.setFromString = function (value) {\n var _this = this;\n this.clear();\n var parts = Path2D.parseSvgPath(value);\n // Current point.\n var x;\n var y;\n // Last control point. Used to calculate the reflection point\n // for `S`, `s`, `T`, `t` commands.\n var cpx;\n var cpy;\n var lastCommand;\n function checkQuadraticCP() {\n if (!lastCommand.match(Path2D.quadraticCommandRe)) {\n cpx = x;\n cpy = y;\n }\n }\n function checkCubicCP() {\n if (!lastCommand.match(Path2D.cubicCommandRe)) {\n cpx = x;\n cpy = y;\n }\n }\n // But that will make compiler complain about x/y, cpx/cpy\n // being used without being set first.\n parts.forEach(function (part) {\n var p = part.params;\n var n = p.length;\n var i = 0;\n switch (part.command) {\n case 'M':\n _this.moveTo(x = p[i++], y = p[i++]);\n while (i < n) {\n _this.lineTo(x = p[i++], y = p[i++]);\n }\n break;\n case 'm':\n _this.moveTo(x += p[i++], y += p[i++]);\n while (i < n) {\n _this.lineTo(x += p[i++], y += p[i++]);\n }\n break;\n case 'L':\n while (i < n) {\n _this.lineTo(x = p[i++], y = p[i++]);\n }\n break;\n case 'l':\n while (i < n) {\n _this.lineTo(x += p[i++], y += p[i++]);\n }\n break;\n case 'C':\n while (i < n) {\n _this.cubicCurveTo(p[i++], p[i++], cpx = p[i++], cpy = p[i++], x = p[i++], y = p[i++]);\n }\n break;\n case 'c':\n while (i < n) {\n _this.cubicCurveTo(x + p[i++], y + p[i++], cpx = x + p[i++], cpy = y + p[i++], x += p[i++], y += p[i++]);\n }\n break;\n case 'S':\n checkCubicCP();\n while (i < n) {\n _this.cubicCurveTo(x + x - cpx, y + y - cpy, cpx = p[i++], cpy = p[i++], x = p[i++], y = p[i++]);\n }\n break;\n case 's':\n checkCubicCP();\n while (i < n) {\n _this.cubicCurveTo(x + x - cpx, y + y - cpy, cpx = x + p[i++], cpy = y + p[i++], x += p[i++], y += p[i++]);\n }\n break;\n case 'Q':\n while (i < n) {\n _this.quadraticCurveTo(cpx = p[i++], cpy = p[i++], x = p[i++], y = p[i++]);\n }\n break;\n case 'q':\n while (i < n) {\n _this.quadraticCurveTo(cpx = x + p[i++], cpy = y + p[i++], x += p[i++], y += p[i++]);\n }\n break;\n case 'T':\n checkQuadraticCP();\n while (i < n) {\n _this.quadraticCurveTo(cpx = x + x - cpx, cpy = y + y - cpy, x = p[i++], y = p[i++]);\n }\n break;\n case 't':\n checkQuadraticCP();\n while (i < n) {\n _this.quadraticCurveTo(cpx = x + x - cpx, cpy = y + y - cpy, x += p[i++], y += p[i++]);\n }\n break;\n case 'A':\n while (i < n) {\n _this.arcTo(p[i++], p[i++], p[i++] * Math.PI / 180, p[i++], p[i++], x = p[i++], y = p[i++]);\n }\n break;\n case 'a':\n while (i < n) {\n _this.arcTo(p[i++], p[i++], p[i++] * Math.PI / 180, p[i++], p[i++], x += p[i++], y += p[i++]);\n }\n break;\n case 'Z':\n case 'z':\n _this.closePath();\n break;\n case 'H':\n while (i < n) {\n _this.lineTo(x = p[i++], y);\n }\n break;\n case 'h':\n while (i < n) {\n _this.lineTo(x += p[i++], y);\n }\n break;\n case 'V':\n while (i < n) {\n _this.lineTo(x, y = p[i++]);\n }\n break;\n case 'v':\n while (i < n) {\n _this.lineTo(x, y += p[i++]);\n }\n break;\n }\n lastCommand = part.command;\n });\n };\n Path2D.prototype.toString = function () {\n var c = this.commands;\n var p = this.params;\n var cn = c.length;\n var out = [];\n for (var ci = 0, pi = 0; ci < cn; ci++) {\n switch (c[ci]) {\n case 'M':\n out.push('M' + p[pi++] + ',' + p[pi++]);\n break;\n case 'L':\n out.push('L' + p[pi++] + ',' + p[pi++]);\n break;\n case 'C':\n out.push('C' + p[pi++] + ',' + p[pi++] + ' ' +\n p[pi++] + ',' + p[pi++] + ' ' +\n p[pi++] + ',' + p[pi++]);\n break;\n case 'Z':\n out.push('Z');\n break;\n }\n }\n return out.join('');\n };\n Path2D.prototype.toPrettyString = function () {\n return Path2D.prettifySvgPath(this.toString());\n };\n Path2D.prototype.toSvg = function () {\n return Path2D.xmlDeclaration + \"\\n\\n \\n\";\n };\n Path2D.prototype.toDebugSvg = function () {\n var d = Path2D.prettifySvgPath(this.toString());\n return Path2D.xmlDeclaration + \"\\n\\n \\n\";\n };\n /**\n * Returns an array of sub-paths of this Path,\n * where each sub-path is represented exclusively by cubic segments.\n */\n Path2D.prototype.toCubicPaths = function () {\n // Each sub-path is an array of `(n * 3 + 1) * 2` numbers,\n // where `n` is the number of segments.\n var paths = [];\n var params = this.params;\n // current path\n var path;\n // the starting point of the current path\n var sx;\n var sy;\n // the previous point of the current path\n var px;\n var py;\n var i = 0; // current parameter\n this.commands.forEach(function (command) {\n switch (command) {\n case 'M':\n path = [\n sx = px = params[i++],\n sy = py = params[i++]\n ];\n paths.push(path);\n break;\n case 'L':\n var x = params[i++];\n var y = params[i++];\n // Place control points along the line `a + (b - a) * t`\n // at t = 1/3 and 2/3:\n path.push((px + px + x) / 3, (py + py + y) / 3, (px + x + x) / 3, (py + y + y) / 3, px = x, py = y);\n break;\n case 'C':\n path.push(params[i++], params[i++], params[i++], params[i++], px = params[i++], py = params[i++]);\n break;\n case 'Z':\n path.push((px + px + sx) / 3, (py + py + sy) / 3, (px + sx + sx) / 3, (py + sy + sy) / 3, px = sx, py = sy);\n break;\n }\n });\n return paths;\n };\n Path2D.cubicPathToString = function (path) {\n var n = path.length;\n if (!(n % 2 === 0 && (n / 2 - 1) / 2 >= 1)) {\n throw new Error('Invalid path.');\n }\n return 'M' + path.slice(0, 2).join(',') + 'C' + path.slice(2).join(',');\n };\n Path2D.splitCommandsRe = /(?=[AaCcHhLlMmQqSsTtVvZz])/g;\n Path2D.matchParamsRe = /-?[0-9]*\\.?\\d+/g;\n Path2D.quadraticCommandRe = /[QqTt]/;\n Path2D.cubicCommandRe = /[CcSs]/;\n Path2D.xmlDeclaration = '';\n Path2D.xmlns = 'http://www.w3.org/2000/svg';\n return Path2D;\n}());\nexport { Path2D };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { Shape } from \"./shape\";\nimport { Path2D } from \"../path2D\";\nvar Path = /** @class */ (function (_super) {\n __extends(Path, _super);\n function Path() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n /**\n * Declare a path to retain for later rendering and hit testing\n * using custom Path2D class. Think of it as a TypeScript version\n * of the native Path2D (with some differences) that works in all browsers.\n */\n _this.path = new Path2D();\n /**\n * The path only has to be updated when certain attributes change.\n * For example, if transform attributes (such as `translationX`)\n * are changed, we don't have to update the path. The `dirtyPath` flag\n * is how we keep track if the path has to be updated or not.\n */\n _this._dirtyPath = true;\n /**\n * Path definition in SVG path syntax:\n * https://www.w3.org/TR/SVG11/paths.html#DAttribute\n */\n _this._svgPath = '';\n return _this;\n }\n Object.defineProperty(Path.prototype, \"dirtyPath\", {\n get: function () {\n return this._dirtyPath;\n },\n set: function (value) {\n if (this._dirtyPath !== value) {\n this._dirtyPath = value;\n if (value) {\n this.dirty = true;\n }\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Path.prototype, \"svgPath\", {\n get: function () {\n return this._svgPath;\n },\n set: function (value) {\n if (this._svgPath !== value) {\n this._svgPath = value;\n this.path.setFromString(value);\n this.dirty = true;\n }\n },\n enumerable: true,\n configurable: true\n });\n Path.prototype.isPointInPath = function (x, y) {\n var point = this.transformPoint(x, y);\n return this.path.closedPath && this.path.isPointInPath(point.x, point.y);\n };\n Path.prototype.isPointInStroke = function (x, y) {\n return false;\n };\n Path.prototype.updatePath = function () { };\n Path.prototype.render = function (ctx) {\n var scene = this.scene;\n if (this.dirtyTransform) {\n this.computeTransformMatrix();\n }\n // if (scene.debug.renderBoundingBoxes) {\n // const bbox = this.computeBBox();\n // if (bbox) {\n // this.matrix.transformBBox(bbox).render(ctx);\n // }\n // }\n this.matrix.toContext(ctx);\n if (this.dirtyPath) {\n this.updatePath();\n this.dirtyPath = false;\n }\n scene.appendPath(this.path);\n this.fillStroke(ctx);\n this.dirty = false;\n };\n Path.className = 'Path';\n return Path;\n}(Shape));\nexport { Path };\n","var twoPi = Math.PI * 2;\n/**\n * Normalize the given angle to be in the [0, 2π) interval.\n * @param radians Angle in radians.\n */\nexport function normalizeAngle360(radians) {\n radians %= twoPi;\n radians += twoPi;\n radians %= twoPi;\n return radians;\n}\nexport function normalizeAngle360Inclusive(radians) {\n radians %= twoPi;\n radians += twoPi;\n if (radians !== twoPi) {\n radians %= twoPi;\n }\n return radians;\n}\n/**\n * Normalize the given angle to be in the [-π, π) interval.\n * @param radians Angle in radians.\n */\nexport function normalizeAngle180(radians) {\n radians %= twoPi;\n if (radians < -Math.PI) {\n radians += twoPi;\n }\n else if (radians >= Math.PI) {\n radians -= twoPi;\n }\n return radians;\n}\nexport function toRadians(degrees) {\n return degrees / 180 * Math.PI;\n}\nexport function toDegrees(radians) {\n return radians / Math.PI * 180;\n}\n","export function isEqual(a, b, epsilon) {\n if (epsilon === void 0) { epsilon = 1e-10; }\n return Math.abs(a - b) < epsilon;\n}\n/**\n * `Number.toFixed(n)` always formats a number so that it has `n` digits after the decimal point.\n * For example, `Number(0.00003427).toFixed(2)` returns `0.00`.\n * That's not very helpful, because all the meaningful information is lost.\n * In this case we would want the formatted value to have at least two significant digits: `0.000034`,\n * not two fraction digits.\n * @param value\n * @param fractionOrSignificantDigits\n */\nexport function toFixed(value, fractionOrSignificantDigits) {\n if (fractionOrSignificantDigits === void 0) { fractionOrSignificantDigits = 2; }\n var power = Math.floor(Math.log(Math.abs(value)) / Math.LN10);\n if (power >= 0 || !isFinite(power)) {\n return value.toFixed(fractionOrSignificantDigits); // fraction digits\n }\n return value.toFixed(Math.abs(power) - 1 + fractionOrSignificantDigits); // significant digits\n}\nvar numberUnits = ['', 'K', 'M', 'B', 'T'];\nexport function log10(x) {\n return Math.log(x) * Math.LOG10E;\n}\nexport var EPSILON = Number.EPSILON || Math.pow(2, -52);\nexport function toReadableNumber(value, fractionDigits) {\n if (fractionDigits === void 0) { fractionDigits = 2; }\n // For example: toReadableNumber(10550000000) yields \"10.6B\"\n var prefix = '';\n if (value <= 0) {\n value = -value;\n prefix = '-';\n }\n var thousands = ~~(log10(value) / log10(1000)); // discard the floating point part\n return prefix + (value / Math.pow(1000.0, thousands)).toFixed(fractionDigits) + numberUnits[thousands];\n}\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { Shape } from \"./shape\";\nimport { Path } from \"./path\";\nimport { BBox } from \"../bbox\";\nimport { normalizeAngle360 } from \"../../util/angle\";\nimport { chainObjects } from \"../../util/object\";\nimport { isEqual } from \"../../util/number\";\nexport var ArcType;\n(function (ArcType) {\n ArcType[ArcType[\"Open\"] = 0] = \"Open\";\n ArcType[ArcType[\"Chord\"] = 1] = \"Chord\";\n ArcType[ArcType[\"Round\"] = 2] = \"Round\";\n})(ArcType || (ArcType = {}));\n/**\n * Elliptical arc node.\n */\nvar Arc = /** @class */ (function (_super) {\n __extends(Arc, _super);\n function Arc() {\n var _this = _super.call(this) || this;\n _this._centerX = 0;\n _this._centerY = 0;\n _this._radiusX = 10;\n _this._radiusY = 10;\n _this._startAngle = 0;\n _this._endAngle = Math.PI * 2;\n _this._counterClockwise = false;\n /**\n * The type of arc to render:\n * - {@link ArcType.Open} - end points of the arc segment are not connected (default)\n * - {@link ArcType.Chord} - end points of the arc segment are connected by a line segment\n * - {@link ArcType.Round} - each of the end points of the arc segment are connected\n * to the center of the arc\n * Arcs with {@link ArcType.Open} do not support hit testing, even if they have their\n * {@link Shape.fillStyle} set, because they are not closed paths. Hit testing support\n * would require using two paths - one for rendering, another for hit testing - and there\n * doesn't seem to be a compelling reason to do that, when one can just use {@link ArcType.Chord}\n * to create a closed path.\n */\n _this._type = ArcType.Open;\n _this.restoreOwnStyles();\n return _this;\n }\n Object.defineProperty(Arc.prototype, \"centerX\", {\n get: function () {\n return this._centerX;\n },\n set: function (value) {\n if (this._centerX !== value) {\n this._centerX = value;\n this.dirtyPath = true;\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Arc.prototype, \"centerY\", {\n get: function () {\n return this._centerY;\n },\n set: function (value) {\n if (this._centerY !== value) {\n this._centerY = value;\n this.dirtyPath = true;\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Arc.prototype, \"radiusX\", {\n get: function () {\n return this._radiusX;\n },\n set: function (value) {\n if (this._radiusX !== value) {\n this._radiusX = value;\n this.dirtyPath = true;\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Arc.prototype, \"radiusY\", {\n get: function () {\n return this._radiusY;\n },\n set: function (value) {\n if (this._radiusY !== value) {\n this._radiusY = value;\n this.dirtyPath = true;\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Arc.prototype, \"startAngle\", {\n get: function () {\n return this._startAngle;\n },\n set: function (value) {\n if (this._startAngle !== value) {\n this._startAngle = value;\n this.dirtyPath = true;\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Arc.prototype, \"endAngle\", {\n get: function () {\n return this._endAngle;\n },\n set: function (value) {\n if (this._endAngle !== value) {\n this._endAngle = value;\n this.dirtyPath = true;\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Arc.prototype, \"fullPie\", {\n get: function () {\n return isEqual(normalizeAngle360(this.startAngle), normalizeAngle360(this.endAngle));\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Arc.prototype, \"counterClockwise\", {\n get: function () {\n return this._counterClockwise;\n },\n set: function (value) {\n if (this._counterClockwise !== value) {\n this._counterClockwise = value;\n this.dirtyPath = true;\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Arc.prototype, \"type\", {\n get: function () {\n return this._type;\n },\n set: function (value) {\n if (this._type !== value) {\n this._type = value;\n this.dirtyPath = true;\n }\n },\n enumerable: true,\n configurable: true\n });\n Arc.prototype.updatePath = function () {\n var path = this.path;\n path.clear(); // No need to recreate the Path, can simply clear the existing one.\n // This is much faster than the native Path2D implementation even though this `cubicArc`\n // method is pure TypeScript and actually produces the definition of an elliptical arc,\n // where you can specify two radii and rotation, while Path2D's `arc` method simply produces\n // a circular arc. Maybe it's due to the experimental nature of the Path2D class,\n // maybe it's because we have to create a new instance of it on each render, who knows...\n path.cubicArc(this.centerX, this.centerY, this.radiusX, this.radiusY, 0, this.startAngle, this.endAngle, this.counterClockwise ? 1 : 0);\n if (this.type === ArcType.Chord) {\n path.closePath();\n }\n else if (this.type === ArcType.Round && !this.fullPie) {\n path.lineTo(this.centerX, this.centerY);\n path.closePath();\n }\n };\n Arc.prototype.computeBBox = function () {\n // Only works with full arcs (circles) and untransformed ellipses.\n return new BBox(this.centerX - this.radiusX, this.centerY - this.radiusY, this.radiusX * 2, this.radiusY * 2);\n };\n Arc.prototype.isPointInPath = function (x, y) {\n var point = this.transformPoint(x, y);\n var bbox = this.computeBBox();\n return this.type !== ArcType.Open\n && bbox.containsPoint(point.x, point.y)\n && this.path.isPointInPath(point.x, point.y);\n };\n Arc.className = 'Arc';\n Arc.defaultStyles = chainObjects(Shape.defaultStyles, {\n lineWidth: 1,\n fillStyle: null\n });\n return Arc;\n}(Path));\nexport { Arc };\n","import { Group } from \"./scene/group\";\nimport { Selection } from \"./scene/selection\";\nimport { Line } from \"./scene/shape/line\";\nimport { Text } from \"./scene/shape/text\";\nimport { Arc } from \"./scene/shape/arc\";\nimport { BBox } from \"./scene/bbox\";\nimport { Matrix } from \"./scene/matrix\";\nimport { createId } from \"./util/id\";\nimport { normalizeAngle360, normalizeAngle360Inclusive, toRadians } from \"./util/angle\";\n// import { Rect } from \"./scene/shape/rect\"; // debug (bbox)\nvar Tags;\n(function (Tags) {\n Tags[Tags[\"Tick\"] = 0] = \"Tick\";\n Tags[Tags[\"GridLine\"] = 1] = \"GridLine\";\n})(Tags || (Tags = {}));\nvar AxisTick = /** @class */ (function () {\n function AxisTick() {\n /**\n * The line width to be used by axis ticks.\n */\n this.width = 1;\n /**\n * The line length to be used by axis ticks.\n */\n this.size = 6;\n /**\n * The color of the axis ticks.\n * Use `undefined` rather than `rgba(0, 0, 0, 0)` to make the ticks invisible.\n */\n this.color = 'rgba(195, 195, 195, 1)';\n /**\n * A hint of how many ticks to use (the exact number of ticks might differ),\n * a `TimeInterval` or a `CountableTimeInterval`.\n * For example:\n *\n * axis.tick.count = 5;\n * axis.tick.count = year;\n * axis.tick.count = month.every(6);\n */\n this.count = 10;\n }\n return AxisTick;\n}());\nexport { AxisTick };\nvar AxisLabel = /** @class */ (function () {\n function AxisLabel() {\n this.fontSize = 12;\n this.fontFamily = 'Verdana, sans-serif';\n /**\n * The padding between the labels and the ticks.\n */\n this.padding = 5;\n /**\n * The color of the labels.\n * Use `undefined` rather than `rgba(0, 0, 0, 0)` to make labels invisible.\n */\n this.color = 'rgba(87, 87, 87, 1)';\n /**\n * Custom label rotation in degrees.\n * Labels are rendered perpendicular to the axis line by default.\n * Or parallel to the axis line, if the {@link parallel} is set to `true`.\n * The value of this config is used as the angular offset/deflection\n * from the default rotation.\n */\n this.rotation = 0;\n /**\n * By default labels and ticks are positioned to the left of the axis line.\n * `true` positions the labels to the right of the axis line.\n * However, if the axis is rotated, its easier to think in terms\n * of this side or the opposite side, rather than left and right.\n * We use the term `mirror` for conciseness, although it's not\n * true mirroring - for example, when a label is rotated, so that\n * it is inclined at the 45 degree angle, text flowing from north-west\n * to south-east, ending at the tick to the left of the axis line,\n * and then we set this config to `true`, the text will still be flowing\n * from north-west to south-east, _starting_ at the tick to the right\n * of the axis line.\n */\n this.mirrored = false;\n /**\n * Labels are rendered perpendicular to the axis line by default.\n * Setting this config to `true` makes labels render parallel to the axis line\n * and center aligns labels' text at the ticks.\n */\n this.parallel = false;\n }\n Object.defineProperty(AxisLabel.prototype, \"format\", {\n get: function () {\n return this._format;\n },\n set: function (value) {\n // See `TimeLocaleObject` docs for the list of supported format directives.\n if (this._format !== value) {\n this._format = value;\n if (this.onFormatChange) {\n this.onFormatChange(value);\n }\n }\n },\n enumerable: true,\n configurable: true\n });\n return AxisLabel;\n}());\nexport { AxisLabel };\n/**\n * A general purpose linear axis with no notion of orientation.\n * The axis is always rendered vertically, with horizontal labels positioned to the left\n * of the axis line by default. The axis can be {@link rotation | rotated} by an arbitrary angle,\n * so that it can be used as a top, right, bottom, left, radial or any other kind\n * of linear axis.\n * The generic `D` parameter is the type of the domain of the axis' scale.\n * The output range of the axis' scale is always numeric (screen coordinates).\n */\nvar Axis = /** @class */ (function () {\n function Axis() {\n // debug (bbox)\n // private bboxRect = (() => {\n // const rect = new Rect();\n // rect.fill = undefined;\n // rect.stroke = 'red';\n // rect.strokeWidth = 1;\n // rect.strokeOpacity = 0.2;\n // return rect;\n // })();\n this.id = createId(this);\n this.lineNode = new Line();\n this.group = new Group();\n this.line = {\n width: 1,\n color: 'rgba(195, 195, 195, 1)'\n };\n this.tick = new AxisTick();\n this.label = new AxisLabel();\n this.translation = { x: 0, y: 0 };\n this.rotation = 0; // axis rotation angle in degrees\n this._visibleRange = [0, 1];\n this._title = undefined;\n /**\n * The length of the grid. The grid is only visible in case of a non-zero value.\n * In case {@link radialGrid} is `true`, the value is interpreted as an angle\n * (in degrees).\n */\n this._gridLength = 0;\n /**\n * The array of styles to cycle through when rendering grid lines.\n * For example, use two {@link GridStyle} objects for alternating styles.\n * Contains only one {@link GridStyle} object by default, meaning all grid lines\n * have the same style.\n */\n this.gridStyle = [{\n stroke: 'rgba(219, 219, 219, 1)',\n lineDash: [4, 2]\n }];\n /**\n * `false` - render grid as lines of {@link gridLength} that extend the ticks\n * on the opposite side of the axis\n * `true` - render grid as concentric circles that go through the ticks\n */\n this._radialGrid = false;\n this.fractionDigits = 0;\n this.thickness = 0;\n this.groupSelection = Selection.select(this.group).selectAll();\n this.label.onFormatChange = this.onLabelFormatChange.bind(this);\n this.group.append(this.lineNode);\n // this.group.append(this.bboxRect); // debug (bbox)\n }\n Object.defineProperty(Axis.prototype, \"scale\", {\n get: function () {\n return this._scale;\n },\n set: function (value) {\n this._scale = value;\n this.requestedRange = value.range.slice();\n this.onLabelFormatChange();\n },\n enumerable: true,\n configurable: true\n });\n /**\n * Meant to be overridden in subclasses to provide extra context the the label formatter.\n * The return value of this function will be passed to the laber.formatter as the `axis` parameter.\n */\n Axis.prototype.getMeta = function () { };\n Axis.prototype.updateRange = function () {\n var _a = this, rr = _a.requestedRange, vr = _a.visibleRange, scale = _a.scale;\n var span = (rr[1] - rr[0]) / (vr[1] - vr[0]);\n var shift = span * vr[0];\n var start = rr[0] - shift;\n scale.range = [start, start + span];\n };\n /**\n * Checks if a point or an object is in range.\n * @param x A point (or object's starting point).\n * @param width Object's width.\n * @param tolerance Expands the range on both ends by this amount.\n */\n Axis.prototype.inRange = function (x, width, tolerance) {\n if (width === void 0) { width = 0; }\n if (tolerance === void 0) { tolerance = 0; }\n return this.inRangeEx(x, width, tolerance) === 0;\n };\n Axis.prototype.inRangeEx = function (x, width, tolerance) {\n if (width === void 0) { width = 0; }\n if (tolerance === void 0) { tolerance = 0; }\n var range = this.range;\n if ((x + width) < (range[0] - tolerance)) {\n return -1; // left or range\n }\n if (x > (range[1] + tolerance)) {\n return 1; // right of range\n }\n return 0; // in range\n };\n Object.defineProperty(Axis.prototype, \"range\", {\n get: function () {\n return this.requestedRange.slice();\n },\n set: function (value) {\n this.requestedRange = value.slice();\n this.updateRange();\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Axis.prototype, \"visibleRange\", {\n get: function () {\n return this._visibleRange.slice();\n },\n set: function (value) {\n if (value && value.length === 2) {\n var min = value[0], max = value[1];\n min = Math.max(0, min);\n max = Math.min(1, max);\n min = Math.min(min, max);\n max = Math.max(min, max);\n this._visibleRange = [min, max];\n this.updateRange();\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Axis.prototype, \"domain\", {\n get: function () {\n return this.scale.domain.slice();\n },\n set: function (value) {\n this.scale.domain = value.slice();\n },\n enumerable: true,\n configurable: true\n });\n Axis.prototype.onLabelFormatChange = function (format) {\n if (format) {\n if (this.scale && this.scale.tickFormat) {\n this.labelFormatter = this.scale.tickFormat(this.tick.count, format);\n }\n }\n else {\n this.labelFormatter = undefined;\n }\n };\n Object.defineProperty(Axis.prototype, \"title\", {\n get: function () {\n return this._title;\n },\n set: function (value) {\n var oldTitle = this._title;\n if (oldTitle !== value) {\n if (oldTitle) {\n this.group.removeChild(oldTitle.node);\n }\n if (value) {\n value.node.rotation = -Math.PI / 2;\n this.group.appendChild(value.node);\n }\n this._title = value;\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Axis.prototype, \"gridLength\", {\n get: function () {\n return this._gridLength;\n },\n set: function (value) {\n // Was visible and now invisible, or was invisible and now visible.\n if (this._gridLength && !value || !this._gridLength && value) {\n this.groupSelection = this.groupSelection.remove().setData([]);\n }\n this._gridLength = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Axis.prototype, \"radialGrid\", {\n get: function () {\n return this._radialGrid;\n },\n set: function (value) {\n if (this._radialGrid !== value) {\n this._radialGrid = value;\n this.groupSelection = this.groupSelection.remove().setData([]);\n }\n },\n enumerable: true,\n configurable: true\n });\n /**\n * Creates/removes/updates the scene graph nodes that constitute the axis.\n * Supposed to be called _manually_ after changing _any_ of the axis properties.\n * This allows to bulk set axis properties before updating the nodes.\n * The node changes made by this method are rendered on the next animation frame.\n * We could schedule this method call automatically on the next animation frame\n * when any of the axis properties change (the way we do when properties of scene graph's\n * nodes change), but this will mean that we first wait for the next animation\n * frame to make changes to the nodes of the axis, then wait for another animation\n * frame to render those changes. It's nice to have everything update automatically,\n * but this extra level of async indirection will not just introduce an unwanted delay,\n * it will also make it harder to reason about the program.\n */\n Axis.prototype.update = function () {\n var _this = this;\n var _a = this, group = _a.group, scale = _a.scale, tick = _a.tick, label = _a.label, gridStyle = _a.gridStyle, requestedRange = _a.requestedRange;\n var requestedRangeMin = Math.min(requestedRange[0], requestedRange[1]);\n var requestedRangeMax = Math.max(requestedRange[0], requestedRange[1]);\n var rotation = toRadians(this.rotation);\n var parallelLabels = label.parallel;\n var labelRotation = normalizeAngle360(toRadians(label.rotation));\n group.translationX = this.translation.x;\n group.translationY = this.translation.y;\n group.rotation = rotation;\n var halfBandwidth = (scale.bandwidth || 0) / 2;\n // The side of the axis line to position the labels on.\n // -1 = left (default)\n // 1 = right\n var sideFlag = label.mirrored ? 1 : -1;\n // When labels are parallel to the axis line, the `parallelFlipFlag` is used to\n // flip the labels to avoid upside-down text, when the axis is rotated\n // such that it is in the right hemisphere, i.e. the angle of rotation\n // is in the [0, π] interval.\n // The rotation angle is normalized, so that we have an easier time checking\n // if it's in the said interval. Since the axis is always rendered vertically\n // and then rotated, zero rotation means 12 (not 3) o-clock.\n // -1 = flip\n // 1 = don't flip (default)\n var parallelFlipRotation = normalizeAngle360(rotation);\n var parallelFlipFlag = !labelRotation && parallelFlipRotation >= 0 && parallelFlipRotation <= Math.PI ? -1 : 1;\n var regularFlipRotation = normalizeAngle360(rotation - Math.PI / 2);\n // Flip if the axis rotation angle is in the top hemisphere.\n var regularFlipFlag = !labelRotation && regularFlipRotation >= 0 && regularFlipRotation <= Math.PI ? -1 : 1;\n var alignFlag = labelRotation >= 0 && labelRotation <= Math.PI ? -1 : 1;\n var ticks = scale.ticks(this.tick.count);\n var update = this.groupSelection.setData(ticks);\n update.exit.remove();\n var enter = update.enter.append(Group);\n // Line auto-snaps to pixel grid if vertical or horizontal.\n enter.append(Line).each(function (node) { return node.tag = Tags.Tick; });\n if (this.gridLength) {\n if (this.radialGrid) {\n enter.append(Arc).each(function (node) { return node.tag = Tags.GridLine; });\n }\n else {\n enter.append(Line).each(function (node) { return node.tag = Tags.GridLine; });\n }\n }\n enter.append(Text);\n var groupSelection = update.merge(enter);\n groupSelection\n .attrFn('translationY', function (_, datum) {\n return Math.round(scale.convert(datum) + halfBandwidth);\n })\n .attrFn('visible', function (node) {\n return node.translationY >= requestedRangeMin && node.translationY <= requestedRangeMax;\n });\n groupSelection.selectByTag(Tags.Tick)\n .each(function (line) {\n line.strokeWidth = tick.width;\n line.stroke = tick.color;\n })\n .attr('x1', sideFlag * tick.size)\n .attr('x2', 0)\n .attr('y1', 0)\n .attr('y2', 0);\n if (this.gridLength && gridStyle.length) {\n var styleCount_1 = gridStyle.length;\n var gridLines = void 0;\n if (this.radialGrid) {\n var angularGridLength_1 = normalizeAngle360Inclusive(toRadians(this.gridLength));\n gridLines = groupSelection.selectByTag(Tags.GridLine)\n .each(function (arc, datum) {\n var radius = Math.round(scale.convert(datum) + halfBandwidth);\n arc.centerX = 0;\n arc.centerY = scale.range[0] - radius;\n arc.endAngle = angularGridLength_1;\n arc.radiusX = radius;\n arc.radiusY = radius;\n });\n }\n else {\n gridLines = groupSelection.selectByTag(Tags.GridLine)\n .each(function (line) {\n line.x1 = 0;\n line.x2 = -sideFlag * _this.gridLength;\n line.y1 = 0;\n line.y2 = 0;\n line.visible = Math.abs(line.parent.translationY - scale.range[0]) > 1;\n });\n }\n gridLines.each(function (gridLine, _, index) {\n var style = gridStyle[index % styleCount_1];\n gridLine.stroke = style.stroke;\n gridLine.strokeWidth = tick.width;\n gridLine.lineDash = style.lineDash;\n gridLine.fill = undefined;\n });\n }\n // `ticks instanceof NumericTicks` doesn't work here, so we feature detect.\n this.fractionDigits = ticks.fractionDigits >= 0 ? ticks.fractionDigits : 0;\n var labelSelection = groupSelection.selectByClass(Text)\n .each(function (node, datum, index) {\n node.fontStyle = label.fontStyle;\n node.fontWeight = label.fontWeight;\n node.fontSize = label.fontSize;\n node.fontFamily = label.fontFamily;\n node.fill = label.color;\n node.textBaseline = parallelLabels && !labelRotation\n ? (sideFlag * parallelFlipFlag === -1 ? 'hanging' : 'bottom')\n : 'middle';\n node.text = _this.formatTickDatum(datum, index);\n node.textAlign = parallelLabels\n ? labelRotation ? (sideFlag * alignFlag === -1 ? 'end' : 'start') : 'center'\n : sideFlag * regularFlipFlag === -1 ? 'end' : 'start';\n });\n var labelX = sideFlag * (tick.size + label.padding);\n var autoRotation = parallelLabels\n ? parallelFlipFlag * Math.PI / 2\n : (regularFlipFlag === -1 ? Math.PI : 0);\n labelSelection.each(function (label) {\n label.x = labelX;\n label.rotationCenterX = labelX;\n label.rotation = autoRotation + labelRotation;\n });\n this.groupSelection = groupSelection;\n // Render axis line.\n var lineNode = this.lineNode;\n lineNode.x1 = 0;\n lineNode.x2 = 0;\n lineNode.y1 = requestedRange[0];\n lineNode.y2 = requestedRange[1];\n lineNode.strokeWidth = this.line.width;\n lineNode.stroke = this.line.color;\n lineNode.visible = ticks.length > 0;\n var title = this.title;\n var titleVisible = false;\n if (title && title.enabled) {\n titleVisible = true;\n var padding = title.padding.bottom;\n var titleNode = title.node;\n var bbox = this.computeBBox({ excludeTitle: true });\n var titleRotationFlag = sideFlag === -1 && parallelFlipRotation > Math.PI && parallelFlipRotation < Math.PI * 2 ? -1 : 1;\n titleNode.rotation = titleRotationFlag * sideFlag * Math.PI / 2;\n titleNode.x = titleRotationFlag * sideFlag * (lineNode.y1 + lineNode.y2) / 2;\n titleNode.x = titleRotationFlag * sideFlag * (requestedRange[0] + requestedRange[1]) / 2;\n if (sideFlag === -1) {\n titleNode.y = titleRotationFlag * (-padding - bbox.width + Math.max(bbox.x + bbox.width, 0));\n }\n else {\n titleNode.y = -padding - bbox.width - Math.min(bbox.x, 0);\n }\n titleNode.textBaseline = titleRotationFlag === 1 ? 'bottom' : 'top';\n }\n if (title) {\n title.node.visible = titleVisible;\n }\n // debug (bbox)\n // const bbox = this.computeBBox();\n // const bboxRect = this.bboxRect;\n // bboxRect.x = bbox.x;\n // bboxRect.y = bbox.y;\n // bboxRect.width = bbox.width;\n // bboxRect.height = bbox.height;\n };\n // For formatting (nice rounded) tick values.\n Axis.prototype.formatTickDatum = function (datum, index) {\n var _a = this, label = _a.label, labelFormatter = _a.labelFormatter, fractionDigits = _a.fractionDigits;\n var meta = this.getMeta();\n return label.formatter\n ? label.formatter({\n value: fractionDigits >= 0 ? datum : String(datum),\n index: index,\n fractionDigits: fractionDigits,\n formatter: labelFormatter,\n axis: meta\n })\n : labelFormatter\n ? labelFormatter(datum)\n : typeof datum === 'number' && fractionDigits >= 0\n // the `datum` is a floating point number\n ? datum.toFixed(fractionDigits)\n // the`datum` is an integer, a string or an object\n : String(datum);\n };\n // For formatting arbitrary values between the ticks.\n Axis.prototype.formatDatum = function (datum) {\n return String(datum);\n };\n Axis.prototype.computeBBox = function (options) {\n var _a = this, title = _a.title, lineNode = _a.lineNode;\n var labels = this.groupSelection.selectByClass(Text);\n var left = Infinity;\n var right = -Infinity;\n var top = Infinity;\n var bottom = -Infinity;\n labels.each(function (label) {\n // The label itself is rotated, but not translated, the group that\n // contains it is. So to capture the group transform in the label bbox\n // calculation we combine the transform matrices of the label and the group.\n // Depending on the timing of the `axis.computeBBox()` method call, we may\n // not have the group's and the label's transform matrices updated yet (because\n // the transform matrix is not recalculated whenever a node's transform attributes\n // change, instead it's marked for recalculation on the next frame by setting\n // the node's `dirtyTransform` flag to `true`), so we force them to update\n // right here by calling `computeTransformMatrix`.\n label.computeTransformMatrix();\n var matrix = Matrix.flyweight(label.matrix);\n var group = label.parent;\n group.computeTransformMatrix();\n matrix.preMultiplySelf(group.matrix);\n var labelBBox = label.computeBBox();\n if (labelBBox) {\n var bbox = matrix.transformBBox(labelBBox);\n left = Math.min(left, bbox.x);\n right = Math.max(right, bbox.x + bbox.width);\n top = Math.min(top, bbox.y);\n bottom = Math.max(bottom, bbox.y + bbox.height);\n }\n });\n if (title && title.enabled && (!options || !options.excludeTitle)) {\n var label = title.node;\n label.computeTransformMatrix();\n var matrix = Matrix.flyweight(label.matrix);\n var labelBBox = label.computeBBox();\n if (labelBBox) {\n var bbox = matrix.transformBBox(labelBBox);\n left = Math.min(left, bbox.x);\n right = Math.max(right, bbox.x + bbox.width);\n top = Math.min(top, bbox.y);\n bottom = Math.max(bottom, bbox.y + bbox.height);\n }\n }\n left = Math.min(left, 0);\n right = Math.max(right, 0);\n top = Math.min(top, lineNode.y1, lineNode.y2);\n bottom = Math.max(bottom, lineNode.y1, lineNode.y2);\n return new BBox(left, top, right - left, bottom - top);\n };\n return Axis;\n}());\nexport { Axis };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { Axis } from \"../axis\";\nexport var ChartAxisDirection;\n(function (ChartAxisDirection) {\n ChartAxisDirection[\"X\"] = \"x\";\n ChartAxisDirection[\"Y\"] = \"y\"; // means 'radius' in polar charts\n})(ChartAxisDirection || (ChartAxisDirection = {}));\nexport function flipChartAxisDirection(direction) {\n if (direction === ChartAxisDirection.X) {\n return ChartAxisDirection.Y;\n }\n else {\n return ChartAxisDirection.X;\n }\n}\nexport var ChartAxisPosition;\n(function (ChartAxisPosition) {\n ChartAxisPosition[\"Top\"] = \"top\";\n ChartAxisPosition[\"Right\"] = \"right\";\n ChartAxisPosition[\"Bottom\"] = \"bottom\";\n ChartAxisPosition[\"Left\"] = \"left\";\n ChartAxisPosition[\"Angle\"] = \"angle\";\n ChartAxisPosition[\"Radius\"] = \"radius\";\n})(ChartAxisPosition || (ChartAxisPosition = {}));\nvar ChartAxis = /** @class */ (function (_super) {\n __extends(ChartAxis, _super);\n function ChartAxis() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.keys = [];\n _this.boundSeries = [];\n return _this;\n }\n Object.defineProperty(ChartAxis.prototype, \"type\", {\n get: function () {\n return this.constructor.type || '';\n },\n enumerable: true,\n configurable: true\n });\n ChartAxis.prototype.getMeta = function () {\n return {\n id: this.id,\n direction: this.direction,\n boundSeries: this.boundSeries,\n };\n };\n Object.defineProperty(ChartAxis.prototype, \"position\", {\n get: function () {\n return this._position;\n },\n set: function (value) {\n if (this._position !== value) {\n this._position = value;\n switch (value) {\n case ChartAxisPosition.Top:\n this.direction = ChartAxisDirection.X;\n this.rotation = -90;\n this.label.mirrored = true;\n this.label.parallel = true;\n break;\n case ChartAxisPosition.Right:\n this.direction = ChartAxisDirection.Y;\n this.rotation = 0;\n this.label.mirrored = true;\n this.label.parallel = false;\n break;\n case ChartAxisPosition.Bottom:\n this.direction = ChartAxisDirection.X;\n this.rotation = -90;\n this.label.mirrored = false;\n this.label.parallel = true;\n break;\n case ChartAxisPosition.Left:\n this.direction = ChartAxisDirection.Y;\n this.rotation = 0;\n this.label.mirrored = false;\n this.label.parallel = false;\n break;\n }\n }\n },\n enumerable: true,\n configurable: true\n });\n return ChartAxis;\n}(Axis));\nexport { ChartAxis };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { LinearScale } from \"../../scale/linearScale\";\nimport { ChartAxis } from \"../chartAxis\";\nvar NumberAxis = /** @class */ (function (_super) {\n __extends(NumberAxis, _super);\n function NumberAxis() {\n var _this = _super.call(this) || this;\n _this._nice = true;\n _this._min = NaN;\n _this._max = NaN;\n _this.scale = new LinearScale();\n return _this;\n }\n Object.defineProperty(NumberAxis.prototype, \"nice\", {\n get: function () {\n return this._nice;\n },\n set: function (value) {\n if (this._nice !== value) {\n this._nice = value;\n if (value && this.scale.nice) {\n this.scale.nice(this.tick.count);\n }\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(NumberAxis.prototype, \"domain\", {\n get: function () {\n return this.scale.domain;\n },\n set: function (value) {\n var _a = this, scale = _a.scale, min = _a.min, max = _a.max;\n value = [\n isNaN(min) ? value[0] : min,\n isNaN(max) ? value[1] : max\n ];\n scale.domain = value;\n scale.clamp = true;\n if (this.nice && this.scale.nice) {\n this.scale.nice(this.tick.count);\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(NumberAxis.prototype, \"min\", {\n get: function () {\n return this._min;\n },\n set: function (value) {\n if (this._min !== value) {\n this._min = value;\n if (!isNaN(value)) {\n this.scale.domain = [value, this.scale.domain[1]];\n }\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(NumberAxis.prototype, \"max\", {\n get: function () {\n return this._max;\n },\n set: function (value) {\n if (this._max !== value) {\n this._max = value;\n if (!isNaN(value)) {\n this.scale.domain = [this.scale.domain[0], value];\n }\n }\n },\n enumerable: true,\n configurable: true\n });\n NumberAxis.prototype.formatDatum = function (datum) {\n return datum.toFixed(2);\n };\n NumberAxis.className = 'NumberAxis';\n NumberAxis.type = 'number';\n return NumberAxis;\n}(ChartAxis));\nexport { NumberAxis };\n","/**\n * Maps a discrete domain to a continuous numeric range.\n * See https://github.com/d3/d3-scale#band-scales for more info.\n */\nvar BandScale = /** @class */ (function () {\n function BandScale() {\n this.type = 'band';\n /**\n * Maps datum to its index in the {@link domain} array.\n * Used to check for duplicate datums (not allowed).\n */\n this.index = new Map();\n /**\n * The output range values for datum at each index.\n */\n this.ordinalRange = [];\n /**\n * Contains unique datums only. Since `{}` is used in place of `Map`\n * for IE11 compatibility, the datums are converted `toString` before\n * the uniqueness check.\n */\n this._domain = [];\n this._range = [0, 1];\n this._bandwidth = 1;\n /**\n * The ratio of the range that is reserved for space between bands.\n */\n this._paddingInner = 0;\n /**\n * The ratio of the range that is reserved for space before the first\n * and after the last band.\n */\n this._paddingOuter = 0;\n this._round = false;\n /**\n * How the leftover range is distributed.\n * `0.5` - equal distribution of space before the first and after the last band,\n * with bands effectively centered within the range.\n */\n this._align = 0.5;\n }\n Object.defineProperty(BandScale.prototype, \"domain\", {\n get: function () {\n return this._domain;\n },\n set: function (values) {\n var domain = this._domain;\n domain.length = 0;\n this.index = new Map();\n var index = this.index;\n // In case one wants to have duplicate domain values, for example, two 'Italy' categories,\n // one should use objects rather than strings for domain values like so:\n // { toString: () => 'Italy' }\n // { toString: () => 'Italy' }\n values.forEach(function (value) {\n if (index.get(value) === undefined) {\n index.set(value, domain.push(value) - 1);\n }\n });\n this.rescale();\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(BandScale.prototype, \"range\", {\n get: function () {\n return this._range;\n },\n set: function (values) {\n this._range[0] = values[0];\n this._range[1] = values[1];\n this.rescale();\n },\n enumerable: true,\n configurable: true\n });\n BandScale.prototype.ticks = function () {\n return this._domain;\n };\n BandScale.prototype.convert = function (d) {\n var i = this.index.get(d);\n if (i === undefined) {\n return NaN;\n }\n var r = this.ordinalRange[i];\n if (r === undefined) {\n return NaN;\n }\n return r;\n };\n Object.defineProperty(BandScale.prototype, \"bandwidth\", {\n get: function () {\n return this._bandwidth;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(BandScale.prototype, \"padding\", {\n get: function () {\n return this._paddingInner;\n },\n set: function (value) {\n value = Math.max(0, Math.min(1, value));\n this._paddingInner = value;\n this._paddingOuter = value;\n this.rescale();\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(BandScale.prototype, \"paddingInner\", {\n get: function () {\n return this._paddingInner;\n },\n set: function (value) {\n this._paddingInner = Math.max(0, Math.min(1, value)); // [0, 1]\n this.rescale();\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(BandScale.prototype, \"paddingOuter\", {\n get: function () {\n return this._paddingOuter;\n },\n set: function (value) {\n this._paddingOuter = Math.max(0, Math.min(1, value)); // [0, 1]\n this.rescale();\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(BandScale.prototype, \"round\", {\n get: function () {\n return this._round;\n },\n set: function (value) {\n this._round = value;\n this.rescale();\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(BandScale.prototype, \"align\", {\n get: function () {\n return this._align;\n },\n set: function (value) {\n this._align = Math.max(0, Math.min(1, value)); // [0, 1]\n this.rescale();\n },\n enumerable: true,\n configurable: true\n });\n BandScale.prototype.rescale = function () {\n var _a;\n var n = this._domain.length;\n if (!n) {\n return;\n }\n var _b = this._range, a = _b[0], b = _b[1];\n var reversed = b < a;\n if (reversed) {\n _a = [b, a], a = _a[0], b = _a[1];\n }\n var step = (b - a) / Math.max(1, n - this._paddingInner + this._paddingOuter * 2);\n if (this._round) {\n step = Math.floor(step);\n }\n a += (b - a - step * (n - this._paddingInner)) * this._align;\n this._bandwidth = step * (1 - this._paddingInner);\n if (this._round) {\n a = Math.round(a);\n this._bandwidth = Math.round(this._bandwidth);\n }\n var values = [];\n for (var i = 0; i < n; i++) {\n values.push(a + step * i);\n }\n this.ordinalRange = reversed ? values.reverse() : values;\n };\n return BandScale;\n}());\nexport { BandScale };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { BandScale } from \"../../scale/bandScale\";\nimport { ChartAxis } from \"../chartAxis\";\nvar CategoryAxis = /** @class */ (function (_super) {\n __extends(CategoryAxis, _super);\n function CategoryAxis() {\n var _this = _super.call(this) || this;\n var scale = new BandScale();\n scale.paddingInner = 0.2;\n scale.paddingOuter = 0.3;\n _this.scale = scale;\n return _this;\n }\n Object.defineProperty(CategoryAxis.prototype, \"paddingInner\", {\n get: function () {\n return this.scale.paddingInner;\n },\n set: function (value) {\n this.scale.paddingInner = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(CategoryAxis.prototype, \"paddingOuter\", {\n get: function () {\n return this.scale.paddingOuter;\n },\n set: function (value) {\n this.scale.paddingOuter = value;\n },\n enumerable: true,\n configurable: true\n });\n CategoryAxis.className = 'CategoryAxis';\n CategoryAxis.type = 'category';\n return CategoryAxis;\n}(ChartAxis));\nexport { CategoryAxis };\n","// Custom `Array.find` implementation for legacy browsers.\nexport function find(arr, predicate) {\n for (var i = 0; i < arr.length; i++) {\n var value = arr[i];\n if (predicate(value, i, arr)) {\n return value;\n }\n }\n}\nexport function findIndex(arr, predicate) {\n for (var i = 0; i < arr.length; i++) {\n if (predicate(arr[i], i, arr)) {\n return i;\n }\n }\n return -1;\n}\n/**\n * Returns the minimum and maximum value in the given iterable using natural order.\n * If the iterable contains no comparable values, returns `undefined`.\n * @param values\n */\nexport function extent(values) {\n var n = values.length;\n var i = -1;\n var value;\n var min;\n var max;\n while (++i < n) { // Find the first comparable finite value.\n if ((value = values[i]) != null && value >= value) {\n min = max = value;\n while (++i < n) { // Compare the remaining values.\n if ((value = values[i]) != null) {\n if (min > value) {\n min = value;\n }\n if (max < value) {\n max = value;\n }\n }\n }\n }\n }\n return typeof min === 'undefined' || typeof max === 'undefined' ? undefined : [min, max];\n}\nexport function finiteExtent(values) {\n var n = values.length;\n var i = -1;\n var value;\n var min;\n var max;\n while (++i < n) { // Find the first comparable finite value.\n if ((value = values[i]) != null && value >= value && isFinite(value)) {\n min = max = value;\n while (++i < n) { // Compare the remaining values.\n if ((value = values[i]) != null && isFinite(value)) {\n if (min > value) {\n min = value;\n }\n if (max < value) {\n max = value;\n }\n }\n }\n }\n }\n return min === undefined || max === undefined ? undefined : [min, max];\n}\n/**\n * This method will only return `undefined` if there's not a single valid finite number present\n * in the given array of values. Date values will be converted to timestamps.\n * @param values\n */\nexport function numericExtent(values) {\n var calculatedExtent = finiteExtent(values);\n if (typeof calculatedExtent === 'undefined') {\n return;\n }\n var a = calculatedExtent[0], b = calculatedExtent[1];\n var min = a instanceof Date ? a.getTime() : a;\n var max = b instanceof Date ? b.getTime() : b;\n if (typeof min === 'number' && isFinite(min) && typeof max === 'number' && isFinite(max)) {\n return [min, max];\n }\n}\n/**\n * finds the min and max using a process appropriate for stacked values. Ie,\n * summing up the positive and negative numbers, and returning the totals of each\n */\nexport function findMinMax(values) {\n var min = 0;\n var max = 0;\n for (var _i = 0, values_1 = values; _i < values_1.length; _i++) {\n var value = values_1[_i];\n if (value < 0) {\n min += value;\n }\n else {\n max += value;\n }\n }\n return { min: min, max: max };\n}\nexport function copy(array, start, count) {\n if (start === void 0) { start = 0; }\n if (count === void 0) { count = array.length; }\n var result = [];\n var n = array.length;\n if (n) {\n for (var i = 0; i < count; i++) {\n result.push(array[(start + i) % n]);\n }\n }\n return result;\n}\n","import { find } from \"../util/array\";\n/**\n * The tree layout is calculated in abstract x/y coordinates, where the root is at (0, 0)\n * and the tree grows downward from the root.\n */\nvar TreeNode = /** @class */ (function () {\n function TreeNode(label, parent, number) {\n if (label === void 0) { label = ''; }\n if (number === void 0) { number = 0; }\n this.x = 0;\n this.y = 0;\n this.subtreeLeft = NaN;\n this.subtreeRight = NaN;\n this.screenX = 0;\n this.screenY = 0;\n this.children = [];\n this.leafCount = 0;\n this.prelim = 0;\n this.mod = 0;\n this.ancestor = this;\n this.change = 0;\n this.shift = 0;\n this.label = label;\n // screenX and screenY are meant to be recomputed from (layout) x and y\n // when the tree is resized (without performing another layout)\n this.parent = parent;\n this.depth = parent ? parent.depth + 1 : 0;\n this.number = number;\n }\n TreeNode.prototype.getLeftSibling = function () {\n return this.number > 0 && this.parent ? this.parent.children[this.number - 1] : undefined;\n };\n TreeNode.prototype.getLeftmostSibling = function () {\n return this.number > 0 && this.parent ? this.parent.children[0] : undefined;\n };\n // traverse the left contour of a subtree, return the successor of v on this contour\n TreeNode.prototype.nextLeft = function () {\n return this.children ? this.children[0] : this.thread;\n };\n // traverse the right contour of a subtree, return the successor of v on this contour\n TreeNode.prototype.nextRight = function () {\n return this.children ? this.children[this.children.length - 1] : this.thread;\n };\n TreeNode.prototype.getSiblings = function () {\n var _this = this;\n return this.parent ? this.parent.children.filter(function (_, i) { return i !== _this.number; }) : [];\n };\n return TreeNode;\n}());\n/**\n * Converts an array of ticks, where each tick has an array of labels, to a label tree.\n * If `pad` is `true`, will ensure that every branch matches the depth of the tree by\n * creating empty labels.\n */\nexport function ticksToTree(ticks, pad) {\n if (pad === void 0) { pad = true; }\n var root = new TreeNode();\n var depth = 0;\n if (pad) {\n ticks.forEach(function (tick) { return depth = Math.max(depth, tick.labels.length); });\n }\n ticks.forEach(function (tick) {\n if (pad) {\n while (tick.labels.length < depth) {\n tick.labels.unshift('');\n }\n }\n insertTick(root, tick);\n });\n return root;\n}\nfunction insertTick(root, tick) {\n var pathParts = tick.labels.slice().reverse(); // path elements from root to leaf label\n var lastPartIndex = pathParts.length - 1;\n pathParts.forEach(function (pathPart, partIndex) {\n var children = root.children;\n var existingNode = find(children, function (child) { return child.label === pathPart; });\n var isNotLeaf = partIndex !== lastPartIndex;\n if (existingNode && isNotLeaf) { // the isNotLeaf check is to allow duplicate leafs\n root = existingNode;\n }\n else {\n var node = new TreeNode(pathPart, root);\n node.number = children.length;\n children.push(node);\n if (isNotLeaf) {\n root = node;\n }\n }\n });\n}\n// Shift the subtree.\nfunction moveSubtree(wm, wp, shift) {\n var subtrees = wp.number - wm.number;\n var ratio = shift / subtrees;\n wp.change -= ratio;\n wp.shift += shift;\n wm.change += ratio;\n wp.prelim += shift;\n wp.mod += shift;\n}\nfunction ancestor(vim, v, defaultAncestor) {\n return v.getSiblings().indexOf(vim.ancestor) >= 0 ? vim.ancestor : defaultAncestor;\n}\n// Spaces out the children.\nfunction executeShifts(v) {\n var children = v.children;\n if (children) {\n var shift = 0;\n var change = 0;\n for (var i = children.length - 1; i >= 0; i--) {\n var w = children[i];\n w.prelim += shift;\n w.mod += shift;\n change += w.change;\n shift += w.shift + change;\n }\n }\n}\n// Moves current subtree with v as the root if some nodes are conflicting in space.\nfunction apportion(v, defaultAncestor, distance) {\n var w = v.getLeftSibling();\n if (w) {\n var vop = v;\n var vip = v;\n var vim = w;\n var vom = vip.getLeftmostSibling();\n var sip = vip.mod;\n var sop = vop.mod;\n var sim = vim.mod;\n var som = vom.mod;\n while (vim.nextRight() && vip.nextLeft()) {\n vim = vim.nextRight();\n vip = vip.nextLeft();\n vom = vom.nextLeft();\n vop = vop.nextRight();\n vop.ancestor = v;\n var shift = (vim.prelim + sim) - (vip.prelim + sip) + distance;\n if (shift > 0) {\n moveSubtree(ancestor(vim, v, defaultAncestor), v, shift);\n sip += shift;\n sop += shift;\n }\n sim += vim.mod;\n sip += vip.mod;\n som += vom.mod;\n sop += vop.mod;\n }\n if (vim.nextRight() && !vop.nextRight()) {\n vop.thread = vim.nextRight();\n vop.mod += sim - sop;\n }\n else {\n if (vip.nextLeft() && !vom.nextLeft()) {\n vom.thread = vip.nextLeft();\n vom.mod += sip - som;\n }\n defaultAncestor = v;\n }\n }\n return defaultAncestor;\n}\n// Compute the preliminary x-coordinate of node and its children (recursively).\nfunction firstWalk(node, distance) {\n var children = node.children;\n if (children.length) {\n var defaultAncestor_1 = children[0];\n children.forEach(function (child) {\n firstWalk(child, distance);\n defaultAncestor_1 = apportion(child, defaultAncestor_1, distance);\n });\n executeShifts(node);\n var midpoint = (children[0].prelim + children[children.length - 1].prelim) / 2;\n var leftSibling = node.getLeftSibling();\n if (leftSibling) {\n node.prelim = leftSibling.prelim + distance;\n node.mod = node.prelim - midpoint;\n }\n else {\n node.prelim = midpoint;\n }\n }\n else {\n var leftSibling = node.getLeftSibling();\n node.prelim = leftSibling ? leftSibling.prelim + distance : 0;\n }\n}\nvar Dimensions = /** @class */ (function () {\n function Dimensions() {\n this.top = Infinity;\n this.right = -Infinity;\n this.bottom = -Infinity;\n this.left = Infinity;\n }\n Dimensions.prototype.update = function (node, xy) {\n var _a = xy(node), x = _a.x, y = _a.y;\n if (x > this.right) {\n this.right = x;\n }\n if (x < this.left) {\n this.left = x;\n }\n if (y > this.bottom) {\n this.bottom = y;\n }\n if (y < this.top) {\n this.top = y;\n }\n };\n return Dimensions;\n}());\nfunction secondWalk(v, m, layout) {\n v.x = v.prelim + m;\n v.y = v.depth;\n layout.update(v);\n v.children.forEach(function (w) { return secondWalk(w, m + v.mod, layout); });\n}\n// After the second walk the parent nodes are positioned at the center of their immediate children.\n// If we want the parent nodes to be positioned at the center of the subtree for which they are roots,\n// we need a third walk to adjust the positions.\nfunction thirdWalk(v) {\n var children = v.children;\n var leafCount = 0;\n children.forEach(function (w) {\n thirdWalk(w);\n if (w.children.length) {\n leafCount += w.leafCount;\n }\n else {\n leafCount++;\n }\n });\n v.leafCount = leafCount;\n if (children.length) {\n v.subtreeLeft = children[0].subtreeLeft;\n v.subtreeRight = children[v.children.length - 1].subtreeRight;\n v.x = (v.subtreeLeft + v.subtreeRight) / 2;\n }\n else {\n v.subtreeLeft = v.x;\n v.subtreeRight = v.x;\n }\n}\nexport function treeLayout(root) {\n var layout = new TreeLayout;\n firstWalk(root, 1);\n secondWalk(root, -root.prelim, layout);\n thirdWalk(root);\n return layout;\n}\nvar TreeLayout = /** @class */ (function () {\n function TreeLayout() {\n this.dimensions = new Dimensions;\n this.leafCount = 0;\n this.nodes = [];\n // One might want to process leaf nodes separately from the rest of the tree.\n // For example, position labels corresponding to leafs vertically, rather than horizontally.\n this.leafNodes = [];\n this.nonLeafNodes = [];\n this.depth = 0;\n }\n TreeLayout.prototype.update = function (node) {\n this.dimensions.update(node, function (node) { return ({ x: node.x, y: node.y }); });\n if (!node.children.length) {\n this.leafCount++;\n this.leafNodes.push(node);\n }\n else {\n this.nonLeafNodes.push(node);\n }\n if (node.depth > this.depth) {\n this.depth = node.depth;\n }\n this.nodes.push(node);\n };\n TreeLayout.prototype.resize = function (width, height, shiftX, shiftY, flipX) {\n if (shiftX === void 0) { shiftX = 0; }\n if (shiftY === void 0) { shiftY = 0; }\n if (flipX === void 0) { flipX = false; }\n var xSteps = this.leafCount - 1;\n var ySteps = this.depth;\n var dimensions = this.dimensions;\n var scalingX = 1;\n var scalingY = 1;\n if (width > 0 && xSteps) {\n var existingSpacingX = (dimensions.right - dimensions.left) / xSteps;\n var desiredSpacingX = width / xSteps;\n scalingX = desiredSpacingX / existingSpacingX;\n if (flipX) {\n scalingX = -scalingX;\n }\n }\n if (height > 0 && ySteps) {\n var existingSpacingY = (dimensions.bottom - dimensions.top) / ySteps;\n var desiredSpacingY = height / ySteps;\n scalingY = desiredSpacingY / existingSpacingY;\n }\n var screenDimensions = new Dimensions();\n this.nodes.forEach(function (node) {\n node.screenX = node.x * scalingX;\n node.screenY = node.y * scalingY;\n screenDimensions.update(node, function (node) { return ({ x: node.screenX, y: node.screenY }); });\n });\n // Normalize so that root top and leftmost leaf left start at zero.\n var offsetX = -screenDimensions.left;\n var offsetY = -screenDimensions.top;\n this.nodes.forEach(function (node) {\n node.screenX += offsetX + shiftX;\n node.screenY += offsetY + shiftY;\n });\n };\n return TreeLayout;\n}());\nexport { TreeLayout };\nfunction logTree(root, formatter) {\n root.children.forEach(function (child) { return logTree(child, formatter); });\n if (formatter) {\n console.log(formatter(root));\n }\n else {\n console.log(root);\n }\n}\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { Group } from \"../../scene/group\";\nimport { Selection } from \"../../scene/selection\";\nimport { Line } from \"../../scene/shape/line\";\nimport { normalizeAngle360, toRadians } from \"../../util/angle\";\nimport { Text } from \"../../scene/shape/text\";\nimport { BBox } from \"../../scene/bbox\";\nimport { Matrix } from \"../../scene/matrix\";\n// import { Rect } from \"../../scene/shape/rect\"; debug (bbox)\nimport { BandScale } from \"../../scale/bandScale\";\nimport { ticksToTree, treeLayout } from \"../../layout/tree\";\nimport { AxisLabel } from \"../../axis\";\nimport { ChartAxis } from \"../chartAxis\";\nimport { createId } from \"../../util/id\";\nvar GroupedCategoryAxisLabel = /** @class */ (function (_super) {\n __extends(GroupedCategoryAxisLabel, _super);\n function GroupedCategoryAxisLabel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.grid = false;\n return _this;\n }\n return GroupedCategoryAxisLabel;\n}(AxisLabel));\n/**\n * A general purpose linear axis with no notion of orientation.\n * The axis is always rendered vertically, with horizontal labels positioned to the left\n * of the axis line by default. The axis can be {@link rotation | rotated} by an arbitrary angle,\n * so that it can be used as a top, right, bottom, left, radial or any other kind\n * of linear axis.\n * The generic `D` parameter is the type of the domain of the axis' scale.\n * The output range of the axis' scale is always numeric (screen coordinates).\n */\nvar GroupedCategoryAxis = /** @class */ (function (_super) {\n __extends(GroupedCategoryAxis, _super);\n function GroupedCategoryAxis() {\n var _this = _super.call(this) || this;\n _this.id = createId(_this);\n // Label scale (labels are positionsed between ticks, tick count = label count + 1).\n // We don't call is `labelScale` for consistency with other axes.\n _this.tickScale = new BandScale();\n _this.group = new Group();\n _this.longestSeparatorLength = 0;\n _this.translation = {\n x: 0,\n y: 0\n };\n /**\n * Axis rotation angle in degrees.\n */\n _this.rotation = 0;\n _this.line = {\n width: 1,\n color: 'rgba(195, 195, 195, 1)'\n };\n // readonly tick = new AxisTick();\n _this.label = new GroupedCategoryAxisLabel();\n /**\n * The color of the labels.\n * Use `undefined` rather than `rgba(0, 0, 0, 0)` to make labels invisible.\n */\n _this.labelColor = 'rgba(87, 87, 87, 1)';\n var _a = _this, group = _a.group, tickScale = _a.tickScale;\n var scale = new BandScale();\n scale.paddingOuter = 0.1;\n scale.paddingInner = scale.paddingOuter * 2;\n _this.requestedRange = scale.range.slice();\n _this.scale = scale;\n tickScale.paddingInner = 1;\n tickScale.paddingOuter = 0;\n _this.gridLineSelection = Selection.select(group).selectAll();\n _this.axisLineSelection = Selection.select(group).selectAll();\n _this.separatorSelection = Selection.select(group).selectAll();\n _this.labelSelection = Selection.select(group).selectAll();\n return _this;\n // this.group.append(this.bboxRect); // debug (bbox)\n }\n Object.defineProperty(GroupedCategoryAxis.prototype, \"domain\", {\n get: function () {\n return this.scale.domain;\n },\n set: function (value) {\n this.scale.domain = value;\n var tickTree = ticksToTree(value);\n this.tickTreeLayout = treeLayout(tickTree);\n var domain = value.slice();\n domain.push('');\n this.tickScale.domain = domain;\n this.resizeTickTree();\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(GroupedCategoryAxis.prototype, \"range\", {\n get: function () {\n return this.requestedRange.slice();\n },\n set: function (value) {\n this.requestedRange = value.slice();\n this.updateRange();\n },\n enumerable: true,\n configurable: true\n });\n GroupedCategoryAxis.prototype.updateRange = function () {\n var _a = this, rr = _a.requestedRange, vr = _a.visibleRange, scale = _a.scale;\n var span = (rr[1] - rr[0]) / (vr[1] - vr[0]);\n var shift = span * vr[0];\n var start = rr[0] - shift;\n this.tickScale.range = scale.range = [start, start + span];\n this.resizeTickTree();\n };\n GroupedCategoryAxis.prototype.resizeTickTree = function () {\n var s = this.scale;\n var range = s.domain.length ? [s.convert(s.domain[0]), s.convert(s.domain[s.domain.length - 1])] : s.range;\n var layout = this.tickTreeLayout;\n var lineHeight = this.lineHeight;\n if (layout) {\n layout.resize(Math.abs(range[1] - range[0]), layout.depth * lineHeight, (Math.min(range[0], range[1]) || 0) + (s.bandwidth || 0) / 2, -layout.depth * lineHeight, (range[1] - range[0]) < 0);\n }\n };\n Object.defineProperty(GroupedCategoryAxis.prototype, \"lineHeight\", {\n get: function () {\n return this.label.fontSize * 1.5;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(GroupedCategoryAxis.prototype, \"gridLength\", {\n get: function () {\n return this._gridLength;\n },\n /**\n * The length of the grid. The grid is only visible in case of a non-zero value.\n */\n set: function (value) {\n // Was visible and now invisible, or was invisible and now visible.\n if (this._gridLength && !value || !this._gridLength && value) {\n this.gridLineSelection = this.gridLineSelection.remove().setData([]);\n this.labelSelection = this.labelSelection.remove().setData([]);\n }\n this._gridLength = value;\n },\n enumerable: true,\n configurable: true\n });\n /**\n * Creates/removes/updates the scene graph nodes that constitute the axis.\n * Supposed to be called _manually_ after changing _any_ of the axis properties.\n * This allows to bulk set axis properties before updating the nodes.\n * The node changes made by this method are rendered on the next animation frame.\n * We could schedule this method call automatically on the next animation frame\n * when any of the axis properties change (the way we do when properties of scene graph's\n * nodes change), but this will mean that we first wait for the next animation\n * frame to make changes to the nodes of the axis, then wait for another animation\n * frame to render those changes. It's nice to have everything update automatically,\n * but this extra level of async indirection will not just introduce an unwanted delay,\n * it will also make it harder to reason about the program.\n */\n GroupedCategoryAxis.prototype.update = function () {\n var _this = this;\n var _a = this, group = _a.group, scale = _a.scale, label = _a.label, tickScale = _a.tickScale, requestedRange = _a.requestedRange;\n var rangeStart = scale.range[0];\n var rangeEnd = scale.range[1];\n var rangeLength = Math.abs(rangeEnd - rangeStart);\n var bandwidth = (rangeLength / scale.domain.length) || 0;\n var parallelLabels = label.parallel;\n var rotation = toRadians(this.rotation);\n var isHorizontal = Math.abs(Math.cos(rotation)) < 1e-8;\n var labelRotation = normalizeAngle360(toRadians(this.label.rotation));\n group.translationX = this.translation.x;\n group.translationY = this.translation.y;\n group.rotation = rotation;\n var title = this.title;\n // The Text `node` of the Caption is not used to render the title of the grouped category axis.\n // The phantom root of the tree layout is used instead.\n if (title) {\n title.node.visible = false;\n }\n var lineHeight = this.lineHeight;\n // Render ticks and labels.\n var tickTreeLayout = this.tickTreeLayout;\n var labels = scale.ticks();\n var treeLabels = tickTreeLayout ? tickTreeLayout.nodes : [];\n var isLabelTree = tickTreeLayout ? tickTreeLayout.depth > 1 : false;\n var ticks = tickScale.ticks();\n // The side of the axis line to position the labels on.\n // -1 = left (default)\n // 1 = right\n var sideFlag = label.mirrored ? 1 : -1;\n // When labels are parallel to the axis line, the `parallelFlipFlag` is used to\n // flip the labels to avoid upside-down text, when the axis is rotated\n // such that it is in the right hemisphere, i.e. the angle of rotation\n // is in the [0, π] interval.\n // The rotation angle is normalized, so that we have an easier time checking\n // if it's in the said interval. Since the axis is always rendered vertically\n // and then rotated, zero rotation means 12 (not 3) o-clock.\n // -1 = flip\n // 1 = don't flip (default)\n var parallelFlipRotation = normalizeAngle360(rotation);\n var parallelFlipFlag = (!labelRotation && parallelFlipRotation >= 0 && parallelFlipRotation <= Math.PI) ? -1 : 1;\n var regularFlipRotation = normalizeAngle360(rotation - Math.PI / 2);\n // Flip if the axis rotation angle is in the top hemisphere.\n var regularFlipFlag = (!labelRotation && regularFlipRotation >= 0 && regularFlipRotation <= Math.PI) ? -1 : 1;\n var updateGridLines = this.gridLineSelection.setData(this.gridLength ? ticks : []);\n updateGridLines.exit.remove();\n var enterGridLines = updateGridLines.enter.append(Line);\n var gridLineSelection = updateGridLines.merge(enterGridLines);\n var updateLabels = this.labelSelection.setData(treeLabels);\n updateLabels.exit.remove();\n var enterLabels = updateLabels.enter.append(Text);\n var labelSelection = updateLabels.merge(enterLabels);\n var labelFormatter = label.formatter;\n var maxLeafLabelWidth = 0;\n labelSelection\n .each(function (node, datum, index) {\n node.fontStyle = label.fontStyle;\n node.fontWeight = label.fontWeight;\n node.fontSize = label.fontSize;\n node.fontFamily = label.fontFamily;\n node.fill = label.color;\n node.textBaseline = parallelFlipFlag === -1 ? 'bottom' : 'hanging';\n // label.textBaseline = parallelLabels && !labelRotation\n // ? (sideFlag * parallelFlipFlag === -1 ? 'hanging' : 'bottom')\n // : 'middle';\n node.textAlign = 'center';\n node.translationX = datum.screenY - label.fontSize * 0.25;\n node.translationY = datum.screenX;\n if (index === 0) { // use the phantom root as the axis title\n if (title && title.enabled && labels.length > 0) {\n node.visible = true;\n node.text = title.text;\n node.fontSize = title.fontSize;\n node.fontStyle = title.fontStyle;\n node.fontWeight = title.fontWeight;\n node.fontFamily = title.fontFamily;\n node.textBaseline = 'hanging';\n }\n else {\n node.visible = false;\n }\n }\n else {\n node.text = labelFormatter\n ? labelFormatter({\n value: String(datum.label),\n index: index\n })\n : String(datum.label);\n node.visible =\n datum.screenX >= requestedRange[0] &&\n datum.screenX <= requestedRange[1];\n }\n var bbox = node.computeBBox();\n if (bbox && bbox.width > maxLeafLabelWidth) {\n maxLeafLabelWidth = bbox.width;\n }\n });\n var labelX = sideFlag * label.padding;\n var autoRotation = parallelLabels\n ? parallelFlipFlag * Math.PI / 2\n : (regularFlipFlag === -1 ? Math.PI : 0);\n var labelGrid = this.label.grid;\n var separatorData = [];\n labelSelection.each(function (label, datum, index) {\n label.x = labelX;\n label.rotationCenterX = labelX;\n if (!datum.children.length) {\n label.rotation = labelRotation;\n label.textAlign = 'end';\n label.textBaseline = 'middle';\n }\n else {\n label.translationX -= maxLeafLabelWidth - lineHeight + _this.label.padding;\n if (isHorizontal) {\n label.rotation = autoRotation;\n }\n else {\n label.rotation = -Math.PI / 2;\n }\n }\n // Calculate positions of label separators for all nodes except the root.\n // Each separator is placed to the top of the current label.\n if (datum.parent && isLabelTree) {\n var y = !datum.children.length\n ? datum.screenX - bandwidth / 2\n : datum.screenX - datum.leafCount * bandwidth / 2;\n if (!datum.children.length) {\n if ((datum.number !== datum.children.length - 1) || labelGrid) {\n separatorData.push({\n y: y,\n x1: 0,\n x2: -maxLeafLabelWidth - _this.label.padding * 2,\n toString: function () { return String(index); }\n });\n }\n }\n else {\n var x = -maxLeafLabelWidth - _this.label.padding * 2 + datum.screenY;\n separatorData.push({\n y: y,\n x1: x + lineHeight,\n x2: x,\n toString: function () { return String(index); }\n });\n }\n }\n });\n // Calculate the position of the long separator on the far bottom of the axis.\n var minX = 0;\n separatorData.forEach(function (d) { return minX = Math.min(minX, d.x2); });\n this.longestSeparatorLength = Math.abs(minX);\n separatorData.push({\n y: Math.max(rangeStart, rangeEnd),\n x1: 0,\n x2: minX,\n toString: function () { return String(separatorData.length); }\n });\n var updateSeparators = this.separatorSelection.setData(separatorData);\n updateSeparators.exit.remove();\n var enterSeparators = updateSeparators.enter.append(Line);\n var separatorSelection = updateSeparators.merge(enterSeparators);\n this.separatorSelection = separatorSelection;\n var epsilon = 0.0000001;\n separatorSelection.each(function (line, datum, i) {\n line.x1 = datum.x1;\n line.x2 = datum.x2;\n line.y1 = datum.y;\n line.y2 = datum.y;\n line.visible = datum.y >= requestedRange[0] - epsilon && datum.y <= requestedRange[1] + epsilon;\n line.stroke = _this.tick.color;\n line.fill = undefined;\n line.strokeWidth = 1;\n });\n this.gridLineSelection = gridLineSelection;\n this.labelSelection = labelSelection;\n // Render axis lines.\n var lineCount = tickTreeLayout ? tickTreeLayout.depth + 1 : 1;\n var lines = [];\n for (var i = 0; i < lineCount; i++) {\n lines.push(i);\n }\n var updateAxisLines = this.axisLineSelection.setData(lines);\n updateAxisLines.exit.remove();\n var enterAxisLines = updateAxisLines.enter.append(Line);\n var axisLineSelection = updateAxisLines.merge(enterAxisLines);\n this.axisLineSelection = axisLineSelection;\n axisLineSelection.each(function (line, _, index) {\n var x = index > 0 ? -maxLeafLabelWidth - _this.label.padding * 2 - (index - 1) * lineHeight : 0;\n line.x1 = x;\n line.x2 = x;\n line.y1 = requestedRange[0];\n line.y2 = requestedRange[1];\n line.strokeWidth = _this.line.width;\n line.stroke = _this.line.color;\n line.visible = labels.length > 0 && (index === 0 || (labelGrid && isLabelTree));\n });\n if (this.gridLength) {\n var styles_1 = this.gridStyle;\n var styleCount_1 = styles_1.length;\n gridLineSelection\n .each(function (line, datum, index) {\n var y = Math.round(tickScale.convert(datum));\n line.x1 = 0;\n line.x2 = -sideFlag * _this.gridLength;\n line.y1 = y;\n line.y2 = y;\n line.visible = y >= requestedRange[0] && y <= requestedRange[1] &&\n Math.abs(line.parent.translationY - rangeStart) > 1;\n var style = styles_1[index % styleCount_1];\n line.stroke = style.stroke;\n line.strokeWidth = _this.tick.width;\n line.lineDash = style.lineDash;\n line.fill = undefined;\n });\n }\n // debug (bbox)\n // const bbox = this.computeBBox();\n // const bboxRect = this.bboxRect;\n // bboxRect.x = bbox.x;\n // bboxRect.y = bbox.y;\n // bboxRect.width = bbox.width;\n // bboxRect.height = bbox.height;\n };\n GroupedCategoryAxis.prototype.computeBBox = function (options) {\n var includeTitle = !options || !options.excludeTitle;\n var left = Infinity;\n var right = -Infinity;\n var top = Infinity;\n var bottom = -Infinity;\n this.labelSelection.each(function (label, _, index) {\n // The label itself is rotated, but not translated, the group that\n // contains it is. So to capture the group transform in the label bbox\n // calculation we combine the transform matrices of the label and the group.\n // Depending on the timing of the `axis.computeBBox()` method call, we may\n // not have the group's and the label's transform matrices updated yet (because\n // the transform matrix is not recalculated whenever a node's transform attributes\n // change, instead it's marked for recalculation on the next frame by setting\n // the node's `dirtyTransform` flag to `true`), so we force them to update\n // right here by calling `computeTransformMatrix`.\n if (index > 0 || includeTitle) { // first node is the root (title)\n label.computeTransformMatrix();\n var matrix = Matrix.flyweight(label.matrix);\n var labelBBox = label.computeBBox();\n if (labelBBox) {\n var bbox = matrix.transformBBox(labelBBox);\n left = Math.min(left, bbox.x);\n right = Math.max(right, bbox.x + bbox.width);\n top = Math.min(top, bbox.y);\n bottom = Math.max(bottom, bbox.y + bbox.height);\n }\n }\n });\n return new BBox(left, top, Math.max(right - left, this.longestSeparatorLength), bottom - top);\n };\n // debug (bbox)\n // private bboxRect = (() => {\n // const rect = new Rect();\n // rect.fill = undefined;\n // rect.stroke = 'red';\n // rect.strokeWidth = 1;\n // rect.strokeOpacity = 0.7;\n // return rect;\n // })();\n GroupedCategoryAxis.className = 'GroupedCategoryAxis';\n GroupedCategoryAxis.type = 'groupedCategory';\n return GroupedCategoryAxis;\n}(ChartAxis));\nexport { GroupedCategoryAxis };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar t0 = new Date;\nvar t1 = new Date;\n/**\n * The interval methods don't mutate Date parameters.\n */\nvar TimeInterval = /** @class */ (function () {\n function TimeInterval(floor, offset) {\n this._floor = floor;\n this._offset = offset;\n }\n /**\n * Returns a new date representing the latest interval boundary date before or equal to date.\n * For example, `day.floor(date)` typically returns 12:00 AM local time on the given date.\n * @param date\n */\n TimeInterval.prototype.floor = function (date) {\n date = new Date(+date);\n this._floor(date);\n return date;\n };\n /**\n * Returns a new date representing the earliest interval boundary date after or equal to date.\n * @param date\n */\n TimeInterval.prototype.ceil = function (date) {\n date = new Date(+date - 1);\n this._floor(date);\n this._offset(date, 1);\n this._floor(date);\n return date;\n };\n /**\n * Returns a new date representing the closest interval boundary date to date.\n * @param date\n */\n TimeInterval.prototype.round = function (date) {\n var d0 = this.floor(date);\n var d1 = this.ceil(date);\n var ms = +date;\n return ms - d0.getTime() < d1.getTime() - ms ? d0 : d1;\n };\n /**\n * Returns a new date equal to date plus step intervals.\n * @param date\n * @param step\n */\n TimeInterval.prototype.offset = function (date, step) {\n if (step === void 0) { step = 1; }\n date = new Date(+date);\n this._offset(date, Math.floor(step));\n return date;\n };\n /**\n * Returns an array of dates representing every interval boundary after or equal to start (inclusive) and before stop (exclusive).\n * @param start\n * @param stop\n * @param step\n */\n TimeInterval.prototype.range = function (start, stop, step) {\n if (step === void 0) { step = 1; }\n var range = [];\n start = this.ceil(start);\n step = Math.floor(step);\n if (start > stop || step <= 0) {\n return range;\n }\n var previous;\n do {\n previous = new Date(+start);\n range.push(previous);\n this._offset(start, step);\n this._floor(start);\n } while (previous < start && start < stop);\n return range;\n };\n // Returns an interval that is a subset of this interval.\n // For example, to create an interval that return 1st, 11th, 21st and 31st of each month:\n // day.filter(date => (date.getDate() - 1) % 10 === 0)\n TimeInterval.prototype.filter = function (test) {\n var _this = this;\n var floor = function (date) {\n if (date >= date) {\n while (_this._floor(date), !test(date)) {\n date.setTime(date.getTime() - 1);\n }\n }\n return date;\n };\n var offset = function (date, step) {\n if (date >= date) {\n if (step < 0) {\n while (++step <= 0) {\n do {\n _this._offset(date, -1);\n } while (!test(date));\n }\n }\n else {\n while (--step >= 0) {\n do {\n _this._offset(date, 1);\n } while (!test(date));\n }\n }\n }\n return date;\n };\n return new TimeInterval(floor, offset);\n };\n return TimeInterval;\n}());\nexport { TimeInterval };\nvar CountableTimeInterval = /** @class */ (function (_super) {\n __extends(CountableTimeInterval, _super);\n function CountableTimeInterval(floor, offset, count, field) {\n var _this = _super.call(this, floor, offset) || this;\n _this._count = count;\n _this._field = field;\n return _this;\n }\n /**\n * Returns the number of interval boundaries after start (exclusive) and before or equal to end (inclusive).\n * @param start\n * @param end\n */\n CountableTimeInterval.prototype.count = function (start, end) {\n t0.setTime(+start);\n t1.setTime(+end);\n this._floor(t0);\n this._floor(t1);\n return Math.floor(this._count(t0, t1));\n };\n /**\n * Returns a filtered view of this interval representing every step'th date.\n * The meaning of step is dependent on this interval’s parent interval as defined by the `field` function.\n * @param step\n */\n CountableTimeInterval.prototype.every = function (step) {\n var _this = this;\n var result;\n step = Math.floor(step);\n if (isFinite(step) && step > 0) {\n if (step > 1) {\n var field_1 = this._field;\n if (field_1) {\n result = this.filter(function (d) { return field_1(d) % step === 0; });\n }\n else {\n result = this.filter(function (d) { return _this.count(0, d) % step === 0; });\n }\n }\n else {\n result = this;\n }\n }\n return result;\n };\n return CountableTimeInterval;\n}(TimeInterval));\nexport { CountableTimeInterval };\n","import { CountableTimeInterval } from \"./interval\";\nfunction floor(date) {\n return date;\n}\nfunction offset(date, milliseconds) {\n date.setTime(date.getTime() + milliseconds);\n}\nfunction count(start, end) {\n return end.getTime() - start.getTime();\n}\nexport var millisecond = new CountableTimeInterval(floor, offset, count);\nexport default millisecond;\n","// Common time unit sizes in milliseconds.\nexport var durationSecond = 1000;\nexport var durationMinute = durationSecond * 60;\nexport var durationHour = durationMinute * 60;\nexport var durationDay = durationHour * 24;\nexport var durationWeek = durationDay * 7;\nexport var durationMonth = durationDay * 30;\nexport var durationYear = durationDay * 365;\n","import { CountableTimeInterval } from \"./interval\";\nimport { durationSecond } from \"./duration\";\nfunction floor(date) {\n date.setTime(date.getTime() - date.getMilliseconds());\n}\nfunction offset(date, seconds) {\n date.setTime(date.getTime() + seconds * durationSecond);\n}\nfunction count(start, end) {\n return (end.getTime() - start.getTime()) / durationSecond;\n}\nexport var second = new CountableTimeInterval(floor, offset, count);\nexport default second;\n","import { CountableTimeInterval } from \"./interval\";\nimport { durationMinute, durationSecond } from \"./duration\";\nfunction floor(date) {\n date.setTime(date.getTime() - date.getMilliseconds() - date.getSeconds() * durationSecond);\n}\nfunction offset(date, minutes) {\n date.setTime(date.getTime() + minutes * durationMinute);\n}\nfunction count(start, end) {\n return (end.getTime() - start.getTime()) / durationMinute;\n}\nfunction field(date) {\n return date.getMinutes();\n}\nexport var minute = new CountableTimeInterval(floor, offset, count, field);\nexport default minute;\n","import { CountableTimeInterval } from \"./interval\";\nimport { durationHour, durationMinute, durationSecond } from \"./duration\";\nfunction floor(date) {\n date.setTime(date.getTime() - date.getMilliseconds() - date.getSeconds() * durationSecond - date.getMinutes() * durationMinute);\n}\nfunction offset(date, hours) {\n date.setTime(date.getTime() + hours * durationHour);\n}\nfunction count(start, end) {\n return (end.getTime() - start.getTime()) / durationHour;\n}\nfunction field(date) {\n return date.getHours();\n}\nexport var hour = new CountableTimeInterval(floor, offset, count, field);\nexport default hour;\n","import { CountableTimeInterval } from \"./interval\";\nimport { durationDay, durationMinute } from \"./duration\";\nfunction floor(date) {\n date.setHours(0, 0, 0, 0);\n}\nfunction offset(date, days) {\n date.setDate(date.getDate() + days);\n}\nfunction count(start, end) {\n var tzMinuteDelta = end.getTimezoneOffset() - start.getTimezoneOffset();\n return (end.getTime() - start.getTime() - tzMinuteDelta * durationMinute) / durationDay;\n}\nfunction field(date) {\n return date.getDate() - 1;\n}\nexport var day = new CountableTimeInterval(floor, offset, count, field);\nexport default day;\n","import { durationMinute, durationWeek } from \"./duration\";\nimport { CountableTimeInterval } from \"./interval\";\n// Set date to n-th day of the week.\nfunction weekday(n) {\n // Sets the `date` to the start of the `n`-th day of the current week.\n // n == 0 is Sunday.\n function floor(date) {\n // 1..31 1..7\n date.setDate(date.getDate() - (date.getDay() + 7 - n) % 7);\n date.setHours(0, 0, 0, 0); // h, m, s, ms\n }\n // Offset the date by the given number of weeks.\n function offset(date, weeks) {\n date.setDate(date.getDate() + weeks * 7);\n }\n // Count the number of weeks between the start and end dates.\n function count(start, end) {\n var msDelta = end.getTime() - start.getTime();\n var tzMinuteDelta = end.getTimezoneOffset() - start.getTimezoneOffset();\n return (msDelta - tzMinuteDelta * durationMinute) / durationWeek;\n }\n return new CountableTimeInterval(floor, offset, count);\n}\nexport var sunday = weekday(0);\nexport var monday = weekday(1);\nexport var tuesday = weekday(2);\nexport var wednesday = weekday(3);\nexport var thursday = weekday(4);\nexport var friday = weekday(5);\nexport var saturday = weekday(6);\nexport default sunday;\n","import { CountableTimeInterval } from \"./interval\";\nfunction floor(date) {\n date.setDate(1);\n date.setHours(0, 0, 0, 0);\n}\nfunction offset(date, months) {\n date.setMonth(date.getMonth() + months);\n}\nfunction count(start, end) {\n return end.getMonth() - start.getMonth() + (end.getFullYear() - start.getFullYear()) * 12;\n}\nfunction field(date) {\n return date.getMonth();\n}\nexport var month = new CountableTimeInterval(floor, offset, count, field);\nexport default month;\n","import { CountableTimeInterval } from \"./interval\";\nfunction floor(date) {\n date.setMonth(0, 1);\n date.setHours(0, 0, 0, 0);\n}\nfunction offset(date, years) {\n date.setFullYear(date.getFullYear() + years);\n}\nfunction count(start, end) {\n return end.getFullYear() - start.getFullYear();\n}\nfunction field(date) {\n return date.getFullYear();\n}\nexport var year = new CountableTimeInterval(floor, offset, count, field);\nexport default year;\n","import { CountableTimeInterval } from \"./interval\";\nimport { durationDay } from \"./duration\";\nfunction floor(date) {\n date.setUTCHours(0, 0, 0, 0);\n}\nfunction offset(date, days) {\n date.setUTCDate(date.getUTCDate() + days);\n}\nfunction count(start, end) {\n return (end.getTime() - start.getTime()) / durationDay;\n}\nfunction field(date) {\n return date.getUTCDate() - 1;\n}\nexport var utcDay = new CountableTimeInterval(floor, offset, count, field);\nexport default utcDay;\n","import { CountableTimeInterval } from \"./interval\";\nfunction floor(date) {\n date.setUTCMonth(0, 1);\n date.setUTCHours(0, 0, 0, 0);\n}\nfunction offset(date, years) {\n date.setUTCFullYear(date.getUTCFullYear() + years);\n}\nfunction count(start, end) {\n return end.getUTCFullYear() - start.getUTCFullYear();\n}\nfunction field(date) {\n return date.getUTCFullYear();\n}\nexport var utcYear = new CountableTimeInterval(floor, offset, count, field);\nexport default utcYear;\n","import { durationWeek } from \"./duration\";\nimport { CountableTimeInterval } from \"./interval\";\n// Set date to n-th day of the week.\nfunction weekday(n) {\n // Sets the `date` to the start of the `n`-th day of the current week.\n // n == 0 is Sunday.\n function floor(date) {\n date.setUTCDate(date.getUTCDate() - (date.getUTCDay() + 7 - n) % 7);\n date.setHours(0, 0, 0, 0); // h, m, s, ms\n }\n // Offset the date by the given number of weeks.\n function offset(date, weeks) {\n date.setUTCDate(date.getUTCDate() + weeks * 7);\n }\n // Count the number of weeks between the start and end dates.\n function count(start, end) {\n return (end.getTime() - start.getTime()) / durationWeek;\n }\n return new CountableTimeInterval(floor, offset, count);\n}\nexport var utcSunday = weekday(0);\nexport var utcMonday = weekday(1);\nexport var utcTuesday = weekday(2);\nexport var utcWednesday = weekday(3);\nexport var utcThursday = weekday(4);\nexport var utcFriday = weekday(5);\nexport var utcSaturday = weekday(6);\nexport default utcSunday;\n","import timeDay from \"../day\";\nimport year from \"../year\";\nimport { sunday as timeSunday, monday as timeMonday, thursday as timeThursday, } from \"../week\";\nimport utcDay from \"../utcDay\";\nimport utcYear from \"../utcYear\";\nimport utcSunday, { utcMonday, utcThursday } from \"../utcWeek\";\nfunction localDate(d) {\n // For JS Dates the [0, 100) interval is a time warp, a fast forward to the 20th century.\n // For example, -1 is -0001 BC, 0 is already 1900 AD.\n if (d.y >= 0 && d.y < 100) {\n var date = new Date(-1, d.m, d.d, d.H, d.M, d.S, d.L);\n date.setFullYear(d.y);\n return date;\n }\n return new Date(d.y, d.m, d.d, d.H, d.M, d.S, d.L);\n}\nfunction utcDate(d) {\n if (d.y >= 0 && d.y < 100) {\n var date = new Date(Date.UTC(-1, d.m, d.d, d.H, d.M, d.S, d.L));\n date.setUTCFullYear(d.y);\n return date;\n }\n return new Date(Date.UTC(d.y, d.m, d.d, d.H, d.M, d.S, d.L));\n}\n/**\n * Creates a lookup map for array of names to go from a name to index.\n * @param names\n */\nfunction formatLookup(names) {\n var map = {};\n for (var i = 0, n = names.length; i < n; i++) {\n map[names[i].toLowerCase()] = i;\n }\n return map;\n}\nfunction newYear(y) {\n return {\n y: y,\n m: 0,\n d: 1,\n H: 0,\n M: 0,\n S: 0,\n L: 0\n };\n}\nvar percentCharCode = 37;\nvar numberRe = /^\\s*\\d+/; // ignores next directive\nvar percentRe = /^%/;\nvar requoteRe = /[\\\\^$*+?|[\\]().{}]/g;\n/**\n * Prepends any character in the `requoteRe` set with a backslash.\n * @param s\n */\nexport var requote = function (s) { return s.replace(requoteRe, '\\\\$&'); }; // $& - matched substring\n/**\n * Returns a RegExp that matches any string that starts with any of the given names (case insensitive).\n * @param names\n */\nexport var formatRe = function (names) { return new RegExp('^(?:' + names.map(requote).join('|') + ')', 'i'); };\n// A map of padding modifiers to padding strings. Default is `0`.\nvar pads = {\n '-': '',\n '_': ' ',\n '0': '0'\n};\nexport function pad(value, fill, width) {\n var sign = value < 0 ? '-' : '';\n var string = String(sign ? -value : value);\n var length = string.length;\n return sign + (length < width ? new Array(width - length + 1).join(fill) + string : string);\n}\n/**\n * Create a new time-locale-based object which exposes time-formatting\n * methods for the specified locale definition.\n *\n * @param timeLocale A time locale definition.\n */\nexport default function formatLocale(timeLocale) {\n var lDateTime = timeLocale.dateTime;\n var lDate = timeLocale.date;\n var lTime = timeLocale.time;\n var lPeriods = timeLocale.periods;\n var lWeekdays = timeLocale.days;\n var lShortWeekdays = timeLocale.shortDays;\n var lMonths = timeLocale.months;\n var lShortMonths = timeLocale.shortMonths;\n var periodRe = formatRe(lPeriods);\n var periodLookup = formatLookup(lPeriods);\n var weekdayRe = formatRe(lWeekdays);\n var weekdayLookup = formatLookup(lWeekdays);\n var shortWeekdayRe = formatRe(lShortWeekdays);\n var shortWeekdayLookup = formatLookup(lShortWeekdays);\n var monthRe = formatRe(lMonths);\n var monthLookup = formatLookup(lMonths);\n var shortMonthRe = formatRe(lShortMonths);\n var shortMonthLookup = formatLookup(lShortMonths);\n var formats = {\n 'a': formatShortWeekday,\n 'A': formatWeekday,\n 'b': formatShortMonth,\n 'B': formatMonth,\n 'c': undefined,\n 'd': formatDayOfMonth,\n 'e': formatDayOfMonth,\n 'f': formatMicroseconds,\n 'H': formatHour24,\n 'I': formatHour12,\n 'j': formatDayOfYear,\n 'L': formatMilliseconds,\n 'm': formatMonthNumber,\n 'M': formatMinutes,\n 'p': formatPeriod,\n 'Q': formatUnixTimestamp,\n 's': formatUnixTimestampSeconds,\n 'S': formatSeconds,\n 'u': formatWeekdayNumberMonday,\n 'U': formatWeekNumberSunday,\n 'V': formatWeekNumberISO,\n 'w': formatWeekdayNumberSunday,\n 'W': formatWeekNumberMonday,\n 'x': undefined,\n 'X': undefined,\n 'y': formatYear,\n 'Y': formatFullYear,\n 'Z': formatZone,\n '%': formatLiteralPercent\n };\n var utcFormats = {\n 'a': formatUTCShortWeekday,\n 'A': formatUTCWeekday,\n 'b': formatUTCShortMonth,\n 'B': formatUTCMonth,\n 'c': undefined,\n 'd': formatUTCDayOfMonth,\n 'e': formatUTCDayOfMonth,\n 'f': formatUTCMicroseconds,\n 'H': formatUTCHour24,\n 'I': formatUTCHour12,\n 'j': formatUTCDayOfYear,\n 'L': formatUTCMilliseconds,\n 'm': formatUTCMonthNumber,\n 'M': formatUTCMinutes,\n 'p': formatUTCPeriod,\n 'Q': formatUnixTimestamp,\n 's': formatUnixTimestampSeconds,\n 'S': formatUTCSeconds,\n 'u': formatUTCWeekdayNumberMonday,\n 'U': formatUTCWeekNumberSunday,\n 'V': formatUTCWeekNumberISO,\n 'w': formatUTCWeekdayNumberSunday,\n 'W': formatUTCWeekNumberMonday,\n 'x': undefined,\n 'X': undefined,\n 'y': formatUTCYear,\n 'Y': formatUTCFullYear,\n 'Z': formatUTCZone,\n '%': formatLiteralPercent\n };\n var parses = {\n 'a': parseShortWeekday,\n 'A': parseWeekday,\n 'b': parseShortMonth,\n 'B': parseMonth,\n 'c': parseLocaleDateTime,\n 'd': parseDayOfMonth,\n 'e': parseDayOfMonth,\n 'f': parseMicroseconds,\n 'H': parseHour24,\n 'I': parseHour24,\n 'j': parseDayOfYear,\n 'L': parseMilliseconds,\n 'm': parseMonthNumber,\n 'M': parseMinutes,\n 'p': parsePeriod,\n 'Q': parseUnixTimestamp,\n 's': parseUnixTimestampSeconds,\n 'S': parseSeconds,\n 'u': parseWeekdayNumberMonday,\n 'U': parseWeekNumberSunday,\n 'V': parseWeekNumberISO,\n 'w': parseWeekdayNumberSunday,\n 'W': parseWeekNumberMonday,\n 'x': parseLocaleDate,\n 'X': parseLocaleTime,\n 'y': parseYear,\n 'Y': parseFullYear,\n 'Z': parseZone,\n '%': parseLiteralPercent\n };\n // Recursive definitions.\n formats.x = newFormat(lDate, formats);\n formats.X = newFormat(lTime, formats);\n formats.c = newFormat(lDateTime, formats);\n utcFormats.x = newFormat(lDate, utcFormats);\n utcFormats.X = newFormat(lTime, utcFormats);\n utcFormats.c = newFormat(lDateTime, utcFormats);\n function newParse(specifier, newDate) {\n return function (str) {\n var d = newYear(1900);\n var i = parseSpecifier(d, specifier, str += '', 0);\n if (i != str.length) {\n return undefined;\n }\n // If a UNIX timestamp is specified, return it.\n if ('Q' in d) {\n return new Date(d.Q);\n }\n // The am-pm flag is 0 for AM, and 1 for PM.\n if ('p' in d) {\n d.H = d.H % 12 + d.p * 12;\n }\n // Convert day-of-week and week-of-year to day-of-year.\n if ('V' in d) {\n if (d.V < 1 || d.V > 53) {\n return undefined;\n }\n if (!('w' in d)) {\n d.w = 1;\n }\n if ('Z' in d) {\n var week = utcDate(newYear(d.y));\n var day = week.getUTCDay();\n week = day > 4 || day === 0 ? utcMonday.ceil(week) : utcMonday.floor(week);\n week = utcDay.offset(week, (d.V - 1) * 7);\n d.y = week.getUTCFullYear();\n d.m = week.getUTCMonth();\n d.d = week.getUTCDate() + (d.w + 6) % 7;\n }\n else {\n var week = newDate(newYear(d.y));\n var day = week.getDay();\n week = day > 4 || day === 0 ? timeMonday.ceil(week) : timeMonday.floor(week);\n week = timeDay.offset(week, (d.V - 1) * 7);\n d.y = week.getFullYear();\n d.m = week.getMonth();\n d.d = week.getDate() + (d.w + 6) % 7;\n }\n }\n else if ('W' in d || 'U' in d) {\n if (!('w' in d)) {\n d.w = 'u' in d\n ? d.u % 7\n : 'W' in d ? 1 : 0;\n }\n var day = 'Z' in d ? utcDate(newYear(d.y)).getUTCDay() : newDate(newYear(d.y)).getDay();\n d.m = 0;\n d.d = 'W' in d ? (d.w + 6) % 7 + d.W * 7 - (day + 5) % 7 : d.w + d.U * 7 - (day + 6) % 7;\n }\n // If a time zone is specified, all fields are interpreted as UTC and then\n // offset according to the specified time zone.\n if ('Z' in d) {\n d.H += d.Z / 100 | 0;\n d.M += d.Z % 100;\n return utcDate(d);\n }\n // Otherwise, all fields are in local time.\n return newDate(d);\n };\n }\n /**\n * Creates a new function that formats the given Date or timestamp according to specifier.\n * @param specifier\n * @param formats\n */\n function newFormat(specifier, formats) {\n return function (date) {\n var string = [];\n var n = specifier.length;\n var i = -1;\n var j = 0;\n if (!(date instanceof Date)) {\n date = new Date(+date);\n }\n while (++i < n) {\n if (specifier.charCodeAt(i) === percentCharCode) {\n string.push(specifier.slice(j, i)); // copy the chunks of specifier with no directives as is\n var c = specifier.charAt(++i);\n var pad_1 = pads[c];\n if (pad_1 != undefined) { // if format directive has a padding modifier in front of it\n c = specifier.charAt(++i); // fetch the directive itself\n }\n else {\n pad_1 = c === 'e' ? ' ' : '0'; // use the default padding modifier\n }\n var format = formats[c];\n if (format) { // if the directive has a corresponding formatting function\n c = format(date, pad_1); // replace the directive with the formatted date\n }\n string.push(c);\n j = i + 1;\n }\n }\n string.push(specifier.slice(j, i));\n return string.join('');\n };\n }\n // Simultaneously walks over the specifier and the parsed string, populating the `d` map with parsed values.\n // The returned number is expected to equal the length of the parsed `string`, if parsing succeeded.\n function parseSpecifier(d, specifier, string, j) {\n // i - `specifier` string index\n // j - parsed `string` index\n var i = 0;\n var n = specifier.length;\n var m = string.length;\n while (i < n) {\n if (j >= m) {\n return -1;\n }\n var code = specifier.charCodeAt(i++);\n if (code === percentCharCode) {\n var char = specifier.charAt(i++);\n var parse = parses[(char in pads ? specifier.charAt(i++) : char)];\n if (!parse || ((j = parse(d, string, j)) < 0)) {\n return -1;\n }\n }\n else if (code != string.charCodeAt(j++)) {\n return -1;\n }\n }\n return j;\n }\n // ----------------------------- formats ----------------------------------\n function formatMicroseconds(date, fill) {\n return formatMilliseconds(date, fill) + '000';\n }\n function formatMilliseconds(date, fill) {\n return pad(date.getMilliseconds(), fill, 3);\n }\n function formatSeconds(date, fill) {\n return pad(date.getSeconds(), fill, 2);\n }\n function formatMinutes(date, fill) {\n return pad(date.getMinutes(), fill, 2);\n }\n function formatHour12(date, fill) {\n return pad(date.getHours() % 12 || 12, fill, 2);\n }\n function formatHour24(date, fill) {\n return pad(date.getHours(), fill, 2);\n }\n function formatPeriod(date) {\n return lPeriods[date.getHours() >= 12 ? 1 : 0];\n }\n function formatShortWeekday(date) {\n return lShortWeekdays[date.getDay()];\n }\n function formatWeekday(date) {\n return lWeekdays[date.getDay()];\n }\n function formatWeekdayNumberMonday(date) {\n var dayOfWeek = date.getDay();\n return dayOfWeek === 0 ? 7 : dayOfWeek;\n }\n function formatWeekNumberSunday(date, fill) {\n return pad(timeSunday.count(year.floor(date), date), fill, 2);\n }\n function formatWeekNumberISO(date, fill) {\n var day = date.getDay();\n date = (day >= 4 || day === 0) ? timeThursday.floor(date) : timeThursday.ceil(date);\n var yearStart = year.floor(date);\n return pad(timeThursday.count(yearStart, date) + (yearStart.getDay() === 4 ? 1 : 0), fill, 2);\n }\n function formatWeekdayNumberSunday(date) {\n return date.getDay();\n }\n function formatWeekNumberMonday(date, fill) {\n return pad(timeMonday.count(year.floor(date), date), fill, 2);\n }\n function formatDayOfMonth(date, fill) {\n return pad(date.getDate(), fill, 2);\n }\n function formatDayOfYear(date, fill) {\n return pad(1 + timeDay.count(year.floor(date), date), fill, 3);\n }\n function formatShortMonth(date) {\n return lShortMonths[date.getMonth()];\n }\n function formatMonth(date) {\n return lMonths[date.getMonth()];\n }\n function formatMonthNumber(date, fill) {\n return pad(date.getMonth() + 1, fill, 2);\n }\n function formatYear(date, fill) {\n return pad(date.getFullYear() % 100, fill, 2);\n }\n function formatFullYear(date, fill) {\n return pad(date.getFullYear() % 10000, fill, 4);\n }\n function formatZone(date) {\n var z = date.getTimezoneOffset();\n return (z > 0 ? '-' : (z *= -1, '+')) + pad(Math.floor(z / 60), '0', 2) + pad(z % 60, '0', 2);\n }\n // -------------------------- UTC formats -----------------------------------\n function formatUTCMicroseconds(date, fill) {\n return formatUTCMilliseconds(date, fill) + '000';\n }\n function formatUTCMilliseconds(date, fill) {\n return pad(date.getUTCMilliseconds(), fill, 3);\n }\n function formatUTCSeconds(date, fill) {\n return pad(date.getUTCSeconds(), fill, 2);\n }\n function formatUTCMinutes(date, fill) {\n return pad(date.getUTCMinutes(), fill, 2);\n }\n function formatUTCHour12(date, fill) {\n return pad(date.getUTCHours() % 12 || 12, fill, 2);\n }\n function formatUTCHour24(date, fill) {\n return pad(date.getUTCHours(), fill, 2);\n }\n function formatUTCPeriod(date) {\n return lPeriods[date.getUTCHours() >= 12 ? 1 : 0];\n }\n function formatUTCDayOfMonth(date, fill) {\n return pad(date.getUTCDate(), fill, 2);\n }\n function formatUTCDayOfYear(date, fill) {\n return pad(1 + utcDay.count(utcYear.floor(date), date), fill, 3);\n }\n function formatUTCMonthNumber(date, fill) {\n return pad(date.getUTCMonth() + 1, fill, 2);\n }\n function formatUTCShortMonth(date) {\n return lShortMonths[date.getUTCMonth()];\n }\n function formatUTCMonth(date) {\n return lMonths[date.getUTCMonth()];\n }\n function formatUTCShortWeekday(date) {\n return lShortWeekdays[date.getUTCDay()];\n }\n function formatUTCWeekday(date) {\n return lWeekdays[date.getUTCDay()];\n }\n function formatUTCWeekdayNumberMonday(date) {\n var dayOfWeek = date.getUTCDay();\n return dayOfWeek === 0 ? 7 : dayOfWeek;\n }\n function formatUTCWeekNumberSunday(date, fill) {\n return pad(utcSunday.count(utcYear.floor(date), date), fill, 2);\n }\n function formatUTCWeekNumberISO(date, fill) {\n var day = date.getUTCDay();\n date = (day >= 4 || day === 0) ? utcThursday.floor(date) : utcThursday.ceil(date);\n var yearStart = utcYear.floor(date);\n return pad(utcThursday.count(yearStart, date) + (yearStart.getUTCDay() === 4 ? 1 : 0), fill, 4);\n }\n function formatUTCWeekdayNumberSunday(date) {\n return date.getUTCDay();\n }\n function formatUTCWeekNumberMonday(date, fill) {\n return pad(utcMonday.count(utcYear.floor(date), date), fill, 2);\n }\n function formatUTCYear(date, fill) {\n return pad(date.getUTCFullYear() % 100, fill, 2);\n }\n function formatUTCFullYear(date, fill) {\n return pad(date.getUTCFullYear() % 10000, fill, 4);\n }\n function formatUTCZone() {\n return '+0000';\n }\n function formatLiteralPercent(date) {\n return '%';\n }\n function formatUnixTimestamp(date) {\n return date.getTime();\n }\n function formatUnixTimestampSeconds(date) {\n return Math.floor(date.getTime() / 1000);\n }\n // ------------------------------- parsers ------------------------------------\n function parseMicroseconds(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 6));\n return n ? (d.L = Math.floor(parseFloat(n[0]) / 1000), i + n[0].length) : -1;\n }\n function parseMilliseconds(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 3));\n return n ? (d.L = +n[0], i + n[0].length) : -1;\n }\n function parseSeconds(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.S = +n[0], i + n[0].length) : -1;\n }\n function parseMinutes(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.M = +n[0], i + n[0].length) : -1;\n }\n function parseHour24(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.H = +n[0], i + n[0].length) : -1;\n }\n function parsePeriod(d, string, i) {\n var n = periodRe.exec(string.slice(i));\n return n ? (d.p = periodLookup[n[0].toLowerCase()], i + n[0].length) : -1;\n }\n function parseDayOfMonth(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.d = +n[0], i + n[0].length) : -1;\n }\n function parseDayOfYear(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 3));\n return n ? (d.m = 0, d.d = +n[0], i + n[0].length) : -1;\n }\n function parseShortWeekday(d, string, i) {\n var n = shortWeekdayRe.exec(string.slice(i));\n return n ? (d.w = shortWeekdayLookup[n[0].toLowerCase()], i + n[0].length) : -1;\n }\n function parseWeekday(d, string, i) {\n var n = weekdayRe.exec(string.slice(i));\n return n ? (d.w = weekdayLookup[n[0].toLowerCase()], i + n[0].length) : -1;\n }\n function parseWeekdayNumberMonday(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 1));\n return n ? (d.u = +n[0], i + n[0].length) : -1;\n }\n function parseWeekNumberSunday(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.U = +n[0], i + n[0].length) : -1;\n }\n function parseWeekNumberISO(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.V = +n[0], i + n[0].length) : -1;\n }\n function parseWeekNumberMonday(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.W = +n[0], i + n[0].length) : -1;\n }\n function parseWeekdayNumberSunday(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 1));\n return n ? (d.w = +n[0], i + n[0].length) : -1;\n }\n function parseShortMonth(d, string, i) {\n var n = shortMonthRe.exec(string.slice(i));\n return n ? (d.m = shortMonthLookup[n[0].toLowerCase()], i + n[0].length) : -1;\n }\n function parseMonth(d, string, i) {\n var n = monthRe.exec(string.slice(i));\n return n ? (d.m = monthLookup[n[0].toLowerCase()], i + n[0].length) : -1;\n }\n function parseMonthNumber(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.m = parseFloat(n[0]) - 1, i + n[0].length) : -1;\n }\n function parseLocaleDateTime(d, string, i) {\n return parseSpecifier(d, lDateTime, string, i);\n }\n function parseLocaleDate(d, string, i) {\n return parseSpecifier(d, lDate, string, i);\n }\n function parseLocaleTime(d, string, i) {\n return parseSpecifier(d, lTime, string, i);\n }\n function parseUnixTimestamp(d, string, i) {\n var n = numberRe.exec(string.slice(i));\n return n ? (d.Q = +n[0], i + n[0].length) : -1;\n }\n function parseUnixTimestampSeconds(d, string, i) {\n var n = numberRe.exec(string.slice(i));\n return n ? (d.Q = (+n[0]) * 1000, i + n[0].length) : -1;\n }\n function parseYear(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.y = +n[0] + (+n[0] > 68 ? 1900 : 2000), i + n[0].length) : -1;\n }\n function parseFullYear(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 4));\n return n ? (d.y = +n[0], i + n[0].length) : -1;\n }\n function parseZone(d, string, i) {\n var n = /^(Z)|([+-]\\d\\d)(?::?(\\d\\d))?/.exec(string.slice(i, i + 6));\n return n ? (d.Z = n[1] ? 0 : -(n[2] + (n[3] || '00')), i + n[0].length) : -1;\n }\n function parseLiteralPercent(d, string, i) {\n var n = percentRe.exec(string.slice(i, i + 1));\n return n ? i + n[0].length : -1;\n }\n return {\n format: function (specifier) {\n var f = newFormat(specifier, formats);\n f.toString = function () { return specifier; };\n return f;\n },\n parse: function (specifier) {\n var p = newParse(specifier, localDate);\n p.toString = function () { return specifier; };\n return p;\n },\n utcFormat: function (specifier) {\n var f = newFormat(specifier, utcFormats);\n f.toString = function () { return specifier; };\n return f;\n },\n utcParse: function (specifier) {\n var p = newParse(specifier, utcDate);\n p.toString = function () { return specifier; };\n return p;\n }\n };\n}\n","import formatLocale from './locale';\nexport var locale;\nsetDefaultLocale({\n dateTime: '%x, %X',\n date: '%-m/%-d/%Y',\n time: '%-I:%M:%S %p',\n periods: ['AM', 'PM'],\n days: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],\n shortDays: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],\n months: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],\n shortMonths: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']\n});\nexport default function setDefaultLocale(definition) {\n return locale = formatLocale(definition);\n}\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport ContinuousScale from \"./continuousScale\";\nimport timeMillisecond from \"../util/time/millisecond\";\nimport timeSecond from \"../util/time/second\";\nimport timeMinute from \"../util/time/minute\";\nimport timeHour from \"../util/time/hour\";\nimport timeDay from \"../util/time/day\";\nimport timeWeek from \"../util/time/week\";\nimport timeMonth from \"../util/time/month\";\nimport timeYear from \"../util/time/year\";\nimport { durationSecond, durationMinute, durationHour, durationDay, durationWeek, durationMonth, durationYear } from \"../util/time/duration\";\nimport { complexBisectRight } from \"../util/bisect\";\nimport { tickStep } from \"../util/ticks\";\nimport { locale } from \"../util/time/format/defaultLocale\";\nvar TimeScale = /** @class */ (function (_super) {\n __extends(TimeScale, _super);\n function TimeScale() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = 'time';\n _this.year = timeYear;\n _this.month = timeMonth;\n _this.week = timeWeek;\n _this.day = timeDay;\n _this.hour = timeHour;\n _this.minute = timeMinute;\n _this.second = timeSecond;\n _this.millisecond = timeMillisecond;\n _this.format = locale.format;\n /**\n * Array of default tick intervals in the following format:\n *\n * [\n * interval (unit of time),\n * number of units (step),\n * the length of that number of units in milliseconds\n * ]\n */\n _this.tickIntervals = [\n [_this.second, 1, durationSecond],\n [_this.second, 5, 5 * durationSecond],\n [_this.second, 15, 15 * durationSecond],\n [_this.second, 30, 30 * durationSecond],\n [_this.minute, 1, durationMinute],\n [_this.minute, 5, 5 * durationMinute],\n [_this.minute, 15, 15 * durationMinute],\n [_this.minute, 30, 30 * durationMinute],\n [_this.hour, 1, durationHour],\n [_this.hour, 3, 3 * durationHour],\n [_this.hour, 6, 6 * durationHour],\n [_this.hour, 12, 12 * durationHour],\n [_this.day, 1, durationDay],\n [_this.day, 2, 2 * durationDay],\n [_this.week, 1, durationWeek],\n [_this.month, 1, durationMonth],\n [_this.month, 3, 3 * durationMonth],\n [_this.year, 1, durationYear]\n ];\n _this.formatMillisecond = _this.format('.%L');\n _this.formatSecond = _this.format(':%S');\n _this.formatMinute = _this.format('%I:%M');\n _this.formatHour = _this.format('%I %p');\n _this.formatDay = _this.format('%a %d');\n _this.formatWeek = _this.format('%b %d');\n _this.formatMonth = _this.format('%B');\n _this.formatYear = _this.format('%Y');\n _this._domain = [new Date(2000, 0, 1), new Date(2000, 0, 2)];\n return _this;\n }\n TimeScale.prototype.defaultTickFormat = function (date) {\n return (this.second.floor(date) < date\n ? this.formatMillisecond\n : this.minute.floor(date) < date\n ? this.formatSecond\n : this.hour.floor(date) < date\n ? this.formatMinute\n : this.day.floor(date) < date\n ? this.formatHour\n : this.month.floor(date) < date\n ? (this.week.floor(date) < date ? this.formatDay : this.formatWeek)\n : this.year.floor(date) < date\n ? this.formatMonth\n : this.formatYear)(date);\n };\n /**\n *\n * @param interval If the `interval` is a number, it's interpreted as the desired tick count\n * and the method tries to pick an appropriate interval automatically, based on the extent of the domain.\n * If the `interval` is `undefined`, it defaults to `10`.\n * If the `interval` is a time interval, simply use it.\n * @param start The start time (timestamp).\n * @param stop The end time (timestamp).\n * @param step Number of intervals between ticks.\n */\n TimeScale.prototype.tickInterval = function (interval, start, stop, step) {\n var _a;\n if (typeof interval === 'number') {\n var tickCount = interval;\n var tickIntervals = this.tickIntervals;\n var target = Math.abs(stop - start) / tickCount;\n var i = complexBisectRight(tickIntervals, target, function (interval) { return interval[2]; });\n if (i === tickIntervals.length) {\n step = tickStep(start / durationYear, stop / durationYear, tickCount);\n interval = this.year;\n }\n else if (i) {\n _a = tickIntervals[target / tickIntervals[i - 1][2] < tickIntervals[i][2] / target ? i - 1 : i], interval = _a[0], step = _a[1];\n }\n else {\n step = Math.max(tickStep(start, stop, interval), 1);\n interval = this.millisecond;\n }\n }\n return step == undefined ? interval : interval.every(step);\n };\n Object.defineProperty(TimeScale.prototype, \"domain\", {\n get: function () {\n return _super.prototype.getDomain.call(this).map(function (t) { return new Date(t); });\n },\n set: function (values) {\n _super.prototype.setDomain.call(this, Array.prototype.map.call(values, function (t) { return t instanceof Date ? +t : +new Date(+t); }));\n },\n enumerable: true,\n configurable: true\n });\n TimeScale.prototype.invert = function (y) {\n return new Date(_super.prototype.invert.call(this, y));\n };\n /**\n * Returns uniformly-spaced dates that represent the scale's domain.\n * @param interval The desired tick count or a time interval object.\n */\n TimeScale.prototype.ticks = function (interval) {\n if (interval === void 0) { interval = 10; }\n var d = _super.prototype.getDomain.call(this);\n var t0 = d[0];\n var t1 = d[d.length - 1];\n var reverse = t1 < t0;\n if (reverse) {\n var _ = t0;\n t0 = t1;\n t1 = _;\n }\n var t = this.tickInterval(interval, t0, t1);\n var i = t ? t.range(t0, t1 + 1) : []; // inclusive stop\n return reverse ? i.reverse() : i;\n };\n /**\n * Returns a time format function suitable for displaying tick values.\n * @param count Ignored. Used only to satisfy the {@link Scale} interface.\n * @param specifier If the specifier string is provided, this method is equivalent to\n * the {@link TimeLocaleObject.format} method.\n * If no specifier is provided, this method returns the default time format function.\n */\n TimeScale.prototype.tickFormat = function (count, specifier) {\n return specifier == undefined ? this.defaultTickFormat.bind(this) : this.format(specifier);\n };\n /**\n * Extends the domain so that it starts and ends on nice round values.\n * This method typically modifies the scale’s domain, and may only extend the bounds to the nearest round value.\n * @param interval\n */\n TimeScale.prototype.nice = function (interval) {\n if (interval === void 0) { interval = 10; }\n var d = _super.prototype.getDomain.call(this);\n var i = this.tickInterval(interval, d[0], d[d.length - 1]);\n if (i) {\n this.domain = this._nice(d, i);\n }\n };\n TimeScale.prototype._nice = function (domain, interval) {\n var _a, _b;\n domain = domain.slice();\n var i0 = 0;\n var i1 = domain.length - 1;\n var x0 = domain[i0];\n var x1 = domain[i1];\n if (x1 < x0) {\n _a = [i1, i0], i0 = _a[0], i1 = _a[1];\n _b = [x1, x0], x0 = _b[0], x1 = _b[1];\n }\n domain[i0] = interval.floor(x0);\n domain[i1] = interval.ceil(x1);\n return domain;\n };\n return TimeScale;\n}(ContinuousScale));\nexport { TimeScale };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { Path } from \"./path\";\nimport { Shape } from \"./shape\";\nimport { BBox } from \"../bbox\";\nimport { LinearGradient } from \"../gradient/linearGradient\";\nimport { Color } from \"../../util/color\";\nexport var RectSizing;\n(function (RectSizing) {\n RectSizing[RectSizing[\"Content\"] = 0] = \"Content\";\n RectSizing[RectSizing[\"Border\"] = 1] = \"Border\";\n})(RectSizing || (RectSizing = {}));\nvar Rect = /** @class */ (function (_super) {\n __extends(Rect, _super);\n function Rect() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this._x = 0;\n _this._y = 0;\n _this._width = 10;\n _this._height = 10;\n _this._radius = 0;\n /**\n * If `true`, the rect is aligned to the pixel grid for crisp looking lines.\n * Animated rects may not look nice with this option enabled, for example\n * when a rect is translated by a sub-pixel value on each frame.\n */\n _this._crisp = false;\n _this._gradient = false;\n _this.effectiveStrokeWidth = Shape.defaultStyles.strokeWidth;\n /**\n * Similar to https://developer.mozilla.org/en-US/docs/Web/CSS/box-sizing\n */\n _this._sizing = RectSizing.Content;\n return _this;\n }\n Object.defineProperty(Rect.prototype, \"x\", {\n get: function () {\n return this._x;\n },\n set: function (value) {\n if (this._x !== value) {\n this._x = value;\n this.dirtyPath = true;\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Rect.prototype, \"y\", {\n get: function () {\n return this._y;\n },\n set: function (value) {\n if (this._y !== value) {\n this._y = value;\n this.dirtyPath = true;\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Rect.prototype, \"width\", {\n get: function () {\n return this._width;\n },\n set: function (value) {\n if (this._width !== value) {\n this._width = value;\n this.dirtyPath = true;\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Rect.prototype, \"height\", {\n get: function () {\n return this._height;\n },\n set: function (value) {\n if (this._height !== value) {\n this._height = value;\n this.dirtyPath = true;\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Rect.prototype, \"radius\", {\n get: function () {\n return this._radius;\n },\n set: function (value) {\n if (this._radius !== value) {\n this._radius = value;\n this.dirtyPath = true;\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Rect.prototype, \"crisp\", {\n get: function () {\n return this._crisp;\n },\n set: function (value) {\n if (this._crisp !== value) {\n this._crisp = value;\n this.dirtyPath = true;\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Rect.prototype, \"gradient\", {\n get: function () {\n return this._gradient;\n },\n set: function (value) {\n if (this._gradient !== value) {\n this._gradient = value;\n this.updateGradientInstance();\n this.dirty = true;\n }\n },\n enumerable: true,\n configurable: true\n });\n Rect.prototype.updateGradientInstance = function () {\n if (this.gradient) {\n var fill = this.fill;\n if (fill) {\n var gradient = new LinearGradient();\n gradient.angle = 270;\n gradient.stops = [{\n offset: 0,\n color: Color.fromString(fill).brighter().toString()\n }, {\n offset: 1,\n color: Color.fromString(fill).darker().toString()\n }];\n this.gradientInstance = gradient;\n }\n }\n else {\n this.gradientInstance = undefined;\n }\n };\n Object.defineProperty(Rect.prototype, \"fill\", {\n get: function () {\n return this._fill;\n },\n set: function (value) {\n if (this._fill !== value) {\n this._fill = value;\n this.updateGradientInstance();\n this.dirty = true;\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Rect.prototype, \"strokeWidth\", {\n get: function () {\n return this._strokeWidth;\n },\n set: function (value) {\n if (this._strokeWidth !== value) {\n this._strokeWidth = value;\n // Normally, when the `lineWidth` changes, we only need to repaint the rect\n // without updating the path. If the `isCrisp` is set to `true` however,\n // we need to update the path to make sure the new stroke aligns to\n // the pixel grid. This is the reason we override the `lineWidth` setter\n // and getter here.\n if (this.crisp || this.sizing === RectSizing.Border) {\n this.dirtyPath = true;\n }\n else {\n this.effectiveStrokeWidth = value;\n this.dirty = true;\n }\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Rect.prototype, \"sizing\", {\n get: function () {\n return this._sizing;\n },\n set: function (value) {\n if (this._sizing !== value) {\n this._sizing = value;\n this.dirtyPath = true;\n }\n },\n enumerable: true,\n configurable: true\n });\n Rect.prototype.updatePath = function () {\n var borderSizing = this.sizing === RectSizing.Border;\n var path = this.path;\n path.clear();\n var x = this.x;\n var y = this.y;\n var width = this.width;\n var height = this.height;\n var strokeWidth;\n if (borderSizing) {\n var halfWidth = width / 2;\n var halfHeight = height / 2;\n strokeWidth = Math.min(this.strokeWidth, halfWidth, halfHeight);\n x = Math.min(x + strokeWidth / 2, x + halfWidth);\n y = Math.min(y + strokeWidth / 2, y + halfHeight);\n width = Math.max(width - strokeWidth, 0);\n height = Math.max(height - strokeWidth, 0);\n }\n else {\n strokeWidth = this.strokeWidth;\n }\n this.effectiveStrokeWidth = strokeWidth;\n if (this.crisp && !borderSizing) {\n var _a = this, a = _a.alignment, al = _a.align;\n path.rect(al(a, x), al(a, y), al(a, x, width), al(a, y, height));\n }\n else {\n path.rect(x, y, width, height);\n }\n };\n Rect.prototype.computeBBox = function () {\n var _a = this, x = _a.x, y = _a.y, width = _a.width, height = _a.height;\n return new BBox(x, y, width, height);\n };\n Rect.prototype.isPointInPath = function (x, y) {\n var point = this.transformPoint(x, y);\n var bbox = this.computeBBox();\n return bbox.containsPoint(point.x, point.y);\n };\n Rect.prototype.isPointInStroke = function (x, y) {\n return false;\n };\n Rect.prototype.fillStroke = function (ctx) {\n if (!this.scene) {\n return;\n }\n var pixelRatio = this.scene.canvas.pixelRatio || 1;\n if (this.fill) {\n if (this.gradientInstance) {\n ctx.fillStyle = this.gradientInstance.generateGradient(ctx, this.computeBBox());\n }\n else {\n ctx.fillStyle = this.fill;\n }\n ctx.globalAlpha = this.opacity * this.fillOpacity;\n // The canvas context scaling (depends on the device's pixel ratio)\n // has no effect on shadows, so we have to account for the pixel ratio\n // manually here.\n var fillShadow = this.fillShadow;\n if (fillShadow && fillShadow.enabled) {\n ctx.shadowColor = fillShadow.color;\n ctx.shadowOffsetX = fillShadow.xOffset * pixelRatio;\n ctx.shadowOffsetY = fillShadow.yOffset * pixelRatio;\n ctx.shadowBlur = fillShadow.blur * pixelRatio;\n }\n ctx.fill();\n }\n ctx.shadowColor = 'rgba(0, 0, 0, 0)';\n if (this.stroke && this.effectiveStrokeWidth) {\n ctx.strokeStyle = this.stroke;\n ctx.globalAlpha = this.opacity * this.strokeOpacity;\n ctx.lineWidth = this.effectiveStrokeWidth;\n if (this.lineDash) {\n ctx.setLineDash(this.lineDash);\n }\n if (this.lineDashOffset) {\n ctx.lineDashOffset = this.lineDashOffset;\n }\n if (this.lineCap) {\n ctx.lineCap = this.lineCap;\n }\n if (this.lineJoin) {\n ctx.lineJoin = this.lineJoin;\n }\n var strokeShadow = this.strokeShadow;\n if (strokeShadow && strokeShadow.enabled) {\n ctx.shadowColor = strokeShadow.color;\n ctx.shadowOffsetX = strokeShadow.xOffset * pixelRatio;\n ctx.shadowOffsetY = strokeShadow.yOffset * pixelRatio;\n ctx.shadowBlur = strokeShadow.blur * pixelRatio;\n }\n ctx.stroke();\n }\n };\n Rect.className = 'Rect';\n return Rect;\n}(Path));\nexport { Rect };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { TimeScale } from \"../../scale/timeScale\";\nimport { ChartAxis } from \"../chartAxis\";\nvar TimeAxis = /** @class */ (function (_super) {\n __extends(TimeAxis, _super);\n function TimeAxis() {\n var _this = _super.call(this) || this;\n _this.datumFormat = '%m/%d/%y, %H:%M:%S';\n _this._nice = true;\n var scale = new TimeScale();\n scale.clamp = true;\n _this.scale = scale;\n _this.datumFormatter = scale.tickFormat(_this.tick.count, _this.datumFormat);\n return _this;\n }\n Object.defineProperty(TimeAxis.prototype, \"nice\", {\n get: function () {\n return this._nice;\n },\n set: function (value) {\n if (this._nice !== value) {\n this._nice = value;\n if (value && this.scale.nice) {\n this.scale.nice(10);\n }\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(TimeAxis.prototype, \"domain\", {\n get: function () {\n return this.scale.domain;\n },\n set: function (value) {\n this.scale.domain = value;\n if (this.nice && this.scale.nice) {\n this.scale.nice(10);\n }\n },\n enumerable: true,\n configurable: true\n });\n TimeAxis.prototype.onLabelFormatChange = function (format) {\n if (format) {\n _super.prototype.onLabelFormatChange.call(this, format);\n }\n else {\n // For time axis labels to look nice, even if date format wasn't set.\n this.labelFormatter = this.scale.tickFormat(this.tick.count, undefined);\n }\n };\n TimeAxis.prototype.formatDatum = function (datum) {\n return this.datumFormatter(datum);\n };\n TimeAxis.className = 'TimeAxis';\n TimeAxis.type = 'time';\n return TimeAxis;\n}(ChartAxis));\nexport { TimeAxis };\n","import { HdpiCanvas } from \"../canvas/hdpiCanvas\";\nimport { createId } from \"../util/id\";\nvar Scene = /** @class */ (function () {\n // As a rule of thumb, constructors with no parameters are preferred.\n // A few exceptions are:\n // - we absolutely need to know something at construction time (document)\n // - knowing something at construction time meaningfully improves performance (width, height)\n function Scene(document, width, height) {\n var _this = this;\n if (document === void 0) { document = window.document; }\n this.id = createId(this);\n this._dirty = false;\n this.animationFrameId = 0;\n this._root = null;\n this.debug = {\n renderFrameIndex: false,\n renderBoundingBoxes: false\n };\n this._frameIndex = 0;\n this.render = function () {\n var _a;\n var _b = _this, ctx = _b.ctx, root = _b.root, pendingSize = _b.pendingSize;\n _this.animationFrameId = 0;\n if (pendingSize) {\n (_a = _this.canvas).resize.apply(_a, pendingSize);\n _this.pendingSize = undefined;\n }\n if (root && !root.visible) {\n _this.dirty = false;\n return;\n }\n // start with a blank canvas, clear previous drawing\n ctx.clearRect(0, 0, _this.width, _this.height);\n if (root) {\n ctx.save();\n if (root.visible) {\n root.render(ctx);\n }\n ctx.restore();\n }\n _this._frameIndex++;\n if (_this.debug.renderFrameIndex) {\n ctx.fillStyle = 'white';\n ctx.fillRect(0, 0, 40, 15);\n ctx.fillStyle = 'black';\n ctx.fillText(_this.frameIndex.toString(), 2, 10);\n }\n _this.dirty = false;\n };\n this.canvas = new HdpiCanvas(document, width, height);\n this.ctx = this.canvas.context;\n }\n Object.defineProperty(Scene.prototype, \"container\", {\n get: function () {\n return this.canvas.container;\n },\n set: function (value) {\n this.canvas.container = value;\n },\n enumerable: true,\n configurable: true\n });\n Scene.prototype.download = function (fileName) {\n this.canvas.download(fileName);\n };\n Scene.prototype.getDataURL = function (type) {\n return this.canvas.getDataURL(type);\n };\n Object.defineProperty(Scene.prototype, \"width\", {\n get: function () {\n return this.pendingSize ? this.pendingSize[0] : this.canvas.width;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Scene.prototype, \"height\", {\n get: function () {\n return this.pendingSize ? this.pendingSize[1] : this.canvas.height;\n },\n enumerable: true,\n configurable: true\n });\n Scene.prototype.resize = function (width, height) {\n width = Math.round(width);\n height = Math.round(height);\n if (width === this.width && height === this.height) {\n return;\n }\n this.pendingSize = [width, height];\n this.dirty = true;\n };\n Object.defineProperty(Scene.prototype, \"dirty\", {\n get: function () {\n return this._dirty;\n },\n set: function (dirty) {\n if (dirty && !this._dirty) {\n this.animationFrameId = requestAnimationFrame(this.render);\n }\n this._dirty = dirty;\n },\n enumerable: true,\n configurable: true\n });\n Scene.prototype.cancelRender = function () {\n if (this.animationFrameId) {\n cancelAnimationFrame(this.animationFrameId);\n this.animationFrameId = 0;\n this._dirty = false;\n }\n };\n Object.defineProperty(Scene.prototype, \"root\", {\n get: function () {\n return this._root;\n },\n set: function (node) {\n if (node === this._root) {\n return;\n }\n if (this._root) {\n this._root._setScene();\n }\n this._root = node;\n if (node) {\n // If `node` is the root node of another scene ...\n if (node.parent === null && node.scene && node.scene !== this) {\n node.scene.root = null;\n }\n node._setScene(this);\n }\n this.dirty = true;\n },\n enumerable: true,\n configurable: true\n });\n Scene.prototype.appendPath = function (path) {\n var ctx = this.ctx;\n var commands = path.commands;\n var params = path.params;\n var n = commands.length;\n var j = 0;\n ctx.beginPath();\n for (var i = 0; i < n; i++) {\n switch (commands[i]) {\n case 'M':\n ctx.moveTo(params[j++], params[j++]);\n break;\n case 'L':\n ctx.lineTo(params[j++], params[j++]);\n break;\n case 'C':\n ctx.bezierCurveTo(params[j++], params[j++], params[j++], params[j++], params[j++], params[j++]);\n break;\n case 'Z':\n ctx.closePath();\n break;\n }\n }\n };\n Object.defineProperty(Scene.prototype, \"frameIndex\", {\n get: function () {\n return this._frameIndex;\n },\n enumerable: true,\n configurable: true\n });\n Scene.className = 'Scene';\n return Scene;\n}());\nexport { Scene };\n","var Gradient = /** @class */ (function () {\n function Gradient() {\n this.stops = [];\n }\n return Gradient;\n}());\nexport { Gradient };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { Gradient } from \"./gradient\";\nvar LinearGradient = /** @class */ (function (_super) {\n __extends(LinearGradient, _super);\n function LinearGradient() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.angle = 0;\n return _this;\n }\n LinearGradient.prototype.generateGradient = function (ctx, bbox) {\n var stops = this.stops;\n var radians = (this.angle % 360) * Math.PI / 180;\n var cos = Math.cos(radians);\n var sin = Math.sin(radians);\n var w = bbox.width;\n var h = bbox.height;\n var cx = bbox.x + w * 0.5;\n var cy = bbox.y + h * 0.5;\n if (w > 0 && h > 0) {\n var l = (Math.sqrt(h * h + w * w) * Math.abs(Math.cos(radians - Math.atan(h / w)))) / 2;\n var gradient_1 = ctx.createLinearGradient(cx + cos * l, cy + sin * l, cx - cos * l, cy - sin * l);\n stops.forEach(function (stop) {\n gradient_1.addColorStop(stop.offset, stop.color);\n });\n return gradient_1;\n }\n return 'black';\n };\n return LinearGradient;\n}(Gradient));\nexport { LinearGradient };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { Path } from \"../../scene/shape/path\";\nimport { BBox } from \"../../scene/bbox\";\nvar Marker = /** @class */ (function (_super) {\n __extends(Marker, _super);\n function Marker() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this._x = 0;\n _this._y = 0;\n _this._size = 12;\n return _this;\n }\n Object.defineProperty(Marker.prototype, \"x\", {\n get: function () {\n return this._x;\n },\n set: function (value) {\n if (this._x !== value) {\n this._x = value;\n this.dirtyPath = true;\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Marker.prototype, \"y\", {\n get: function () {\n return this._y;\n },\n set: function (value) {\n if (this._y !== value) {\n this._y = value;\n this.dirtyPath = true;\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Marker.prototype, \"size\", {\n get: function () {\n return this._size;\n },\n set: function (value) {\n if (this._size !== value) {\n this._size = Math.abs(value);\n this.dirtyPath = true;\n }\n },\n enumerable: true,\n configurable: true\n });\n Marker.prototype.computeBBox = function () {\n var _a = this, x = _a.x, y = _a.y, size = _a.size;\n var half = size / 2;\n return new BBox(x - half, y - half, size, size);\n };\n return Marker;\n}(Path));\nexport { Marker };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { Marker } from \"./marker\";\nvar Square = /** @class */ (function (_super) {\n __extends(Square, _super);\n function Square() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n Square.prototype.updatePath = function () {\n var _a = this, path = _a.path, x = _a.x, y = _a.y;\n var hs = this.size / 2;\n var _b = this, a = _b.alignment, al = _b.align;\n path.clear();\n path.moveTo(al(a, x - hs), al(a, y - hs));\n path.lineTo(al(a, x + hs), al(a, y - hs));\n path.lineTo(al(a, x + hs), al(a, y + hs));\n path.lineTo(al(a, x - hs), al(a, y + hs));\n path.closePath();\n };\n Square.className = 'Square';\n return Square;\n}(Marker));\nexport { Square };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { Group } from \"../scene/group\";\nimport { Text } from \"../scene/shape/text\";\nimport { Square } from \"./marker/square\";\nimport { HdpiCanvas } from \"../canvas/hdpiCanvas\";\nvar MarkerLabel = /** @class */ (function (_super) {\n __extends(MarkerLabel, _super);\n function MarkerLabel() {\n var _this = _super.call(this) || this;\n _this.label = new Text();\n _this._marker = new Square();\n _this._markerSize = 15;\n _this._spacing = 8;\n var label = _this.label;\n label.textBaseline = 'middle';\n label.fontSize = 12;\n label.fontFamily = 'Verdana, sans-serif';\n label.fill = 'black';\n // For better looking vertical alignment of labels to markers.\n label.y = HdpiCanvas.has.textMetrics ? 1 : 0;\n _this.append([_this.marker, label]);\n _this.update();\n return _this;\n }\n Object.defineProperty(MarkerLabel.prototype, \"text\", {\n get: function () {\n return this.label.text;\n },\n set: function (value) {\n this.label.text = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(MarkerLabel.prototype, \"fontStyle\", {\n get: function () {\n return this.label.fontStyle;\n },\n set: function (value) {\n this.label.fontStyle = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(MarkerLabel.prototype, \"fontWeight\", {\n get: function () {\n return this.label.fontWeight;\n },\n set: function (value) {\n this.label.fontWeight = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(MarkerLabel.prototype, \"fontSize\", {\n get: function () {\n return this.label.fontSize;\n },\n set: function (value) {\n this.label.fontSize = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(MarkerLabel.prototype, \"fontFamily\", {\n get: function () {\n return this.label.fontFamily;\n },\n set: function (value) {\n this.label.fontFamily = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(MarkerLabel.prototype, \"color\", {\n get: function () {\n return this.label.fill;\n },\n set: function (value) {\n this.label.fill = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(MarkerLabel.prototype, \"marker\", {\n get: function () {\n return this._marker;\n },\n set: function (value) {\n if (this._marker !== value) {\n this.removeChild(this._marker);\n this._marker = value;\n this.appendChild(value);\n this.update();\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(MarkerLabel.prototype, \"markerSize\", {\n get: function () {\n return this._markerSize;\n },\n set: function (value) {\n if (this._markerSize !== value) {\n this._markerSize = value;\n this.update();\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(MarkerLabel.prototype, \"markerFill\", {\n get: function () {\n return this.marker.fill;\n },\n set: function (value) {\n this.marker.fill = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(MarkerLabel.prototype, \"markerStroke\", {\n get: function () {\n return this.marker.stroke;\n },\n set: function (value) {\n this.marker.stroke = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(MarkerLabel.prototype, \"markerStrokeWidth\", {\n get: function () {\n return this.marker.strokeWidth;\n },\n set: function (value) {\n this.marker.strokeWidth = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(MarkerLabel.prototype, \"markerFillOpacity\", {\n get: function () {\n return this.marker.fillOpacity;\n },\n set: function (value) {\n this.marker.fillOpacity = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(MarkerLabel.prototype, \"markerStrokeOpacity\", {\n get: function () {\n return this.marker.strokeOpacity;\n },\n set: function (value) {\n this.marker.strokeOpacity = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(MarkerLabel.prototype, \"opacity\", {\n get: function () {\n return this.marker.opacity;\n },\n set: function (value) {\n this.marker.opacity = value;\n this.label.opacity = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(MarkerLabel.prototype, \"spacing\", {\n get: function () {\n return this._spacing;\n },\n set: function (value) {\n if (this._spacing !== value) {\n this._spacing = value;\n this.update();\n }\n },\n enumerable: true,\n configurable: true\n });\n MarkerLabel.prototype.update = function () {\n var marker = this.marker;\n var markerSize = this.markerSize;\n marker.size = markerSize;\n this.label.x = markerSize / 2 + this.spacing;\n };\n MarkerLabel.className = 'MarkerLabel';\n return MarkerLabel;\n}(Group));\nexport { MarkerLabel };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { Marker } from \"./marker\";\nvar Circle = /** @class */ (function (_super) {\n __extends(Circle, _super);\n function Circle() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n Circle.prototype.updatePath = function () {\n var _a = this, x = _a.x, y = _a.y, path = _a.path, size = _a.size;\n var r = size / 2;\n path.clear();\n path.cubicArc(x, y, r, r, 0, 0, Math.PI * 2, 0);\n path.closePath();\n };\n Circle.className = 'Circle';\n return Circle;\n}(Marker));\nexport { Circle };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { Marker } from \"./marker\";\nvar Cross = /** @class */ (function (_super) {\n __extends(Cross, _super);\n function Cross() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n Cross.prototype.updatePath = function () {\n var _a = this, x = _a.x, y = _a.y;\n var _b = this, path = _b.path, size = _b.size;\n var s = size / 4.2;\n path.clear();\n path.moveTo(x -= s, y);\n path.lineTo(x -= s, y -= s);\n path.lineTo(x += s, y -= s);\n path.lineTo(x += s, y += s);\n path.lineTo(x += s, y -= s);\n path.lineTo(x += s, y += s);\n path.lineTo(x -= s, y += s);\n path.lineTo(x += s, y += s);\n path.lineTo(x -= s, y += s);\n path.lineTo(x -= s, y -= s);\n path.lineTo(x -= s, y += s);\n path.lineTo(x -= s, y -= s);\n path.closePath();\n };\n Cross.className = 'Cross';\n return Cross;\n}(Marker));\nexport { Cross };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { Marker } from \"./marker\";\nvar Diamond = /** @class */ (function (_super) {\n __extends(Diamond, _super);\n function Diamond() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n Diamond.prototype.updatePath = function () {\n var _a = this, x = _a.x, y = _a.y;\n var _b = this, path = _b.path, size = _b.size;\n var s = size / 2;\n path.clear();\n path.moveTo(x, y -= s);\n path.lineTo(x += s, y += s);\n path.lineTo(x -= s, y += s);\n path.lineTo(x -= s, y -= s);\n path.lineTo(x += s, y -= s);\n path.closePath();\n };\n Diamond.className = 'Diamond';\n return Diamond;\n}(Marker));\nexport { Diamond };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { Marker } from \"./marker\";\nvar Heart = /** @class */ (function (_super) {\n __extends(Heart, _super);\n function Heart() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n Heart.prototype.rad = function (degree) {\n return degree / 180 * Math.PI;\n };\n Heart.prototype.updatePath = function () {\n var _a = this, x = _a.x, path = _a.path, size = _a.size, rad = _a.rad;\n var r = size / 4;\n var y = this.y + r / 2;\n path.clear();\n path.cubicArc(x - r, y - r, r, r, 0, rad(130), rad(330), 0);\n path.cubicArc(x + r, y - r, r, r, 0, rad(220), rad(50), 0);\n path.lineTo(x, y + r);\n path.closePath();\n };\n Heart.className = 'Heart';\n return Heart;\n}(Marker));\nexport { Heart };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { Marker } from \"./marker\";\nvar Plus = /** @class */ (function (_super) {\n __extends(Plus, _super);\n function Plus() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n Plus.prototype.updatePath = function () {\n var _a = this, x = _a.x, y = _a.y;\n var _b = this, path = _b.path, size = _b.size;\n var s = size / 3;\n var hs = s / 2;\n path.clear();\n path.moveTo(x -= hs, y -= hs);\n path.lineTo(x, y -= s);\n path.lineTo(x += s, y);\n path.lineTo(x, y += s);\n path.lineTo(x += s, y);\n path.lineTo(x, y += s);\n path.lineTo(x -= s, y);\n path.lineTo(x, y += s);\n path.lineTo(x -= s, y);\n path.lineTo(x, y -= s);\n path.lineTo(x -= s, y);\n path.lineTo(x, y -= s);\n path.closePath();\n };\n Plus.className = 'Plus';\n return Plus;\n}(Marker));\nexport { Plus };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { Marker } from \"./marker\";\nvar Triangle = /** @class */ (function (_super) {\n __extends(Triangle, _super);\n function Triangle() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n Triangle.prototype.updatePath = function () {\n var _a = this, x = _a.x, y = _a.y;\n var _b = this, path = _b.path, size = _b.size;\n var s = size * 1.1;\n path.clear();\n path.moveTo(x, y -= s * 0.48);\n path.lineTo(x += s * 0.5, y += s * 0.87);\n path.lineTo(x -= s, y);\n path.closePath();\n };\n Triangle.className = 'Triangle';\n return Triangle;\n}(Marker));\nexport { Triangle };\n","import { Square } from \"./square\";\nimport { Circle } from \"./circle\";\nimport { Cross } from \"./cross\";\nimport { Diamond } from \"./diamond\";\nimport { Heart } from \"./heart\";\nimport { Plus } from \"./plus\";\nimport { Triangle } from \"./triangle\";\n// This function is in its own file because putting it into SeriesMarker makes the Legend\n// suddenly aware of the series (it's an agnostic component), and putting it into Marker\n// introduces circular dependencies.\nexport function getMarker(shape) {\n if (shape === void 0) { shape = Square; }\n if (typeof shape === 'string') {\n switch (shape) {\n case 'circle':\n return Circle;\n case 'cross':\n return Cross;\n case 'diamond':\n return Diamond;\n case 'heart':\n return Heart;\n case 'plus':\n return Plus;\n case 'triangle':\n return Triangle;\n default:\n return Square;\n }\n }\n if (typeof shape === 'function') {\n return shape;\n }\n return Square;\n}\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n 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;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nimport { Group } from \"../scene/group\";\nimport { Selection } from \"../scene/selection\";\nimport { MarkerLabel } from \"./markerLabel\";\nimport { reactive, Observable } from \"../util/observable\";\nimport { getMarker } from \"./marker/util\";\nimport { createId } from \"../util/id\";\nexport var LegendOrientation;\n(function (LegendOrientation) {\n LegendOrientation[LegendOrientation[\"Vertical\"] = 0] = \"Vertical\";\n LegendOrientation[LegendOrientation[\"Horizontal\"] = 1] = \"Horizontal\";\n})(LegendOrientation || (LegendOrientation = {}));\nexport var LegendPosition;\n(function (LegendPosition) {\n LegendPosition[\"Top\"] = \"top\";\n LegendPosition[\"Right\"] = \"right\";\n LegendPosition[\"Bottom\"] = \"bottom\";\n LegendPosition[\"Left\"] = \"left\";\n})(LegendPosition || (LegendPosition = {}));\nvar LegendLabel = /** @class */ (function (_super) {\n __extends(LegendLabel, _super);\n function LegendLabel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.color = 'black';\n _this.fontSize = 12;\n _this.fontFamily = 'Verdana, sans-serif';\n return _this;\n }\n __decorate([\n reactive('change')\n ], LegendLabel.prototype, \"color\", void 0);\n __decorate([\n reactive('layoutChange')\n ], LegendLabel.prototype, \"fontStyle\", void 0);\n __decorate([\n reactive('layoutChange')\n ], LegendLabel.prototype, \"fontWeight\", void 0);\n __decorate([\n reactive('layoutChange')\n ], LegendLabel.prototype, \"fontSize\", void 0);\n __decorate([\n reactive('layoutChange')\n ], LegendLabel.prototype, \"fontFamily\", void 0);\n __decorate([\n reactive()\n ], LegendLabel.prototype, \"formatter\", void 0);\n return LegendLabel;\n}(Observable));\nexport { LegendLabel };\nvar LegendMarker = /** @class */ (function (_super) {\n __extends(LegendMarker, _super);\n function LegendMarker() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.size = 15;\n /**\n * Padding between the marker and the label within each legend item.\n */\n _this.padding = 8;\n _this.strokeWidth = 1;\n return _this;\n }\n __decorate([\n reactive('layoutChange')\n ], LegendMarker.prototype, \"size\", void 0);\n __decorate([\n reactive('layoutChange')\n ], LegendMarker.prototype, \"shape\", void 0);\n __decorate([\n reactive('layoutChange')\n ], LegendMarker.prototype, \"padding\", void 0);\n __decorate([\n reactive('change')\n ], LegendMarker.prototype, \"strokeWidth\", void 0);\n return LegendMarker;\n}(Observable));\nexport { LegendMarker };\nvar LegendItem = /** @class */ (function (_super) {\n __extends(LegendItem, _super);\n function LegendItem() {\n var _this = _super.call(this) || this;\n _this.marker = new LegendMarker();\n _this.label = new LegendLabel();\n /**\n * The legend uses grid layout for its items, occupying as few columns as possible when positioned to left or right,\n * and as few rows as possible when positioned to top or bottom. This config specifies the amount of horizontal\n * padding between legend items.\n */\n _this.paddingX = 16;\n /**\n * The legend uses grid layout for its items, occupying as few columns as possible when positioned to left or right,\n * and as few rows as possible when positioned to top or bottom. This config specifies the amount of vertical\n * padding between legend items.\n */\n _this.paddingY = 8;\n var changeListener = function () { return _this.fireEvent({ type: 'change' }); };\n _this.marker.addEventListener('change', changeListener);\n _this.label.addEventListener('change', changeListener);\n var layoutChangeListener = function () { return _this.fireEvent({ type: 'layoutChange' }); };\n _this.marker.addEventListener('layoutChange', layoutChangeListener);\n _this.label.addEventListener('layoutChange', layoutChangeListener);\n return _this;\n }\n __decorate([\n reactive('layoutChange')\n ], LegendItem.prototype, \"paddingX\", void 0);\n __decorate([\n reactive('layoutChange')\n ], LegendItem.prototype, \"paddingY\", void 0);\n return LegendItem;\n}(Observable));\nexport { LegendItem };\nvar Legend = /** @class */ (function (_super) {\n __extends(Legend, _super);\n function Legend() {\n var _this = _super.call(this) || this;\n _this.id = createId(_this);\n _this.group = new Group();\n _this.itemSelection = Selection.select(_this.group).selectAll();\n _this.oldSize = [0, 0];\n _this.item = new LegendItem();\n _this.data = [];\n _this.enabled = true;\n _this.orientation = LegendOrientation.Vertical;\n _this.position = LegendPosition.Right;\n /**\n * Spacing between the legend and the edge of the chart's element.\n */\n _this.spacing = 20;\n _this._size = [0, 0];\n _this.addPropertyListener('data', _this.onDataChange);\n _this.addPropertyListener('enabled', _this.onEnabledChange);\n _this.addPropertyListener('position', _this.onPositionChange);\n _this.item.marker.addPropertyListener('shape', _this.onMarkerShapeChange, _this);\n _this.addEventListener('change', _this.update);\n _this.item.addEventListener('change', function () { return _this.fireEvent({ type: 'change' }); });\n _this.item.addEventListener('layoutChange', function () { return _this.fireEvent({ type: 'layoutChange' }); });\n return _this;\n }\n Object.defineProperty(Legend.prototype, \"layoutHorizontalSpacing\", {\n get: function () {\n return this.item.paddingX;\n },\n /**\n * @deprecated Please use {@link item.paddingX} instead.\n */\n set: function (value) {\n this.item.paddingX = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Legend.prototype, \"layoutVerticalSpacing\", {\n get: function () {\n return this.item.paddingY;\n },\n /**\n * @deprecated Please use {@link item.paddingY} instead.\n */\n set: function (value) {\n this.item.paddingY = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Legend.prototype, \"itemSpacing\", {\n get: function () {\n return this.item.marker.padding;\n },\n /**\n * @deprecated Please use {@link item.marker.padding} instead.\n */\n set: function (value) {\n this.item.marker.padding = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Legend.prototype, \"markerShape\", {\n get: function () {\n return this.item.marker.shape;\n },\n /**\n * @deprecated Please use {@link item.marker.shape} instead.\n */\n set: function (value) {\n this.item.marker.shape = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Legend.prototype, \"markerSize\", {\n get: function () {\n return this.item.marker.size;\n },\n /**\n * @deprecated Please use {@link item.marker.size} instead.\n */\n set: function (value) {\n this.item.marker.size = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Legend.prototype, \"strokeWidth\", {\n get: function () {\n return this.item.marker.strokeWidth;\n },\n /**\n * @deprecated Please use {@link item.marker.strokeWidth} instead.\n */\n set: function (value) {\n this.item.marker.strokeWidth = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Legend.prototype, \"color\", {\n get: function () {\n return this.item.label.color;\n },\n /**\n * @deprecated Please use {@link item.label.color} instead.\n */\n set: function (value) {\n this.item.label.color = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Legend.prototype, \"fontStyle\", {\n get: function () {\n return this.item.label.fontStyle;\n },\n /**\n * @deprecated Please use {@link item.label.fontStyle} instead.\n */\n set: function (value) {\n this.item.label.fontStyle = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Legend.prototype, \"fontWeight\", {\n get: function () {\n return this.item.label.fontWeight;\n },\n /**\n * @deprecated Please use {@link item.label.fontWeight} instead.\n */\n set: function (value) {\n this.item.label.fontWeight = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Legend.prototype, \"fontSize\", {\n get: function () {\n return this.item.label.fontSize;\n },\n /**\n * @deprecated Please use {@link item.label.fontSize} instead.\n */\n set: function (value) {\n this.item.label.fontSize = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Legend.prototype, \"fontFamily\", {\n get: function () {\n return this.item.label.fontFamily;\n },\n /**\n * @deprecated Please use {@link item.label.fontFamily} instead.\n */\n set: function (value) {\n this.item.label.fontFamily = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Legend.prototype, \"size\", {\n get: function () {\n return this._size;\n },\n enumerable: true,\n configurable: true\n });\n Legend.prototype.onDataChange = function (event) {\n this.group.visible = event.value.length > 0 && this.enabled;\n };\n Legend.prototype.onEnabledChange = function (event) {\n this.group.visible = event.value && this.data.length > 0;\n };\n Legend.prototype.onPositionChange = function (event) {\n switch (event.value) {\n case 'right':\n case 'left':\n this.orientation = LegendOrientation.Vertical;\n break;\n case 'bottom':\n case 'top':\n this.orientation = LegendOrientation.Horizontal;\n break;\n }\n };\n Legend.prototype.onMarkerShapeChange = function () {\n this.itemSelection = this.itemSelection.setData([]);\n this.itemSelection.exit.remove();\n if (this.group.scene) {\n this.group.scene.cancelRender();\n }\n };\n /**\n * The method is given the desired size of the legend, which only serves as a hint.\n * The vertically oriented legend will take as much horizontal space as needed, but will\n * respect the height constraints, and the horizontal legend will take as much vertical\n * space as needed in an attempt not to exceed the given width.\n * After the layout is done, the {@link size} will contain the actual size of the legend.\n * If the actual size is not the same as the previous actual size, the legend will fire\n * the 'layoutChange' event to communicate that another layout is needed, and the above\n * process should be repeated.\n * @param width\n * @param height\n */\n Legend.prototype.performLayout = function (width, height) {\n var item = this.item;\n var marker = item.marker, paddingX = item.paddingX, paddingY = item.paddingY;\n var updateSelection = this.itemSelection.setData(this.data, function (_, datum) {\n var MarkerShape = getMarker(marker.shape || datum.marker.shape);\n return datum.id + '-' + datum.itemId + '-' + MarkerShape.name;\n });\n updateSelection.exit.remove();\n var enterSelection = updateSelection.enter.append(MarkerLabel).each(function (node, datum) {\n var MarkerShape = getMarker(marker.shape || datum.marker.shape);\n node.marker = new MarkerShape();\n });\n var itemSelection = this.itemSelection = updateSelection.merge(enterSelection);\n var itemCount = itemSelection.size;\n // Update properties that affect the size of the legend items and measure them.\n var bboxes = [];\n var itemMarker = this.item.marker;\n var itemLabel = this.item.label;\n itemSelection.each(function (markerLabel, datum) {\n // TODO: measure only when one of these properties or data change (in a separate routine)\n markerLabel.markerSize = itemMarker.size;\n markerLabel.spacing = itemMarker.padding;\n markerLabel.fontStyle = itemLabel.fontStyle;\n markerLabel.fontWeight = itemLabel.fontWeight;\n markerLabel.fontSize = itemLabel.fontSize;\n markerLabel.fontFamily = itemLabel.fontFamily;\n markerLabel.text = datum.label.text;\n bboxes.push(markerLabel.computeBBox());\n });\n var itemHeight = bboxes.length && bboxes[0].height;\n var rowCount = 0;\n var columnWidth = 0;\n var paddedItemsWidth = 0;\n var paddedItemsHeight = 0;\n switch (this.orientation) {\n case LegendOrientation.Horizontal:\n if (!(isFinite(width) && width > 0)) {\n return false;\n }\n rowCount = 0;\n var columnCount = 0;\n // Split legend items into columns until the width is suitable.\n do {\n var itemsWidth = 0;\n columnCount = 0;\n columnWidth = 0;\n rowCount++;\n var i = 0;\n while (i < itemCount) {\n var bbox = bboxes[i];\n if (bbox.width > columnWidth) {\n columnWidth = bbox.width;\n }\n i++;\n if (i % rowCount === 0) {\n itemsWidth += columnWidth;\n columnWidth = 0;\n columnCount++;\n }\n }\n if (i % rowCount !== 0) {\n itemsWidth += columnWidth;\n columnCount++;\n }\n paddedItemsWidth = itemsWidth + (columnCount - 1) * paddingX;\n } while (paddedItemsWidth > width && columnCount > 1);\n paddedItemsHeight = itemHeight * rowCount + (rowCount - 1) * paddingY;\n break;\n case LegendOrientation.Vertical:\n if (!(isFinite(height) && height > 0)) {\n return false;\n }\n rowCount = itemCount * 2;\n // Split legend items into columns until the height is suitable.\n do {\n rowCount = (rowCount >> 1) + (rowCount % 2);\n columnWidth = 0;\n var itemsWidth = 0;\n var itemsHeight = 0;\n var columnCount_1 = 0;\n var i = 0;\n while (i < itemCount) {\n var bbox = bboxes[i];\n if (!columnCount_1) {\n itemsHeight += bbox.height;\n }\n if (bbox.width > columnWidth) {\n columnWidth = bbox.width;\n }\n i++;\n if (i % rowCount === 0) {\n itemsWidth += columnWidth;\n columnWidth = 0;\n columnCount_1++;\n }\n }\n if (i % rowCount !== 0) {\n itemsWidth += columnWidth;\n columnCount_1++;\n }\n paddedItemsWidth = itemsWidth + (columnCount_1 - 1) * paddingX;\n paddedItemsHeight = itemsHeight + (rowCount - 1) * paddingY;\n } while (paddedItemsHeight > height && rowCount > 1);\n break;\n }\n // Top-left corner of the first legend item.\n var startX = (width - paddedItemsWidth) / 2;\n var startY = (height - paddedItemsHeight) / 2;\n var x = 0;\n var y = 0;\n columnWidth = 0;\n // Position legend items using the layout computed above.\n itemSelection.each(function (markerLabel, datum, i) {\n // Round off for pixel grid alignment to work properly.\n markerLabel.translationX = Math.floor(startX + x);\n markerLabel.translationY = Math.floor(startY + y);\n var bbox = bboxes[i];\n if (bbox.width > columnWidth) {\n columnWidth = bbox.width;\n }\n if ((i + 1) % rowCount === 0) {\n x += columnWidth + paddingX;\n y = 0;\n columnWidth = 0;\n }\n else {\n y += bbox.height + paddingY;\n }\n });\n // Update legend item properties that don't affect the layout.\n this.update();\n var size = this._size;\n var oldSize = this.oldSize;\n size[0] = paddedItemsWidth;\n size[1] = paddedItemsHeight;\n if (size[0] !== oldSize[0] || size[1] !== oldSize[1]) {\n oldSize[0] = size[0];\n oldSize[1] = size[1];\n }\n };\n Legend.prototype.update = function () {\n var _this = this;\n this.itemSelection.each(function (markerLabel, datum) {\n var marker = datum.marker;\n markerLabel.markerFill = marker.fill;\n markerLabel.markerStroke = marker.stroke;\n markerLabel.markerStrokeWidth = _this.item.marker.strokeWidth;\n markerLabel.markerFillOpacity = marker.fillOpacity;\n markerLabel.markerStrokeOpacity = marker.strokeOpacity;\n markerLabel.opacity = datum.enabled ? 1 : 0.5;\n markerLabel.color = _this.item.label.color;\n });\n };\n Legend.prototype.getDatumForPoint = function (x, y) {\n var node = this.group.pickNode(x, y);\n if (node && node.parent) {\n return node.parent.datum;\n }\n };\n Legend.className = 'Legend';\n __decorate([\n reactive('layoutChange')\n ], Legend.prototype, \"data\", void 0);\n __decorate([\n reactive('layoutChange')\n ], Legend.prototype, \"enabled\", void 0);\n __decorate([\n reactive('layoutChange')\n ], Legend.prototype, \"orientation\", void 0);\n __decorate([\n reactive('layoutChange')\n ], Legend.prototype, \"position\", void 0);\n __decorate([\n reactive('layoutChange')\n ], Legend.prototype, \"spacing\", void 0);\n return Legend;\n}(Observable));\nexport { Legend };\n","var SizeMonitor = /** @class */ (function () {\n function SizeMonitor() {\n }\n SizeMonitor.init = function () {\n var _this = this;\n var NativeResizeObserver = window.ResizeObserver;\n if (NativeResizeObserver) {\n this.resizeObserver = new NativeResizeObserver(function (entries) {\n for (var _i = 0, entries_1 = entries; _i < entries_1.length; _i++) {\n var entry = entries_1[_i];\n var _a = entry.contentRect, width = _a.width, height = _a.height;\n _this.checkSize(_this.elements.get(entry.target), entry.target, width, height);\n }\n });\n }\n else { // polyfill (more reliable even in browsers that support ResizeObserver)\n var step = function () {\n _this.elements.forEach(function (entry, element) {\n var width = element.clientWidth ? element.clientWidth : 0;\n var height = element.clientHeight ? element.clientHeight : 0;\n _this.checkSize(entry, element, width, height);\n });\n };\n window.setInterval(step, 100);\n }\n this.ready = true;\n };\n SizeMonitor.checkSize = function (entry, element, width, height) {\n if (entry) {\n if (!entry.size || width !== entry.size.width || height !== entry.size.height) {\n entry.size = { width: width, height: height };\n entry.cb(entry.size, element);\n }\n }\n };\n // Only a single callback is supported.\n SizeMonitor.observe = function (element, cb) {\n if (!this.ready) {\n this.init();\n }\n this.unobserve(element);\n if (this.resizeObserver) {\n this.resizeObserver.observe(element);\n }\n this.elements.set(element, { cb: cb });\n };\n SizeMonitor.unobserve = function (element) {\n if (this.resizeObserver) {\n this.resizeObserver.unobserve(element);\n }\n this.elements.delete(element);\n };\n SizeMonitor.elements = new Map();\n SizeMonitor.requestAnimationFrameId = 0;\n SizeMonitor.ready = false;\n return SizeMonitor;\n}());\nexport { SizeMonitor };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n 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;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nimport { Group } from \"../../scene/group\";\nimport { Observable, reactive } from \"../../util/observable\";\nimport { ChartAxisDirection } from \"../chartAxis\";\nimport { createId } from \"../../util/id\";\nvar SeriesTooltip = /** @class */ (function (_super) {\n __extends(SeriesTooltip, _super);\n function SeriesTooltip() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.enabled = true;\n return _this;\n }\n __decorate([\n reactive('change')\n ], SeriesTooltip.prototype, \"enabled\", void 0);\n return SeriesTooltip;\n}(Observable));\nexport { SeriesTooltip };\nvar Series = /** @class */ (function (_super) {\n __extends(Series, _super);\n function Series() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.id = createId(_this);\n /**\n * The group node that contains all the nodes used to render this series.\n */\n _this.group = new Group();\n _this.directions = [ChartAxisDirection.X, ChartAxisDirection.Y];\n /**\n * @deprecated Use {@link tooltip.enabled} instead.\n */\n _this.tooltipEnabled = true;\n _this.data = undefined;\n _this.visible = true;\n _this.showInLegend = true;\n _this.cursor = 'default';\n _this.scheduleLayout = function () {\n _this.fireEvent({ type: 'layoutChange' });\n };\n _this.scheduleData = function () {\n _this.fireEvent({ type: 'dataChange' });\n };\n return _this;\n }\n Object.defineProperty(Series.prototype, \"type\", {\n get: function () {\n return this.constructor.type || '';\n },\n enumerable: true,\n configurable: true\n });\n Series.prototype.setColors = function (fills, strokes) { };\n /**\n * Returns the actual keys used (to fetch the values from `data` items) for the given direction.\n */\n Series.prototype.getKeys = function (direction) {\n var _this = this;\n var directionKeys = this.directionKeys;\n var keys = directionKeys && directionKeys[direction];\n var values = [];\n if (keys) {\n keys.forEach(function (key) {\n var value = _this[key];\n if (value) {\n if (Array.isArray(value)) {\n values.push.apply(values, value);\n }\n else {\n values.push(value);\n }\n }\n });\n }\n return values;\n };\n // Returns node data associated with the rendered portion of the series' data.\n Series.prototype.getNodeData = function () {\n return [];\n };\n Series.prototype.fireNodeClickEvent = function (event, datum) { };\n Series.prototype.toggleSeriesItem = function (itemId, enabled) {\n this.visible = enabled;\n };\n // Each series is expected to have its own logic to efficiently update its nodes\n // on hightlight changes.\n Series.prototype.onHighlightChange = function () { };\n Series.prototype.fixNumericExtent = function (extent, type) {\n if (!extent) {\n // if (type) {\n // console.warn(`The ${type}-domain could not be found (no valid values), using the default of [0, 1].`);\n // }\n return [0, 1];\n }\n var min = extent[0], max = extent[1];\n if (min instanceof Date) {\n min = min.getTime();\n }\n if (max instanceof Date) {\n max = max.getTime();\n }\n if (min === max) {\n var padding = Math.abs(min * 0.01);\n min -= padding;\n max += padding;\n // if (type) {\n // console.warn(`The ${type}-domain has zero length and has been automatically expanded`\n // + ` by 1 in each direction (from the single valid ${type}-value: ${min}).`);\n // }\n }\n if (!isFinite(min) || !isFinite(max)) {\n min = 0;\n max = 1;\n // if (type) {\n // console.warn(`The ${type}-domain has infinite length, using the default of [0, 1].`);\n // }\n }\n return [min, max];\n };\n __decorate([\n reactive('dataChange')\n ], Series.prototype, \"data\", void 0);\n __decorate([\n reactive('dataChange')\n ], Series.prototype, \"visible\", void 0);\n __decorate([\n reactive('layoutChange')\n ], Series.prototype, \"showInLegend\", void 0);\n return Series;\n}(Observable));\nexport { Series };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n 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;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nimport { Observable, reactive } from \"../../util/observable\";\nimport { Circle } from \"../marker/circle\";\nvar SeriesMarker = /** @class */ (function (_super) {\n __extends(SeriesMarker, _super);\n function SeriesMarker() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.enabled = true;\n /**\n * One of the predefined marker names, or a marker constructor function (for user-defined markers).\n * A series will create one marker instance per data point.\n */\n _this.shape = Circle;\n _this.size = 6;\n /**\n * In case a series has the `sizeKey` set, the `sizeKey` values along with the `size` and `maxSize` configs\n * will be used to determine the size of the marker. All values will be mapped to a marker size\n * within the `[size, maxSize]` range, where the largest values will correspond to the `maxSize`\n * and the lowest to the `size`.\n */\n _this.maxSize = 30;\n _this.strokeWidth = 1;\n return _this;\n }\n __decorate([\n reactive('change')\n ], SeriesMarker.prototype, \"enabled\", void 0);\n __decorate([\n reactive('change')\n ], SeriesMarker.prototype, \"shape\", void 0);\n __decorate([\n reactive('change')\n ], SeriesMarker.prototype, \"size\", void 0);\n __decorate([\n reactive('change')\n ], SeriesMarker.prototype, \"maxSize\", void 0);\n __decorate([\n reactive('change')\n ], SeriesMarker.prototype, \"domain\", void 0);\n __decorate([\n reactive('change')\n ], SeriesMarker.prototype, \"fill\", void 0);\n __decorate([\n reactive('change')\n ], SeriesMarker.prototype, \"stroke\", void 0);\n __decorate([\n reactive('change')\n ], SeriesMarker.prototype, \"strokeWidth\", void 0);\n return SeriesMarker;\n}(Observable));\nexport { SeriesMarker };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { Series } from \"../series\";\nimport { ChartAxisDirection } from \"../../chartAxis\";\nimport { SeriesMarker } from \"../seriesMarker\";\nvar CartesianSeries = /** @class */ (function (_super) {\n __extends(CartesianSeries, _super);\n function CartesianSeries() {\n var _a;\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.directionKeys = (_a = {},\n _a[ChartAxisDirection.X] = ['xKey'],\n _a[ChartAxisDirection.Y] = ['yKey'],\n _a);\n return _this;\n }\n return CartesianSeries;\n}(Series));\nexport { CartesianSeries };\nvar CartesianSeriesMarker = /** @class */ (function (_super) {\n __extends(CartesianSeriesMarker, _super);\n function CartesianSeriesMarker() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n return CartesianSeriesMarker;\n}(SeriesMarker));\nexport { CartesianSeriesMarker };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n 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;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nimport { Scene } from \"../scene/scene\";\nimport { Group } from \"../scene/group\";\nimport { Padding } from \"../util/padding\";\nimport { Shape } from \"../scene/shape/shape\";\nimport { Rect } from \"../scene/shape/rect\";\nimport { Legend } from \"./legend\";\nimport { find } from \"../util/array\";\nimport { SizeMonitor } from \"../util/sizeMonitor\";\nimport { Observable, reactive } from \"../util/observable\";\nimport { CartesianSeries } from \"./series/cartesian/cartesianSeries\";\nimport { createId } from \"../util/id\";\nvar defaultTooltipCss = \"\\n.ag-chart-tooltip {\\n display: table;\\n position: absolute;\\n user-select: none;\\n pointer-events: none;\\n white-space: nowrap;\\n z-index: 99999;\\n font: 12px Verdana, sans-serif;\\n color: black;\\n background: rgb(244, 244, 244);\\n border-radius: 5px;\\n box-shadow: 0 0 1px rgba(3, 3, 3, 0.7), 0.5vh 0.5vh 1vh rgba(3, 3, 3, 0.25);\\n}\\n\\n.ag-chart-tooltip-hidden {\\n top: -10000px !important;\\n}\\n\\n.ag-chart-tooltip-title {\\n font-weight: bold;\\n padding: 7px;\\n border-top-left-radius: 5px;\\n border-top-right-radius: 5px;\\n color: white;\\n background-color: #888888;\\n border-top-left-radius: 5px;\\n border-top-right-radius: 5px;\\n}\\n\\n.ag-chart-tooltip-content {\\n padding: 7px;\\n line-height: 1.7em;\\n border-bottom-left-radius: 5px;\\n border-bottom-right-radius: 5px;\\n overflow: hidden;\\n}\\n\\n.ag-chart-tooltip-content:empty {\\n padding: 0;\\n height: 7px;\\n}\\n\\n.ag-chart-tooltip-arrow::before {\\n content: \\\"\\\";\\n\\n position: absolute;\\n top: 100%;\\n left: 50%;\\n transform: translateX(-50%);\\n\\n border: 6px solid #989898;\\n\\n border-left-color: transparent;\\n border-right-color: transparent;\\n border-top-color: #989898;\\n border-bottom-color: transparent;\\n\\n width: 0;\\n height: 0;\\n\\n margin: 0 auto;\\n}\\n\\n.ag-chart-tooltip-arrow::after {\\n content: \\\"\\\";\\n\\n position: absolute;\\n top: 100%;\\n left: 50%;\\n transform: translateX(-50%);\\n\\n border: 5px solid black;\\n\\n border-left-color: transparent;\\n border-right-color: transparent;\\n border-top-color: rgb(244, 244, 244);\\n border-bottom-color: transparent;\\n\\n width: 0;\\n height: 0;\\n\\n margin: 0 auto;\\n}\\n\\n.ag-chart-wrapper {\\n box-sizing: border-box;\\n overflow: hidden;\\n}\\n\";\nexport function toTooltipHtml(input, defaults) {\n if (typeof input === 'string') {\n return input;\n }\n defaults = defaults || {};\n var _a = input.content, content = _a === void 0 ? defaults.content || '' : _a, _b = input.title, title = _b === void 0 ? defaults.title || undefined : _b, _c = input.color, color = _c === void 0 ? defaults.color || 'white' : _c, _d = input.backgroundColor, backgroundColor = _d === void 0 ? defaults.backgroundColor || '#888' : _d;\n var titleHtml = title ? \"
\" + title + \"
\" : '';\n return titleHtml + \"
\" + content + \"
\";\n}\nvar ChartTooltip = /** @class */ (function (_super) {\n __extends(ChartTooltip, _super);\n function ChartTooltip(chart) {\n var _this = _super.call(this) || this;\n _this.element = document.createElement('div');\n _this.enabled = true;\n _this.class = Chart.defaultTooltipClass;\n _this.delay = 0;\n /**\n * If `true`, the tooltip will be shown for the marker closest to the mouse cursor.\n * Only has effect on series with markers.\n */\n _this.tracking = true;\n _this.showTimeout = 0;\n _this.constrained = false;\n _this.chart = chart;\n _this.class = '';\n var tooltipRoot = document.body;\n tooltipRoot.appendChild(_this.element);\n // Detect when the chart becomes invisible and hide the tooltip as well.\n if (window.IntersectionObserver) {\n var target_1 = _this.chart.scene.canvas.element;\n var observer = new IntersectionObserver(function (entries) {\n for (var _i = 0, entries_1 = entries; _i < entries_1.length; _i++) {\n var entry = entries_1[_i];\n if (entry.target === target_1 && entry.intersectionRatio === 0) {\n _this.toggle(false);\n }\n }\n }, { root: tooltipRoot });\n observer.observe(target_1);\n _this.observer = observer;\n }\n return _this;\n }\n ChartTooltip.prototype.isVisible = function () {\n var element = this.element;\n if (element.classList) { // if not IE11\n return !element.classList.contains(Chart.defaultTooltipClass + '-hidden');\n }\n // IE11 part.\n var classes = element.getAttribute('class');\n if (classes) {\n return classes.split(' ').indexOf(Chart.defaultTooltipClass + '-hidden') < 0;\n }\n return false;\n };\n ChartTooltip.prototype.updateClass = function (visible, constrained) {\n var classList = [Chart.defaultTooltipClass, this.class];\n if (visible !== true) {\n classList.push(Chart.defaultTooltipClass + \"-hidden\");\n }\n if (constrained !== true) {\n classList.push(Chart.defaultTooltipClass + \"-arrow\");\n }\n this.element.setAttribute('class', classList.join(' '));\n };\n /**\n * Shows tooltip at the given event's coordinates.\n * If the `html` parameter is missing, moves the existing tooltip to the new position.\n */\n ChartTooltip.prototype.show = function (meta, html, instantly) {\n var _this = this;\n if (instantly === void 0) { instantly = false; }\n var el = this.element;\n if (html !== undefined) {\n el.innerHTML = html;\n }\n else if (!el.innerHTML) {\n return;\n }\n var left = meta.pageX - el.clientWidth / 2;\n var top = meta.pageY - el.clientHeight - 8;\n this.constrained = false;\n if (this.chart.container) {\n var tooltipRect = el.getBoundingClientRect();\n var minLeft = 0;\n var maxLeft = window.innerWidth - tooltipRect.width;\n if (left < minLeft) {\n left = minLeft;\n this.updateClass(true, this.constrained = true);\n }\n else if (left > maxLeft) {\n left = maxLeft;\n this.updateClass(true, this.constrained = true);\n }\n if (top < window.pageYOffset) {\n top = meta.pageY + 20;\n this.updateClass(true, this.constrained = true);\n }\n }\n el.style.left = left + \"px\";\n el.style.top = top + \"px\";\n if (this.delay > 0 && !instantly) {\n this.toggle(false);\n this.showTimeout = window.setTimeout(function () {\n _this.toggle(true);\n }, this.delay);\n return;\n }\n this.toggle(true);\n };\n ChartTooltip.prototype.toggle = function (visible) {\n if (!visible) {\n window.clearTimeout(this.showTimeout);\n if (this.chart.lastPick && !this.delay) {\n this.chart.dehighlightDatum();\n this.chart.lastPick = undefined;\n }\n }\n this.updateClass(visible, this.constrained);\n };\n ChartTooltip.prototype.destroy = function () {\n var parentNode = this.element.parentNode;\n if (parentNode) {\n parentNode.removeChild(this.element);\n }\n if (this.observer) {\n this.observer.unobserve(this.chart.scene.canvas.element);\n }\n };\n __decorate([\n reactive()\n ], ChartTooltip.prototype, \"enabled\", void 0);\n __decorate([\n reactive()\n ], ChartTooltip.prototype, \"class\", void 0);\n __decorate([\n reactive()\n ], ChartTooltip.prototype, \"delay\", void 0);\n __decorate([\n reactive()\n ], ChartTooltip.prototype, \"tracking\", void 0);\n return ChartTooltip;\n}(Observable));\nexport { ChartTooltip };\nvar Chart = /** @class */ (function (_super) {\n __extends(Chart, _super);\n function Chart(document) {\n if (document === void 0) { document = window.document; }\n var _this = _super.call(this) || this;\n _this.id = createId(_this);\n _this.background = new Rect();\n _this.legend = new Legend();\n _this.legendAutoPadding = new Padding();\n _this.captionAutoPadding = 0; // top padding only\n _this._container = undefined;\n _this._data = [];\n _this._autoSize = false;\n _this._tooltipClass = Chart.defaultTooltipClass;\n /**\n * @deprecated Please use {@link tooltip.tracking} instead.\n */\n _this.tooltipTracking = true;\n _this.padding = new Padding(20);\n _this._axes = [];\n _this._series = [];\n _this._axesChanged = false;\n _this._seriesChanged = false;\n _this.layoutCallbackId = 0;\n _this._performLayout = function () {\n _this.layoutCallbackId = 0;\n _this.background.width = _this.width;\n _this.background.height = _this.height;\n _this.performLayout();\n if (!_this.layoutPending) {\n _this.fireEvent({ type: 'layoutDone' });\n }\n };\n _this.dataCallbackId = 0;\n _this._onMouseDown = _this.onMouseDown.bind(_this);\n _this._onMouseUp = _this.onMouseUp.bind(_this);\n _this._onMouseMove = _this.onMouseMove.bind(_this);\n _this._onMouseOut = _this.onMouseOut.bind(_this);\n _this._onClick = _this.onClick.bind(_this);\n var root = new Group();\n var background = _this.background;\n background.fill = 'white';\n root.appendChild(background);\n var element = _this._element = document.createElement('div');\n element.setAttribute('class', 'ag-chart-wrapper');\n var scene = new Scene(document);\n _this.scene = scene;\n scene.root = root;\n scene.container = element;\n _this.autoSize = true;\n var legend = _this.legend;\n legend.addEventListener('layoutChange', _this.onLayoutChange, _this);\n legend.item.label.addPropertyListener('formatter', _this.updateLegend, _this);\n legend.addPropertyListener('position', _this.onLegendPositionChange, _this);\n _this.tooltip = new ChartTooltip(_this);\n _this.tooltip.addPropertyListener('class', function () { return _this.tooltip.toggle(); });\n if (Chart.tooltipDocuments.indexOf(document) < 0) {\n var styleElement = document.createElement('style');\n styleElement.innerHTML = defaultTooltipCss;\n // Make sure the default tooltip style goes before other styles so it can be overridden.\n document.head.insertBefore(styleElement, document.head.querySelector('style'));\n Chart.tooltipDocuments.push(document);\n }\n _this.setupDomListeners(scene.canvas.element);\n _this.addPropertyListener('title', _this.onCaptionChange);\n _this.addPropertyListener('subtitle', _this.onCaptionChange);\n _this.addEventListener('layoutChange', function () { return _this.layoutPending = true; });\n return _this;\n }\n Object.defineProperty(Chart.prototype, \"container\", {\n get: function () {\n return this._container;\n },\n set: function (value) {\n if (this._container !== value) {\n var parentNode = this.element.parentNode;\n if (parentNode != null) {\n parentNode.removeChild(this.element);\n }\n if (value) {\n value.appendChild(this.element);\n }\n this._container = value;\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Chart.prototype, \"data\", {\n get: function () {\n return this._data;\n },\n set: function (data) {\n this._data = data;\n this.series.forEach(function (series) { return series.data = data; });\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Chart.prototype, \"width\", {\n get: function () {\n return this.scene.width;\n },\n set: function (value) {\n this.autoSize = false;\n if (this.width !== value) {\n this.scene.resize(value, this.height);\n this.fireEvent({ type: 'layoutChange' });\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Chart.prototype, \"height\", {\n get: function () {\n return this.scene.height;\n },\n set: function (value) {\n this.autoSize = false;\n if (this.height !== value) {\n this.scene.resize(this.width, value);\n this.fireEvent({ type: 'layoutChange' });\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Chart.prototype, \"autoSize\", {\n get: function () {\n return this._autoSize;\n },\n set: function (value) {\n if (this._autoSize !== value) {\n this._autoSize = value;\n var style = this.element.style;\n if (value) {\n var chart_1 = this; // capture `this` for IE11\n SizeMonitor.observe(this.element, function (size) {\n if (size.width !== chart_1.width || size.height !== chart_1.height) {\n chart_1.scene.resize(size.width, size.height);\n chart_1.fireEvent({ type: 'layoutChange' });\n }\n });\n style.display = 'block';\n style.width = '100%';\n style.height = '100%';\n }\n else {\n SizeMonitor.unobserve(this.element);\n style.display = 'inline-block';\n style.width = 'auto';\n style.height = 'auto';\n }\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Chart.prototype, \"tooltipClass\", {\n get: function () {\n return this.tooltip.class;\n },\n /**\n * @deprecated Please use {@link tooltip.class} instead.\n */\n set: function (value) {\n this.tooltip.class = value;\n },\n enumerable: true,\n configurable: true\n });\n Chart.prototype.download = function (fileName) {\n this.scene.download(fileName);\n };\n Chart.prototype.destroy = function () {\n this.tooltip.destroy();\n SizeMonitor.unobserve(this.element);\n this.container = undefined;\n this.cleanupDomListeners(this.scene.canvas.element);\n this.scene.container = undefined;\n };\n Chart.prototype.onLayoutChange = function () {\n this.layoutPending = true;\n };\n Chart.prototype.onLegendPositionChange = function () {\n this.legendAutoPadding.clear();\n this.layoutPending = true;\n };\n Chart.prototype.onCaptionChange = function (event) {\n var value = event.value, oldValue = event.oldValue;\n if (oldValue) {\n oldValue.removeEventListener('change', this.onLayoutChange, this);\n this.scene.root.removeChild(oldValue.node);\n }\n if (value) {\n value.addEventListener('change', this.onLayoutChange, this);\n this.scene.root.appendChild(value.node);\n }\n };\n Object.defineProperty(Chart.prototype, \"element\", {\n get: function () {\n return this._element;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Chart.prototype, \"axes\", {\n get: function () {\n return this._axes;\n },\n set: function (values) {\n var _this = this;\n this._axes.forEach(function (axis) { return _this.detachAxis(axis); });\n // make linked axes go after the regular ones (simulates stable sort by `linkedTo` property)\n this._axes = values.filter(function (a) { return !a.linkedTo; }).concat(values.filter(function (a) { return a.linkedTo; }));\n this._axes.forEach(function (axis) { return _this.attachAxis(axis); });\n this.axesChanged = true;\n },\n enumerable: true,\n configurable: true\n });\n Chart.prototype.attachAxis = function (axis) {\n this.scene.root.insertBefore(axis.group, this.seriesRoot);\n };\n Chart.prototype.detachAxis = function (axis) {\n this.scene.root.removeChild(axis.group);\n };\n Object.defineProperty(Chart.prototype, \"series\", {\n get: function () {\n return this._series;\n },\n set: function (values) {\n var _this = this;\n this.removeAllSeries();\n values.forEach(function (series) { return _this.addSeries(series); });\n },\n enumerable: true,\n configurable: true\n });\n Chart.prototype.scheduleLayout = function () {\n this.layoutPending = true;\n };\n Chart.prototype.scheduleData = function () {\n // To prevent the chart from thinking the cursor is over the same node\n // after a change to data (the nodes are reused on data changes).\n this.dehighlightDatum();\n this.dataPending = true;\n };\n Chart.prototype.addSeries = function (series, before) {\n var _a = this, allSeries = _a.series, seriesRoot = _a.seriesRoot;\n var canAdd = allSeries.indexOf(series) < 0;\n if (canAdd) {\n var beforeIndex = before ? allSeries.indexOf(before) : -1;\n if (beforeIndex >= 0) {\n allSeries.splice(beforeIndex, 0, series);\n seriesRoot.insertBefore(series.group, before.group);\n }\n else {\n allSeries.push(series);\n seriesRoot.append(series.group);\n }\n this.initSeries(series);\n this.seriesChanged = true;\n this.axesChanged = true;\n return true;\n }\n return false;\n };\n Chart.prototype.initSeries = function (series) {\n series.chart = this;\n if (!series.data) {\n series.data = this.data;\n }\n series.addEventListener('layoutChange', this.scheduleLayout, this);\n series.addEventListener('dataChange', this.scheduleData, this);\n series.addEventListener('legendChange', this.updateLegend, this);\n series.addEventListener('nodeClick', this.onSeriesNodeClick, this);\n };\n Chart.prototype.freeSeries = function (series) {\n series.chart = undefined;\n series.removeEventListener('layoutChange', this.scheduleLayout, this);\n series.removeEventListener('dataChange', this.scheduleData, this);\n series.removeEventListener('legendChange', this.updateLegend, this);\n series.removeEventListener('nodeClick', this.onSeriesNodeClick, this);\n };\n Chart.prototype.addSeriesAfter = function (series, after) {\n var _a = this, allSeries = _a.series, seriesRoot = _a.seriesRoot;\n var canAdd = allSeries.indexOf(series) < 0;\n if (canAdd) {\n var afterIndex = after ? this.series.indexOf(after) : -1;\n if (afterIndex >= 0) {\n if (afterIndex + 1 < allSeries.length) {\n seriesRoot.insertBefore(series.group, allSeries[afterIndex + 1].group);\n }\n else {\n seriesRoot.append(series.group);\n }\n this.initSeries(series);\n allSeries.splice(afterIndex + 1, 0, series);\n }\n else {\n if (allSeries.length > 0) {\n seriesRoot.insertBefore(series.group, allSeries[0].group);\n }\n else {\n seriesRoot.append(series.group);\n }\n this.initSeries(series);\n allSeries.unshift(series);\n }\n this.seriesChanged = true;\n this.axesChanged = true;\n }\n return false;\n };\n Chart.prototype.removeSeries = function (series) {\n var index = this.series.indexOf(series);\n if (index >= 0) {\n this.series.splice(index, 1);\n this.freeSeries(series);\n this.seriesRoot.removeChild(series.group);\n this.seriesChanged = true;\n return true;\n }\n return false;\n };\n Chart.prototype.removeAllSeries = function () {\n var _this = this;\n this.series.forEach(function (series) {\n _this.freeSeries(series);\n _this.seriesRoot.removeChild(series.group);\n });\n this._series = []; // using `_series` instead of `series` to prevent infinite recursion\n this.seriesChanged = true;\n };\n Chart.prototype.assignSeriesToAxes = function () {\n var _this = this;\n this.axes.forEach(function (axis) {\n var axisName = axis.direction + 'Axis';\n var boundSeries = [];\n _this.series.forEach(function (series) {\n if (series[axisName] === axis) {\n boundSeries.push(series);\n }\n });\n axis.boundSeries = boundSeries;\n });\n this.seriesChanged = false;\n };\n Chart.prototype.assignAxesToSeries = function (force) {\n var _this = this;\n if (force === void 0) { force = false; }\n // This method has to run before `assignSeriesToAxes`.\n var directionToAxesMap = {};\n this.axes.forEach(function (axis) {\n var direction = axis.direction;\n var directionAxes = directionToAxesMap[direction] || (directionToAxesMap[direction] = []);\n directionAxes.push(axis);\n });\n this.series.forEach(function (series) {\n series.directions.forEach(function (direction) {\n var axisName = direction + 'Axis';\n if (!series[axisName] || force) {\n var directionAxes = directionToAxesMap[direction];\n if (directionAxes) {\n var axis = _this.findMatchingAxis(directionAxes, series.getKeys(direction));\n if (axis) {\n series[axisName] = axis;\n }\n }\n }\n });\n if (series instanceof CartesianSeries) {\n if (!series.xAxis) {\n console.warn(\"Could not find a matching xAxis for the \" + series.id + \" series.\");\n return;\n }\n if (!series.yAxis) {\n console.warn(\"Could not find a matching yAxis for the \" + series.id + \" series.\");\n return;\n }\n }\n });\n this.axesChanged = false;\n };\n Chart.prototype.findMatchingAxis = function (directionAxes, directionKeys) {\n for (var i = 0; i < directionAxes.length; i++) {\n var axis = directionAxes[i];\n var axisKeys = axis.keys;\n if (!axisKeys.length) {\n return axis;\n }\n else if (directionKeys) {\n for (var j = 0; j < directionKeys.length; j++) {\n if (axisKeys.indexOf(directionKeys[j]) >= 0) {\n return axis;\n }\n }\n }\n }\n };\n Object.defineProperty(Chart.prototype, \"axesChanged\", {\n get: function () {\n return this._axesChanged;\n },\n set: function (value) {\n this._axesChanged = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Chart.prototype, \"seriesChanged\", {\n get: function () {\n return this._seriesChanged;\n },\n set: function (value) {\n this._seriesChanged = value;\n if (value) {\n this.dataPending = true;\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Chart.prototype, \"layoutPending\", {\n /**\n * Only `true` while we are waiting for the layout to start.\n * This will be `false` if the layout has already started and is ongoing.\n */\n get: function () {\n return !!this.layoutCallbackId;\n },\n set: function (value) {\n if (value) {\n if (!(this.layoutCallbackId || this.dataPending)) {\n this.layoutCallbackId = requestAnimationFrame(this._performLayout);\n }\n }\n else if (this.layoutCallbackId) {\n cancelAnimationFrame(this.layoutCallbackId);\n this.layoutCallbackId = 0;\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Chart.prototype, \"dataPending\", {\n get: function () {\n return !!this.dataCallbackId;\n },\n set: function (value) {\n var _this = this;\n if (this.dataCallbackId) {\n clearTimeout(this.dataCallbackId);\n this.dataCallbackId = 0;\n }\n if (value) {\n this.dataCallbackId = window.setTimeout(function () {\n _this.dataPending = false;\n _this.processData();\n }, 0);\n }\n },\n enumerable: true,\n configurable: true\n });\n Chart.prototype.processData = function () {\n this.layoutPending = false;\n if (this.axesChanged) {\n this.assignAxesToSeries(true);\n this.assignSeriesToAxes();\n }\n if (this.seriesChanged) {\n this.assignSeriesToAxes();\n }\n this.series.filter(function (s) { return s.visible; }).forEach(function (series) { return series.processData(); });\n this.updateLegend();\n this.layoutPending = true;\n };\n Chart.prototype.updateLegend = function () {\n var legendData = [];\n this.series.filter(function (s) { return s.showInLegend; }).forEach(function (series) { return series.listSeriesItems(legendData); });\n var formatter = this.legend.item.label.formatter;\n if (formatter) {\n legendData.forEach(function (datum) { return datum.label.text = formatter({\n id: datum.id,\n itemId: datum.itemId,\n value: datum.label.text\n }); });\n }\n this.legend.data = legendData;\n };\n Chart.prototype.positionCaptions = function () {\n var _a = this, title = _a.title, subtitle = _a.subtitle;\n var titleVisible = false;\n var subtitleVisible = false;\n var spacing = 10;\n var paddingTop = spacing;\n if (title && title.enabled) {\n title.node.x = this.width / 2;\n title.node.y = paddingTop;\n titleVisible = true;\n var titleBBox = title.node.computeBBox(); // make sure to set node's x/y, then computeBBox\n if (titleBBox) {\n paddingTop = titleBBox.y + titleBBox.height;\n }\n if (subtitle && subtitle.enabled) {\n subtitle.node.x = this.width / 2;\n subtitle.node.y = paddingTop + spacing;\n subtitleVisible = true;\n var subtitleBBox = subtitle.node.computeBBox();\n if (subtitleBBox) {\n paddingTop = subtitleBBox.y + subtitleBBox.height;\n }\n }\n }\n if (title) {\n title.node.visible = titleVisible;\n }\n if (subtitle) {\n subtitle.node.visible = subtitleVisible;\n }\n this.captionAutoPadding = Math.floor(paddingTop);\n };\n Chart.prototype.positionLegend = function () {\n if (!this.legend.enabled || !this.legend.data.length) {\n return;\n }\n var _a = this, legend = _a.legend, captionAutoPadding = _a.captionAutoPadding, legendAutoPadding = _a.legendAutoPadding;\n var width = this.width;\n var height = this.height - captionAutoPadding;\n var legendGroup = legend.group;\n var legendSpacing = legend.spacing;\n var translationX = 0;\n var translationY = 0;\n var legendBBox;\n switch (legend.position) {\n case 'bottom':\n legend.performLayout(width - legendSpacing * 2, 0);\n legendBBox = legendGroup.computeBBox();\n translationX = (width - legendBBox.width) / 2 - legendBBox.x;\n translationY = captionAutoPadding + height - legendBBox.height - legendBBox.y - legendSpacing;\n legendAutoPadding.bottom = legendBBox.height;\n break;\n case 'top':\n legend.performLayout(width - legendSpacing * 2, 0);\n legendBBox = legendGroup.computeBBox();\n translationX = (width - legendBBox.width) / 2 - legendBBox.x;\n translationY = captionAutoPadding + legendSpacing - legendBBox.y;\n legendAutoPadding.top = legendBBox.height;\n break;\n case 'left':\n legend.performLayout(0, height - legendSpacing * 2);\n legendBBox = legendGroup.computeBBox();\n translationX = legendSpacing - legendBBox.x;\n translationY = captionAutoPadding + (height - legendBBox.height) / 2 - legendBBox.y;\n legendAutoPadding.left = legendBBox.width;\n break;\n default: // case 'right':\n legend.performLayout(0, height - legendSpacing * 2);\n legendBBox = legendGroup.computeBBox();\n translationX = width - legendBBox.width - legendBBox.x - legendSpacing;\n translationY = captionAutoPadding + (height - legendBBox.height) / 2 - legendBBox.y;\n legendAutoPadding.right = legendBBox.width;\n break;\n }\n // Round off for pixel grid alignment to work properly.\n legendGroup.translationX = Math.floor(translationX + legendGroup.translationX);\n legendGroup.translationY = Math.floor(translationY + legendGroup.translationY);\n };\n Chart.prototype.setupDomListeners = function (chartElement) {\n chartElement.addEventListener('mousedown', this._onMouseDown);\n chartElement.addEventListener('mousemove', this._onMouseMove);\n chartElement.addEventListener('mouseup', this._onMouseUp);\n chartElement.addEventListener('mouseout', this._onMouseOut);\n chartElement.addEventListener('click', this._onClick);\n };\n Chart.prototype.cleanupDomListeners = function (chartElement) {\n chartElement.removeEventListener('mousedown', this._onMouseDown);\n chartElement.removeEventListener('mousemove', this._onMouseMove);\n chartElement.removeEventListener('mouseup', this._onMouseUp);\n chartElement.removeEventListener('mouseout', this._onMouseOut);\n chartElement.removeEventListener('click', this._onClick);\n };\n Chart.prototype.getSeriesRect = function () {\n return this.seriesRect;\n };\n // x/y are local canvas coordinates in CSS pixels, not actual pixels\n Chart.prototype.pickSeriesNode = function (x, y) {\n if (!this.seriesRect || !this.seriesRect.containsPoint(x, y)) {\n return undefined;\n }\n var allSeries = this.series;\n var node = undefined;\n for (var i = allSeries.length - 1; i >= 0; i--) {\n var series = allSeries[i];\n node = series.group.pickNode(x, y);\n if (node) {\n return {\n series: series,\n node: node\n };\n }\n }\n };\n // Provided x/y are in canvas coordinates.\n Chart.prototype.pickClosestSeriesNodeDatum = function (x, y) {\n if (!this.seriesRect || !this.seriesRect.containsPoint(x, y)) {\n return undefined;\n }\n var allSeries = this.series;\n function getDistance(p1, p2) {\n return Math.sqrt(Math.pow((p1.x - p2.x), 2) + Math.pow((p1.y - p2.y), 2));\n }\n var minDistance = Infinity;\n var closestDatum;\n var _loop_1 = function (i) {\n var series = allSeries[i];\n if (!series.visible) {\n return \"continue\";\n }\n var hitPoint = series.group.transformPoint(x, y);\n series.getNodeData().forEach(function (datum) {\n if (!datum.point) {\n return;\n }\n var distance = getDistance(hitPoint, datum.point);\n if (distance < minDistance) {\n minDistance = distance;\n closestDatum = datum;\n }\n });\n };\n for (var i = allSeries.length - 1; i >= 0; i--) {\n _loop_1(i);\n }\n if (closestDatum) {\n return closestDatum;\n }\n };\n Chart.prototype.onMouseMove = function (event) {\n if (this.tooltip.enabled) {\n if (this.tooltip.delay > 0) {\n this.tooltip.toggle(false);\n }\n this.handleTooltip(event);\n }\n };\n Chart.prototype.handleTooltip = function (event) {\n var _a = this, lastPick = _a.lastPick, tooltipTracking = _a.tooltip.tracking;\n var offsetX = event.offsetX, offsetY = event.offsetY;\n var pick = this.pickSeriesNode(offsetX, offsetY);\n var nodeDatum;\n if (pick && pick.node instanceof Shape) {\n var node = pick.node;\n nodeDatum = node.datum;\n if (lastPick && lastPick.datum === nodeDatum) {\n lastPick.node = node;\n lastPick.event = event;\n }\n // Marker nodes will have the `point` info in their datums.\n // Highlight if not a marker node or, if not in the tracking mode, highlight markers too.\n if ((!node.datum.point || !tooltipTracking)) {\n if (!lastPick // cursor moved from empty space to a node\n || lastPick.node !== node) { // cursor moved from one node to another\n this.onSeriesDatumPick(event, node.datum, node, event);\n }\n else if (pick.series.tooltip.enabled) { // cursor moved within the same node\n this.tooltip.show(event);\n }\n // A non-marker node (takes precedence over marker nodes) was highlighted.\n // Or we are not in the tracking mode.\n // Either way, we are done at this point.\n return;\n }\n }\n var hideTooltip = false;\n // In tracking mode a tooltip is shown for the closest rendered datum.\n // This makes it easier to show tooltips when markers are small and/or plentiful\n // and also gives the ability to show tooltips even when the series were configured\n // to not render markers.\n if (tooltipTracking) {\n var closestDatum = this.pickClosestSeriesNodeDatum(offsetX, offsetY);\n if (closestDatum && closestDatum.point) {\n var _b = closestDatum.point, x = _b.x, y = _b.y;\n var canvas = this.scene.canvas;\n var point = closestDatum.series.group.inverseTransformPoint(x, y);\n var canvasRect = canvas.element.getBoundingClientRect();\n this.onSeriesDatumPick({\n pageX: Math.round(canvasRect.left + window.pageXOffset + point.x),\n pageY: Math.round(canvasRect.top + window.pageYOffset + point.y)\n }, closestDatum, nodeDatum === closestDatum && pick ? pick.node : undefined, event);\n }\n else {\n hideTooltip = true;\n }\n }\n if (lastPick && (hideTooltip || !tooltipTracking)) {\n // Cursor moved from a non-marker node to empty space.\n this.dehighlightDatum();\n this.tooltip.toggle(false);\n this.lastPick = undefined;\n }\n };\n Chart.prototype.onMouseDown = function (event) { };\n Chart.prototype.onMouseUp = function (event) { };\n Chart.prototype.onMouseOut = function (event) {\n this.tooltip.toggle(false);\n };\n Chart.prototype.onClick = function (event) {\n if (this.checkSeriesNodeClick()) {\n return;\n }\n if (this.checkLegendClick(event)) {\n return;\n }\n this.fireEvent({\n type: 'click',\n event: event\n });\n };\n Chart.prototype.checkSeriesNodeClick = function () {\n var lastPick = this.lastPick;\n if (lastPick && lastPick.event && lastPick.node) {\n var event_1 = lastPick.event, datum = lastPick.datum;\n datum.series.fireNodeClickEvent(event_1, datum);\n return true;\n }\n return false;\n };\n Chart.prototype.onSeriesNodeClick = function (event) {\n this.fireEvent(__assign(__assign({}, event), { type: 'seriesNodeClick' }));\n };\n Chart.prototype.checkLegendClick = function (event) {\n var datum = this.legend.getDatumForPoint(event.offsetX, event.offsetY);\n if (datum) {\n var id_1 = datum.id, itemId = datum.itemId, enabled = datum.enabled;\n var series = find(this.series, function (series) { return series.id === id_1; });\n if (series) {\n series.toggleSeriesItem(itemId, !enabled);\n if (enabled) {\n this.tooltip.toggle(false);\n }\n this.legend.fireEvent({\n type: 'click',\n event: event,\n itemId: itemId,\n enabled: !enabled\n });\n return true;\n }\n }\n return false;\n };\n Chart.prototype.onSeriesDatumPick = function (meta, datum, node, event) {\n if (this.lastPick) {\n this.dehighlightDatum();\n }\n this.lastPick = {\n datum: datum,\n node: node,\n event: event\n };\n this.highlightDatum(datum, node);\n var html = datum.series.tooltip.enabled && datum.series.getTooltipHtml(datum);\n if (html) {\n this.tooltip.show(meta, html);\n }\n };\n Chart.prototype.highlightDatum = function (datum, node) {\n var style = this.scene.canvas.element.style;\n this.highlightedDatum = datum;\n this.series.forEach(function (s) {\n if (node) {\n style.cursor = s.cursor;\n }\n s.onHighlightChange();\n });\n };\n Chart.prototype.dehighlightDatum = function () {\n if (this.highlightedDatum) {\n this.scene.canvas.element.style.cursor = 'default';\n this.highlightedDatum = undefined;\n this.series.forEach(function (s) { return s.onHighlightChange(); });\n }\n };\n Chart.defaultTooltipClass = 'ag-chart-tooltip';\n Chart.tooltipDocuments = [];\n __decorate([\n reactive('layoutChange')\n ], Chart.prototype, \"padding\", void 0);\n __decorate([\n reactive('layoutChange')\n ], Chart.prototype, \"title\", void 0);\n __decorate([\n reactive('layoutChange')\n ], Chart.prototype, \"subtitle\", void 0);\n return Chart;\n}(Observable));\nexport { Chart };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { Node } from \"./node\";\nimport { Path2D } from \"./path2D\";\nimport { BBox } from \"./bbox\";\n/**\n * Acts as `Group` node but with specified bounds that form a rectangle.\n * Any parts of the child nodes outside that rectangle will not be visible.\n * Unlike the `Group` node, the `ClipRect` node cannot be transformed.\n */\nvar ClipRect = /** @class */ (function (_super) {\n __extends(ClipRect, _super);\n function ClipRect() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.isContainerNode = true;\n _this.path = new Path2D();\n _this._enabled = true;\n _this._dirtyPath = true;\n _this._x = 0;\n _this._y = 0;\n _this._width = 10;\n _this._height = 10;\n return _this;\n }\n ClipRect.prototype.containsPoint = function (x, y) {\n var point = this.transformPoint(x, y);\n return point.x >= this.x && point.x <= this.x + this.width\n && point.y >= this.y && point.y <= this.y + this.height;\n };\n Object.defineProperty(ClipRect.prototype, \"enabled\", {\n get: function () {\n return this._enabled;\n },\n set: function (value) {\n if (this._enabled !== value) {\n this._enabled = value;\n this.dirty = true;\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(ClipRect.prototype, \"dirtyPath\", {\n get: function () {\n return this._dirtyPath;\n },\n set: function (value) {\n if (this._dirtyPath !== value) {\n this._dirtyPath = value;\n if (value) {\n this.dirty = true;\n }\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(ClipRect.prototype, \"x\", {\n get: function () {\n return this._x;\n },\n set: function (value) {\n if (this._x !== value) {\n this._x = value;\n this.dirtyPath = true;\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(ClipRect.prototype, \"y\", {\n get: function () {\n return this._y;\n },\n set: function (value) {\n if (this._y !== value) {\n this._y = value;\n this.dirtyPath = true;\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(ClipRect.prototype, \"width\", {\n get: function () {\n return this._width;\n },\n set: function (value) {\n if (this._width !== value) {\n this._width = value;\n this.dirtyPath = true;\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(ClipRect.prototype, \"height\", {\n get: function () {\n return this._height;\n },\n set: function (value) {\n if (this._height !== value) {\n this._height = value;\n this.dirtyPath = true;\n }\n },\n enumerable: true,\n configurable: true\n });\n ClipRect.prototype.updatePath = function () {\n var path = this.path;\n path.clear();\n path.rect(this.x, this.y, this.width, this.height);\n this.dirtyPath = false;\n };\n ClipRect.prototype.computeBBox = function () {\n var _a = this, x = _a.x, y = _a.y, width = _a.width, height = _a.height;\n return new BBox(x, y, width, height);\n };\n ClipRect.prototype.render = function (ctx) {\n if (this.enabled) {\n if (this.dirtyPath) {\n this.updatePath();\n }\n this.scene.appendPath(this.path);\n ctx.clip();\n }\n var children = this.children;\n var n = children.length;\n for (var i = 0; i < n; i++) {\n ctx.save();\n var child = children[i];\n if (child.visible) {\n child.render(ctx);\n }\n ctx.restore();\n }\n // debug\n // this.computeBBox().render(ctx, {\n // label: this.id,\n // resetTransform: true,\n // fillStyle: 'rgba(0, 0, 0, 0.5)'\n // });\n };\n ClipRect.className = 'ClipRect';\n return ClipRect;\n}(Node));\nexport { ClipRect };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { Path } from \"../../scene/shape/path\";\nimport { BBox } from \"../../scene/bbox\";\nvar RangeHandle = /** @class */ (function (_super) {\n __extends(RangeHandle, _super);\n function RangeHandle() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this._fill = '#f2f2f2';\n _this._stroke = '#999999';\n _this._strokeWidth = 1;\n _this._lineCap = 'square';\n _this._centerX = 0;\n _this._centerY = 0;\n // Use an even number for better looking results.\n _this._width = 8;\n // Use an even number for better looking results.\n _this._gripLineGap = 2;\n // Use an even number for better looking results.\n _this._gripLineLength = 8;\n _this._height = 16;\n return _this;\n }\n Object.defineProperty(RangeHandle.prototype, \"centerX\", {\n get: function () {\n return this._centerX;\n },\n set: function (value) {\n if (this._centerX !== value) {\n this._centerX = value;\n this.dirtyPath = true;\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(RangeHandle.prototype, \"centerY\", {\n get: function () {\n return this._centerY;\n },\n set: function (value) {\n if (this._centerY !== value) {\n this._centerY = value;\n this.dirtyPath = true;\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(RangeHandle.prototype, \"width\", {\n get: function () {\n return this._width;\n },\n set: function (value) {\n if (this._width !== value) {\n this._width = value;\n this.dirtyPath = true;\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(RangeHandle.prototype, \"gripLineGap\", {\n get: function () {\n return this._gripLineGap;\n },\n set: function (value) {\n if (this._gripLineGap !== value) {\n this._gripLineGap = value;\n this.dirtyPath = true;\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(RangeHandle.prototype, \"gripLineLength\", {\n get: function () {\n return this._gripLineLength;\n },\n set: function (value) {\n if (this._gripLineLength !== value) {\n this._gripLineLength = value;\n this.dirtyPath = true;\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(RangeHandle.prototype, \"height\", {\n get: function () {\n return this._height;\n },\n set: function (value) {\n if (this._height !== value) {\n this._height = value;\n this.dirtyPath = true;\n }\n },\n enumerable: true,\n configurable: true\n });\n RangeHandle.prototype.computeBBox = function () {\n var _a = this, centerX = _a.centerX, centerY = _a.centerY, width = _a.width, height = _a.height;\n var x = centerX - width / 2;\n var y = centerY - height / 2;\n return new BBox(x, y, width, height);\n };\n RangeHandle.prototype.isPointInPath = function (x, y) {\n var point = this.transformPoint(x, y);\n var bbox = this.computeBBox();\n return bbox.containsPoint(point.x, point.y);\n };\n RangeHandle.prototype.updatePath = function () {\n var _a = this, path = _a.path, centerX = _a.centerX, centerY = _a.centerY, width = _a.width, height = _a.height;\n var _b = this, a = _b.alignment, al = _b.align;\n path.clear();\n var x = centerX - width / 2;\n var y = centerY - height / 2;\n var ax = al(a, x);\n var ay = al(a, y);\n var axw = ax + al(a, x, width);\n var ayh = ay + al(a, y, height);\n // Handle.\n path.moveTo(ax, ay);\n path.lineTo(axw, ay);\n path.lineTo(axw, ayh);\n path.lineTo(ax, ayh);\n path.lineTo(ax, ay);\n // Grip lines.\n var dx = this.gripLineGap / 2;\n var dy = this.gripLineLength / 2;\n path.moveTo(al(a, centerX - dx), al(a, centerY - dy));\n path.lineTo(al(a, centerX - dx), al(a, centerY + dy));\n path.moveTo(al(a, centerX + dx), al(a, centerY - dy));\n path.lineTo(al(a, centerX + dx), al(a, centerY + dy));\n };\n RangeHandle.className = 'RangeHandle';\n return RangeHandle;\n}(Path));\nexport { RangeHandle };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { Path } from \"../../scene/shape/path\";\nimport { BBox } from \"../../scene/bbox\";\nvar RangeMask = /** @class */ (function (_super) {\n __extends(RangeMask, _super);\n function RangeMask() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this._stroke = '#999999';\n _this._strokeWidth = 1;\n _this._fill = '#999999';\n _this._fillOpacity = 0.2;\n _this._lineCap = 'square';\n _this._x = 0;\n _this._y = 0;\n _this._width = 200;\n _this._height = 30;\n _this.minRange = 0.05;\n _this._min = 0;\n _this._max = 1;\n return _this;\n }\n Object.defineProperty(RangeMask.prototype, \"x\", {\n get: function () {\n return this._x;\n },\n set: function (value) {\n if (this._x !== value) {\n this._x = value;\n this.dirtyPath = true;\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(RangeMask.prototype, \"y\", {\n get: function () {\n return this._y;\n },\n set: function (value) {\n if (this._y !== value) {\n this._y = value;\n this.dirtyPath = true;\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(RangeMask.prototype, \"width\", {\n get: function () {\n return this._width;\n },\n set: function (value) {\n if (this._width !== value) {\n this._width = value;\n this.dirtyPath = true;\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(RangeMask.prototype, \"height\", {\n get: function () {\n return this._height;\n },\n set: function (value) {\n if (this._height !== value) {\n this._height = value;\n this.dirtyPath = true;\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(RangeMask.prototype, \"min\", {\n get: function () {\n return this._min;\n },\n set: function (value) {\n value = Math.min(Math.max(value, 0), this.max - this.minRange);\n if (isNaN(value)) {\n return;\n }\n if (this._min !== value) {\n this._min = value;\n this.dirtyPath = true;\n this.onRangeChange && this.onRangeChange(value, this.max);\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(RangeMask.prototype, \"max\", {\n get: function () {\n return this._max;\n },\n set: function (value) {\n value = Math.max(Math.min(value, 1), this.min + this.minRange);\n if (isNaN(value)) {\n return;\n }\n if (this._max !== value) {\n this._max = value;\n this.dirtyPath = true;\n this.onRangeChange && this.onRangeChange(this.min, value);\n }\n },\n enumerable: true,\n configurable: true\n });\n RangeMask.prototype.computeBBox = function () {\n var _a = this, x = _a.x, y = _a.y, width = _a.width, height = _a.height;\n return new BBox(x, y, width, height);\n };\n RangeMask.prototype.computeVisibleRangeBBox = function () {\n var _a = this, x = _a.x, y = _a.y, width = _a.width, height = _a.height, min = _a.min, max = _a.max;\n var minX = x + width * min;\n var maxX = x + width * max;\n return new BBox(minX, y, maxX - minX, height);\n };\n RangeMask.prototype.updatePath = function () {\n var _a = this, path = _a.path, x = _a.x, y = _a.y, width = _a.width, height = _a.height, min = _a.min, max = _a.max;\n var _b = this, a = _b.alignment, al = _b.align;\n path.clear();\n var ax = al(a, x);\n var ay = al(a, y);\n var axw = ax + al(a, x, width);\n var ayh = ay + al(a, y, height);\n // Whole range.\n path.moveTo(ax, ay);\n path.lineTo(axw, ay);\n path.lineTo(axw, ayh);\n path.lineTo(ax, ayh);\n path.lineTo(ax, ay);\n var minX = al(a, x + width * min);\n var maxX = al(a, x + width * max);\n // Visible range.\n path.moveTo(minX, ay);\n path.lineTo(minX, ayh);\n path.lineTo(maxX, ayh);\n path.lineTo(maxX, ay);\n path.lineTo(minX, ay);\n };\n RangeMask.className = 'RangeMask';\n return RangeMask;\n}(Path));\nexport { RangeMask };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { Group } from \"../../scene/group\";\nimport { RangeHandle } from \"./rangeHandle\";\nimport { RangeMask } from \"./rangeMask\";\nvar RangeSelector = /** @class */ (function (_super) {\n __extends(RangeSelector, _super);\n function RangeSelector() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.isContainerNode = true;\n _this.minHandle = new RangeHandle();\n _this.maxHandle = new RangeHandle();\n _this.mask = (function () {\n var _a = RangeSelector.defaults, x = _a.x, y = _a.y, width = _a.width, height = _a.height, min = _a.min, max = _a.max;\n var mask = new RangeMask();\n mask.x = x;\n mask.y = y;\n mask.width = width;\n mask.height = height;\n mask.min = min;\n mask.max = max;\n var _b = _this, minHandle = _b.minHandle, maxHandle = _b.maxHandle;\n minHandle.centerX = x;\n maxHandle.centerX = x + width;\n minHandle.centerY = maxHandle.centerY = y + height / 2;\n _this.append([mask, minHandle, maxHandle]);\n mask.onRangeChange = function (min, max) {\n _this.updateHandles();\n _this.onRangeChange && _this.onRangeChange(min, max);\n };\n return mask;\n })();\n _this._x = RangeSelector.defaults.x;\n _this._y = RangeSelector.defaults.y;\n _this._width = RangeSelector.defaults.width;\n _this._height = RangeSelector.defaults.height;\n _this._min = RangeSelector.defaults.min;\n _this._max = RangeSelector.defaults.max;\n return _this;\n }\n Object.defineProperty(RangeSelector.prototype, \"x\", {\n get: function () {\n return this.mask.x;\n },\n set: function (value) {\n this.mask.x = value;\n this.updateHandles();\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(RangeSelector.prototype, \"y\", {\n get: function () {\n return this.mask.y;\n },\n set: function (value) {\n this.mask.y = value;\n this.updateHandles();\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(RangeSelector.prototype, \"width\", {\n get: function () {\n return this.mask.width;\n },\n set: function (value) {\n this.mask.width = value;\n this.updateHandles();\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(RangeSelector.prototype, \"height\", {\n get: function () {\n return this.mask.height;\n },\n set: function (value) {\n this.mask.height = value;\n this.updateHandles();\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(RangeSelector.prototype, \"min\", {\n get: function () {\n return this.mask.min;\n },\n set: function (value) {\n this.mask.min = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(RangeSelector.prototype, \"max\", {\n get: function () {\n return this.mask.max;\n },\n set: function (value) {\n this.mask.max = value;\n },\n enumerable: true,\n configurable: true\n });\n RangeSelector.prototype.updateHandles = function () {\n var _a = this, minHandle = _a.minHandle, maxHandle = _a.maxHandle, x = _a.x, y = _a.y, width = _a.width, height = _a.height, mask = _a.mask;\n minHandle.centerX = x + width * mask.min;\n maxHandle.centerX = x + width * mask.max;\n minHandle.centerY = maxHandle.centerY = y + height / 2;\n };\n RangeSelector.prototype.computeBBox = function () {\n return this.mask.computeBBox();\n };\n RangeSelector.prototype.computeVisibleRangeBBox = function () {\n return this.mask.computeVisibleRangeBBox();\n };\n RangeSelector.prototype.render = function (ctx) {\n if (this.dirtyTransform) {\n this.computeTransformMatrix();\n }\n this.matrix.toContext(ctx);\n var _a = this, mask = _a.mask, minHandle = _a.minHandle, maxHandle = _a.maxHandle;\n [mask, minHandle, maxHandle].forEach(function (child) {\n ctx.save();\n if (child.visible) {\n child.render(ctx);\n }\n ctx.restore();\n });\n };\n RangeSelector.className = 'Range';\n RangeSelector.defaults = {\n x: 0,\n y: 0,\n width: 200,\n height: 30,\n min: 0,\n max: 1\n };\n return RangeSelector;\n}(Group));\nexport { RangeSelector };\n","var NavigatorMask = /** @class */ (function () {\n function NavigatorMask(rangeMask) {\n this.rm = rangeMask;\n }\n Object.defineProperty(NavigatorMask.prototype, \"fill\", {\n get: function () {\n return this.rm.fill;\n },\n set: function (value) {\n this.rm.fill = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(NavigatorMask.prototype, \"stroke\", {\n get: function () {\n return this.rm.stroke;\n },\n set: function (value) {\n this.rm.stroke = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(NavigatorMask.prototype, \"strokeWidth\", {\n get: function () {\n return this.rm.strokeWidth;\n },\n set: function (value) {\n this.rm.strokeWidth = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(NavigatorMask.prototype, \"fillOpacity\", {\n get: function () {\n return this.rm.fillOpacity;\n },\n set: function (value) {\n this.rm.fillOpacity = value;\n },\n enumerable: true,\n configurable: true\n });\n return NavigatorMask;\n}());\nexport { NavigatorMask };\n","var NavigatorHandle = /** @class */ (function () {\n function NavigatorHandle(rangeHandle) {\n this.rh = rangeHandle;\n }\n Object.defineProperty(NavigatorHandle.prototype, \"fill\", {\n get: function () {\n return this.rh.fill;\n },\n set: function (value) {\n this.rh.fill = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(NavigatorHandle.prototype, \"stroke\", {\n get: function () {\n return this.rh.stroke;\n },\n set: function (value) {\n this.rh.stroke = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(NavigatorHandle.prototype, \"strokeWidth\", {\n get: function () {\n return this.rh.strokeWidth;\n },\n set: function (value) {\n this.rh.strokeWidth = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(NavigatorHandle.prototype, \"width\", {\n get: function () {\n return this.rh.width;\n },\n set: function (value) {\n this.rh.width = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(NavigatorHandle.prototype, \"height\", {\n get: function () {\n return this.rh.height;\n },\n set: function (value) {\n this.rh.height = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(NavigatorHandle.prototype, \"gripLineGap\", {\n get: function () {\n return this.rh.gripLineGap;\n },\n set: function (value) {\n this.rh.gripLineGap = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(NavigatorHandle.prototype, \"gripLineLength\", {\n get: function () {\n return this.rh.gripLineLength;\n },\n set: function (value) {\n this.rh.gripLineLength = value;\n },\n enumerable: true,\n configurable: true\n });\n return NavigatorHandle;\n}());\nexport { NavigatorHandle };\n","import { RangeSelector } from \"../shapes/rangeSelector\";\nimport { ChartAxisDirection } from \"../chartAxis\";\nimport { BBox } from \"../../scene/bbox\";\nimport { NavigatorMask } from \"./navigatorMask\";\nimport { NavigatorHandle } from \"./navigatorHandle\";\nvar Navigator = /** @class */ (function () {\n function Navigator(chart) {\n var _this = this;\n this.rs = new RangeSelector();\n this.mask = new NavigatorMask(this.rs.mask);\n this.minHandle = new NavigatorHandle(this.rs.minHandle);\n this.maxHandle = new NavigatorHandle(this.rs.maxHandle);\n this.minHandleDragging = false;\n this.maxHandleDragging = false;\n this.panHandleOffset = NaN;\n this._margin = 10;\n this.chart = chart;\n chart.scene.root.append(this.rs);\n this.rs.onRangeChange = function (min, max) { return _this.updateAxes(min, max); };\n }\n Object.defineProperty(Navigator.prototype, \"enabled\", {\n get: function () {\n return this.rs.visible;\n },\n set: function (value) {\n this.rs.visible = value;\n this.chart.layoutPending = true;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Navigator.prototype, \"x\", {\n get: function () {\n return this.rs.x;\n },\n set: function (value) {\n this.rs.x = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Navigator.prototype, \"y\", {\n get: function () {\n return this.rs.y;\n },\n set: function (value) {\n this.rs.y = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Navigator.prototype, \"width\", {\n get: function () {\n return this.rs.width;\n },\n set: function (value) {\n this.rs.width = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Navigator.prototype, \"height\", {\n get: function () {\n return this.rs.height;\n },\n set: function (value) {\n this.rs.height = value;\n this.chart.layoutPending = true;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Navigator.prototype, \"margin\", {\n get: function () {\n return this._margin;\n },\n set: function (value) {\n this._margin = value;\n this.chart.layoutPending = true;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Navigator.prototype, \"min\", {\n get: function () {\n return this.rs.min;\n },\n set: function (value) {\n this.rs.min = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Navigator.prototype, \"max\", {\n get: function () {\n return this.rs.max;\n },\n set: function (value) {\n this.rs.max = value;\n },\n enumerable: true,\n configurable: true\n });\n Navigator.prototype.updateAxes = function (min, max) {\n var chart = this.chart;\n var clipSeries = false;\n chart.axes.forEach(function (axis) {\n if (axis.direction === ChartAxisDirection.X) {\n if (!clipSeries && (min > 0 || max < 1)) {\n clipSeries = true;\n }\n axis.visibleRange = [min, max];\n axis.update();\n }\n });\n chart.seriesRoot.enabled = clipSeries;\n chart.series.forEach(function (series) { return series.update(); });\n };\n Navigator.prototype.onDragStart = function (offset) {\n if (!this.enabled) {\n return;\n }\n var offsetX = offset.offsetX, offsetY = offset.offsetY;\n var rs = this.rs;\n var minHandle = rs.minHandle, maxHandle = rs.maxHandle, x = rs.x, width = rs.width, min = rs.min;\n var visibleRange = rs.computeVisibleRangeBBox();\n if (!(this.minHandleDragging || this.maxHandleDragging)) {\n if (minHandle.containsPoint(offsetX, offsetY)) {\n this.minHandleDragging = true;\n }\n else if (maxHandle.containsPoint(offsetX, offsetY)) {\n this.maxHandleDragging = true;\n }\n else if (visibleRange.containsPoint(offsetX, offsetY)) {\n this.panHandleOffset = (offsetX - x) / width - min;\n }\n }\n };\n Navigator.prototype.onDrag = function (offset) {\n if (!this.enabled) {\n return;\n }\n var _a = this, rs = _a.rs, panHandleOffset = _a.panHandleOffset;\n var x = rs.x, y = rs.y, width = rs.width, height = rs.height, minHandle = rs.minHandle, maxHandle = rs.maxHandle;\n var style = this.chart.element.style;\n var offsetX = offset.offsetX, offsetY = offset.offsetY;\n var minX = x + width * rs.min;\n var maxX = x + width * rs.max;\n var visibleRange = new BBox(minX, y, maxX - minX, height);\n function getRatio() {\n return Math.min(Math.max((offsetX - x) / width, 0), 1);\n }\n if (minHandle.containsPoint(offsetX, offsetY)) {\n style.cursor = 'ew-resize';\n }\n else if (maxHandle.containsPoint(offsetX, offsetY)) {\n style.cursor = 'ew-resize';\n }\n else if (visibleRange.containsPoint(offsetX, offsetY)) {\n style.cursor = 'grab';\n }\n else {\n style.cursor = 'default';\n }\n if (this.minHandleDragging) {\n rs.min = getRatio();\n }\n else if (this.maxHandleDragging) {\n rs.max = getRatio();\n }\n else if (!isNaN(panHandleOffset)) {\n var span = rs.max - rs.min;\n var min = Math.min(getRatio() - panHandleOffset, 1 - span);\n if (min <= rs.min) { // pan left\n rs.min = min;\n rs.max = rs.min + span;\n }\n else { // pan right\n rs.max = min + span;\n rs.min = rs.max - span;\n }\n }\n };\n Navigator.prototype.onDragStop = function () {\n this.stopHandleDragging();\n };\n Navigator.prototype.stopHandleDragging = function () {\n this.minHandleDragging = this.maxHandleDragging = false;\n this.panHandleOffset = NaN;\n };\n return Navigator;\n}());\nexport { Navigator };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { Chart } from \"./chart\";\nimport { numericExtent } from \"../util/array\";\nimport { CategoryAxis } from \"./axis/categoryAxis\";\nimport { GroupedCategoryAxis } from \"./axis/groupedCategoryAxis\";\nimport { ChartAxisPosition, ChartAxisDirection } from \"./chartAxis\";\nimport { BBox } from \"../scene/bbox\";\nimport { ClipRect } from \"../scene/clipRect\";\nimport { Navigator } from \"./navigator/navigator\";\nvar CartesianChart = /** @class */ (function (_super) {\n __extends(CartesianChart, _super);\n function CartesianChart(document) {\n if (document === void 0) { document = window.document; }\n var _this = _super.call(this, document) || this;\n _this._seriesRoot = new ClipRect();\n _this.navigator = new Navigator(_this);\n // Prevent the scene from rendering chart components in an invalid state\n // (before first layout is performed).\n _this.scene.root.visible = false;\n var root = _this.scene.root;\n root.append(_this.seriesRoot);\n root.append(_this.legend.group);\n _this.navigator.enabled = false;\n return _this;\n }\n Object.defineProperty(CartesianChart.prototype, \"seriesRoot\", {\n get: function () {\n return this._seriesRoot;\n },\n enumerable: true,\n configurable: true\n });\n CartesianChart.prototype.performLayout = function () {\n if (this.dataPending) {\n return;\n }\n this.scene.root.visible = true;\n var _a = this, width = _a.width, height = _a.height, axes = _a.axes, legend = _a.legend, navigator = _a.navigator;\n var shrinkRect = new BBox(0, 0, width, height);\n this.positionCaptions();\n this.positionLegend();\n if (legend.enabled && legend.data.length) {\n var legendAutoPadding = this.legendAutoPadding;\n var legendPadding = this.legend.spacing;\n shrinkRect.x += legendAutoPadding.left;\n shrinkRect.y += legendAutoPadding.top;\n shrinkRect.width -= legendAutoPadding.left + legendAutoPadding.right;\n shrinkRect.height -= legendAutoPadding.top + legendAutoPadding.bottom;\n switch (this.legend.position) {\n case 'right':\n shrinkRect.width -= legendPadding;\n break;\n case 'bottom':\n shrinkRect.height -= legendPadding;\n break;\n case 'left':\n shrinkRect.x += legendPadding;\n shrinkRect.width -= legendPadding;\n break;\n case 'top':\n shrinkRect.y += legendPadding;\n shrinkRect.height -= legendPadding;\n break;\n }\n }\n var _b = this, captionAutoPadding = _b.captionAutoPadding, padding = _b.padding;\n this.updateAxes();\n shrinkRect.x += padding.left;\n shrinkRect.width -= padding.left + padding.right;\n shrinkRect.y += padding.top + captionAutoPadding;\n shrinkRect.height -= padding.top + captionAutoPadding + padding.bottom;\n if (navigator.enabled) {\n shrinkRect.height -= navigator.height + navigator.margin;\n }\n var bottomAxesHeight = 0;\n axes.forEach(function (axis) {\n axis.group.visible = true;\n var axisThickness = Math.floor(axis.thickness || axis.computeBBox().width);\n switch (axis.position) {\n case ChartAxisPosition.Top:\n shrinkRect.y += axisThickness;\n shrinkRect.height -= axisThickness;\n axis.translation.y = Math.floor(shrinkRect.y + 1);\n axis.label.mirrored = true;\n break;\n case ChartAxisPosition.Right:\n shrinkRect.width -= axisThickness;\n axis.translation.x = Math.floor(shrinkRect.x + shrinkRect.width);\n axis.label.mirrored = true;\n break;\n case ChartAxisPosition.Bottom:\n shrinkRect.height -= axisThickness;\n bottomAxesHeight += axisThickness;\n axis.translation.y = Math.floor(shrinkRect.y + shrinkRect.height + 1);\n break;\n case ChartAxisPosition.Left:\n shrinkRect.x += axisThickness;\n shrinkRect.width -= axisThickness;\n axis.translation.x = Math.floor(shrinkRect.x);\n break;\n }\n });\n axes.forEach(function (axis) {\n switch (axis.position) {\n case ChartAxisPosition.Top:\n case ChartAxisPosition.Bottom:\n axis.translation.x = Math.floor(shrinkRect.x);\n axis.range = [0, shrinkRect.width];\n axis.gridLength = shrinkRect.height;\n break;\n case ChartAxisPosition.Left:\n case ChartAxisPosition.Right:\n axis.translation.y = Math.floor(shrinkRect.y);\n if (axis instanceof CategoryAxis || axis instanceof GroupedCategoryAxis) {\n axis.range = [0, shrinkRect.height];\n }\n else {\n axis.range = [shrinkRect.height, 0];\n }\n axis.gridLength = shrinkRect.width;\n break;\n }\n });\n this.seriesRect = shrinkRect;\n this.series.forEach(function (series) {\n series.group.translationX = Math.floor(shrinkRect.x);\n series.group.translationY = Math.floor(shrinkRect.y);\n series.update(); // this has to happen after the `updateAxes` call\n });\n var seriesRoot = this.seriesRoot;\n seriesRoot.x = shrinkRect.x;\n seriesRoot.y = shrinkRect.y;\n seriesRoot.width = shrinkRect.width;\n seriesRoot.height = shrinkRect.height;\n if (navigator.enabled) {\n navigator.x = shrinkRect.x;\n navigator.y = shrinkRect.y + shrinkRect.height + bottomAxesHeight + navigator.margin;\n navigator.width = shrinkRect.width;\n }\n this.axes.forEach(function (axis) { return axis.update(); });\n };\n CartesianChart.prototype.initSeries = function (series) {\n _super.prototype.initSeries.call(this, series);\n series.addEventListener('dataProcessed', this.updateAxes, this);\n };\n CartesianChart.prototype.freeSeries = function (series) {\n _super.prototype.freeSeries.call(this, series);\n series.removeEventListener('dataProcessed', this.updateAxes, this);\n };\n CartesianChart.prototype.setupDomListeners = function (chartElement) {\n _super.prototype.setupDomListeners.call(this, chartElement);\n this._onTouchStart = this.onTouchStart.bind(this);\n this._onTouchMove = this.onTouchMove.bind(this);\n this._onTouchEnd = this.onTouchEnd.bind(this);\n this._onTouchCancel = this.onTouchCancel.bind(this);\n chartElement.addEventListener('touchstart', this._onTouchStart);\n chartElement.addEventListener('touchmove', this._onTouchMove);\n chartElement.addEventListener('touchend', this._onTouchEnd);\n chartElement.addEventListener('touchcancel', this._onTouchCancel);\n };\n CartesianChart.prototype.cleanupDomListeners = function (chartElement) {\n _super.prototype.cleanupDomListeners.call(this, chartElement);\n chartElement.removeEventListener('touchstart', this._onTouchStart);\n chartElement.removeEventListener('touchmove', this._onTouchMove);\n chartElement.removeEventListener('touchend', this._onTouchEnd);\n chartElement.removeEventListener('touchcancel', this._onTouchCancel);\n };\n CartesianChart.prototype.getTouchOffset = function (event) {\n var rect = this.scene.canvas.element.getBoundingClientRect();\n var touch = event.touches[0];\n return touch ? {\n offsetX: touch.clientX - rect.left,\n offsetY: touch.clientY - rect.top\n } : undefined;\n };\n CartesianChart.prototype.onTouchStart = function (event) {\n var offset = this.getTouchOffset(event);\n if (offset) {\n this.navigator.onDragStart(offset);\n }\n };\n CartesianChart.prototype.onTouchMove = function (event) {\n var offset = this.getTouchOffset(event);\n if (offset) {\n this.navigator.onDrag(offset);\n }\n };\n CartesianChart.prototype.onTouchEnd = function (event) {\n this.navigator.onDragStop();\n };\n CartesianChart.prototype.onTouchCancel = function (event) {\n this.navigator.onDragStop();\n };\n CartesianChart.prototype.onMouseDown = function (event) {\n _super.prototype.onMouseDown.call(this, event);\n this.navigator.onDragStart(event);\n };\n CartesianChart.prototype.onMouseMove = function (event) {\n _super.prototype.onMouseMove.call(this, event);\n this.navigator.onDrag(event);\n };\n CartesianChart.prototype.onMouseUp = function (event) {\n _super.prototype.onMouseUp.call(this, event);\n this.navigator.onDragStop();\n };\n CartesianChart.prototype.onMouseOut = function (event) {\n _super.prototype.onMouseOut.call(this, event);\n this.navigator.onDragStop();\n };\n CartesianChart.prototype.updateAxes = function () {\n var navigator = this.navigator;\n var clipSeries = false;\n this.axes.forEach(function (axis) {\n var _a;\n var direction = axis.direction, boundSeries = axis.boundSeries;\n if (axis.linkedTo) {\n axis.domain = axis.linkedTo.domain;\n }\n else {\n var domains_1 = [];\n boundSeries.filter(function (s) { return s.visible; }).forEach(function (series) {\n domains_1.push(series.getDomain(direction));\n });\n var domain = (_a = new Array()).concat.apply(_a, domains_1);\n axis.domain = numericExtent(domain) || domain; // if numeric extent can't be found, it's categories\n }\n if (axis.direction === ChartAxisDirection.X) {\n axis.visibleRange = [navigator.min, navigator.max];\n }\n if (!clipSeries && (axis.visibleRange[0] > 0 || axis.visibleRange[1] < 1)) {\n clipSeries = true;\n }\n axis.update();\n });\n this.seriesRoot.enabled = clipSeries;\n };\n CartesianChart.className = 'CartesianChart';\n CartesianChart.type = 'cartesian';\n return CartesianChart;\n}(Chart));\nexport { CartesianChart };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { ClipRect } from \"../main\";\nimport { BBox } from \"../scene/bbox\";\nimport { Chart } from \"./chart\";\nvar HierarchyChart = /** @class */ (function (_super) {\n __extends(HierarchyChart, _super);\n function HierarchyChart(document) {\n if (document === void 0) { document = window.document; }\n var _this = _super.call(this, document) || this;\n _this._data = {};\n _this._seriesRoot = new ClipRect();\n // Prevent the scene from rendering chart components in an invalid state\n // (before first layout is performed).\n _this.scene.root.visible = false;\n var root = _this.scene.root;\n root.append(_this.seriesRoot);\n root.append(_this.legend.group);\n return _this;\n }\n Object.defineProperty(HierarchyChart.prototype, \"seriesRoot\", {\n get: function () {\n return this._seriesRoot;\n },\n enumerable: true,\n configurable: true\n });\n HierarchyChart.prototype.performLayout = function () {\n if (this.dataPending) {\n return;\n }\n this.scene.root.visible = true;\n var _a = this, width = _a.width, height = _a.height, legend = _a.legend;\n var shrinkRect = new BBox(0, 0, width, height);\n this.positionCaptions();\n this.positionLegend();\n if (legend.enabled && legend.data.length) {\n var legendAutoPadding = this.legendAutoPadding;\n var legendPadding = this.legend.spacing;\n shrinkRect.x += legendAutoPadding.left;\n shrinkRect.y += legendAutoPadding.top;\n shrinkRect.width -= legendAutoPadding.left + legendAutoPadding.right;\n shrinkRect.height -= legendAutoPadding.top + legendAutoPadding.bottom;\n switch (this.legend.position) {\n case 'right':\n shrinkRect.width -= legendPadding;\n break;\n case 'bottom':\n shrinkRect.height -= legendPadding;\n break;\n case 'left':\n shrinkRect.x += legendPadding;\n shrinkRect.width -= legendPadding;\n break;\n case 'top':\n shrinkRect.y += legendPadding;\n shrinkRect.height -= legendPadding;\n break;\n }\n }\n var _b = this, captionAutoPadding = _b.captionAutoPadding, padding = _b.padding;\n shrinkRect.x += padding.left;\n shrinkRect.width -= padding.left + padding.right;\n shrinkRect.y += padding.top + captionAutoPadding;\n shrinkRect.height -= padding.top + captionAutoPadding + padding.bottom;\n this.seriesRect = shrinkRect;\n this.series.forEach(function (series) {\n series.group.translationX = Math.floor(shrinkRect.x);\n series.group.translationY = Math.floor(shrinkRect.y);\n series.update(); // this has to happen after the `updateAxes` call\n });\n var seriesRoot = this.seriesRoot;\n seriesRoot.x = shrinkRect.x;\n seriesRoot.y = shrinkRect.y;\n seriesRoot.width = shrinkRect.width;\n seriesRoot.height = shrinkRect.height;\n };\n HierarchyChart.className = 'HierarchyChart';\n HierarchyChart.type = 'hierarchy';\n return HierarchyChart;\n}(Chart));\nexport { HierarchyChart };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { CartesianChart } from \"./cartesianChart\";\nimport { numericExtent } from \"../util/array\";\nimport { ChartAxisDirection } from \"./chartAxis\";\nvar GroupedCategoryChart = /** @class */ (function (_super) {\n __extends(GroupedCategoryChart, _super);\n function GroupedCategoryChart() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n GroupedCategoryChart.prototype.updateAxes = function () {\n this.axes.forEach(function (axis) {\n var _a;\n var direction = axis.direction, boundSeries = axis.boundSeries;\n var domains = [];\n var isNumericX = undefined;\n boundSeries.filter(function (s) { return s.visible; }).forEach(function (series) {\n if (direction === ChartAxisDirection.X) {\n if (isNumericX === undefined) {\n // always add first X domain\n var domain_1 = series.getDomain(direction);\n domains.push(domain_1);\n isNumericX = typeof domain_1[0] === 'number';\n }\n else if (isNumericX) {\n // only add further X domains if the axis is numeric\n domains.push(series.getDomain(direction));\n }\n }\n else {\n domains.push(series.getDomain(direction));\n }\n });\n var domain = (_a = new Array()).concat.apply(_a, domains);\n axis.domain = numericExtent(domain) || domain;\n axis.update();\n });\n };\n GroupedCategoryChart.className = 'GroupedCategoryChart';\n GroupedCategoryChart.type = 'groupedCategory';\n return GroupedCategoryChart;\n}(CartesianChart));\nexport { GroupedCategoryChart };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { Series } from \"../series\";\nimport { ChartAxisDirection } from \"../../chartAxis\";\nimport { SeriesMarker } from \"../seriesMarker\";\nvar PolarSeries = /** @class */ (function (_super) {\n __extends(PolarSeries, _super);\n function PolarSeries() {\n var _a;\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.directionKeys = (_a = {},\n _a[ChartAxisDirection.X] = ['angleKey'],\n _a[ChartAxisDirection.Y] = ['radiusKey'],\n _a);\n /**\n * The center of the polar series (for example, the center of a pie).\n * If the polar chart has multiple series, all of them will have their\n * center set to the same value as a result of the polar chart layout.\n * The center coordinates are not supposed to be set by the user.\n */\n _this.centerX = 0;\n _this.centerY = 0;\n /**\n * The maximum radius the series can use.\n * This value is set automatically as a result of the polar chart layout\n * and is not supposed to be set by the user.\n */\n _this.radius = 0;\n return _this;\n }\n return PolarSeries;\n}(Series));\nexport { PolarSeries };\nvar PolarSeriesMarker = /** @class */ (function (_super) {\n __extends(PolarSeriesMarker, _super);\n function PolarSeriesMarker() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n return PolarSeriesMarker;\n}(SeriesMarker));\nexport { PolarSeriesMarker };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n 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;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nimport { Chart } from \"./chart\";\nimport { PolarSeries } from \"./series/polar/polarSeries\";\nimport { reactive } from \"../util/observable\";\nimport { Padding } from \"../util/padding\";\nimport { BBox } from \"../scene/bbox\";\nvar PolarChart = /** @class */ (function (_super) {\n __extends(PolarChart, _super);\n function PolarChart(document) {\n if (document === void 0) { document = window.document; }\n var _this = _super.call(this, document) || this;\n _this.padding = new Padding(40);\n _this.scene.root.append(_this.legend.group);\n return _this;\n }\n Object.defineProperty(PolarChart.prototype, \"seriesRoot\", {\n get: function () {\n return this.scene.root;\n },\n enumerable: true,\n configurable: true\n });\n PolarChart.prototype.performLayout = function () {\n var shrinkRect = new BBox(0, 0, this.width, this.height);\n this.positionCaptions();\n this.positionLegend();\n var captionAutoPadding = this.captionAutoPadding;\n shrinkRect.y += captionAutoPadding;\n shrinkRect.height -= captionAutoPadding;\n if (this.legend.enabled && this.legend.data.length) {\n var legendAutoPadding = this.legendAutoPadding;\n shrinkRect.x += legendAutoPadding.left;\n shrinkRect.y += legendAutoPadding.top;\n shrinkRect.width -= legendAutoPadding.left + legendAutoPadding.right;\n shrinkRect.height -= legendAutoPadding.top + legendAutoPadding.bottom;\n var legendPadding = this.legend.spacing;\n switch (this.legend.position) {\n case 'right':\n shrinkRect.width -= legendPadding;\n break;\n case 'bottom':\n shrinkRect.height -= legendPadding;\n break;\n case 'left':\n shrinkRect.x += legendPadding;\n shrinkRect.width -= legendPadding;\n break;\n case 'top':\n shrinkRect.y += legendPadding;\n shrinkRect.height -= legendPadding;\n break;\n }\n }\n var padding = this.padding;\n shrinkRect.x += padding.left;\n shrinkRect.y += padding.top;\n shrinkRect.width -= padding.left + padding.right;\n shrinkRect.height -= padding.top + padding.bottom;\n this.seriesRect = shrinkRect;\n var centerX = shrinkRect.x + shrinkRect.width / 2;\n var centerY = shrinkRect.y + shrinkRect.height / 2;\n var radius = Math.min(shrinkRect.width, shrinkRect.height) / 2;\n this.series.forEach(function (series) {\n if (series instanceof PolarSeries) {\n series.centerX = centerX;\n series.centerY = centerY;\n series.radius = radius;\n series.update();\n }\n });\n };\n PolarChart.className = 'PolarChart';\n PolarChart.type = 'polar';\n __decorate([\n reactive('layoutChange')\n ], PolarChart.prototype, \"padding\", void 0);\n return PolarChart;\n}(Chart));\nexport { PolarChart };\n","export function equal(a, b) {\n if (a === b)\n return true;\n if (a && b && typeof a == 'object' && typeof b == 'object') {\n if (a.constructor !== b.constructor)\n return false;\n var length_1, i = void 0;\n if (Array.isArray(a)) {\n length_1 = a.length;\n if (length_1 != b.length)\n return false;\n for (i = length_1; i-- !== 0;)\n if (!equal(a[i], b[i]))\n return false;\n return true;\n }\n // if ((a instanceof Map) && (b instanceof Map)) {\n // if (a.size !== b.size) return false;\n // for (i of a.entries())\n // if (!b.has(i[0])) return false;\n // for (i of a.entries())\n // if (!equal(i[1], b.get(i[0]))) return false;\n // return true;\n // }\n //\n // if ((a instanceof Set) && (b instanceof Set)) {\n // if (a.size !== b.size) return false;\n // for (i of a.entries())\n // if (!b.has(i[0])) return false;\n // return true;\n // }\n //\n // if (ArrayBuffer.isView(a) && ArrayBuffer.isView(b)) {\n // length = a.length;\n // if (length != b.length) return false;\n // for (i = length; i-- !== 0;)\n // if (a[i] !== b[i]) return false;\n // return true;\n // }\n if (a.constructor === RegExp)\n return a.source === b.source && a.flags === b.flags;\n if (a.valueOf !== Object.prototype.valueOf)\n return a.valueOf() === b.valueOf();\n if (a.toString !== Object.prototype.toString)\n return a.toString() === b.toString();\n var keys = Object.keys(a);\n length_1 = keys.length;\n if (length_1 !== Object.keys(b).length)\n return false;\n for (i = length_1; i-- !== 0;)\n if (!Object.prototype.hasOwnProperty.call(b, keys[i]))\n return false;\n for (i = length_1; i-- !== 0;) {\n var key = keys[i];\n if (!equal(a[key], b[key]))\n return false;\n }\n return true;\n }\n // true if both NaN, false otherwise\n return a !== a && b !== b;\n}\n","import { locale } from \"./time/format/defaultLocale\";\nvar interpolatePattern = /(#\\{(.*?)\\})/g;\nexport function interpolate(input, values, formats) {\n return input.replace(interpolatePattern, function () {\n var name = arguments[2];\n var _a = name.split(':'), valueName = _a[0], formatName = _a[1];\n var value = values[valueName];\n if (typeof value === 'number') {\n var format = formatName && formats && formats[formatName];\n if (format) {\n var _b = format, locales = _b.locales, options = _b.options;\n return value.toLocaleString(locales, options);\n }\n return String(value);\n }\n if (value instanceof Date) {\n var format = formatName && formats && formats[formatName];\n if (typeof format === 'string') {\n var formatter = locale.format(format);\n return formatter(value);\n }\n return value.toDateString();\n }\n if (typeof value === 'string' || (value && value.toString)) {\n return String(value);\n }\n return '';\n });\n}\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n 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;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nimport { Group } from \"../../../scene/group\";\nimport { Selection } from \"../../../scene/selection\";\nimport { SeriesTooltip } from \"../series\";\nimport { PointerEvents } from \"../../../scene/node\";\nimport { Path } from \"../../../scene/shape/path\";\nimport { CartesianSeries, CartesianSeriesMarker } from \"./cartesianSeries\";\nimport { ChartAxisDirection } from \"../../chartAxis\";\nimport { getMarker } from \"../../marker/util\";\nimport { toTooltipHtml } from \"../../chart\";\nimport { findMinMax } from \"../../../util/array\";\nimport { equal } from \"../../../util/equal\";\nimport { reactive } from \"../../../util/observable\";\nimport { interpolate } from \"../../../util/string\";\nvar AreaSeriesTooltip = /** @class */ (function (_super) {\n __extends(AreaSeriesTooltip, _super);\n function AreaSeriesTooltip() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n __decorate([\n reactive('change')\n ], AreaSeriesTooltip.prototype, \"renderer\", void 0);\n __decorate([\n reactive('change')\n ], AreaSeriesTooltip.prototype, \"format\", void 0);\n return AreaSeriesTooltip;\n}(SeriesTooltip));\nexport { AreaSeriesTooltip };\nvar AreaSeries = /** @class */ (function (_super) {\n __extends(AreaSeries, _super);\n function AreaSeries() {\n var _this = _super.call(this) || this;\n _this.tooltip = new AreaSeriesTooltip();\n _this.areaGroup = _this.group.appendChild(new Group);\n _this.strokeGroup = _this.group.appendChild(new Group);\n _this.markerGroup = _this.group.appendChild(new Group);\n _this.areaSelection = Selection.select(_this.areaGroup).selectAll();\n _this.strokeSelection = Selection.select(_this.strokeGroup).selectAll();\n _this.markerSelection = Selection.select(_this.markerGroup).selectAll();\n _this.markerSelectionData = [];\n /**\n * The assumption is that the values will be reset (to `true`)\n * in the {@link yKeys} setter.\n */\n _this.seriesItemEnabled = new Map();\n _this.xData = [];\n _this.yData = [];\n _this.yDomain = [];\n _this.directionKeys = {\n x: ['xKey'],\n y: ['yKeys']\n };\n _this.marker = new CartesianSeriesMarker();\n _this.fills = [\n '#c16068',\n '#a2bf8a',\n '#ebcc87',\n '#80a0c3',\n '#b58dae',\n '#85c0d1'\n ];\n _this.strokes = [\n '#874349',\n '#718661',\n '#a48f5f',\n '#5a7088',\n '#7f637a',\n '#5d8692'\n ];\n _this.fillOpacity = 1;\n _this.strokeOpacity = 1;\n _this.lineDash = undefined;\n _this.lineDashOffset = 0;\n _this._xKey = '';\n _this.xName = '';\n _this._yKeys = [];\n _this.yNames = [];\n _this.strokeWidth = 2;\n _this.highlightStyle = { fill: 'yellow' };\n _this.addEventListener('update', _this.update);\n _this.marker.enabled = false;\n _this.marker.addPropertyListener('shape', _this.onMarkerShapeChange, _this);\n _this.marker.addEventListener('change', _this.update, _this);\n return _this;\n }\n AreaSeries.prototype.onMarkerShapeChange = function () {\n this.markerSelection = this.markerSelection.setData([]);\n this.markerSelection.exit.remove();\n this.update();\n this.fireEvent({ type: 'legendChange' });\n };\n Object.defineProperty(AreaSeries.prototype, \"xKey\", {\n get: function () {\n return this._xKey;\n },\n set: function (value) {\n if (this._xKey !== value) {\n this._xKey = value;\n this.xData = [];\n this.scheduleData();\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(AreaSeries.prototype, \"yKeys\", {\n get: function () {\n return this._yKeys;\n },\n set: function (values) {\n if (!equal(this._yKeys, values)) {\n this._yKeys = values;\n this.yData = [];\n var seriesItemEnabled_1 = this.seriesItemEnabled;\n seriesItemEnabled_1.clear();\n values.forEach(function (key) { return seriesItemEnabled_1.set(key, true); });\n this.scheduleData();\n }\n },\n enumerable: true,\n configurable: true\n });\n AreaSeries.prototype.setColors = function (fills, strokes) {\n this.fills = fills;\n this.strokes = strokes;\n };\n Object.defineProperty(AreaSeries.prototype, \"normalizedTo\", {\n get: function () {\n return this._normalizedTo;\n },\n set: function (value) {\n var absValue = value ? Math.abs(value) : undefined;\n if (this._normalizedTo !== absValue) {\n this._normalizedTo = absValue;\n this.scheduleData();\n }\n },\n enumerable: true,\n configurable: true\n });\n AreaSeries.prototype.onHighlightChange = function () {\n this.updateMarkerNodes();\n };\n AreaSeries.prototype.processData = function () {\n var _a = this, xKey = _a.xKey, yKeys = _a.yKeys, seriesItemEnabled = _a.seriesItemEnabled;\n var data = xKey && yKeys.length && this.data ? this.data : [];\n // if (!(chart && chart.xAxis && chart.yAxis)) {\n // return false;\n // }\n // If the data is an array of rows like so:\n //\n // [{\n // xKy: 'Jan',\n // yKey1: 5,\n // yKey2: 7,\n // yKey3: -9,\n // }, {\n // xKey: 'Feb',\n // yKey1: 10,\n // yKey2: -15,\n // yKey3: 20\n // }]\n //\n var keysFound = true; // only warn once\n this.xData = data.map(function (datum) {\n if (keysFound && !(xKey in datum)) {\n keysFound = false;\n console.warn(\"The key '\" + xKey + \"' was not found in the data: \", datum);\n }\n return datum[xKey];\n });\n this.yData = data.map(function (datum) { return yKeys.map(function (yKey) {\n if (keysFound && !(yKey in datum)) {\n keysFound = false;\n console.warn(\"The key '\" + yKey + \"' was not found in the data: \", datum);\n }\n var value = datum[yKey];\n return isFinite(value) && seriesItemEnabled.get(yKey) ? value : 0;\n }); });\n // xData: ['Jan', 'Feb']\n //\n // yData: [\n // [5, 7, -9],\n // [10, -15, 20]\n // ]\n var _b = this, yData = _b.yData, normalizedTo = _b.normalizedTo;\n var yMinMax = yData.map(function (values) { return findMinMax(values); }); // used for normalization\n var yLargestMinMax = this.findLargestMinMax(yMinMax);\n var yMin;\n var yMax;\n if (normalizedTo && isFinite(normalizedTo)) {\n yMin = yLargestMinMax.min < 0 ? -normalizedTo : 0;\n yMax = normalizedTo;\n yData.forEach(function (stack, i) { return stack.forEach(function (y, j) {\n if (y < 0) {\n stack[j] = -y / yMinMax[i].min * normalizedTo;\n }\n else {\n stack[j] = y / yMinMax[i].max * normalizedTo;\n }\n }); });\n }\n else {\n yMin = yLargestMinMax.min;\n yMax = yLargestMinMax.max;\n }\n if (yMin === 0 && yMax === 0) {\n yMax = 1;\n }\n this.yDomain = this.fixNumericExtent([yMin, yMax], 'y');\n this.fireEvent({ type: 'dataProcessed' });\n return true;\n };\n AreaSeries.prototype.findLargestMinMax = function (totals) {\n var min = 0;\n var max = 0;\n for (var _i = 0, totals_1 = totals; _i < totals_1.length; _i++) {\n var total = totals_1[_i];\n if (total.min < min) {\n min = total.min;\n }\n if (total.max > max) {\n max = total.max;\n }\n }\n return { min: min, max: max };\n };\n AreaSeries.prototype.getDomain = function (direction) {\n if (direction === ChartAxisDirection.X) {\n return this.xData;\n }\n else {\n return this.yDomain;\n }\n };\n AreaSeries.prototype.update = function () {\n var _a = this, visible = _a.visible, chart = _a.chart, xAxis = _a.xAxis, yAxis = _a.yAxis, xData = _a.xData, yData = _a.yData;\n this.group.visible = visible && !!(xData.length && yData.length);\n if (!xAxis || !yAxis || !visible || !chart || chart.layoutPending || chart.dataPending || !xData.length || !yData.length) {\n return;\n }\n var selectionData = this.generateSelectionData();\n if (!selectionData) {\n return;\n }\n var areaSelectionData = selectionData.areaSelectionData, markerSelectionData = selectionData.markerSelectionData;\n this.updateAreaSelection(areaSelectionData);\n this.updateStrokeSelection(areaSelectionData);\n this.updateMarkerSelection(markerSelectionData);\n this.updateMarkerNodes();\n this.markerSelectionData = markerSelectionData;\n };\n AreaSeries.prototype.generateSelectionData = function () {\n var _this = this;\n if (!this.data) {\n return;\n }\n var _a = this, yKeys = _a.yKeys, data = _a.data, xData = _a.xData, yData = _a.yData, marker = _a.marker, fills = _a.fills, strokes = _a.strokes, xScale = _a.xAxis.scale, yScale = _a.yAxis.scale;\n var xOffset = (xScale.bandwidth || 0) / 2;\n var yOffset = (yScale.bandwidth || 0) / 2;\n var areaSelectionData = [];\n var markerSelectionData = [];\n var last = xData.length * 2 - 1;\n xData.forEach(function (xDatum, i) {\n var yDatum = yData[i];\n var seriesDatum = data[i];\n var x = xScale.convert(xDatum) + xOffset;\n var prevMin = 0;\n var prevMax = 0;\n yDatum.forEach(function (curr, j) {\n var prev = curr < 0 ? prevMin : prevMax;\n var y = yScale.convert(prev + curr) + yOffset;\n var yKey = yKeys[j];\n var yValue = seriesDatum[yKey];\n if (marker) {\n markerSelectionData.push({\n index: i,\n series: _this,\n seriesDatum: seriesDatum,\n yValue: yValue,\n yKey: yKey,\n point: { x: x, y: y },\n fill: fills[j % fills.length],\n stroke: strokes[j % strokes.length]\n });\n }\n var areaDatum = areaSelectionData[j] || (areaSelectionData[j] = { yKey: yKey, points: [] });\n var areaPoints = areaDatum.points;\n areaPoints[i] = { x: x, y: y };\n areaPoints[last - i] = { x: x, y: yScale.convert(prev) + yOffset }; // bottom y\n if (curr < 0) {\n prevMin += curr;\n }\n else {\n prevMax += curr;\n }\n });\n });\n return { areaSelectionData: areaSelectionData, markerSelectionData: markerSelectionData };\n };\n AreaSeries.prototype.updateAreaSelection = function (areaSelectionData) {\n var _this = this;\n var _a = this, fills = _a.fills, fillOpacity = _a.fillOpacity, strokes = _a.strokes, strokeOpacity = _a.strokeOpacity, strokeWidth = _a.strokeWidth, seriesItemEnabled = _a.seriesItemEnabled, shadow = _a.shadow;\n var updateAreas = this.areaSelection.setData(areaSelectionData);\n updateAreas.exit.remove();\n var enterAreas = updateAreas.enter.append(Path)\n .each(function (path) {\n path.lineJoin = 'round';\n path.stroke = undefined;\n path.pointerEvents = PointerEvents.None;\n });\n var areaSelection = updateAreas.merge(enterAreas);\n areaSelection.each(function (shape, datum, index) {\n var path = shape.path;\n shape.fill = fills[index % fills.length];\n shape.fillOpacity = fillOpacity;\n shape.stroke = strokes[index % strokes.length];\n shape.strokeOpacity = strokeOpacity;\n shape.strokeWidth = strokeWidth;\n shape.lineDash = _this.lineDash;\n shape.lineDashOffset = _this.lineDashOffset;\n shape.fillShadow = shadow;\n shape.visible = !!seriesItemEnabled.get(datum.yKey);\n path.clear();\n var points = datum.points;\n points.forEach(function (_a, i) {\n var x = _a.x, y = _a.y;\n if (i > 0) {\n path.lineTo(x, y);\n }\n else {\n path.moveTo(x, y);\n }\n });\n path.closePath();\n });\n this.areaSelection = areaSelection;\n };\n AreaSeries.prototype.updateStrokeSelection = function (areaSelectionData) {\n var _this = this;\n if (!this.data) {\n return;\n }\n var _a = this, strokes = _a.strokes, strokeWidth = _a.strokeWidth, strokeOpacity = _a.strokeOpacity, data = _a.data, seriesItemEnabled = _a.seriesItemEnabled;\n var updateStrokes = this.strokeSelection.setData(areaSelectionData);\n updateStrokes.exit.remove();\n var enterStrokes = updateStrokes.enter.append(Path)\n .each(function (path) {\n path.fill = undefined;\n path.lineJoin = path.lineCap = 'round';\n path.pointerEvents = PointerEvents.None;\n });\n var strokeSelection = updateStrokes.merge(enterStrokes);\n strokeSelection.each(function (shape, datum, index) {\n var path = shape.path;\n shape.stroke = strokes[index % strokes.length];\n shape.strokeWidth = strokeWidth;\n shape.visible = !!seriesItemEnabled.get(datum.yKey);\n shape.strokeOpacity = strokeOpacity;\n shape.lineDash = _this.lineDash;\n shape.lineDashOffset = _this.lineDashOffset;\n path.clear();\n var points = datum.points;\n // The stroke doesn't go all the way around the fill, only on top,\n // that's why we iterate until `data.length` (rather than `points.length`) and stop.\n for (var i = 0; i < data.length; i++) {\n var _a = points[i], x = _a.x, y = _a.y;\n if (i > 0) {\n path.lineTo(x, y);\n }\n else {\n path.moveTo(x, y);\n }\n }\n });\n this.strokeSelection = strokeSelection;\n };\n AreaSeries.prototype.updateMarkerSelection = function (markerSelectionData) {\n var marker = this.marker;\n var data = marker.shape ? markerSelectionData : [];\n var MarkerShape = getMarker(marker.shape);\n var updateMarkers = this.markerSelection.setData(data);\n updateMarkers.exit.remove();\n var enterMarkers = updateMarkers.enter.append(MarkerShape);\n this.markerSelection = updateMarkers.merge(enterMarkers);\n };\n AreaSeries.prototype.updateMarkerNodes = function () {\n if (!this.chart) {\n return;\n }\n var marker = this.marker;\n var markerFormatter = marker.formatter;\n var markerStrokeWidth = marker.strokeWidth !== undefined ? marker.strokeWidth : this.strokeWidth;\n var markerSize = marker.size;\n var _a = this, xKey = _a.xKey, seriesItemEnabled = _a.seriesItemEnabled;\n var highlightedDatum = this.chart.highlightedDatum;\n var _b = this.highlightStyle, highlightFill = _b.fill, highlightStroke = _b.stroke;\n this.markerSelection.each(function (node, datum) {\n var highlighted = datum === highlightedDatum;\n var markerFill = highlighted && highlightFill !== undefined ? highlightFill : marker.fill || datum.fill;\n var markerStroke = highlighted && highlightStroke !== undefined ? highlightStroke : marker.stroke || datum.stroke;\n var markerFormat = undefined;\n if (markerFormatter) {\n markerFormat = markerFormatter({\n datum: datum.seriesDatum,\n xKey: xKey,\n yKey: datum.yKey,\n fill: markerFill,\n stroke: markerStroke,\n strokeWidth: markerStrokeWidth,\n size: markerSize,\n highlighted: highlighted\n });\n }\n node.fill = markerFormat && markerFormat.fill || markerFill;\n node.stroke = markerFormat && markerFormat.stroke || markerStroke;\n node.strokeWidth = markerFormat && markerFormat.strokeWidth !== undefined\n ? markerFormat.strokeWidth\n : markerStrokeWidth;\n node.size = markerFormat && markerFormat.size !== undefined\n ? markerFormat.size\n : markerSize;\n node.translationX = datum.point.x;\n node.translationY = datum.point.y;\n node.visible = marker.enabled && node.size > 0 && !!seriesItemEnabled.get(datum.yKey);\n });\n };\n AreaSeries.prototype.getNodeData = function () {\n return this.markerSelectionData;\n };\n AreaSeries.prototype.fireNodeClickEvent = function (event, datum) {\n this.fireEvent({\n type: 'nodeClick',\n event: event,\n series: this,\n datum: datum.seriesDatum,\n xKey: this.xKey,\n yKey: datum.yKey\n });\n };\n AreaSeries.prototype.getTooltipHtml = function (nodeDatum) {\n var _a = this, xKey = _a.xKey, xAxis = _a.xAxis, yAxis = _a.yAxis;\n var yKey = nodeDatum.yKey;\n if (!xKey || !yKey) {\n return '';\n }\n var _b = this, xName = _b.xName, yKeys = _b.yKeys, yNames = _b.yNames, yData = _b.yData, fills = _b.fills, tooltip = _b.tooltip;\n var yGroup = yData[nodeDatum.index];\n var _c = tooltip.renderer, tooltipRenderer = _c === void 0 ? this.tooltipRenderer : _c, tooltipFormat = tooltip.format;\n var datum = nodeDatum.seriesDatum;\n var yKeyIndex = yKeys.indexOf(yKey);\n var xValue = datum[xKey];\n var yValue = datum[yKey];\n var processedYValue = yGroup[yKeyIndex];\n var yName = yNames[yKeyIndex];\n var color = fills[yKeyIndex % fills.length];\n var xString = xAxis.formatDatum(xValue);\n var yString = yAxis.formatDatum(yValue);\n var title = yName;\n var content = xString + ': ' + yString;\n var defaults = {\n title: title,\n backgroundColor: color,\n content: content\n };\n if (tooltipFormat || tooltipRenderer) {\n var params = {\n datum: datum,\n xKey: xKey,\n xName: xName,\n xValue: xValue,\n yKey: yKey,\n yValue: yValue,\n processedYValue: processedYValue,\n yName: yName,\n color: color\n };\n if (tooltipFormat) {\n return toTooltipHtml({\n content: interpolate(tooltipFormat, params)\n }, defaults);\n }\n if (tooltipRenderer) {\n return toTooltipHtml(tooltipRenderer(params), defaults);\n }\n }\n return toTooltipHtml(defaults);\n };\n AreaSeries.prototype.listSeriesItems = function (legendData) {\n var _a = this, data = _a.data, id = _a.id, xKey = _a.xKey, yKeys = _a.yKeys, yNames = _a.yNames, seriesItemEnabled = _a.seriesItemEnabled, marker = _a.marker, fills = _a.fills, strokes = _a.strokes, fillOpacity = _a.fillOpacity, strokeOpacity = _a.strokeOpacity;\n if (data && data.length && xKey && yKeys.length) {\n yKeys.forEach(function (yKey, index) {\n legendData.push({\n id: id,\n itemId: yKey,\n enabled: seriesItemEnabled.get(yKey) || false,\n label: {\n text: yNames[index] || yKeys[index]\n },\n marker: {\n shape: marker.shape,\n fill: marker.fill || fills[index % fills.length],\n stroke: marker.stroke || strokes[index % strokes.length],\n fillOpacity: fillOpacity,\n strokeOpacity: strokeOpacity\n }\n });\n });\n }\n };\n AreaSeries.prototype.toggleSeriesItem = function (itemId, enabled) {\n this.seriesItemEnabled.set(itemId, enabled);\n this.scheduleData();\n };\n AreaSeries.className = 'AreaSeries';\n AreaSeries.type = 'area';\n __decorate([\n reactive('dataChange')\n ], AreaSeries.prototype, \"fills\", void 0);\n __decorate([\n reactive('dataChange')\n ], AreaSeries.prototype, \"strokes\", void 0);\n __decorate([\n reactive('update')\n ], AreaSeries.prototype, \"fillOpacity\", void 0);\n __decorate([\n reactive('update')\n ], AreaSeries.prototype, \"strokeOpacity\", void 0);\n __decorate([\n reactive('update')\n ], AreaSeries.prototype, \"lineDash\", void 0);\n __decorate([\n reactive('update')\n ], AreaSeries.prototype, \"lineDashOffset\", void 0);\n __decorate([\n reactive('update')\n ], AreaSeries.prototype, \"xName\", void 0);\n __decorate([\n reactive('update')\n ], AreaSeries.prototype, \"yNames\", void 0);\n __decorate([\n reactive('update')\n ], AreaSeries.prototype, \"strokeWidth\", void 0);\n __decorate([\n reactive('update')\n ], AreaSeries.prototype, \"shadow\", void 0);\n return AreaSeries;\n}(CartesianSeries));\nexport { AreaSeries };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n 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;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nimport { Group } from \"../../../scene/group\";\nimport { Selection } from \"../../../scene/selection\";\nimport { Rect } from \"../../../scene/shape/rect\";\nimport { Text } from \"../../../scene/shape/text\";\nimport { BandScale } from \"../../../scale/bandScale\";\nimport { SeriesTooltip } from \"../series\";\nimport { Label } from \"../../label\";\nimport { PointerEvents } from \"../../../scene/node\";\nimport { CartesianSeries } from \"./cartesianSeries\";\nimport { ChartAxisDirection, flipChartAxisDirection } from \"../../chartAxis\";\nimport { toTooltipHtml } from \"../../chart\";\nimport { findMinMax } from \"../../../util/array\";\nimport { equal } from \"../../../util/equal\";\nimport { reactive } from \"../../../util/observable\";\nvar BarSeriesNodeTag;\n(function (BarSeriesNodeTag) {\n BarSeriesNodeTag[BarSeriesNodeTag[\"Bar\"] = 0] = \"Bar\";\n BarSeriesNodeTag[BarSeriesNodeTag[\"Label\"] = 1] = \"Label\";\n})(BarSeriesNodeTag || (BarSeriesNodeTag = {}));\nexport var BarLabelPlacement;\n(function (BarLabelPlacement) {\n BarLabelPlacement[\"Inside\"] = \"inside\";\n BarLabelPlacement[\"Outside\"] = \"outside\";\n})(BarLabelPlacement || (BarLabelPlacement = {}));\nvar BarSeriesLabel = /** @class */ (function (_super) {\n __extends(BarSeriesLabel, _super);\n function BarSeriesLabel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.placement = BarLabelPlacement.Inside;\n return _this;\n }\n __decorate([\n reactive('change')\n ], BarSeriesLabel.prototype, \"formatter\", void 0);\n __decorate([\n reactive('change')\n ], BarSeriesLabel.prototype, \"placement\", void 0);\n return BarSeriesLabel;\n}(Label));\nvar BarSeriesTooltip = /** @class */ (function (_super) {\n __extends(BarSeriesTooltip, _super);\n function BarSeriesTooltip() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n __decorate([\n reactive('change')\n ], BarSeriesTooltip.prototype, \"renderer\", void 0);\n return BarSeriesTooltip;\n}(SeriesTooltip));\nexport { BarSeriesTooltip };\nfunction flat(arr, target) {\n if (target === void 0) { target = []; }\n arr.forEach(function (v) {\n if (Array.isArray(v)) {\n flat(v, target);\n }\n else {\n target.push(v);\n }\n });\n return target;\n}\nvar BarSeries = /** @class */ (function (_super) {\n __extends(BarSeries, _super);\n function BarSeries() {\n var _a;\n var _this = _super.call(this) || this;\n // Need to put bar and label nodes into separate groups, because even though label nodes are\n // created after the bar nodes, this only guarantees that labels will always be on top of bars\n // on the first run. If on the next run more bars are added, they might clip the labels\n // rendered during the previous run.\n _this.rectGroup = _this.group.appendChild(new Group);\n _this.textGroup = _this.group.appendChild(new Group);\n _this.rectSelection = Selection.select(_this.rectGroup).selectAll();\n _this.textSelection = Selection.select(_this.textGroup).selectAll();\n _this.xData = [];\n _this.yData = [];\n _this.yDomain = [];\n _this.label = new BarSeriesLabel();\n /**\n * The assumption is that the values will be reset (to `true`)\n * in the {@link yKeys} setter.\n */\n _this.seriesItemEnabled = new Map();\n _this.tooltip = new BarSeriesTooltip();\n _this.flipXY = false;\n _this.fills = [\n '#c16068',\n '#a2bf8a',\n '#ebcc87',\n '#80a0c3',\n '#b58dae',\n '#85c0d1'\n ];\n _this.strokes = [\n '#874349',\n '#718661',\n '#a48f5f',\n '#5a7088',\n '#7f637a',\n '#5d8692'\n ];\n _this.fillOpacity = 1;\n _this.strokeOpacity = 1;\n _this.lineDash = undefined;\n _this.lineDashOffset = 0;\n /**\n * Used to get the position of bars within each group.\n */\n _this.groupScale = new BandScale();\n _this.directionKeys = (_a = {},\n _a[ChartAxisDirection.X] = ['xKey'],\n _a[ChartAxisDirection.Y] = ['yKeys'],\n _a);\n _this._xKey = '';\n _this._xName = '';\n _this.cumYKeyCount = [];\n _this.flatYKeys = undefined; // only set when a user used a flat array for yKeys\n _this.hideInLegend = [];\n /**\n * yKeys: [['coffee']] - regular bars, each category has a single bar that shows a value for coffee\n * yKeys: [['coffee'], ['tea'], ['milk']] - each category has three bars that show values for coffee, tea and milk\n * yKeys: [['coffee', 'tea', 'milk']] - each category has a single bar with three stacks that show values for coffee, tea and milk\n * yKeys: [['coffee', 'tea', 'milk'], ['paper', 'ink']] - each category has 2 stacked bars,\n * first showing values for coffee, tea and milk and second values for paper and ink\n */\n _this._yKeys = [];\n _this._grouped = false;\n /**\n * A map of `yKeys` to their names (used in legends and tooltips).\n * For example, if a key is `product_name` it's name can be a more presentable `Product Name`.\n */\n _this._yNames = {};\n _this._strokeWidth = 1;\n _this.highlightStyle = { fill: 'yellow' };\n _this.addEventListener('update', _this.update);\n _this.label.enabled = false;\n _this.label.addEventListener('change', _this.update, _this);\n return _this;\n }\n BarSeries.prototype.getKeys = function (direction) {\n var _this = this;\n var directionKeys = this.directionKeys;\n var keys = directionKeys && directionKeys[this.flipXY ? flipChartAxisDirection(direction) : direction];\n var values = [];\n if (keys) {\n keys.forEach(function (key) {\n var value = _this[key];\n if (value) {\n if (Array.isArray(value)) {\n values = values.concat(flat(value));\n }\n else {\n values.push(value);\n }\n }\n });\n }\n return values;\n };\n Object.defineProperty(BarSeries.prototype, \"xKey\", {\n get: function () {\n return this._xKey;\n },\n set: function (value) {\n if (this._xKey !== value) {\n this._xKey = value;\n this.xData = [];\n this.scheduleData();\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(BarSeries.prototype, \"xName\", {\n get: function () {\n return this._xName;\n },\n set: function (value) {\n if (this._xName !== value) {\n this._xName = value;\n this.update();\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(BarSeries.prototype, \"yKeys\", {\n get: function () {\n return this._yKeys;\n },\n set: function (yKeys) {\n var _this = this;\n if (!equal(this._yKeys, yKeys)) {\n // Convert from flat y-keys to grouped y-keys.\n if (yKeys.length && !Array.isArray(yKeys[0])) {\n var keys = this.flatYKeys = yKeys;\n if (this.grouped) {\n yKeys = keys.map(function (k) { return [k]; });\n }\n else {\n yKeys = [keys];\n }\n }\n else {\n this.flatYKeys = undefined;\n }\n this._yKeys = yKeys;\n var prevYKeyCount_1 = 0;\n this.cumYKeyCount = [];\n var visibleStacks_1 = [];\n yKeys.forEach(function (stack, index) {\n if (stack.length > 0) {\n visibleStacks_1.push(String(index));\n }\n _this.cumYKeyCount.push(prevYKeyCount_1);\n prevYKeyCount_1 += stack.length;\n });\n this.yData = [];\n var seriesItemEnabled_1 = this.seriesItemEnabled;\n seriesItemEnabled_1.clear();\n yKeys.forEach(function (stack) {\n stack.forEach(function (yKey) { return seriesItemEnabled_1.set(yKey, true); });\n });\n var groupScale = this.groupScale;\n groupScale.domain = visibleStacks_1;\n groupScale.padding = 0.1;\n groupScale.round = true;\n this.scheduleData();\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(BarSeries.prototype, \"grouped\", {\n get: function () {\n return this._grouped;\n },\n set: function (value) {\n if (this._grouped !== value) {\n this._grouped = value;\n if (this.flatYKeys) {\n this.yKeys = this.flatYKeys;\n }\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(BarSeries.prototype, \"yNames\", {\n get: function () {\n return this._yNames;\n },\n set: function (values) {\n if (Array.isArray(values) && this.flatYKeys) {\n var map_1 = {};\n this.flatYKeys.forEach(function (k, i) {\n map_1[k] = values[i];\n });\n values = map_1;\n }\n this._yNames = values;\n this.scheduleData();\n },\n enumerable: true,\n configurable: true\n });\n BarSeries.prototype.setColors = function (fills, strokes) {\n this.fills = fills;\n this.strokes = strokes;\n };\n Object.defineProperty(BarSeries.prototype, \"normalizedTo\", {\n get: function () {\n return this._normalizedTo;\n },\n set: function (value) {\n var absValue = value ? Math.abs(value) : undefined;\n if (this._normalizedTo !== absValue) {\n this._normalizedTo = absValue;\n this.scheduleData();\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(BarSeries.prototype, \"strokeWidth\", {\n get: function () {\n return this._strokeWidth;\n },\n set: function (value) {\n if (this._strokeWidth !== value) {\n this._strokeWidth = value;\n this.update();\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(BarSeries.prototype, \"shadow\", {\n get: function () {\n return this._shadow;\n },\n set: function (value) {\n if (this._shadow !== value) {\n this._shadow = value;\n this.update();\n }\n },\n enumerable: true,\n configurable: true\n });\n BarSeries.prototype.onHighlightChange = function () {\n this.updateRectNodes();\n };\n BarSeries.prototype.processData = function () {\n var _a = this, xKey = _a.xKey, yKeys = _a.yKeys, seriesItemEnabled = _a.seriesItemEnabled;\n var data = xKey && yKeys.length && this.data ? this.data : [];\n var keysFound = true; // only warn once\n this.xData = data.map(function (datum) {\n if (keysFound && !(xKey in datum)) {\n keysFound = false;\n console.warn(\"The key '\" + xKey + \"' was not found in the data: \", datum);\n }\n return datum[xKey];\n });\n this.yData = data.map(function (datum) { return yKeys.map(function (stack) {\n return stack.map(function (yKey) {\n if (keysFound && !(yKey in datum)) {\n keysFound = false;\n console.warn(\"The key '\" + yKey + \"' was not found in the data: \", datum);\n }\n var value = datum[yKey];\n return isFinite(value) && seriesItemEnabled.get(yKey) ? value : 0;\n });\n }); });\n // Used for normalization of stacked bars. Contains min/max values for each stack in each group,\n // where min is zero and max is a positive total of all values in the stack\n // or min is a negative total of all values in the stack and max is zero.\n var yMinMax = this.yData.map(function (group) { return group.map(function (stack) { return findMinMax(stack); }); });\n var _b = this, yData = _b.yData, normalizedTo = _b.normalizedTo;\n var yLargestMinMax = this.findLargestMinMax(yMinMax);\n var yMin;\n var yMax;\n if (normalizedTo && isFinite(normalizedTo)) {\n yMin = yLargestMinMax.min < 0 ? -normalizedTo : 0;\n yMax = normalizedTo;\n yData.forEach(function (group, i) {\n group.forEach(function (stack, j) {\n stack.forEach(function (y, k) {\n if (y < 0) {\n stack[k] = -y / yMinMax[i][j].min * normalizedTo;\n }\n else {\n stack[k] = y / yMinMax[i][j].max * normalizedTo;\n }\n });\n });\n });\n }\n else {\n yMin = yLargestMinMax.min;\n yMax = yLargestMinMax.max;\n }\n this.yDomain = this.fixNumericExtent([yMin, yMax], 'y');\n this.fireEvent({ type: 'dataProcessed' });\n return true;\n };\n BarSeries.prototype.findLargestMinMax = function (groups) {\n var tallestStackMin = 0;\n var tallestStackMax = 0;\n for (var _i = 0, groups_1 = groups; _i < groups_1.length; _i++) {\n var group = groups_1[_i];\n for (var _a = 0, group_1 = group; _a < group_1.length; _a++) {\n var stack = group_1[_a];\n if (stack.min < tallestStackMin) {\n tallestStackMin = stack.min;\n }\n if (stack.max > tallestStackMax) {\n tallestStackMax = stack.max;\n }\n }\n }\n return { min: tallestStackMin, max: tallestStackMax };\n };\n BarSeries.prototype.getDomain = function (direction) {\n if (this.flipXY) {\n direction = flipChartAxisDirection(direction);\n }\n if (direction === ChartAxisDirection.X) {\n return this.xData;\n }\n else {\n return this.yDomain;\n }\n };\n BarSeries.prototype.fireNodeClickEvent = function (event, datum) {\n this.fireEvent({\n type: 'nodeClick',\n event: event,\n series: this,\n datum: datum.seriesDatum,\n xKey: this.xKey,\n yKey: datum.yKey\n });\n };\n BarSeries.prototype.getCategoryAxis = function () {\n return this.flipXY ? this.yAxis : this.xAxis;\n };\n BarSeries.prototype.getValueAxis = function () {\n return this.flipXY ? this.xAxis : this.yAxis;\n };\n BarSeries.prototype.generateNodeData = function () {\n var _this = this;\n if (!this.data) {\n return [];\n }\n var flipXY = this.flipXY;\n var xAxis = this.getCategoryAxis();\n var yAxis = this.getValueAxis();\n var xScale = xAxis.scale;\n var yScale = yAxis.scale;\n var _a = this, groupScale = _a.groupScale, yKeys = _a.yKeys, cumYKeyCount = _a.cumYKeyCount, fills = _a.fills, strokes = _a.strokes, strokeWidth = _a.strokeWidth, seriesItemEnabled = _a.seriesItemEnabled, data = _a.data, xData = _a.xData, yData = _a.yData, label = _a.label;\n var labelFontStyle = label.fontStyle;\n var labelFontWeight = label.fontWeight;\n var labelFontSize = label.fontSize;\n var labelFontFamily = label.fontFamily;\n var labelColor = label.color;\n var labelFormatter = label.formatter;\n var labelPlacement = label.placement;\n groupScale.range = [0, xScale.bandwidth];\n var grouped = true;\n var barWidth = grouped ? groupScale.bandwidth : xScale.bandwidth;\n var nodeData = [];\n xData.forEach(function (group, groupIndex) {\n var seriesDatum = data[groupIndex];\n var x = xScale.convert(group);\n var groupYs = yData[groupIndex]; // y-data for groups of stacks\n for (var stackIndex = 0; stackIndex < groupYs.length; stackIndex++) {\n var stackYs = groupYs[stackIndex]; // y-data for a stack withing a group\n var prevMinY = 0;\n var prevMaxY = 0;\n for (var levelIndex = 0; levelIndex < stackYs.length; levelIndex++) {\n var currY = stackYs[levelIndex];\n var yKey = yKeys[stackIndex][levelIndex];\n var barX = grouped ? x + groupScale.convert(String(stackIndex)) : x;\n // Bars outside of visible range are not rendered, so we generate node data\n // only for the visible subset of user data.\n if (!xAxis.inRange(barX, barWidth)) {\n continue;\n }\n var prevY = currY < 0 ? prevMinY : prevMaxY;\n var y = yScale.convert(prevY + currY);\n var bottomY = yScale.convert(prevY);\n var yValue = seriesDatum[yKey]; // unprocessed y-value\n var yValueIsNumber = typeof yValue === 'number';\n var labelText = void 0;\n if (labelFormatter) {\n labelText = labelFormatter({ value: yValueIsNumber ? yValue : undefined });\n }\n else {\n labelText = yValueIsNumber && isFinite(yValue) ? yValue.toFixed(2) : '';\n }\n var labelX = void 0;\n var labelY = void 0;\n if (flipXY) {\n labelY = barX + barWidth / 2;\n if (labelPlacement === BarLabelPlacement.Inside) {\n labelX = y + (yValue >= 0 ? -1 : 1) * Math.abs(bottomY - y) / 2;\n }\n else {\n labelX = y + (yValue >= 0 ? 1 : -1) * 4;\n }\n }\n else {\n labelX = barX + barWidth / 2;\n if (labelPlacement === BarLabelPlacement.Inside) {\n labelY = y + (yValue >= 0 ? 1 : -1) * Math.abs(bottomY - y) / 2;\n }\n else {\n labelY = y + (yValue >= 0 ? -3 : 4);\n }\n }\n var labelTextAlign = void 0;\n var labelTextBaseline = void 0;\n if (labelPlacement === BarLabelPlacement.Inside) {\n labelTextAlign = 'center';\n labelTextBaseline = 'middle';\n }\n else {\n labelTextAlign = flipXY ? (yValue >= 0 ? 'start' : 'end') : 'center';\n labelTextBaseline = flipXY ? 'middle' : (yValue >= 0 ? 'bottom' : 'top');\n }\n var colorIndex = cumYKeyCount[stackIndex] + levelIndex;\n nodeData.push({\n index: groupIndex,\n series: _this,\n seriesDatum: seriesDatum,\n yValue: yValue,\n yKey: yKey,\n x: flipXY ? Math.min(y, bottomY) : barX,\n y: flipXY ? barX : Math.min(y, bottomY),\n width: flipXY ? Math.abs(bottomY - y) : barWidth,\n height: flipXY ? barWidth : Math.abs(bottomY - y),\n fill: fills[colorIndex % fills.length],\n stroke: strokes[colorIndex % strokes.length],\n strokeWidth: strokeWidth,\n label: seriesItemEnabled.get(yKey) && labelText ? {\n text: labelText,\n fontStyle: labelFontStyle,\n fontWeight: labelFontWeight,\n fontSize: labelFontSize,\n fontFamily: labelFontFamily,\n textAlign: labelTextAlign,\n textBaseline: labelTextBaseline,\n fill: labelColor,\n x: labelX,\n y: labelY\n } : undefined\n });\n if (currY < 0) {\n prevMinY += currY;\n }\n else {\n prevMaxY += currY;\n }\n }\n }\n });\n return nodeData;\n };\n BarSeries.prototype.update = function () {\n var _a = this, visible = _a.visible, chart = _a.chart, xAxis = _a.xAxis, yAxis = _a.yAxis, xData = _a.xData, yData = _a.yData;\n this.group.visible = visible;\n if (!chart || chart.layoutPending || chart.dataPending ||\n !xAxis || !yAxis || !visible || !xData.length || !yData.length) {\n return;\n }\n var nodeData = this.generateNodeData();\n this.updateRectSelection(nodeData);\n this.updateRectNodes();\n this.updateTextSelection(nodeData);\n this.updateTextNodes();\n };\n BarSeries.prototype.updateRectSelection = function (selectionData) {\n var updateRects = this.rectSelection.setData(selectionData);\n updateRects.exit.remove();\n var enterRects = updateRects.enter.append(Rect).each(function (rect) {\n rect.tag = BarSeriesNodeTag.Bar;\n rect.crisp = true;\n });\n this.rectSelection = updateRects.merge(enterRects);\n };\n BarSeries.prototype.updateRectNodes = function () {\n var _this = this;\n if (!this.chart) {\n return;\n }\n var _a = this, fillOpacity = _a.fillOpacity, strokeOpacity = _a.strokeOpacity, _b = _a.highlightStyle, fill = _b.fill, stroke = _b.stroke, shadow = _a.shadow, formatter = _a.formatter, xKey = _a.xKey, flipXY = _a.flipXY;\n var highlightedDatum = this.chart.highlightedDatum;\n this.rectSelection.each(function (rect, datum) {\n var highlighted = datum === highlightedDatum;\n var rectFill = highlighted && fill !== undefined ? fill : datum.fill;\n var rectStroke = highlighted && stroke !== undefined ? stroke : datum.stroke;\n var format = undefined;\n if (formatter) {\n format = formatter({\n datum: datum.seriesDatum,\n fill: rectFill,\n stroke: rectStroke,\n strokeWidth: datum.strokeWidth,\n highlighted: highlighted,\n xKey: xKey,\n yKey: datum.yKey\n });\n }\n rect.x = datum.x;\n rect.y = datum.y;\n rect.width = datum.width;\n rect.height = datum.height;\n rect.fill = format && format.fill || rectFill;\n rect.stroke = format && format.stroke || rectStroke;\n rect.strokeWidth = format && format.strokeWidth !== undefined ? format.strokeWidth : datum.strokeWidth;\n rect.fillOpacity = fillOpacity;\n rect.strokeOpacity = strokeOpacity;\n rect.lineDash = _this.lineDash;\n rect.lineDashOffset = _this.lineDashOffset;\n rect.fillShadow = shadow;\n // Prevent stroke from rendering for zero height columns and zero width bars.\n rect.visible = flipXY ? datum.width > 0 : datum.height > 0;\n });\n };\n BarSeries.prototype.updateTextSelection = function (selectionData) {\n var updateTexts = this.textSelection.setData(selectionData);\n updateTexts.exit.remove();\n var enterTexts = updateTexts.enter.append(Text).each(function (text) {\n text.tag = BarSeriesNodeTag.Label;\n text.pointerEvents = PointerEvents.None;\n });\n this.textSelection = updateTexts.merge(enterTexts);\n };\n BarSeries.prototype.updateTextNodes = function () {\n var labelEnabled = this.label.enabled;\n this.textSelection.each(function (text, datum) {\n var label = datum.label;\n if (label && labelEnabled) {\n text.fontStyle = label.fontStyle;\n text.fontWeight = label.fontWeight;\n text.fontSize = label.fontSize;\n text.fontFamily = label.fontFamily;\n text.textAlign = label.textAlign;\n text.textBaseline = label.textBaseline;\n text.text = label.text;\n text.x = label.x;\n text.y = label.y;\n text.fill = label.fill;\n text.visible = true;\n }\n else {\n text.visible = false;\n }\n });\n };\n BarSeries.prototype.getTooltipHtml = function (nodeDatum) {\n var _a = this, xKey = _a.xKey, yKeys = _a.yKeys, yData = _a.yData;\n var xAxis = this.getCategoryAxis();\n var yAxis = this.getValueAxis();\n var yKey = nodeDatum.yKey;\n if (!xKey || !yKey || !yData.length) {\n return '';\n }\n var yGroup = yData[nodeDatum.index];\n var fillIndex = 0;\n var i = 0;\n var j = 0;\n for (; j < yKeys.length; j++) {\n var stack = yKeys[j];\n i = stack.indexOf(yKey);\n if (i >= 0) {\n fillIndex += i;\n break;\n }\n fillIndex += stack.length;\n }\n var _b = this, xName = _b.xName, yNames = _b.yNames, fills = _b.fills, tooltip = _b.tooltip;\n var _c = tooltip.renderer, tooltipRenderer = _c === void 0 ? this.tooltipRenderer : _c; // TODO: remove deprecated tooltipRenderer\n var datum = nodeDatum.seriesDatum;\n var yName = yNames[yKey];\n var color = fills[fillIndex % fills.length];\n var xValue = datum[xKey];\n var yValue = datum[yKey];\n var processedYValue = yGroup[j][i];\n var xString = xAxis.formatDatum(xValue);\n var yString = yAxis.formatDatum(yValue);\n var title = yName;\n var content = xString + ': ' + yString;\n var defaults = {\n title: title,\n backgroundColor: color,\n content: content\n };\n if (tooltipRenderer) {\n return toTooltipHtml(tooltipRenderer({\n datum: datum,\n xKey: xKey,\n xValue: xValue,\n xName: xName,\n yKey: yKey,\n yValue: yValue,\n processedYValue: processedYValue,\n yName: yName,\n color: color\n }), defaults);\n }\n return toTooltipHtml(defaults);\n };\n BarSeries.prototype.listSeriesItems = function (legendData) {\n var _a = this, id = _a.id, data = _a.data, xKey = _a.xKey, yKeys = _a.yKeys, yNames = _a.yNames, cumYKeyCount = _a.cumYKeyCount, seriesItemEnabled = _a.seriesItemEnabled, hideInLegend = _a.hideInLegend, fills = _a.fills, strokes = _a.strokes, fillOpacity = _a.fillOpacity, strokeOpacity = _a.strokeOpacity;\n if (data && data.length && xKey && yKeys.length) {\n this.yKeys.forEach(function (stack, stackIndex) {\n stack.forEach(function (yKey, levelIndex) {\n if (hideInLegend.indexOf(yKey) < 0) {\n var colorIndex = cumYKeyCount[stackIndex] + levelIndex;\n legendData.push({\n id: id,\n itemId: yKey,\n enabled: seriesItemEnabled.get(yKey) || false,\n label: {\n text: yNames[yKey] || yKey\n },\n marker: {\n fill: fills[colorIndex % fills.length],\n stroke: strokes[colorIndex % strokes.length],\n fillOpacity: fillOpacity,\n strokeOpacity: strokeOpacity\n }\n });\n }\n });\n });\n }\n };\n BarSeries.prototype.toggleSeriesItem = function (itemId, enabled) {\n var seriesItemEnabled = this.seriesItemEnabled;\n seriesItemEnabled.set(itemId, enabled);\n var yKeys = this.yKeys.map(function (stack) { return stack.slice(); }); // deep clone\n seriesItemEnabled.forEach(function (enabled, yKey) {\n if (!enabled) {\n yKeys.forEach(function (stack) {\n var index = stack.indexOf(yKey);\n if (index >= 0) {\n stack.splice(index, 1);\n }\n });\n }\n });\n var visibleStacks = [];\n yKeys.forEach(function (stack, index) {\n if (stack.length > 0) {\n visibleStacks.push(String(index));\n }\n });\n this.groupScale.domain = visibleStacks;\n this.scheduleData();\n };\n BarSeries.className = 'BarSeries';\n BarSeries.type = 'bar';\n __decorate([\n reactive('dataChange')\n ], BarSeries.prototype, \"flipXY\", void 0);\n __decorate([\n reactive('dataChange')\n ], BarSeries.prototype, \"fills\", void 0);\n __decorate([\n reactive('dataChange')\n ], BarSeries.prototype, \"strokes\", void 0);\n __decorate([\n reactive('layoutChange')\n ], BarSeries.prototype, \"fillOpacity\", void 0);\n __decorate([\n reactive('layoutChange')\n ], BarSeries.prototype, \"strokeOpacity\", void 0);\n __decorate([\n reactive('update')\n ], BarSeries.prototype, \"lineDash\", void 0);\n __decorate([\n reactive('update')\n ], BarSeries.prototype, \"lineDashOffset\", void 0);\n __decorate([\n reactive('update')\n ], BarSeries.prototype, \"formatter\", void 0);\n __decorate([\n reactive('layoutChange')\n ], BarSeries.prototype, \"hideInLegend\", void 0);\n return BarSeries;\n}(CartesianSeries));\nexport { BarSeries };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n 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;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nimport { Observable, reactive } from \"../util/observable\";\nvar Label = /** @class */ (function (_super) {\n __extends(Label, _super);\n function Label() {\n var _this = _super.call(this) || this;\n _this.enabled = true;\n _this.fontSize = 12;\n _this.fontFamily = 'Verdana, sans-serif';\n _this.color = 'rgba(70, 70, 70, 1)';\n return _this;\n }\n __decorate([\n reactive('change', 'dataChange')\n ], Label.prototype, \"enabled\", void 0);\n __decorate([\n reactive('change')\n ], Label.prototype, \"fontStyle\", void 0);\n __decorate([\n reactive('change')\n ], Label.prototype, \"fontWeight\", void 0);\n __decorate([\n reactive('change')\n ], Label.prototype, \"fontSize\", void 0);\n __decorate([\n reactive('change')\n ], Label.prototype, \"fontFamily\", void 0);\n __decorate([\n reactive('change')\n ], Label.prototype, \"color\", void 0);\n return Label;\n}(Observable));\nexport { Label };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n 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;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __spreadArrays = (this && this.__spreadArrays) || function () {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n r[k] = a[j];\n return r;\n};\nimport { Group } from \"../../../scene/group\";\nimport { Selection } from \"../../../scene/selection\";\nimport { Rect } from \"../../../scene/shape/rect\";\nimport { Text } from \"../../../scene/shape/text\";\nimport { SeriesTooltip } from \"../series\";\nimport { Label } from \"../../label\";\nimport { PointerEvents } from \"../../../scene/node\";\nimport { CartesianSeries } from \"./cartesianSeries\";\nimport { ChartAxisDirection } from \"../../chartAxis\";\nimport { toTooltipHtml } from \"../../chart\";\nimport { numericExtent, finiteExtent } from \"../../../util/array\";\nimport { reactive } from \"../../../util/observable\";\nimport ticks, { tickStep } from \"../../../util/ticks\";\nvar HistogramSeriesNodeTag;\n(function (HistogramSeriesNodeTag) {\n HistogramSeriesNodeTag[HistogramSeriesNodeTag[\"Bin\"] = 0] = \"Bin\";\n HistogramSeriesNodeTag[HistogramSeriesNodeTag[\"Label\"] = 1] = \"Label\";\n})(HistogramSeriesNodeTag || (HistogramSeriesNodeTag = {}));\nvar HistogramSeriesLabel = /** @class */ (function (_super) {\n __extends(HistogramSeriesLabel, _super);\n function HistogramSeriesLabel() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n __decorate([\n reactive('change')\n ], HistogramSeriesLabel.prototype, \"formatter\", void 0);\n return HistogramSeriesLabel;\n}(Label));\nvar defaultBinCount = 10;\nvar aggregationFunctions = {\n count: function (bin) { return bin.data.length; },\n sum: function (bin, yKey) { return bin.data.reduce(function (acc, datum) { return acc + datum[yKey]; }, 0); },\n mean: function (bin, yKey) { return aggregationFunctions.sum(bin, yKey) / aggregationFunctions.count(bin, yKey); }\n};\nvar HistogramBin = /** @class */ (function () {\n function HistogramBin(_a) {\n var domainMin = _a[0], domainMax = _a[1];\n this.data = [];\n this.aggregatedValue = 0;\n this.frequency = 0;\n this.domain = [domainMin, domainMax];\n }\n ;\n HistogramBin.prototype.addDatum = function (datum) {\n this.data.push(datum);\n this.frequency++;\n };\n Object.defineProperty(HistogramBin.prototype, \"domainWidth\", {\n get: function () {\n var _a = this.domain, domainMin = _a[0], domainMax = _a[1];\n return domainMax - domainMin;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(HistogramBin.prototype, \"relativeHeight\", {\n get: function () {\n return this.aggregatedValue / this.domainWidth;\n },\n enumerable: true,\n configurable: true\n });\n HistogramBin.prototype.calculateAggregatedValue = function (aggregationName, yKey) {\n if (!yKey) {\n // not having a yKey forces us into a frequency plot\n aggregationName = 'count';\n }\n var aggregationFunction = aggregationFunctions[aggregationName];\n this.aggregatedValue = aggregationFunction(this, yKey);\n };\n HistogramBin.prototype.getY = function (areaPlot) {\n return areaPlot ? this.relativeHeight : this.aggregatedValue;\n };\n return HistogramBin;\n}());\nexport { HistogramBin };\nvar HistogramSeriesTooltip = /** @class */ (function (_super) {\n __extends(HistogramSeriesTooltip, _super);\n function HistogramSeriesTooltip() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n __decorate([\n reactive('change')\n ], HistogramSeriesTooltip.prototype, \"renderer\", void 0);\n return HistogramSeriesTooltip;\n}(SeriesTooltip));\nexport { HistogramSeriesTooltip };\nvar HistogramSeries = /** @class */ (function (_super) {\n __extends(HistogramSeries, _super);\n function HistogramSeries() {\n var _a;\n var _this = _super.call(this) || this;\n // Need to put column and label nodes into separate groups, because even though label nodes are\n // created after the column nodes, this only guarantees that labels will always be on top of columns\n // on the first run. If on the next run more columns are added, they might clip the labels\n // rendered during the previous run.\n _this.rectGroup = _this.group.appendChild(new Group());\n _this.textGroup = _this.group.appendChild(new Group());\n _this.rectSelection = Selection.select(_this.rectGroup).selectAll();\n _this.textSelection = Selection.select(_this.textGroup).selectAll();\n _this.binnedData = [];\n _this.xDomain = [];\n _this.yDomain = [];\n _this.label = new HistogramSeriesLabel();\n _this.seriesItemEnabled = true;\n _this.tooltip = new HistogramSeriesTooltip();\n _this.fill = undefined;\n _this.stroke = undefined;\n _this.fillOpacity = 1;\n _this.strokeOpacity = 1;\n _this.lineDash = undefined;\n _this.lineDashOffset = 0;\n _this.directionKeys = (_a = {},\n _a[ChartAxisDirection.X] = ['xKey'],\n _a[ChartAxisDirection.Y] = ['yKey'],\n _a);\n _this._xKey = '';\n _this._areaPlot = false;\n _this._bins = undefined;\n _this._aggregation = 'count';\n _this._binCount = undefined;\n _this._xName = '';\n _this._yKey = '';\n _this._yName = '';\n _this._strokeWidth = 1;\n _this.highlightStyle = { fill: 'yellow' };\n _this.label.enabled = false;\n _this.label.addEventListener('change', _this.update, _this);\n return _this;\n }\n HistogramSeries.prototype.getKeys = function (direction) {\n var _this = this;\n var directionKeys = this.directionKeys;\n var keys = directionKeys && directionKeys[direction];\n var values = [];\n if (keys) {\n keys.forEach(function (key) {\n var value = _this[key];\n if (value) {\n if (Array.isArray(value)) {\n values.push.apply(values, value);\n }\n else {\n values.push(value);\n }\n }\n });\n }\n return values;\n };\n Object.defineProperty(HistogramSeries.prototype, \"xKey\", {\n get: function () {\n return this._xKey;\n },\n set: function (value) {\n if (this._xKey !== value) {\n this._xKey = value;\n this.scheduleData();\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(HistogramSeries.prototype, \"areaPlot\", {\n get: function () {\n return this._areaPlot;\n },\n set: function (c) {\n this._areaPlot = c;\n this.scheduleData();\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(HistogramSeries.prototype, \"bins\", {\n get: function () {\n return this._bins;\n },\n set: function (bins) {\n this._bins = bins;\n this.scheduleData();\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(HistogramSeries.prototype, \"aggregation\", {\n get: function () {\n return this._aggregation;\n },\n set: function (aggregation) {\n this._aggregation = aggregation;\n this.scheduleData();\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(HistogramSeries.prototype, \"binCount\", {\n get: function () {\n return this._binCount;\n },\n set: function (binCount) {\n this._binCount = binCount;\n this.scheduleData();\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(HistogramSeries.prototype, \"xName\", {\n get: function () {\n return this._xName;\n },\n set: function (value) {\n if (this._xName !== value) {\n this._xName = value;\n this.update();\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(HistogramSeries.prototype, \"yKey\", {\n get: function () {\n return this._yKey;\n },\n set: function (yKey) {\n this._yKey = yKey;\n this.seriesItemEnabled = true;\n this.scheduleData();\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(HistogramSeries.prototype, \"yName\", {\n get: function () {\n return this._yName;\n },\n set: function (values) {\n this._yName = values;\n this.scheduleData();\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(HistogramSeries.prototype, \"strokeWidth\", {\n get: function () {\n return this._strokeWidth;\n },\n set: function (value) {\n if (this._strokeWidth !== value) {\n this._strokeWidth = value;\n this.update();\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(HistogramSeries.prototype, \"shadow\", {\n get: function () {\n return this._shadow;\n },\n set: function (value) {\n if (this._shadow !== value) {\n this._shadow = value;\n this.update();\n }\n },\n enumerable: true,\n configurable: true\n });\n HistogramSeries.prototype.onHighlightChange = function () {\n this.updateRectNodes();\n };\n HistogramSeries.prototype.setColors = function (fills, strokes) {\n this.fill = fills[0];\n this.stroke = strokes[0];\n };\n // During processData phase, used to unify different ways of the user specifying\n // the bins. Returns bins in format[[min1, max1], [min2, max2], ... ].\n HistogramSeries.prototype.deriveBins = function () {\n var _this = this;\n var _a = this, bins = _a.bins, binCount = _a.binCount;\n if (!this.data) {\n return [];\n }\n if (bins) {\n return bins;\n }\n var xData = this.data.map(function (datum) { return datum[_this.xKey]; });\n var xDomain = this.fixNumericExtent(finiteExtent(xData), 'x');\n var binStarts = ticks(xDomain[0], xDomain[1], this.binCount || defaultBinCount);\n var binSize = tickStep(xDomain[0], xDomain[1], this.binCount || defaultBinCount);\n var firstBinEnd = binStarts[0];\n var expandStartToBin = function (n) { return [n, n + binSize]; };\n return __spreadArrays([\n [firstBinEnd - binSize, firstBinEnd]\n ], binStarts.map(expandStartToBin));\n };\n HistogramSeries.prototype.placeDataInBins = function (data) {\n var _this = this;\n var xKey = this.xKey;\n var derivedBins = this.deriveBins();\n // creating a sorted copy allows binning in O(n) rather than O(n²)\n // but at the expense of more temporary memory\n var sortedData = data.slice().sort(function (a, b) {\n if (a[xKey] < b[xKey]) {\n return -1;\n }\n if (a[xKey] > b[xKey]) {\n return 1;\n }\n return 0;\n });\n var currentBin = 0;\n var bins = [new HistogramBin(derivedBins[0])];\n loop: for (var i = 0, ln = sortedData.length; i < ln; i++) {\n var datum = sortedData[i];\n while (datum[xKey] > derivedBins[currentBin][1]) {\n currentBin++;\n var bin = derivedBins[currentBin];\n if (!bin) {\n break loop;\n }\n bins.push(new HistogramBin(bin));\n }\n bins[currentBin].addDatum(datum);\n }\n bins.forEach(function (b) { return b.calculateAggregatedValue(_this._aggregation, _this.yKey); });\n return bins;\n };\n Object.defineProperty(HistogramSeries.prototype, \"xMax\", {\n get: function () {\n var _this = this;\n return this.data && this.data.reduce(function (acc, datum) {\n return Math.max(acc, datum[_this.xKey]);\n }, Number.NEGATIVE_INFINITY);\n },\n enumerable: true,\n configurable: true\n });\n HistogramSeries.prototype.processData = function () {\n var _this = this;\n var _a = this, xKey = _a.xKey, data = _a.data;\n this.binnedData = this.placeDataInBins(xKey && data ? data : []);\n var yData = this.binnedData.map(function (b) { return b.getY(_this.areaPlot); });\n var yMinMax = numericExtent(yData);\n this.yDomain = this.fixNumericExtent([0, yMinMax ? yMinMax[1] : 1], 'y');\n var firstBin = this.binnedData[0];\n var lastBin = this.binnedData[this.binnedData.length - 1];\n var xMin = firstBin.domain[0];\n var xMax = lastBin.domain[1];\n this.xDomain = [xMin, xMax];\n this.fireEvent({ type: 'dataProcessed' });\n return true;\n };\n HistogramSeries.prototype.getDomain = function (direction) {\n if (direction === ChartAxisDirection.X) {\n return this.xDomain;\n }\n else {\n return this.yDomain;\n }\n };\n HistogramSeries.prototype.fireNodeClickEvent = function (event, datum) {\n this.fireEvent({\n type: 'nodeClick',\n event: event,\n series: this,\n datum: datum.seriesDatum,\n xKey: this.xKey\n });\n };\n HistogramSeries.prototype.update = function () {\n var _a = this, visible = _a.visible, chart = _a.chart, xAxis = _a.xAxis, yAxis = _a.yAxis;\n this.group.visible = visible;\n if (!xAxis || !yAxis || !visible || !chart || chart.layoutPending || chart.dataPending) {\n return;\n }\n var nodeData = this.generateNodeData();\n this.updateRectSelection(nodeData);\n this.updateRectNodes();\n this.updateTextSelection(nodeData);\n this.updateTextNodes();\n };\n HistogramSeries.prototype.generateNodeData = function () {\n var _this = this;\n if (!this.seriesItemEnabled) {\n return [];\n }\n var _a = this, xScale = _a.xAxis.scale, yScale = _a.yAxis.scale, fill = _a.fill, stroke = _a.stroke, strokeWidth = _a.strokeWidth;\n var nodeData = [];\n var defaultLabelFormatter = function (params) { return String(params.value); };\n var _b = this.label, _c = _b.formatter, labelFormatter = _c === void 0 ? defaultLabelFormatter : _c, labelFontStyle = _b.fontStyle, labelFontWeight = _b.fontWeight, labelFontSize = _b.fontSize, labelFontFamily = _b.fontFamily, labelColor = _b.color;\n this.binnedData.forEach(function (binOfData) {\n var total = binOfData.aggregatedValue, frequency = binOfData.frequency, _a = binOfData.domain, xDomainMin = _a[0], xDomainMax = _a[1], relativeHeight = binOfData.relativeHeight;\n var xMinPx = xScale.convert(xDomainMin), xMaxPx = xScale.convert(xDomainMax), \n // note: assuming can't be negative:\n y = _this.areaPlot ? relativeHeight : (_this.yKey ? total : frequency), yZeroPx = yScale.convert(0), yMaxPx = yScale.convert(y), w = xMaxPx - xMinPx, h = Math.abs(yMaxPx - yZeroPx);\n var selectionDatumLabel = y !== 0 ? {\n text: labelFormatter({ value: binOfData.aggregatedValue }),\n fontStyle: labelFontStyle,\n fontWeight: labelFontWeight,\n fontSize: labelFontSize,\n fontFamily: labelFontFamily,\n fill: labelColor,\n x: xMinPx + w / 2,\n y: yMaxPx + h / 2\n } : undefined;\n nodeData.push({\n series: _this,\n seriesDatum: binOfData,\n // since each selection is an aggregation of multiple data.\n x: xMinPx,\n y: yMaxPx,\n width: w,\n height: h,\n fill: fill,\n stroke: stroke,\n strokeWidth: strokeWidth,\n label: selectionDatumLabel,\n });\n });\n return nodeData;\n };\n HistogramSeries.prototype.updateRectSelection = function (nodeData) {\n var updateRects = this.rectSelection.setData(nodeData);\n updateRects.exit.remove();\n var enterRects = updateRects.enter.append(Rect).each(function (rect) {\n rect.tag = HistogramSeriesNodeTag.Bin;\n rect.crisp = true;\n });\n this.rectSelection = updateRects.merge(enterRects);\n };\n HistogramSeries.prototype.updateRectNodes = function () {\n var _this = this;\n if (!this.chart) {\n return;\n }\n var highlightedDatum = this.chart.highlightedDatum;\n var _a = this, fillOpacity = _a.fillOpacity, strokeOpacity = _a.strokeOpacity, shadow = _a.shadow, _b = _a.highlightStyle, fill = _b.fill, stroke = _b.stroke;\n this.rectSelection.each(function (rect, datum) {\n var highlighted = datum === highlightedDatum;\n rect.x = datum.x;\n rect.y = datum.y;\n rect.width = datum.width;\n rect.height = datum.height;\n rect.fill = highlighted && fill !== undefined ? fill : datum.fill;\n rect.stroke = highlighted && stroke !== undefined ? stroke : datum.stroke;\n rect.fillOpacity = fillOpacity;\n rect.strokeOpacity = strokeOpacity;\n rect.strokeWidth = datum.strokeWidth;\n rect.lineDash = _this.lineDash;\n rect.lineDashOffset = _this.lineDashOffset;\n rect.fillShadow = shadow;\n rect.visible = datum.height > 0; // prevent stroke from rendering for zero height columns\n });\n };\n HistogramSeries.prototype.updateTextSelection = function (nodeData) {\n var updateTexts = this.textSelection.setData(nodeData);\n updateTexts.exit.remove();\n var enterTexts = updateTexts.enter.append(Text).each(function (text) {\n text.tag = HistogramSeriesNodeTag.Label;\n text.pointerEvents = PointerEvents.None;\n text.textAlign = 'center';\n text.textBaseline = 'middle';\n });\n this.textSelection = updateTexts.merge(enterTexts);\n };\n HistogramSeries.prototype.updateTextNodes = function () {\n var labelEnabled = this.label.enabled;\n this.textSelection.each(function (text, datum) {\n var label = datum.label;\n if (label && labelEnabled) {\n text.text = label.text;\n text.x = label.x;\n text.y = label.y;\n text.fontStyle = label.fontStyle;\n text.fontWeight = label.fontWeight;\n text.fontSize = label.fontSize;\n text.fontFamily = label.fontFamily;\n text.fill = label.fill;\n text.visible = true;\n }\n else {\n text.visible = false;\n }\n });\n };\n HistogramSeries.prototype.getTooltipHtml = function (nodeDatum) {\n var _a = this, xKey = _a.xKey, yKey = _a.yKey, xAxis = _a.xAxis, yAxis = _a.yAxis;\n if (!xKey) {\n return '';\n }\n var _b = this, xName = _b.xName, yName = _b.yName, color = _b.fill, tooltip = _b.tooltip, aggregation = _b.aggregation;\n var _c = tooltip.renderer, tooltipRenderer = _c === void 0 ? this.tooltipRenderer : _c;\n var bin = nodeDatum.seriesDatum;\n var aggregatedValue = bin.aggregatedValue, frequency = bin.frequency, _d = bin.domain, rangeMin = _d[0], rangeMax = _d[1];\n var title = (xName || xKey) + \": \" + xAxis.formatDatum(rangeMin) + \" - \" + xAxis.formatDatum(rangeMax);\n var content = yKey ?\n \"\" + (yName || yKey) + \" (\" + aggregation + \"): \" + yAxis.formatDatum(aggregatedValue) + \"
\" :\n '';\n content += \"Frequency: \" + frequency;\n var defaults = {\n title: title,\n backgroundColor: color,\n content: content\n };\n if (tooltipRenderer) {\n return toTooltipHtml(tooltipRenderer({\n datum: bin,\n xKey: xKey,\n xValue: bin.domain,\n xName: xName,\n yKey: yKey,\n yValue: bin.aggregatedValue,\n yName: yName,\n color: color\n }), defaults);\n }\n return toTooltipHtml(defaults);\n };\n HistogramSeries.prototype.listSeriesItems = function (legendData) {\n var _a = this, id = _a.id, data = _a.data, yKey = _a.yKey, yName = _a.yName, seriesItemEnabled = _a.seriesItemEnabled, fill = _a.fill, stroke = _a.stroke, fillOpacity = _a.fillOpacity, strokeOpacity = _a.strokeOpacity;\n if (data && data.length) {\n legendData.push({\n id: id,\n itemId: yKey,\n enabled: seriesItemEnabled,\n label: {\n text: yName || yKey || 'Frequency'\n },\n marker: {\n fill: fill || 'rgba(0, 0, 0, 0)',\n stroke: stroke || 'rgba(0, 0, 0, 0)',\n fillOpacity: fillOpacity,\n strokeOpacity: strokeOpacity\n }\n });\n }\n };\n HistogramSeries.prototype.toggleSeriesItem = function (itemId, enabled) {\n if (itemId === this.yKey) {\n this.seriesItemEnabled = enabled;\n }\n this.scheduleData();\n };\n HistogramSeries.className = 'HistogramSeries';\n HistogramSeries.type = 'histogram';\n __decorate([\n reactive('dataChange')\n ], HistogramSeries.prototype, \"fill\", void 0);\n __decorate([\n reactive('dataChange')\n ], HistogramSeries.prototype, \"stroke\", void 0);\n __decorate([\n reactive('layoutChange')\n ], HistogramSeries.prototype, \"fillOpacity\", void 0);\n __decorate([\n reactive('layoutChange')\n ], HistogramSeries.prototype, \"strokeOpacity\", void 0);\n __decorate([\n reactive('update')\n ], HistogramSeries.prototype, \"lineDash\", void 0);\n __decorate([\n reactive('update')\n ], HistogramSeries.prototype, \"lineDashOffset\", void 0);\n return HistogramSeries;\n}(CartesianSeries));\nexport { HistogramSeries };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n 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;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nimport { Path } from \"../../../scene/shape/path\";\nimport ContinuousScale from \"../../../scale/continuousScale\";\nimport { Selection } from \"../../../scene/selection\";\nimport { Group } from \"../../../scene/group\";\nimport { SeriesTooltip } from \"../series\";\nimport { numericExtent } from \"../../../util/array\";\nimport { PointerEvents } from \"../../../scene/node\";\nimport { CartesianSeries, CartesianSeriesMarker } from \"./cartesianSeries\";\nimport { ChartAxisDirection } from \"../../chartAxis\";\nimport { getMarker } from \"../../marker/util\";\nimport { reactive } from \"../../../util/observable\";\nimport { toTooltipHtml } from \"../../chart\";\nimport { interpolate } from \"../../../util/string\";\nvar LineSeriesTooltip = /** @class */ (function (_super) {\n __extends(LineSeriesTooltip, _super);\n function LineSeriesTooltip() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n __decorate([\n reactive('change')\n ], LineSeriesTooltip.prototype, \"renderer\", void 0);\n __decorate([\n reactive('change')\n ], LineSeriesTooltip.prototype, \"format\", void 0);\n return LineSeriesTooltip;\n}(SeriesTooltip));\nexport { LineSeriesTooltip };\nvar LineSeries = /** @class */ (function (_super) {\n __extends(LineSeries, _super);\n function LineSeries() {\n var _this = _super.call(this) || this;\n _this.xDomain = [];\n _this.yDomain = [];\n _this.xData = [];\n _this.yData = [];\n _this.lineNode = new Path();\n // We use groups for this selection even though each group only contains a marker ATM\n // because in the future we might want to add label support as well.\n _this.nodeSelection = Selection.select(_this.group).selectAll();\n _this.nodeData = [];\n _this.marker = new CartesianSeriesMarker();\n _this.stroke = '#874349';\n _this.lineDash = undefined;\n _this.lineDashOffset = 0;\n _this.strokeWidth = 2;\n _this.strokeOpacity = 1;\n _this.tooltip = new LineSeriesTooltip();\n _this._xKey = '';\n _this.xName = '';\n _this._yKey = '';\n _this.yName = '';\n _this.highlightStyle = { fill: 'yellow' };\n var lineNode = _this.lineNode;\n lineNode.fill = undefined;\n lineNode.lineJoin = 'round';\n lineNode.pointerEvents = PointerEvents.None;\n _this.group.append(lineNode);\n _this.addEventListener('update', _this.update);\n var marker = _this.marker;\n marker.fill = '#c16068';\n marker.stroke = '#874349';\n marker.addPropertyListener('shape', _this.onMarkerShapeChange, _this);\n marker.addPropertyListener('enabled', _this.onMarkerEnabledChange, _this);\n marker.addEventListener('change', _this.update, _this);\n return _this;\n }\n LineSeries.prototype.onMarkerShapeChange = function () {\n this.nodeSelection = this.nodeSelection.setData([]);\n this.nodeSelection.exit.remove();\n this.update();\n this.fireEvent({ type: 'legendChange' });\n };\n LineSeries.prototype.onMarkerEnabledChange = function (event) {\n if (!event.value) {\n this.nodeSelection = this.nodeSelection.setData([]);\n this.nodeSelection.exit.remove();\n }\n };\n LineSeries.prototype.setColors = function (fills, strokes) {\n this.stroke = fills[0];\n this.marker.stroke = strokes[0];\n this.marker.fill = fills[0];\n };\n Object.defineProperty(LineSeries.prototype, \"xKey\", {\n get: function () {\n return this._xKey;\n },\n set: function (value) {\n if (this._xKey !== value) {\n this._xKey = value;\n this.xData = [];\n this.scheduleData();\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(LineSeries.prototype, \"yKey\", {\n get: function () {\n return this._yKey;\n },\n set: function (value) {\n if (this._yKey !== value) {\n this._yKey = value;\n this.yData = [];\n this.scheduleData();\n }\n },\n enumerable: true,\n configurable: true\n });\n LineSeries.prototype.processData = function () {\n var _a = this, xAxis = _a.xAxis, yAxis = _a.yAxis, xKey = _a.xKey, yKey = _a.yKey, xData = _a.xData, yData = _a.yData;\n var data = xKey && yKey && this.data ? this.data : [];\n if (!xAxis) {\n return false;\n }\n var isContinuousX = xAxis.scale instanceof ContinuousScale;\n var isContinuousY = yAxis.scale instanceof ContinuousScale;\n xData.length = 0;\n yData.length = 0;\n for (var i = 0, n = data.length; i < n; i++) {\n var datum = data[i];\n var x = datum[xKey];\n var y = datum[yKey];\n xData.push(x);\n yData.push(y);\n }\n this.xDomain = isContinuousX ? this.fixNumericExtent(numericExtent(xData), 'x') : xData;\n this.yDomain = isContinuousY ? this.fixNumericExtent(numericExtent(yData), 'y') : yData;\n return true;\n };\n LineSeries.prototype.getDomain = function (direction) {\n if (direction === ChartAxisDirection.X) {\n return this.xDomain;\n }\n return this.yDomain;\n };\n LineSeries.prototype.onHighlightChange = function () {\n this.updateNodes();\n };\n LineSeries.prototype.update = function () {\n this.group.visible = this.visible;\n var _a = this, chart = _a.chart, xAxis = _a.xAxis, yAxis = _a.yAxis;\n if (!chart || chart.layoutPending || chart.dataPending || !xAxis || !yAxis) {\n return;\n }\n this.updateLinePath(); // this will generate node data too\n this.updateNodeSelection();\n this.updateNodes();\n };\n LineSeries.prototype.getXYDatums = function (i, xData, yData, xScale, yScale) {\n var isContinuousX = xScale instanceof ContinuousScale;\n var isContinuousY = yScale instanceof ContinuousScale;\n var xDatum = xData[i];\n var yDatum = yData[i];\n var noDatum = yDatum == null || (isContinuousY && (isNaN(yDatum) || !isFinite(yDatum))) ||\n xDatum == null || (isContinuousX && (isNaN(xDatum) || !isFinite(xDatum)));\n return noDatum ? undefined : [xDatum, yDatum];\n };\n LineSeries.prototype.updateLinePath = function () {\n if (!this.data) {\n return;\n }\n var _a = this, xAxis = _a.xAxis, yAxis = _a.yAxis, data = _a.data, xData = _a.xData, yData = _a.yData, lineNode = _a.lineNode;\n var xScale = xAxis.scale;\n var yScale = yAxis.scale;\n var xOffset = (xScale.bandwidth || 0) / 2;\n var yOffset = (yScale.bandwidth || 0) / 2;\n var linePath = lineNode.path;\n var nodeData = [];\n linePath.clear();\n var moveTo = true;\n var prevXInRange = undefined;\n var nextXYDatums = undefined;\n for (var i = 0; i < xData.length; i++) {\n var xyDatums = nextXYDatums || this.getXYDatums(i, xData, yData, xScale, yScale);\n if (!xyDatums) {\n prevXInRange = undefined;\n moveTo = true;\n }\n else {\n var xDatum = xyDatums[0], yDatum = xyDatums[1];\n var x = xScale.convert(xDatum) + xOffset;\n var tolerance = (xScale.bandwidth || (this.marker.size * 0.5 + (this.marker.strokeWidth || 0))) + 1;\n nextXYDatums = this.getXYDatums(i + 1, xData, yData, xScale, yScale);\n var xInRange = xAxis.inRangeEx(x, 0, tolerance);\n var nextXInRange = nextXYDatums && xAxis.inRangeEx(xScale.convert(nextXYDatums[0]) + xOffset, 0, tolerance);\n if (xInRange === -1 && nextXInRange === -1) {\n moveTo = true;\n continue;\n }\n if (xInRange === 1 && prevXInRange === 1) {\n moveTo = true;\n continue;\n }\n prevXInRange = xInRange;\n var y = yScale.convert(yDatum) + yOffset;\n if (moveTo) {\n linePath.moveTo(x, y);\n moveTo = false;\n }\n else {\n linePath.lineTo(x, y);\n }\n nodeData.push({\n series: this,\n seriesDatum: data[i],\n point: { x: x, y: y }\n });\n }\n }\n lineNode.stroke = this.stroke;\n lineNode.strokeWidth = this.strokeWidth;\n lineNode.lineDash = this.lineDash;\n lineNode.lineDashOffset = this.lineDashOffset;\n lineNode.strokeOpacity = this.strokeOpacity;\n // Used by marker nodes and for hit-testing even when not using markers\n // when `chart.tooltipTracking` is true.\n this.nodeData = nodeData;\n };\n LineSeries.prototype.updateNodeSelection = function () {\n var marker = this.marker;\n var nodeData = marker.shape ? this.nodeData : [];\n var MarkerShape = getMarker(marker.shape);\n var updateSelection = this.nodeSelection.setData(nodeData);\n updateSelection.exit.remove();\n var enterSelection = updateSelection.enter.append(Group);\n enterSelection.append(MarkerShape);\n this.nodeSelection = updateSelection.merge(enterSelection);\n };\n LineSeries.prototype.updateNodes = function () {\n if (!this.chart) {\n return;\n }\n var _a = this, marker = _a.marker, xKey = _a.xKey, yKey = _a.yKey, stroke = _a.stroke, strokeWidth = _a.strokeWidth;\n var MarkerShape = getMarker(marker.shape);\n var highlightedDatum = this.chart.highlightedDatum;\n var _b = this.highlightStyle, highlightFill = _b.fill, highlightStroke = _b.stroke;\n var markerFormatter = marker.formatter;\n var markerSize = marker.size;\n var markerStrokeWidth = marker.strokeWidth !== undefined ? marker.strokeWidth : strokeWidth;\n this.nodeSelection.selectByClass(MarkerShape)\n .each(function (node, datum) {\n var highlighted = datum === highlightedDatum;\n var markerFill = highlighted && highlightFill !== undefined ? highlightFill : marker.fill;\n var markerStroke = highlighted && highlightStroke !== undefined ? highlightStroke : marker.stroke || stroke;\n var markerFormat = undefined;\n if (markerFormatter) {\n markerFormat = markerFormatter({\n datum: datum.seriesDatum,\n xKey: xKey,\n yKey: yKey,\n fill: markerFill,\n stroke: markerStroke,\n strokeWidth: markerStrokeWidth,\n size: markerSize,\n highlighted: highlighted\n });\n }\n node.fill = markerFormat && markerFormat.fill || markerFill;\n node.stroke = markerFormat && markerFormat.stroke || markerStroke;\n node.strokeWidth = markerFormat && markerFormat.strokeWidth !== undefined\n ? markerFormat.strokeWidth\n : markerStrokeWidth;\n node.size = markerFormat && markerFormat.size !== undefined\n ? markerFormat.size\n : markerSize;\n node.translationX = datum.point.x;\n node.translationY = datum.point.y;\n node.visible = marker.enabled && node.size > 0;\n });\n };\n LineSeries.prototype.getNodeData = function () {\n return this.nodeData;\n };\n LineSeries.prototype.fireNodeClickEvent = function (event, datum) {\n this.fireEvent({\n type: 'nodeClick',\n event: event,\n series: this,\n datum: datum.seriesDatum,\n xKey: this.xKey,\n yKey: this.yKey\n });\n };\n LineSeries.prototype.getTooltipHtml = function (nodeDatum) {\n var _a = this, xKey = _a.xKey, yKey = _a.yKey, xAxis = _a.xAxis, yAxis = _a.yAxis;\n if (!xKey || !yKey) {\n return '';\n }\n var _b = this, xName = _b.xName, yName = _b.yName, color = _b.stroke, tooltip = _b.tooltip;\n var _c = tooltip.renderer, tooltipRenderer = _c === void 0 ? this.tooltipRenderer : _c, tooltipFormat = tooltip.format;\n var datum = nodeDatum.seriesDatum;\n var xValue = datum[xKey];\n var yValue = datum[yKey];\n var xString = xAxis.formatDatum(xValue);\n var yString = yAxis.formatDatum(yValue);\n var title = this.title || yName;\n var content = xString + ': ' + yString;\n var defaults = {\n title: title,\n backgroundColor: color,\n content: content\n };\n if (tooltipFormat || tooltipRenderer) {\n var params = {\n datum: datum,\n xKey: xKey,\n xValue: xValue,\n xName: xName,\n yKey: yKey,\n yValue: yValue,\n yName: yName,\n title: title,\n color: color\n };\n if (tooltipFormat) {\n return toTooltipHtml({\n content: interpolate(tooltipFormat, params)\n }, defaults);\n }\n if (tooltipRenderer) {\n return toTooltipHtml(tooltipRenderer(params), defaults);\n }\n }\n return toTooltipHtml(defaults);\n };\n LineSeries.prototype.listSeriesItems = function (legendData) {\n var _a = this, id = _a.id, data = _a.data, xKey = _a.xKey, yKey = _a.yKey, yName = _a.yName, visible = _a.visible, title = _a.title, marker = _a.marker, stroke = _a.stroke, strokeOpacity = _a.strokeOpacity;\n if (data && data.length && xKey && yKey) {\n legendData.push({\n id: id,\n itemId: undefined,\n enabled: visible,\n label: {\n text: title || yName || yKey\n },\n marker: {\n shape: marker.shape,\n fill: marker.fill || 'rgba(0, 0, 0, 0)',\n stroke: marker.stroke || stroke || 'rgba(0, 0, 0, 0)',\n fillOpacity: 1,\n strokeOpacity: strokeOpacity\n }\n });\n }\n };\n LineSeries.className = 'LineSeries';\n LineSeries.type = 'line';\n __decorate([\n reactive('layoutChange')\n ], LineSeries.prototype, \"title\", void 0);\n __decorate([\n reactive('update')\n ], LineSeries.prototype, \"stroke\", void 0);\n __decorate([\n reactive('update')\n ], LineSeries.prototype, \"lineDash\", void 0);\n __decorate([\n reactive('update')\n ], LineSeries.prototype, \"lineDashOffset\", void 0);\n __decorate([\n reactive('update')\n ], LineSeries.prototype, \"strokeWidth\", void 0);\n __decorate([\n reactive('update')\n ], LineSeries.prototype, \"strokeOpacity\", void 0);\n __decorate([\n reactive('update')\n ], LineSeries.prototype, \"xName\", void 0);\n __decorate([\n reactive('update')\n ], LineSeries.prototype, \"yName\", void 0);\n return LineSeries;\n}(CartesianSeries));\nexport { LineSeries };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n 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;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nimport { Selection } from \"../../../scene/selection\";\nimport { Group } from \"../../../scene/group\";\nimport { SeriesTooltip } from \"../series\";\nimport { finiteExtent } from \"../../../util/array\";\nimport { LinearScale } from \"../../../scale/linearScale\";\nimport { reactive } from \"../../../util/observable\";\nimport { CartesianSeries, CartesianSeriesMarker } from \"./cartesianSeries\";\nimport { ChartAxisDirection } from \"../../chartAxis\";\nimport { getMarker } from \"../../marker/util\";\nimport { toTooltipHtml } from \"../../chart\";\nimport ContinuousScale from \"../../../scale/continuousScale\";\nvar ScatterSeriesTooltip = /** @class */ (function (_super) {\n __extends(ScatterSeriesTooltip, _super);\n function ScatterSeriesTooltip() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n __decorate([\n reactive('change')\n ], ScatterSeriesTooltip.prototype, \"renderer\", void 0);\n return ScatterSeriesTooltip;\n}(SeriesTooltip));\nexport { ScatterSeriesTooltip };\nvar ScatterSeries = /** @class */ (function (_super) {\n __extends(ScatterSeries, _super);\n function ScatterSeries() {\n var _this = _super.call(this) || this;\n _this.xDomain = [];\n _this.yDomain = [];\n _this.xData = [];\n _this.yData = [];\n _this.sizeData = [];\n _this.sizeScale = new LinearScale();\n _this.nodeSelection = Selection.select(_this.group).selectAll();\n _this.nodeData = [];\n _this.marker = new CartesianSeriesMarker();\n _this._fill = '#c16068';\n _this._stroke = '#874349';\n _this._strokeWidth = 2;\n _this._fillOpacity = 1;\n _this._strokeOpacity = 1;\n _this.highlightStyle = { fill: 'yellow' };\n _this.xKey = '';\n _this.yKey = '';\n _this.xName = '';\n _this.yName = '';\n _this.sizeName = 'Size';\n _this.labelName = 'Label';\n _this.tooltip = new ScatterSeriesTooltip();\n var marker = _this.marker;\n marker.addPropertyListener('shape', _this.onMarkerShapeChange, _this);\n marker.addEventListener('change', _this.update, _this);\n _this.addPropertyListener('xKey', function () { return _this.xData = []; });\n _this.addPropertyListener('yKey', function () { return _this.yData = []; });\n _this.addPropertyListener('sizeKey', function () { return _this.sizeData = []; });\n return _this;\n }\n Object.defineProperty(ScatterSeries.prototype, \"fill\", {\n get: function () {\n return this._fill;\n },\n set: function (value) {\n if (this._fill !== value) {\n this._fill = value;\n this.scheduleData();\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(ScatterSeries.prototype, \"stroke\", {\n get: function () {\n return this._stroke;\n },\n set: function (value) {\n if (this._stroke !== value) {\n this._stroke = value;\n this.scheduleData();\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(ScatterSeries.prototype, \"strokeWidth\", {\n get: function () {\n return this._strokeWidth;\n },\n set: function (value) {\n if (this._strokeWidth !== value) {\n this._strokeWidth = value;\n this.update();\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(ScatterSeries.prototype, \"fillOpacity\", {\n get: function () {\n return this._fillOpacity;\n },\n set: function (value) {\n if (this._fillOpacity !== value) {\n this._fillOpacity = value;\n this.scheduleLayout();\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(ScatterSeries.prototype, \"strokeOpacity\", {\n get: function () {\n return this._strokeOpacity;\n },\n set: function (value) {\n if (this._strokeOpacity !== value) {\n this._strokeOpacity = value;\n this.scheduleLayout();\n }\n },\n enumerable: true,\n configurable: true\n });\n ScatterSeries.prototype.onHighlightChange = function () {\n this.updateNodes();\n };\n ScatterSeries.prototype.onMarkerShapeChange = function () {\n this.nodeSelection = this.nodeSelection.setData([]);\n this.nodeSelection.exit.remove();\n this.update();\n this.fireEvent({ type: 'legendChange' });\n };\n ScatterSeries.prototype.setColors = function (fills, strokes) {\n this.fill = fills[0];\n this.stroke = strokes[0];\n this.marker.fill = fills[0];\n this.marker.stroke = strokes[0];\n };\n ScatterSeries.prototype.processData = function () {\n var _a = this, xKey = _a.xKey, yKey = _a.yKey, sizeKey = _a.sizeKey, xAxis = _a.xAxis, yAxis = _a.yAxis, marker = _a.marker;\n var data = xKey && yKey && this.data ? this.data : [];\n this.xData = data.map(function (d) { return d[xKey]; });\n this.yData = data.map(function (d) { return d[yKey]; });\n if (sizeKey) {\n this.sizeData = data.map(function (d) { return d[sizeKey]; });\n }\n else {\n this.sizeData = [];\n }\n this.sizeScale.domain = marker.domain ? marker.domain : finiteExtent(this.sizeData) || [1, 1];\n if (xAxis.scale instanceof ContinuousScale) {\n this.xDomain = this.fixNumericExtent(finiteExtent(this.xData), 'x');\n }\n else {\n this.xDomain = this.xData;\n }\n if (yAxis.scale instanceof ContinuousScale) {\n this.yDomain = this.fixNumericExtent(finiteExtent(this.yData), 'y');\n }\n else {\n this.yDomain = this.yData;\n }\n return true;\n };\n ScatterSeries.prototype.getDomain = function (direction) {\n if (direction === ChartAxisDirection.X) {\n return this.xDomain;\n }\n else {\n return this.yDomain;\n }\n };\n ScatterSeries.prototype.getNodeData = function () {\n return this.nodeData;\n };\n ScatterSeries.prototype.fireNodeClickEvent = function (event, datum) {\n this.fireEvent({\n type: 'nodeClick',\n event: event,\n series: this,\n datum: datum.seriesDatum,\n xKey: this.xKey,\n yKey: this.yKey,\n sizeKey: this.sizeKey\n });\n };\n ScatterSeries.prototype.generateNodeData = function () {\n if (!this.data) {\n return [];\n }\n var _a = this, xAxis = _a.xAxis, yAxis = _a.yAxis;\n var xScale = xAxis.scale;\n var yScale = yAxis.scale;\n var isContinuousX = xScale instanceof ContinuousScale;\n var isContinuousY = yScale instanceof ContinuousScale;\n var xOffset = (xScale.bandwidth || 0) / 2;\n var yOffset = (yScale.bandwidth || 0) / 2;\n var _b = this, data = _b.data, xData = _b.xData, yData = _b.yData, sizeData = _b.sizeData, sizeScale = _b.sizeScale, marker = _b.marker;\n sizeScale.range = [marker.size, marker.maxSize];\n var nodeData = [];\n for (var i = 0; i < xData.length; i++) {\n var xDatum = xData[i];\n var yDatum = yData[i];\n var noDatum = yDatum == null || (isContinuousY && (isNaN(yDatum) || !isFinite(yDatum))) ||\n xDatum == null || (isContinuousX && (isNaN(xDatum) || !isFinite(xDatum)));\n if (noDatum) {\n continue;\n }\n var x = xScale.convert(xDatum) + xOffset;\n if (!xAxis.inRange(x)) {\n continue;\n }\n nodeData.push({\n series: this,\n seriesDatum: data[i],\n point: {\n x: x,\n y: yScale.convert(yData[i]) + yOffset\n },\n size: sizeData.length ? sizeScale.convert(sizeData[i]) : marker.size\n });\n }\n return nodeData;\n };\n ScatterSeries.prototype.update = function () {\n var _a = this, visible = _a.visible, chart = _a.chart, xAxis = _a.xAxis, yAxis = _a.yAxis;\n this.group.visible = visible;\n if (!visible || !chart || chart.layoutPending || chart.dataPending || !xAxis || !yAxis) {\n return;\n }\n var nodeData = this.nodeData = this.generateNodeData();\n this.updateNodeSelection(nodeData);\n this.updateNodes();\n };\n ScatterSeries.prototype.updateNodeSelection = function (nodeData) {\n var MarkerShape = getMarker(this.marker.shape);\n var updateSelection = this.nodeSelection.setData(nodeData);\n updateSelection.exit.remove();\n var enterSelection = updateSelection.enter.append(Group);\n enterSelection.append(MarkerShape);\n this.nodeSelection = updateSelection.merge(enterSelection);\n };\n ScatterSeries.prototype.updateNodes = function () {\n if (!this.chart) {\n return;\n }\n var highlightedDatum = this.chart.highlightedDatum;\n var _a = this, marker = _a.marker, xKey = _a.xKey, yKey = _a.yKey, fill = _a.fill, stroke = _a.stroke, strokeWidth = _a.strokeWidth, fillOpacity = _a.fillOpacity, strokeOpacity = _a.strokeOpacity;\n var _b = this.highlightStyle, highlightFill = _b.fill, highlightStroke = _b.stroke;\n var markerStrokeWidth = marker.strokeWidth !== undefined ? marker.strokeWidth : strokeWidth;\n var MarkerShape = getMarker(marker.shape);\n var markerFormatter = marker.formatter;\n this.nodeSelection.selectByClass(MarkerShape)\n .each(function (node, datum) {\n var highlighted = datum === highlightedDatum;\n var markerFill = highlighted && highlightFill !== undefined ? highlightFill : marker.fill || fill;\n var markerStroke = highlighted && highlightStroke !== undefined ? highlightStroke : marker.stroke || stroke;\n var markerFormat = undefined;\n if (markerFormatter) {\n markerFormat = markerFormatter({\n datum: datum.seriesDatum,\n xKey: xKey,\n yKey: yKey,\n fill: markerFill,\n stroke: markerStroke,\n strokeWidth: markerStrokeWidth,\n size: datum.size,\n highlighted: highlighted\n });\n }\n node.fill = markerFormat && markerFormat.fill || markerFill;\n node.stroke = markerFormat && markerFormat.stroke || markerStroke;\n node.strokeWidth = markerFormat && markerFormat.strokeWidth !== undefined\n ? markerFormat.strokeWidth\n : markerStrokeWidth;\n node.size = markerFormat && markerFormat.size !== undefined\n ? markerFormat.size\n : datum.size;\n node.fillOpacity = fillOpacity;\n node.strokeOpacity = strokeOpacity;\n node.translationX = datum.point.x;\n node.translationY = datum.point.y;\n node.visible = marker.enabled && node.size > 0;\n });\n };\n ScatterSeries.prototype.getTooltipHtml = function (nodeDatum) {\n var _a = this, xKey = _a.xKey, yKey = _a.yKey, xAxis = _a.xAxis, yAxis = _a.yAxis;\n if (!xKey || !yKey) {\n return '';\n }\n var _b = this, tooltip = _b.tooltip, xName = _b.xName, yName = _b.yName, sizeKey = _b.sizeKey, sizeName = _b.sizeName, labelKey = _b.labelKey, labelName = _b.labelName;\n var _c = tooltip.renderer, tooltipRenderer = _c === void 0 ? this.tooltipRenderer : _c;\n var color = this.marker.fill || this.fill || 'gray';\n var title = this.title || yName;\n var datum = nodeDatum.seriesDatum;\n var xValue = datum[xKey];\n var yValue = datum[yKey];\n var xString = xAxis.formatDatum(xValue);\n var yString = yAxis.formatDatum(yValue);\n var content = \"\" + (xName || xKey) + \": \" + xString\n + (\"
\" + (yName || yKey) + \": \" + yString);\n if (sizeKey) {\n content += \"
\" + sizeName + \": \" + datum[sizeKey];\n }\n if (labelKey) {\n content = \"\" + labelName + \": \" + datum[labelKey] + \"
\" + content;\n }\n var defaults = {\n title: title,\n backgroundColor: color,\n content: content\n };\n if (tooltipRenderer) {\n return toTooltipHtml(tooltipRenderer({\n datum: datum,\n xKey: xKey,\n xValue: xValue,\n xName: xName,\n yKey: yKey,\n yValue: yValue,\n yName: yName,\n sizeKey: sizeKey,\n sizeName: sizeName,\n labelKey: labelKey,\n labelName: labelName,\n title: title,\n color: color\n }), defaults);\n }\n return toTooltipHtml(defaults);\n };\n ScatterSeries.prototype.listSeriesItems = function (legendData) {\n var _a = this, id = _a.id, data = _a.data, xKey = _a.xKey, yKey = _a.yKey, yName = _a.yName, title = _a.title, visible = _a.visible, marker = _a.marker, fill = _a.fill, stroke = _a.stroke, fillOpacity = _a.fillOpacity, strokeOpacity = _a.strokeOpacity;\n if (data && data.length && xKey && yKey) {\n legendData.push({\n id: id,\n itemId: undefined,\n enabled: visible,\n label: {\n text: title || yName || yKey\n },\n marker: {\n shape: marker.shape,\n fill: marker.fill || fill || 'rgba(0, 0, 0, 0)',\n stroke: marker.stroke || stroke || 'rgba(0, 0, 0, 0)',\n fillOpacity: fillOpacity,\n strokeOpacity: strokeOpacity\n }\n });\n }\n };\n ScatterSeries.className = 'ScatterSeries';\n ScatterSeries.type = 'scatter';\n __decorate([\n reactive('layoutChange')\n ], ScatterSeries.prototype, \"title\", void 0);\n __decorate([\n reactive('dataChange')\n ], ScatterSeries.prototype, \"xKey\", void 0);\n __decorate([\n reactive('dataChange')\n ], ScatterSeries.prototype, \"yKey\", void 0);\n __decorate([\n reactive('dataChange')\n ], ScatterSeries.prototype, \"sizeKey\", void 0);\n __decorate([\n reactive('dataChange')\n ], ScatterSeries.prototype, \"labelKey\", void 0);\n return ScatterSeries;\n}(CartesianSeries));\nexport { ScatterSeries };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n 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;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nimport { Series } from \"../series\";\nimport { reactive } from \"../../../util/observable\";\nvar HierarchySeries = /** @class */ (function (_super) {\n __extends(HierarchySeries, _super);\n function HierarchySeries() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.data = undefined;\n return _this;\n }\n __decorate([\n reactive('dataChange')\n ], HierarchySeries.prototype, \"data\", void 0);\n return HierarchySeries;\n}(Series));\nexport { HierarchySeries };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n 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;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nimport { Observable, reactive } from \"../util/observable\";\nvar DropShadow = /** @class */ (function (_super) {\n __extends(DropShadow, _super);\n function DropShadow() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.enabled = true;\n _this.color = 'rgba(0, 0, 0, 0.5)';\n _this.xOffset = 0;\n _this.yOffset = 0;\n _this.blur = 5;\n return _this;\n }\n __decorate([\n reactive('change')\n ], DropShadow.prototype, \"enabled\", void 0);\n __decorate([\n reactive('change')\n ], DropShadow.prototype, \"color\", void 0);\n __decorate([\n reactive('change')\n ], DropShadow.prototype, \"xOffset\", void 0);\n __decorate([\n reactive('change')\n ], DropShadow.prototype, \"yOffset\", void 0);\n __decorate([\n reactive('change')\n ], DropShadow.prototype, \"blur\", void 0);\n return DropShadow;\n}(Observable));\nexport { DropShadow };\n","function slice(parent, x0, y0, x1, y1) {\n var nodes = parent.children;\n var k = parent.value && (y1 - y0) / parent.value;\n nodes.forEach(function (node) {\n node.x0 = x0;\n node.x1 = x1;\n node.y0 = y0;\n node.y1 = y0 += node.value * k;\n });\n}\nfunction dice(parent, x0, y0, x1, y1) {\n var nodes = parent.children;\n var k = parent.value && (x1 - x0) / parent.value;\n nodes.forEach(function (node) {\n node.x0 = x0;\n node.x1 = x0 += node.value * k;\n node.y0 = y0;\n node.y1 = y1;\n });\n}\nfunction roundNode(node) {\n node.x0 = Math.round(node.x0);\n node.y0 = Math.round(node.y0);\n node.x1 = Math.round(node.x1);\n node.y1 = Math.round(node.y1);\n}\nexport function squarifyRatio(ratio, parent, x0, y0, x1, y1) {\n var rows = [];\n var nodes = parent.children;\n var n = nodes.length;\n var value = parent.value;\n var i0 = 0;\n var i1 = 0;\n var dx;\n var dy;\n var nodeValue;\n var sumValue;\n var minValue;\n var maxValue;\n var newRatio;\n var minRatio;\n var alpha;\n var beta;\n while (i0 < n) {\n dx = x1 - x0;\n dy = y1 - y0;\n // Find the next non-empty node.\n do {\n sumValue = nodes[i1++].value;\n } while (!sumValue && i1 < n);\n minValue = maxValue = sumValue;\n alpha = Math.max(dy / dx, dx / dy) / (value * ratio);\n beta = sumValue * sumValue * alpha;\n minRatio = Math.max(maxValue / beta, beta / minValue);\n // Keep adding nodes while the aspect ratio maintains or improves.\n for (; i1 < n; ++i1) {\n nodeValue = nodes[i1].value;\n sumValue += nodeValue;\n if (nodeValue < minValue) {\n minValue = nodeValue;\n }\n if (nodeValue > maxValue) {\n maxValue = nodeValue;\n }\n beta = sumValue * sumValue * alpha;\n newRatio = Math.max(maxValue / beta, beta / minValue);\n if (newRatio > minRatio) {\n sumValue -= nodeValue;\n break;\n }\n minRatio = newRatio;\n }\n // Position and record the row orientation.\n var row = {\n value: sumValue,\n dice: dx < dy,\n children: nodes.slice(i0, i1)\n };\n rows.push(row);\n if (row.dice) {\n dice(row, x0, y0, x1, value ? y0 += dy * sumValue / value : y1);\n }\n else {\n slice(row, x0, y0, value ? x0 += dx * sumValue / value : x1, y1);\n }\n value -= sumValue;\n i0 = i1;\n }\n return rows;\n}\nvar phi = (1 + Math.sqrt(5)) / 2;\nvar squarify = (function custom(ratio) {\n function squarify(parent, x0, y0, x1, y1) {\n squarifyRatio(ratio, parent, x0, y0, x1, y1);\n }\n squarify.ratio = function (x) { return custom((x = +x) > 1 ? x : 1); };\n return squarify;\n})(phi);\nvar Treemap = /** @class */ (function () {\n function Treemap() {\n this.paddingStack = [0];\n this.dx = 1;\n this.dy = 1;\n this.round = true;\n this.tile = squarify;\n this.paddingInner = function (_) { return 0; };\n this.paddingTop = function (_) { return 0; };\n this.paddingRight = function (_) { return 0; };\n this.paddingBottom = function (_) { return 0; };\n this.paddingLeft = function (_) { return 0; };\n }\n Object.defineProperty(Treemap.prototype, \"size\", {\n get: function () {\n return [this.dx, this.dy];\n },\n set: function (size) {\n this.dx = size[0];\n this.dy = size[1];\n },\n enumerable: true,\n configurable: true\n });\n Treemap.prototype.processData = function (root) {\n root.x0 = 0;\n root.y0 = 0;\n root.x1 = this.dx;\n root.y1 = this.dy;\n root.eachBefore(this.positionNode.bind(this));\n this.paddingStack = [0];\n if (this.round) {\n root.eachBefore(roundNode);\n }\n return root;\n };\n Treemap.prototype.positionNode = function (node) {\n var p = this.paddingStack[node.depth];\n var x0 = node.x0 + p;\n var y0 = node.y0 + p;\n var x1 = node.x1 - p;\n var y1 = node.y1 - p;\n if (x1 < x0) {\n x0 = x1 = (x0 + x1) / 2;\n }\n if (y1 < y0) {\n y0 = y1 = (y0 + y1) / 2;\n }\n node.x0 = x0;\n node.y0 = y0;\n node.x1 = x1;\n node.y1 = y1;\n if (node.children) {\n p = this.paddingStack[node.depth + 1] = this.paddingInner(node) / 2;\n x0 += this.paddingLeft(node) - p;\n y0 += this.paddingTop(node) - p;\n x1 -= this.paddingRight(node) - p;\n y1 -= this.paddingBottom(node) - p;\n if (x1 < x0) {\n x0 = x1 = (x0 + x1) / 2;\n }\n if (y1 < y0) {\n y0 = y1 = (y0 + y1) / 2;\n }\n this.tile(node, x0, y0, x1, y1);\n }\n };\n return Treemap;\n}());\nexport { Treemap };\n","var HierarchyNode = /** @class */ (function () {\n function HierarchyNode(data) {\n this.value = 0;\n this.depth = 0;\n this.height = 0;\n this.parent = undefined;\n this.children = undefined;\n this.data = data;\n }\n HierarchyNode.prototype.countFn = function (node) {\n var sum = 0, children = node.children;\n if (!children || !children.length) {\n sum = 1;\n }\n else {\n var i = children.length;\n while (--i >= 0) {\n sum += children[i].value;\n }\n }\n node.value = sum;\n };\n HierarchyNode.prototype.count = function () {\n return this.eachAfter(this.countFn);\n };\n HierarchyNode.prototype.each = function (callback, scope) {\n var _this = this;\n var index = -1;\n this.iterator(function (node) {\n callback.call(scope, node, ++index, _this);\n });\n return this;\n };\n /**\n * Invokes the given callback for each node in post-order traversal.\n * @param callback\n * @param scope\n */\n HierarchyNode.prototype.eachAfter = function (callback, scope) {\n var node = this;\n var nodes = [node];\n var next = [];\n while (node = nodes.pop()) {\n next.push(node);\n var children = node.children;\n if (children) {\n for (var i = 0, n = children.length; i < n; ++i) {\n nodes.push(children[i]);\n }\n }\n }\n var index = -1;\n while (node = next.pop()) {\n callback.call(scope, node, ++index, this);\n }\n return this;\n };\n /**\n * Invokes the given callback for each node in pre-order traversal.\n * @param callback\n * @param scope\n */\n HierarchyNode.prototype.eachBefore = function (callback, scope) {\n var node = this;\n var nodes = [node];\n var index = -1;\n while (node = nodes.pop()) {\n callback.call(scope, node, ++index, this);\n var children = node.children;\n if (children) {\n for (var i = children.length - 1; i >= 0; --i) {\n var child = children[i];\n nodes.push(child);\n }\n }\n }\n return this;\n };\n HierarchyNode.prototype.find = function (callback, scope) {\n var _this = this;\n var index = -1;\n var result;\n this.iterator(function (node) {\n if (callback.call(scope, node, ++index, _this)) {\n result = node;\n return false;\n }\n });\n return result;\n };\n HierarchyNode.prototype.sum = function (value) {\n return this.eachAfter(function (node) {\n var sum = +value(node.data) || 0;\n var children = node.children;\n if (children) {\n var i = children.length;\n while (--i >= 0) {\n sum += children[i].value;\n }\n }\n node.value = sum;\n });\n };\n HierarchyNode.prototype.sort = function (compare) {\n return this.eachBefore(function (node) {\n if (node.children) {\n node.children.sort(compare);\n }\n });\n };\n HierarchyNode.prototype.path = function (end) {\n var start = this;\n var ancestor = leastCommonAncestor(start, end);\n var nodes = [start];\n while (start !== ancestor) {\n start = start.parent;\n nodes.push(start);\n }\n var k = nodes.length;\n while (end !== ancestor) {\n nodes.splice(k, 0, end);\n end = end.parent;\n }\n // const otherBranch = [];\n // while (end !== ancestor) {\n // otherBranch.push(end);\n // end = end.parent;\n // }\n // nodes.concat(otherBranch.reverse());\n return nodes;\n };\n HierarchyNode.prototype.ancestors = function () {\n var node = this;\n var nodes = [node];\n while (node = node.parent) {\n nodes.push(node);\n }\n return nodes;\n };\n HierarchyNode.prototype.descendants = function () {\n var nodes = [];\n this.iterator(function (node) { return nodes.push(node); });\n return nodes;\n };\n HierarchyNode.prototype.leaves = function () {\n var leaves = [];\n this.eachBefore(function (node) {\n if (!node.children) {\n leaves.push(node);\n }\n });\n return leaves;\n };\n HierarchyNode.prototype.links = function () {\n var root = this;\n var links = [];\n root.each(function (node) {\n if (node !== root) { // Don’t include the root’s parent, if any.\n links.push({ source: node.parent, target: node });\n }\n });\n return links;\n };\n HierarchyNode.prototype.copy = function () {\n // TODO\n };\n HierarchyNode.prototype.iterator = function (callback) {\n var node = this;\n var next = [node];\n var current;\n doLoop: do {\n current = next.reverse();\n next = [];\n while (node = current.pop()) {\n if (callback(node) === false) {\n break doLoop;\n }\n var children = node.children;\n if (children) {\n for (var i = 0, n = children.length; i < n; ++i) {\n next.push(children[i]);\n }\n }\n }\n } while (next.length);\n };\n return HierarchyNode;\n}());\nexport { HierarchyNode };\nexport function hierarchy(data, children) {\n if (data instanceof Map) {\n data = [undefined, data];\n if (children === undefined) {\n children = mapChildren;\n }\n }\n else if (children === undefined) {\n children = objectChildren;\n }\n var root = new HierarchyNode(data);\n var nodes = [root];\n var node;\n var child, childs, i, n;\n while (node = nodes.pop()) {\n if ((childs = children(node.data)) && (n = (childs = Array.from(childs)).length)) {\n node.children = childs;\n for (i = n - 1; i >= 0; --i) {\n nodes.push(child = childs[i] = new HierarchyNode(childs[i]));\n child.parent = node;\n child.depth = node.depth + 1;\n }\n }\n }\n return root.eachBefore(computeHeight);\n}\nfunction computeHeight(node) {\n var height = 0;\n do {\n node.height = height;\n } while ((node = node.parent) && (node.height < ++height));\n}\nfunction mapChildren(d) {\n return Array.isArray(d) ? d[1] : undefined;\n}\nfunction objectChildren(d) {\n return d.children;\n}\nfunction leastCommonAncestor(a, b) {\n if (!(a && b)) {\n return undefined;\n }\n if (a === b) {\n return a;\n }\n var aNodes = a.ancestors();\n var bNodes = b.ancestors();\n var c = undefined;\n a = aNodes.pop();\n b = bNodes.pop();\n while (a === b) {\n c = a;\n a = aNodes.pop();\n b = bNodes.pop();\n }\n return c;\n}\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n 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;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nimport { Selection } from \"../../../scene/selection\";\nimport { HdpiCanvas } from \"../../../canvas/hdpiCanvas\";\nimport { reactive } from \"../../../util/observable\";\nimport { Label } from \"../../label\";\nimport { SeriesTooltip } from \"../series\";\nimport { HierarchySeries } from \"./hierarchySeries\";\nimport { toTooltipHtml } from \"../../chart\";\nimport { Group } from \"../../../scene/group\";\nimport { Text } from \"../../../scene/shape/text\";\nimport { Rect } from \"../../../scene/shape/rect\";\nimport { DropShadow } from \"../../../scene/dropShadow\";\nimport { LinearScale } from \"../../../scale/linearScale\";\nimport { Treemap } from \"../../../layout/treemap\";\nimport { hierarchy } from \"../../../layout/hierarchy\";\nimport { toFixed } from \"../../../util/number\";\nvar TreemapSeriesTooltip = /** @class */ (function (_super) {\n __extends(TreemapSeriesTooltip, _super);\n function TreemapSeriesTooltip() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n __decorate([\n reactive('change')\n ], TreemapSeriesTooltip.prototype, \"renderer\", void 0);\n return TreemapSeriesTooltip;\n}(SeriesTooltip));\nexport { TreemapSeriesTooltip };\nvar TreemapSeriesLabel = /** @class */ (function (_super) {\n __extends(TreemapSeriesLabel, _super);\n function TreemapSeriesLabel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.padding = 10;\n return _this;\n }\n __decorate([\n reactive('change')\n ], TreemapSeriesLabel.prototype, \"padding\", void 0);\n return TreemapSeriesLabel;\n}(Label));\nexport { TreemapSeriesLabel };\nvar TextNodeTag;\n(function (TextNodeTag) {\n TextNodeTag[TextNodeTag[\"Name\"] = 0] = \"Name\";\n TextNodeTag[TextNodeTag[\"Value\"] = 1] = \"Value\";\n})(TextNodeTag || (TextNodeTag = {}));\nvar TreemapSeries = /** @class */ (function (_super) {\n __extends(TreemapSeries, _super);\n function TreemapSeries() {\n var _this = _super.call(this) || this;\n _this.groupSelection = Selection.select(_this.group).selectAll();\n _this.labelMap = new Map();\n _this.layout = new Treemap();\n _this.title = (function () {\n var label = new TreemapSeriesLabel();\n label.color = 'white';\n label.fontWeight = 'bold';\n label.fontSize = 12;\n label.fontFamily = 'Verdana, sans-serif';\n label.padding = 15;\n return label;\n })();\n _this.subtitle = (function () {\n var label = new TreemapSeriesLabel();\n label.color = 'white';\n label.fontSize = 9;\n label.fontFamily = 'Verdana, sans-serif';\n label.padding = 13;\n return label;\n })();\n _this.labels = {\n large: (function () {\n var label = new Label();\n label.color = 'white';\n label.fontWeight = 'bold';\n label.fontSize = 18;\n return label;\n })(),\n medium: (function () {\n var label = new Label();\n label.color = 'white';\n label.fontWeight = 'bold';\n label.fontSize = 14;\n return label;\n })(),\n small: (function () {\n var label = new Label();\n label.color = 'white';\n label.fontWeight = 'bold';\n label.fontSize = 10;\n return label;\n })(),\n color: (function () {\n var label = new Label();\n label.color = 'white';\n return label;\n })()\n };\n _this._nodePadding = 2;\n _this.labelKey = 'label';\n _this.sizeKey = 'size';\n _this.colorKey = 'color';\n _this.colorDomain = [-5, 5];\n _this.colorRange = ['#cb4b3f', '#6acb64'];\n _this.colorParents = false;\n _this.gradient = true;\n _this.colorName = 'Change';\n _this.rootName = 'Root';\n _this._shadow = (function () {\n var shadow = new DropShadow();\n shadow.color = 'rgba(0, 0, 0, 0.4)';\n shadow.xOffset = 1.5;\n shadow.yOffset = 1.5;\n return shadow;\n })();\n _this.highlightStyle = { fill: 'yellow' };\n _this.tooltip = new TreemapSeriesTooltip();\n _this.shadow.addEventListener('change', _this.update, _this);\n _this.title.addEventListener('change', _this.update, _this);\n _this.subtitle.addEventListener('change', _this.update, _this);\n _this.labels.small.addEventListener('change', _this.update, _this);\n _this.labels.medium.addEventListener('change', _this.update, _this);\n _this.labels.large.addEventListener('change', _this.update, _this);\n _this.labels.color.addEventListener('change', _this.update, _this);\n return _this;\n }\n Object.defineProperty(TreemapSeries.prototype, \"nodePadding\", {\n get: function () {\n return this._nodePadding;\n },\n set: function (value) {\n if (this._nodePadding !== value) {\n this._nodePadding = value;\n this.updateLayoutPadding();\n this.update();\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(TreemapSeries.prototype, \"shadow\", {\n get: function () {\n return this._shadow;\n },\n set: function (value) {\n if (this._shadow !== value) {\n this._shadow = value;\n this.update();\n }\n },\n enumerable: true,\n configurable: true\n });\n TreemapSeries.prototype.onHighlightChange = function () {\n this.updateNodes();\n };\n TreemapSeries.prototype.updateLayoutPadding = function () {\n var _a = this, title = _a.title, subtitle = _a.subtitle, nodePadding = _a.nodePadding, labelKey = _a.labelKey;\n this.layout.paddingRight = function (_) { return nodePadding; };\n this.layout.paddingBottom = function (_) { return nodePadding; };\n this.layout.paddingLeft = function (_) { return nodePadding; };\n this.layout.paddingTop = function (node) {\n var name = node.data[labelKey] || '';\n if (node.children) {\n name = name.toUpperCase();\n }\n var font = node.depth > 1 ? subtitle : title;\n var textSize = HdpiCanvas.getTextSize(name, [font.fontWeight, font.fontSize + 'px', font.fontFamily].join(' ').trim());\n var innerNodeWidth = node.x1 - node.x0 - nodePadding * 2;\n var hasTitle = node.depth > 0 && node.children && textSize.width <= innerNodeWidth;\n node.hasTitle = hasTitle;\n return hasTitle ? textSize.height + nodePadding * 2 : nodePadding;\n };\n };\n TreemapSeries.prototype.processData = function () {\n if (!this.data) {\n return false;\n }\n var _a = this, data = _a.data, sizeKey = _a.sizeKey, labelKey = _a.labelKey, colorKey = _a.colorKey, colorDomain = _a.colorDomain, colorRange = _a.colorRange, colorParents = _a.colorParents;\n var dataRoot;\n if (sizeKey) {\n dataRoot = hierarchy(data).sum(function (datum) { return datum.children ? 1 : datum[sizeKey]; });\n }\n else {\n dataRoot = hierarchy(data).sum(function (datum) { return datum.children ? 0 : 1; });\n }\n this.dataRoot = dataRoot;\n var colorScale = new LinearScale();\n colorScale.domain = colorDomain;\n colorScale.range = colorRange;\n var series = this;\n function traverse(root, depth) {\n if (depth === void 0) { depth = 0; }\n var children = root.children, data = root.data;\n var label = data[labelKey];\n var colorValue = colorKey ? data[colorKey] : depth;\n root.series = series;\n root.fill = !children || colorParents ? colorScale.convert(colorValue) : '#272931';\n root.colorValue = colorValue;\n if (label) {\n root.label = children ? label.toUpperCase() : label;\n }\n else {\n root.label = '';\n }\n if (children) {\n children.forEach(function (child) { return traverse(child, depth + 1); });\n }\n }\n traverse(this.dataRoot);\n return true;\n };\n TreemapSeries.prototype.getLabelCenterX = function (datum) {\n return (datum.x0 + datum.x1) / 2;\n };\n TreemapSeries.prototype.getLabelCenterY = function (datum) {\n return (datum.y0 + datum.y1) / 2 + 2;\n };\n TreemapSeries.prototype.update = function () {\n var _a = this, chart = _a.chart, dataRoot = _a.dataRoot;\n if (!chart || !dataRoot) {\n return;\n }\n var seriesRect = chart.getSeriesRect();\n if (!seriesRect) {\n return;\n }\n this.layout.size = [seriesRect.width, seriesRect.height];\n this.updateLayoutPadding();\n var descendants = this.layout.processData(dataRoot).descendants();\n var updateGroups = this.groupSelection.setData(descendants);\n updateGroups.exit.remove();\n var enterGroups = updateGroups.enter.append(Group);\n enterGroups.append(Rect);\n enterGroups.append(Text).each(function (node) { return node.tag = TextNodeTag.Name; });\n enterGroups.append(Text).each(function (node) { return node.tag = TextNodeTag.Value; });\n this.groupSelection = updateGroups.merge(enterGroups);\n this.updateNodes();\n };\n TreemapSeries.prototype.updateNodes = function () {\n var _this = this;\n var chart = this.chart;\n if (!chart) {\n return;\n }\n var highlightedDatum = chart.highlightedDatum;\n var _a = this.highlightStyle, highlightFill = _a.fill, highlightStroke = _a.stroke;\n var _b = this, colorKey = _b.colorKey, labelMap = _b.labelMap, nodePadding = _b.nodePadding, title = _b.title, subtitle = _b.subtitle, labels = _b.labels, shadow = _b.shadow, gradient = _b.gradient;\n this.groupSelection.selectByClass(Rect).each(function (rect, datum) {\n var highlighted = datum === highlightedDatum;\n var fill = highlighted && highlightFill !== undefined\n ? highlightFill\n : datum.fill;\n var stroke = highlighted && highlightStroke !== undefined\n ? highlightStroke\n : datum.depth < 2 ? undefined : 'black';\n rect.fill = fill;\n rect.stroke = stroke;\n rect.strokeWidth = 1;\n rect.crisp = true;\n rect.gradient = gradient;\n rect.x = datum.x0;\n rect.y = datum.y0;\n rect.width = datum.x1 - datum.x0;\n rect.height = datum.y1 - datum.y0;\n });\n this.groupSelection.selectByTag(TextNodeTag.Name).each(function (text, datum, index) {\n var isLeaf = !datum.children;\n var innerNodeWidth = datum.x1 - datum.x0 - nodePadding * 2;\n var innerNodeHeight = datum.y1 - datum.y0 - nodePadding * 2;\n var hasTitle = datum.hasTitle;\n var highlighted = datum === highlightedDatum;\n var label;\n if (isLeaf) {\n if (innerNodeWidth > 40 && innerNodeHeight > 40) {\n label = labels.large;\n }\n else if (innerNodeWidth > 20 && innerNodeHeight > 20) {\n label = labels.medium;\n }\n else {\n label = labels.small;\n }\n }\n else {\n if (datum.depth > 1) {\n label = subtitle;\n }\n else {\n label = title;\n }\n }\n text.fontWeight = label.fontWeight;\n text.fontSize = label.fontSize;\n text.fontFamily = label.fontFamily;\n text.textBaseline = isLeaf ? 'bottom' : (hasTitle ? 'top' : 'middle');\n text.textAlign = hasTitle ? 'left' : 'center';\n text.text = datum.label;\n var textBBox = text.computeBBox();\n var hasLabel = isLeaf && !!textBBox\n && textBBox.width <= innerNodeWidth\n && textBBox.height * 2 + 8 <= innerNodeHeight;\n labelMap.set(index, text);\n text.fill = highlighted ? 'black' : label.color;\n text.fillShadow = hasLabel && !highlighted ? shadow : undefined;\n text.visible = hasTitle || hasLabel;\n if (hasTitle) {\n text.x = datum.x0 + nodePadding;\n text.y = datum.y0 + nodePadding;\n }\n else {\n text.x = _this.getLabelCenterX(datum);\n text.y = _this.getLabelCenterY(datum);\n }\n });\n this.groupSelection.selectByTag(TextNodeTag.Value).each(function (text, datum, index) {\n var isLeaf = !datum.children;\n var innerNodeWidth = datum.x1 - datum.x0 - nodePadding * 2;\n var highlighted = datum === highlightedDatum;\n var value = datum.colorValue;\n var label = labels.color;\n text.fontSize = label.fontSize;\n text.fontFamily = label.fontFamily;\n text.fontStyle = label.fontStyle;\n text.fontWeight = label.fontWeight;\n text.textBaseline = 'top';\n text.textAlign = 'center';\n text.text = typeof value === 'number' && isFinite(value)\n ? String(toFixed(datum.colorValue)) + '%'\n : '';\n var textBBox = text.computeBBox();\n var nameNode = labelMap.get(index);\n var hasLabel = !!nameNode && nameNode.visible;\n var isVisible = isLeaf && !!colorKey && hasLabel && !!textBBox && textBBox.width < innerNodeWidth;\n text.fill = highlighted ? 'black' : label.color;\n text.fillShadow = highlighted ? undefined : shadow;\n text.visible = isVisible;\n if (isVisible) {\n text.x = _this.getLabelCenterX(datum);\n text.y = _this.getLabelCenterY(datum);\n }\n else {\n if (nameNode && !(datum.children && datum.children.length)) {\n nameNode.textBaseline = 'middle';\n nameNode.y = _this.getLabelCenterY(datum);\n }\n }\n });\n };\n TreemapSeries.prototype.getDomain = function (direction) {\n return [0, 1];\n };\n TreemapSeries.prototype.getTooltipHtml = function (datum) {\n var _a = this, tooltip = _a.tooltip, sizeKey = _a.sizeKey, labelKey = _a.labelKey, colorKey = _a.colorKey, colorName = _a.colorName, rootName = _a.rootName;\n var data = datum.data;\n var tooltipRenderer = tooltip.renderer;\n var title = datum.depth ? data[labelKey] : (rootName || data[labelKey]);\n var content = undefined;\n var color = datum.fill || 'gray';\n if (colorKey && colorName) {\n var colorValue = data[colorKey];\n if (typeof colorValue === 'number' && isFinite(colorValue)) {\n content = \"\" + colorName + \": \" + toFixed(data[colorKey]);\n }\n }\n var defaults = {\n title: title,\n backgroundColor: color,\n content: content\n };\n if (tooltipRenderer) {\n return toTooltipHtml(tooltipRenderer({\n datum: datum,\n sizeKey: sizeKey,\n labelKey: labelKey,\n colorKey: colorKey,\n title: title,\n color: color\n }), defaults);\n }\n return toTooltipHtml(defaults);\n };\n TreemapSeries.prototype.listSeriesItems = function (legendData) {\n };\n TreemapSeries.className = 'TreemapSeries';\n TreemapSeries.type = 'treemap';\n __decorate([\n reactive('dataChange')\n ], TreemapSeries.prototype, \"labelKey\", void 0);\n __decorate([\n reactive('dataChange')\n ], TreemapSeries.prototype, \"sizeKey\", void 0);\n __decorate([\n reactive('dataChange')\n ], TreemapSeries.prototype, \"colorKey\", void 0);\n __decorate([\n reactive('dataChange')\n ], TreemapSeries.prototype, \"colorDomain\", void 0);\n __decorate([\n reactive('dataChange')\n ], TreemapSeries.prototype, \"colorRange\", void 0);\n __decorate([\n reactive('dataChange')\n ], TreemapSeries.prototype, \"colorParents\", void 0);\n __decorate([\n reactive('update')\n ], TreemapSeries.prototype, \"gradient\", void 0);\n return TreemapSeries;\n}(HierarchySeries));\nexport { TreemapSeries };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n 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;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nimport { Group } from \"../../../scene/group\";\nimport { Line } from \"../../../scene/shape/line\";\nimport { Text } from \"../../../scene/shape/text\";\nimport { Selection } from \"../../../scene/selection\";\nimport { LinearScale } from \"../../../scale/linearScale\";\nimport { Sector } from \"../../../scene/shape/sector\";\nimport { SeriesTooltip } from \"./../series\";\nimport { Label } from \"../../label\";\nimport { PointerEvents } from \"../../../scene/node\";\nimport { normalizeAngle180, toRadians } from \"../../../util/angle\";\nimport { toFixed } from \"../../../util/number\";\nimport { reactive, Observable } from \"../../../util/observable\";\nimport { PolarSeries } from \"./polarSeries\";\nimport { ChartAxisDirection } from \"../../chartAxis\";\nimport { toTooltipHtml } from \"../../chart\";\nvar PieNodeTag;\n(function (PieNodeTag) {\n PieNodeTag[PieNodeTag[\"Sector\"] = 0] = \"Sector\";\n PieNodeTag[PieNodeTag[\"Callout\"] = 1] = \"Callout\";\n PieNodeTag[PieNodeTag[\"Label\"] = 2] = \"Label\";\n})(PieNodeTag || (PieNodeTag = {}));\nvar PieSeriesLabel = /** @class */ (function (_super) {\n __extends(PieSeriesLabel, _super);\n function PieSeriesLabel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.offset = 3; // from the callout line\n _this.minAngle = 20; // in degrees\n return _this;\n }\n __decorate([\n reactive('change')\n ], PieSeriesLabel.prototype, \"offset\", void 0);\n __decorate([\n reactive('dataChange')\n ], PieSeriesLabel.prototype, \"minAngle\", void 0);\n __decorate([\n reactive('dataChange')\n ], PieSeriesLabel.prototype, \"formatter\", void 0);\n return PieSeriesLabel;\n}(Label));\nvar PieSeriesCallout = /** @class */ (function (_super) {\n __extends(PieSeriesCallout, _super);\n function PieSeriesCallout() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.colors = [\n '#874349',\n '#718661',\n '#a48f5f',\n '#5a7088',\n '#7f637a',\n '#5d8692'\n ];\n _this.length = 10;\n _this.strokeWidth = 1;\n return _this;\n }\n __decorate([\n reactive('change')\n ], PieSeriesCallout.prototype, \"colors\", void 0);\n __decorate([\n reactive('change')\n ], PieSeriesCallout.prototype, \"length\", void 0);\n __decorate([\n reactive('change')\n ], PieSeriesCallout.prototype, \"strokeWidth\", void 0);\n return PieSeriesCallout;\n}(Observable));\nvar PieSeriesTooltip = /** @class */ (function (_super) {\n __extends(PieSeriesTooltip, _super);\n function PieSeriesTooltip() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n __decorate([\n reactive('change')\n ], PieSeriesTooltip.prototype, \"renderer\", void 0);\n return PieSeriesTooltip;\n}(SeriesTooltip));\nexport { PieSeriesTooltip };\nvar PieSeries = /** @class */ (function (_super) {\n __extends(PieSeries, _super);\n function PieSeries() {\n var _this = _super.call(this) || this;\n _this.radiusScale = new LinearScale();\n _this.groupSelection = Selection.select(_this.group).selectAll();\n /**\n * The processed data that gets visualized.\n */\n _this.groupSelectionData = [];\n _this.angleScale = (function () {\n var scale = new LinearScale();\n // Each slice is a ratio of the whole, where all ratios add up to 1.\n scale.domain = [0, 1];\n // Add 90 deg to start the first pie at 12 o'clock.\n scale.range = [-Math.PI, Math.PI].map(function (angle) { return angle + Math.PI / 2; });\n return scale;\n })();\n // When a user toggles a series item (e.g. from the legend), its boolean state is recorded here.\n _this.seriesItemEnabled = [];\n _this.label = new PieSeriesLabel();\n _this.callout = new PieSeriesCallout();\n _this.tooltip = new PieSeriesTooltip();\n /**\n * The key of the numeric field to use to determine the angle (for example,\n * a pie slice angle).\n */\n _this.angleKey = '';\n _this.angleName = '';\n _this._fills = [\n '#c16068',\n '#a2bf8a',\n '#ebcc87',\n '#80a0c3',\n '#b58dae',\n '#85c0d1'\n ];\n _this._strokes = [\n '#874349',\n '#718661',\n '#a48f5f',\n '#5a7088',\n '#7f637a',\n '#5d8692'\n ];\n _this.fillOpacity = 1;\n _this.strokeOpacity = 1;\n _this.lineDash = undefined;\n _this.lineDashOffset = 0;\n /**\n * The series rotation in degrees.\n */\n _this.rotation = 0;\n _this.outerRadiusOffset = 0;\n _this.innerRadiusOffset = 0;\n _this.strokeWidth = 1;\n _this.highlightStyle = { fill: 'yellow' };\n _this.addEventListener('update', _this.update, _this);\n _this.label.addEventListener('change', _this.scheduleLayout, _this);\n _this.label.addEventListener('dataChange', _this.scheduleData, _this);\n _this.callout.addEventListener('change', _this.scheduleLayout, _this);\n _this.addPropertyListener('data', function (event) {\n if (event.value) {\n event.source.seriesItemEnabled = event.value.map(function () { return true; });\n }\n });\n return _this;\n }\n Object.defineProperty(PieSeries.prototype, \"title\", {\n get: function () {\n return this._title;\n },\n set: function (value) {\n var oldTitle = this._title;\n if (oldTitle !== value) {\n if (oldTitle) {\n oldTitle.removeEventListener('change', this.scheduleLayout);\n this.group.removeChild(oldTitle.node);\n }\n if (value) {\n value.node.textBaseline = 'bottom';\n value.addEventListener('change', this.scheduleLayout);\n this.group.appendChild(value.node);\n }\n this._title = value;\n this.scheduleLayout();\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PieSeries.prototype, \"fills\", {\n get: function () {\n return this._fills;\n },\n set: function (values) {\n this._fills = values;\n this.scheduleData();\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PieSeries.prototype, \"strokes\", {\n get: function () {\n return this._strokes;\n },\n set: function (values) {\n this._strokes = values;\n this.scheduleData();\n },\n enumerable: true,\n configurable: true\n });\n PieSeries.prototype.onHighlightChange = function () {\n this.updateNodes();\n };\n PieSeries.prototype.setColors = function (fills, strokes) {\n this.fills = fills;\n this.strokes = strokes;\n this.callout.colors = strokes;\n };\n PieSeries.prototype.getDomain = function (direction) {\n if (direction === ChartAxisDirection.X) {\n return this.angleScale.domain;\n }\n else {\n return this.radiusScale.domain;\n }\n };\n PieSeries.prototype.processData = function () {\n var _this = this;\n var _a = this, angleKey = _a.angleKey, radiusKey = _a.radiusKey, seriesItemEnabled = _a.seriesItemEnabled, angleScale = _a.angleScale, groupSelectionData = _a.groupSelectionData, label = _a.label;\n var data = angleKey && this.data ? this.data : [];\n var angleData = data.map(function (datum, index) { return seriesItemEnabled[index] && Math.abs(+datum[angleKey]) || 0; });\n var angleDataTotal = angleData.reduce(function (a, b) { return a + b; }, 0);\n // The ratios (in [0, 1] interval) used to calculate the end angle value for every pie slice.\n // Each slice starts where the previous one ends, so we only keep the ratios for end angles.\n var angleDataRatios = (function () {\n var sum = 0;\n return angleData.map(function (datum) { return sum += datum / angleDataTotal; });\n })();\n var labelFormatter = label.formatter;\n var labelKey = label.enabled && this.labelKey;\n var labelData = [];\n var radiusData = [];\n if (labelKey) {\n if (labelFormatter) {\n labelData = data.map(function (datum) { return labelFormatter({ value: datum[labelKey] }); });\n }\n else {\n labelData = data.map(function (datum) { return String(datum[labelKey]); });\n }\n }\n if (radiusKey) {\n var _b = this, radiusMin = _b.radiusMin, radiusMax = _b.radiusMax;\n var radii = data.map(function (datum) { return Math.abs(datum[radiusKey]); });\n var min_1 = radiusMin !== undefined ? radiusMin : Math.min.apply(Math, radii);\n var max = radiusMax !== undefined ? radiusMax : Math.max.apply(Math, radii);\n var delta_1 = max - min_1;\n radiusData = radii.map(function (value) { return delta_1 ? (value - min_1) / delta_1 : 1; });\n }\n groupSelectionData.length = 0;\n var rotation = toRadians(this.rotation);\n var halfPi = Math.PI / 2;\n var datumIndex = 0;\n // Simply use reduce here to pair up adjacent ratios.\n angleDataRatios.reduce(function (start, end) {\n var radius = radiusKey ? radiusData[datumIndex] : 1;\n var startAngle = angleScale.convert(start) + rotation;\n var endAngle = angleScale.convert(end) + rotation;\n var midAngle = (startAngle + endAngle) / 2;\n var span = Math.abs(endAngle - startAngle);\n var midCos = Math.cos(midAngle);\n var midSin = Math.sin(midAngle);\n var labelMinAngle = toRadians(label.minAngle);\n var labelVisible = labelKey && span > labelMinAngle;\n var midAngle180 = normalizeAngle180(midAngle);\n // Split the circle into quadrants like so: ⊗\n var quadrantStart = -3 * Math.PI / 4; // same as `normalizeAngle180(toRadians(-135))`\n var textAlign;\n var textBaseline;\n if (midAngle180 >= quadrantStart && midAngle180 < (quadrantStart += halfPi)) {\n textAlign = 'center';\n textBaseline = 'bottom';\n }\n else if (midAngle180 >= quadrantStart && midAngle180 < (quadrantStart += halfPi)) {\n textAlign = 'left';\n textBaseline = 'middle';\n }\n else if (midAngle180 >= quadrantStart && midAngle180 < (quadrantStart += halfPi)) {\n textAlign = 'center';\n textBaseline = 'hanging';\n }\n else {\n textAlign = 'right';\n textBaseline = 'middle';\n }\n groupSelectionData.push({\n series: _this,\n seriesDatum: data[datumIndex],\n index: datumIndex,\n radius: radius,\n startAngle: startAngle,\n endAngle: endAngle,\n midAngle: midAngle,\n midCos: midCos,\n midSin: midSin,\n label: labelVisible ? {\n text: labelData[datumIndex],\n textAlign: textAlign,\n textBaseline: textBaseline\n } : undefined\n });\n datumIndex++;\n return end;\n }, 0);\n return true;\n };\n PieSeries.prototype.update = function () {\n var chart = this.chart;\n var visible = this.group.visible = this.visible && this.seriesItemEnabled.indexOf(true) >= 0;\n if (!visible || !chart || chart.dataPending || chart.layoutPending) {\n return;\n }\n var _a = this, radius = _a.radius, innerRadiusOffset = _a.innerRadiusOffset, outerRadiusOffset = _a.outerRadiusOffset, title = _a.title;\n this.radiusScale.range = [\n innerRadiusOffset ? radius + innerRadiusOffset : 0,\n radius + (outerRadiusOffset || 0)\n ];\n this.group.translationX = this.centerX;\n this.group.translationY = this.centerY;\n if (title) {\n title.node.translationY = -radius - outerRadiusOffset - 2;\n title.node.visible = title.enabled;\n }\n this.updateGroupSelection();\n this.updateNodes();\n };\n PieSeries.prototype.updateGroupSelection = function () {\n var updateGroups = this.groupSelection.setData(this.groupSelectionData);\n updateGroups.exit.remove();\n var enterGroups = updateGroups.enter.append(Group);\n enterGroups.append(Sector).each(function (node) { return node.tag = PieNodeTag.Sector; });\n enterGroups.append(Line).each(function (node) {\n node.tag = PieNodeTag.Callout;\n node.pointerEvents = PointerEvents.None;\n });\n enterGroups.append(Text).each(function (node) {\n node.tag = PieNodeTag.Label;\n node.pointerEvents = PointerEvents.None;\n });\n this.groupSelection = updateGroups.merge(enterGroups);\n };\n PieSeries.prototype.updateNodes = function () {\n var _this = this;\n if (!this.chart) {\n return;\n }\n var _a = this, fills = _a.fills, strokes = _a.strokes, fillOpacity = _a.fillOpacity, strokeOpacity = _a.strokeOpacity, strokeWidth = _a.strokeWidth, radiusScale = _a.radiusScale, callout = _a.callout, shadow = _a.shadow, _b = _a.highlightStyle, fill = _b.fill, stroke = _b.stroke, centerOffset = _b.centerOffset, angleKey = _a.angleKey, radiusKey = _a.radiusKey, formatter = _a.formatter;\n var highlightedDatum = this.chart.highlightedDatum;\n var centerOffsets = [];\n var innerRadius = radiusScale.convert(0);\n this.groupSelection.selectByTag(PieNodeTag.Sector).each(function (sector, datum, index) {\n var radius = radiusScale.convert(datum.radius);\n var highlighted = datum === highlightedDatum;\n var sectorFill = highlighted && fill !== undefined ? fill : fills[index % fills.length];\n var sectorStroke = highlighted && stroke !== undefined ? stroke : strokes[index % strokes.length];\n var format = undefined;\n if (formatter) {\n format = formatter({\n datum: datum.seriesDatum,\n fill: sectorFill,\n stroke: sectorStroke,\n strokeWidth: strokeWidth,\n highlighted: highlighted,\n angleKey: angleKey,\n radiusKey: radiusKey\n });\n }\n sector.innerRadius = innerRadius;\n sector.outerRadius = radius;\n sector.startAngle = datum.startAngle;\n sector.endAngle = datum.endAngle;\n sector.fill = format && format.fill || sectorFill;\n sector.stroke = format && format.stroke || sectorStroke;\n sector.strokeWidth = format && format.strokeWidth !== undefined ? format.strokeWidth : strokeWidth;\n sector.fillOpacity = fillOpacity;\n sector.strokeOpacity = strokeOpacity;\n sector.lineDash = _this.lineDash;\n sector.lineDashOffset = _this.lineDashOffset;\n sector.centerOffset = highlighted && centerOffset !== undefined ? centerOffset : 0;\n sector.fillShadow = shadow;\n sector.lineJoin = 'round';\n centerOffsets.push(sector.centerOffset);\n });\n var calloutColors = callout.colors, calloutLength = callout.length, calloutStrokeWidth = callout.strokeWidth;\n this.groupSelection.selectByTag(PieNodeTag.Callout).each(function (line, datum, index) {\n if (datum.label) {\n var radius = radiusScale.convert(datum.radius);\n line.strokeWidth = calloutStrokeWidth;\n line.stroke = calloutColors[index % calloutColors.length];\n line.x1 = datum.midCos * radius;\n line.y1 = datum.midSin * radius;\n line.x2 = datum.midCos * (radius + calloutLength);\n line.y2 = datum.midSin * (radius + calloutLength);\n }\n else {\n line.stroke = undefined;\n }\n });\n {\n var _c = this.label, offset_1 = _c.offset, fontStyle_1 = _c.fontStyle, fontWeight_1 = _c.fontWeight, fontSize_1 = _c.fontSize, fontFamily_1 = _c.fontFamily, color_1 = _c.color;\n this.groupSelection.selectByTag(PieNodeTag.Label).each(function (text, datum, index) {\n var label = datum.label;\n if (label) {\n var radius = radiusScale.convert(datum.radius);\n var labelRadius = centerOffsets[index] + radius + calloutLength + offset_1;\n text.fontStyle = fontStyle_1;\n text.fontWeight = fontWeight_1;\n text.fontSize = fontSize_1;\n text.fontFamily = fontFamily_1;\n text.text = label.text;\n text.x = datum.midCos * labelRadius;\n text.y = datum.midSin * labelRadius;\n text.fill = color_1;\n text.textAlign = label.textAlign;\n text.textBaseline = label.textBaseline;\n }\n else {\n text.fill = undefined;\n }\n });\n }\n };\n PieSeries.prototype.fireNodeClickEvent = function (event, datum) {\n this.fireEvent({\n type: 'nodeClick',\n event: event,\n series: this,\n datum: datum.seriesDatum,\n angleKey: this.angleKey,\n labelKey: this.labelKey,\n radiusKey: this.radiusKey\n });\n };\n PieSeries.prototype.getTooltipHtml = function (nodeDatum) {\n var angleKey = this.angleKey;\n if (!angleKey) {\n return '';\n }\n var _a = this, fills = _a.fills, tooltip = _a.tooltip, angleName = _a.angleName, radiusKey = _a.radiusKey, radiusName = _a.radiusName, labelKey = _a.labelKey, labelName = _a.labelName;\n var _b = tooltip.renderer, tooltipRenderer = _b === void 0 ? this.tooltipRenderer : _b;\n var color = fills[nodeDatum.index % fills.length];\n var datum = nodeDatum.seriesDatum;\n var label = labelKey ? datum[labelKey] + \": \" : '';\n var angleValue = datum[angleKey];\n var formattedAngleValue = typeof angleValue === 'number' ? toFixed(angleValue) : angleValue.toString();\n var title = this.title ? this.title.text : undefined;\n var content = label + formattedAngleValue;\n var defaults = {\n title: title,\n backgroundColor: color,\n content: content\n };\n if (tooltipRenderer) {\n return toTooltipHtml(tooltipRenderer({\n datum: datum,\n angleKey: angleKey,\n angleValue: angleValue,\n angleName: angleName,\n radiusKey: radiusKey,\n radiusValue: radiusKey ? datum[radiusKey] : undefined,\n radiusName: radiusName,\n labelKey: labelKey,\n labelName: labelName,\n title: title,\n color: color,\n }), defaults);\n }\n return toTooltipHtml(defaults);\n };\n PieSeries.prototype.listSeriesItems = function (legendData) {\n var _this = this;\n var _a = this, labelKey = _a.labelKey, data = _a.data;\n if (data && data.length && labelKey) {\n var _b = this, fills_1 = _b.fills, strokes_1 = _b.strokes, id_1 = _b.id;\n data.forEach(function (datum, index) {\n legendData.push({\n id: id_1,\n itemId: index,\n enabled: _this.seriesItemEnabled[index],\n label: {\n text: String(datum[labelKey])\n },\n marker: {\n fill: fills_1[index % fills_1.length],\n stroke: strokes_1[index % strokes_1.length],\n fillOpacity: _this.fillOpacity,\n strokeOpacity: _this.strokeOpacity\n }\n });\n });\n }\n };\n PieSeries.prototype.toggleSeriesItem = function (itemId, enabled) {\n this.seriesItemEnabled[itemId] = enabled;\n this.scheduleData();\n };\n PieSeries.className = 'PieSeries';\n PieSeries.type = 'pie';\n __decorate([\n reactive('dataChange')\n ], PieSeries.prototype, \"angleKey\", void 0);\n __decorate([\n reactive('update')\n ], PieSeries.prototype, \"angleName\", void 0);\n __decorate([\n reactive('dataChange')\n ], PieSeries.prototype, \"radiusKey\", void 0);\n __decorate([\n reactive('update')\n ], PieSeries.prototype, \"radiusName\", void 0);\n __decorate([\n reactive('dataChange')\n ], PieSeries.prototype, \"radiusMin\", void 0);\n __decorate([\n reactive('dataChange')\n ], PieSeries.prototype, \"radiusMax\", void 0);\n __decorate([\n reactive('dataChange')\n ], PieSeries.prototype, \"labelKey\", void 0);\n __decorate([\n reactive('update')\n ], PieSeries.prototype, \"labelName\", void 0);\n __decorate([\n reactive('layoutChange')\n ], PieSeries.prototype, \"fillOpacity\", void 0);\n __decorate([\n reactive('layoutChange')\n ], PieSeries.prototype, \"strokeOpacity\", void 0);\n __decorate([\n reactive('update')\n ], PieSeries.prototype, \"lineDash\", void 0);\n __decorate([\n reactive('update')\n ], PieSeries.prototype, \"lineDashOffset\", void 0);\n __decorate([\n reactive('update')\n ], PieSeries.prototype, \"formatter\", void 0);\n __decorate([\n reactive('dataChange')\n ], PieSeries.prototype, \"rotation\", void 0);\n __decorate([\n reactive('layoutChange')\n ], PieSeries.prototype, \"outerRadiusOffset\", void 0);\n __decorate([\n reactive('dataChange')\n ], PieSeries.prototype, \"innerRadiusOffset\", void 0);\n __decorate([\n reactive('layoutChange')\n ], PieSeries.prototype, \"strokeWidth\", void 0);\n __decorate([\n reactive('layoutChange')\n ], PieSeries.prototype, \"shadow\", void 0);\n return PieSeries;\n}(PolarSeries));\nexport { PieSeries };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { Shape } from \"./shape\";\nimport { Path2D } from \"../path2D\";\nimport { normalizeAngle360 } from \"../../util/angle\";\nimport { isEqual } from \"../../util/number\";\nimport { BBox } from \"../bbox\";\nvar Sector = /** @class */ (function (_super) {\n __extends(Sector, _super);\n function Sector() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.path = new Path2D();\n _this._dirtyPath = true;\n _this._centerX = 0;\n _this._centerY = 0;\n _this._centerOffset = 0;\n _this._innerRadius = 10;\n _this._outerRadius = 20;\n _this._startAngle = 0;\n _this._endAngle = Math.PI * 2;\n _this._angleOffset = 0;\n return _this;\n }\n Object.defineProperty(Sector.prototype, \"dirtyPath\", {\n get: function () {\n return this._dirtyPath;\n },\n set: function (value) {\n if (this._dirtyPath !== value) {\n this._dirtyPath = value;\n if (value) {\n this.dirty = true;\n }\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Sector.prototype, \"centerX\", {\n get: function () {\n return this._centerX;\n },\n set: function (value) {\n if (this._centerX !== value) {\n this._centerX = value;\n this.dirtyPath = true;\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Sector.prototype, \"centerY\", {\n get: function () {\n return this._centerY;\n },\n set: function (value) {\n if (this._centerY !== value) {\n this._centerY = value;\n this.dirtyPath = true;\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Sector.prototype, \"centerOffset\", {\n get: function () {\n return this._centerOffset;\n },\n set: function (value) {\n if (this._centerOffset !== value) {\n this._centerOffset = Math.max(0, value);\n this.dirtyPath = true;\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Sector.prototype, \"innerRadius\", {\n get: function () {\n return this._innerRadius;\n },\n set: function (value) {\n if (this._innerRadius !== value) {\n this._innerRadius = value;\n this.dirtyPath = true;\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Sector.prototype, \"outerRadius\", {\n get: function () {\n return this._outerRadius;\n },\n set: function (value) {\n if (this._outerRadius !== value) {\n this._outerRadius = value;\n this.dirtyPath = true;\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Sector.prototype, \"startAngle\", {\n get: function () {\n return this._startAngle;\n },\n set: function (value) {\n if (this._startAngle !== value) {\n this._startAngle = value;\n this.dirtyPath = true;\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Sector.prototype, \"endAngle\", {\n get: function () {\n return this._endAngle;\n },\n set: function (value) {\n if (this._endAngle !== value) {\n this._endAngle = value;\n this.dirtyPath = true;\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Sector.prototype, \"angleOffset\", {\n get: function () {\n return this._angleOffset;\n },\n set: function (value) {\n if (this._angleOffset !== value) {\n this._angleOffset = value;\n this.dirtyPath = true;\n }\n },\n enumerable: true,\n configurable: true\n });\n Sector.prototype.computeBBox = function () {\n var radius = this.outerRadius;\n return new BBox(this.centerX - radius, this.centerY - radius, radius * 2, radius * 2);\n };\n Sector.prototype.isPointInPath = function (x, y) {\n var point = this.transformPoint(x, y);\n return this.path.isPointInPath(point.x, point.y);\n };\n Sector.prototype.isPointInStroke = function (x, y) {\n return false;\n };\n Object.defineProperty(Sector.prototype, \"fullPie\", {\n get: function () {\n return isEqual(normalizeAngle360(this.startAngle), normalizeAngle360(this.endAngle));\n },\n enumerable: true,\n configurable: true\n });\n Sector.prototype.updatePath = function () {\n if (!this.dirtyPath) {\n return;\n }\n var path = this.path;\n var angleOffset = this.angleOffset;\n var startAngle = Math.min(this.startAngle, this.endAngle) + angleOffset;\n var endAngle = Math.max(this.startAngle, this.endAngle) + angleOffset;\n var midAngle = (startAngle + endAngle) * 0.5;\n var innerRadius = Math.min(this.innerRadius, this.outerRadius);\n var outerRadius = Math.max(this.innerRadius, this.outerRadius);\n var centerOffset = this.centerOffset;\n var fullPie = this.fullPie;\n var centerX = this.centerX;\n var centerY = this.centerY;\n path.clear();\n if (centerOffset) {\n centerX += centerOffset * Math.cos(midAngle);\n centerY += centerOffset * Math.sin(midAngle);\n }\n if (!fullPie) {\n path.moveTo(centerX + innerRadius * Math.cos(startAngle), centerY + innerRadius * Math.sin(startAngle));\n // if (showTip) {\n // path.lineTo(\n // centerX + 0.5 * (innerRadius + outerRadius) * Math.cos(startAngle) + tipOffset * Math.cos(startAngle + Math.PI / 2),\n // centerY + 0.5 * (innerRadius + outerRadius) * Math.sin(startAngle) + tipOffset * Math.sin(startAngle + Math.PI / 2)\n // );\n // }\n path.lineTo(centerX + outerRadius * Math.cos(startAngle), centerY + outerRadius * Math.sin(startAngle));\n }\n path.cubicArc(centerX, centerY, outerRadius, outerRadius, 0, startAngle, endAngle, 0);\n // path[fullPie ? 'moveTo' : 'lineTo'](\n // centerX + innerRadius * Math.cos(endAngle),\n // centerY + innerRadius * Math.sin(endAngle)\n // );\n if (fullPie) {\n path.moveTo(centerX + innerRadius * Math.cos(endAngle), centerY + innerRadius * Math.sin(endAngle));\n }\n else {\n // if (showTip) {\n // path.lineTo(\n // centerX + 0.5 * (innerRadius + outerRadius) * Math.cos(endAngle) + tipOffset * Math.cos(endAngle + Math.PI / 2),\n // centerY + 0.5 * (innerRadius + outerRadius) * Math.sin(endAngle) + tipOffset * Math.sin(endAngle + Math.PI / 2)\n // );\n // }\n // Temp workaround for https://bugs.chromium.org/p/chromium/issues/detail?id=993330\n // Revert this commit when fixed ^^.\n var x = centerX + innerRadius * Math.cos(endAngle);\n path.lineTo(Math.abs(x) < 1e-8 ? 0 : x, centerY + innerRadius * Math.sin(endAngle));\n }\n path.cubicArc(centerX, centerY, innerRadius, innerRadius, 0, endAngle, startAngle, 1);\n path.closePath();\n this.dirtyPath = false;\n };\n Sector.prototype.render = function (ctx) {\n if (this.dirtyTransform) {\n this.computeTransformMatrix();\n }\n this.matrix.toContext(ctx);\n this.updatePath();\n this.scene.appendPath(this.path);\n this.fillStroke(ctx);\n this.dirty = false;\n };\n Sector.className = 'Sector';\n return Sector;\n}(Shape));\nexport { Sector };\n","import { CountableTimeInterval } from \"./interval\";\nimport { durationMinute } from \"./duration\";\nfunction floor(date) {\n date.setUTCSeconds(0, 0);\n}\nfunction offset(date, minutes) {\n date.setTime(date.getTime() + minutes * durationMinute);\n}\nfunction count(start, end) {\n return (end.getTime() - start.getTime()) / durationMinute;\n}\nfunction field(date) {\n return date.getUTCMinutes();\n}\nexport var utcMinute = new CountableTimeInterval(floor, offset, count, field);\nexport default utcMinute;\n","import { CountableTimeInterval } from \"./interval\";\nimport { durationHour } from \"./duration\";\nfunction floor(date) {\n date.setUTCMinutes(0, 0, 0);\n}\nfunction offset(date, hours) {\n date.setTime(date.getTime() + hours * durationHour);\n}\nfunction count(start, end) {\n return (end.getTime() - start.getTime()) / durationHour;\n}\nfunction field(date) {\n return date.getUTCHours();\n}\nexport var utcHour = new CountableTimeInterval(floor, offset, count, field);\nexport default utcHour;\n","import { CountableTimeInterval } from \"./interval\";\nfunction floor(date) {\n date.setUTCDate(1);\n date.setUTCHours(0, 0, 0, 0);\n}\nfunction offset(date, months) {\n date.setUTCMonth(date.getUTCMonth() + months);\n}\nfunction count(start, end) {\n return end.getUTCMonth() - start.getUTCMonth() + (end.getUTCFullYear() - start.getUTCFullYear()) * 12;\n}\nfunction field(date) {\n return date.getUTCMonth();\n}\nexport var utcMonth = new CountableTimeInterval(floor, offset, count, field);\nexport default utcMonth;\n","var __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nimport { deepMerge, getValue, isObject } from \"../../util/object\";\nimport { copy } from \"../../util/array\";\nimport { Padding } from \"../../util/padding\";\nimport { Chart } from \"../chart\";\nvar palette = {\n fills: [\n '#f3622d',\n '#fba71b',\n '#57b757',\n '#41a9c9',\n '#4258c9',\n '#9a42c8',\n '#c84164',\n '#888888'\n ],\n strokes: [\n '#aa4520',\n '#b07513',\n '#3d803d',\n '#2d768d',\n '#2e3e8d',\n '#6c2e8c',\n '#8c2d46',\n '#5f5f5f'\n ]\n};\nvar ChartTheme = /** @class */ (function () {\n function ChartTheme(options) {\n var defaults = this.createChartConfigPerSeries(this.getDefaults());\n if (isObject(options)) {\n var mergeOptions_1 = { arrayMerge: arrayMerge };\n options = deepMerge({}, options, mergeOptions_1);\n var overrides_1 = options.overrides;\n if (overrides_1) {\n if (isObject(overrides_1.common)) {\n ChartTheme.seriesTypes.concat(['cartesian', 'polar']).forEach(function (seriesType) {\n defaults[seriesType] = deepMerge(defaults[seriesType], overrides_1.common, mergeOptions_1);\n });\n }\n if (overrides_1.cartesian) {\n defaults.cartesian = deepMerge(defaults.cartesian, overrides_1.cartesian, mergeOptions_1);\n ChartTheme.cartesianSeriesTypes.forEach(function (seriesType) {\n defaults[seriesType] = deepMerge(defaults[seriesType], overrides_1.cartesian, mergeOptions_1);\n });\n }\n if (overrides_1.polar) {\n defaults.polar = deepMerge(defaults.polar, overrides_1.polar, mergeOptions_1);\n ChartTheme.polarSeriesTypes.forEach(function (seriesType) {\n defaults[seriesType] = deepMerge(defaults[seriesType], overrides_1.polar, mergeOptions_1);\n });\n }\n if (overrides_1.hierarchy) {\n defaults.hierarchy = deepMerge(defaults.hierarchy, overrides_1.hierarchy, mergeOptions_1);\n ChartTheme.hierarchySeriesTypes.forEach(function (seriesType) {\n defaults[seriesType] = deepMerge(defaults[seriesType], overrides_1.hierarchy, mergeOptions_1);\n });\n }\n ChartTheme.seriesTypes.forEach(function (seriesType) {\n var _a;\n var chartConfig = overrides_1[seriesType];\n if (chartConfig) {\n if (chartConfig.series) {\n chartConfig.series = (_a = {}, _a[seriesType] = chartConfig.series, _a);\n }\n defaults[seriesType] = deepMerge(defaults[seriesType], chartConfig, mergeOptions_1);\n }\n });\n }\n }\n this.palette = options && options.palette ? options.palette : this.getPalette();\n this.config = Object.freeze(defaults);\n }\n ChartTheme.prototype.getPalette = function () {\n return palette;\n };\n ChartTheme.getAxisDefaults = function () {\n return {\n top: {},\n right: {},\n bottom: {},\n left: {},\n thickness: 0,\n title: {\n padding: {\n top: 10,\n right: 10,\n bottom: 10,\n left: 10\n },\n text: 'Axis Title',\n fontStyle: undefined,\n fontWeight: 'bold',\n fontSize: 12,\n fontFamily: this.fontFamily,\n color: 'rgb(70, 70, 70)'\n },\n label: {\n fontStyle: undefined,\n fontWeight: undefined,\n fontSize: 12,\n fontFamily: this.fontFamily,\n padding: 5,\n rotation: 0,\n color: 'rgb(87, 87, 87)',\n formatter: undefined\n },\n line: {\n width: 1,\n color: 'rgb(195, 195, 195)'\n },\n tick: {\n width: 1,\n size: 6,\n color: 'rgb(195, 195, 195)',\n count: 10\n },\n gridStyle: [{\n stroke: 'rgb(219, 219, 219)',\n lineDash: [4, 2]\n }]\n };\n };\n ChartTheme.getSeriesDefaults = function () {\n return {\n tooltip: {\n enabled: true,\n renderer: undefined,\n format: undefined\n },\n visible: true,\n showInLegend: true,\n cursor: 'default'\n };\n };\n ChartTheme.getBarSeriesDefaults = function () {\n return __assign(__assign({}, this.getSeriesDefaults()), { flipXY: false, fillOpacity: 1, strokeOpacity: 1, xKey: '', xName: '', yKeys: [], yNames: [], grouped: false, normalizedTo: undefined, strokeWidth: 1, lineDash: undefined, lineDashOffset: 0, tooltipRenderer: undefined, highlightStyle: {\n fill: 'yellow'\n }, label: {\n enabled: false,\n fontStyle: undefined,\n fontWeight: undefined,\n fontSize: 12,\n fontFamily: this.fontFamily,\n color: 'rgb(70, 70, 70)',\n formatter: undefined,\n placement: 'inside'\n }, shadow: {\n enabled: false,\n color: 'rgba(0, 0, 0, 0.5)',\n xOffset: 3,\n yOffset: 3,\n blur: 5\n } });\n };\n ChartTheme.getCartesianSeriesMarkerDefaults = function () {\n return {\n enabled: true,\n shape: 'circle',\n size: 6,\n maxSize: 30,\n strokeWidth: 1,\n formatter: undefined\n };\n };\n ChartTheme.getChartDefaults = function () {\n return {\n width: 600,\n height: 300,\n autoSize: true,\n background: {\n visible: true,\n fill: 'white'\n },\n padding: {\n top: 20,\n right: 20,\n bottom: 20,\n left: 20\n },\n title: {\n enabled: false,\n padding: {\n top: 10,\n right: 10,\n bottom: 10,\n left: 10\n },\n text: 'Title',\n fontStyle: undefined,\n fontWeight: 'bold',\n fontSize: 16,\n fontFamily: this.fontFamily,\n color: 'rgb(70, 70, 70)'\n },\n subtitle: {\n enabled: false,\n padding: {\n top: 10,\n right: 10,\n bottom: 10,\n left: 10\n },\n text: 'Subtitle',\n fontStyle: undefined,\n fontWeight: undefined,\n fontSize: 12,\n fontFamily: this.fontFamily,\n color: 'rgb(140, 140, 140)'\n },\n legend: {\n enabled: true,\n position: 'right',\n spacing: 20,\n item: {\n paddingX: 16,\n paddingY: 8,\n marker: {\n shape: undefined,\n size: 15,\n strokeWidth: 1,\n padding: 8\n },\n label: {\n color: 'black',\n fontStyle: undefined,\n fontWeight: undefined,\n fontSize: 12,\n fontFamily: this.fontFamily,\n formatter: undefined\n }\n }\n },\n tooltip: {\n enabled: true,\n tracking: true,\n delay: 0,\n class: Chart.defaultTooltipClass\n }\n };\n };\n ChartTheme.prototype.createChartConfigPerSeries = function (config) {\n var typeToAliases = {\n cartesian: ChartTheme.cartesianSeriesTypes,\n polar: ChartTheme.polarSeriesTypes\n };\n var _loop_1 = function (type) {\n typeToAliases[type].forEach(function (alias) {\n if (!config[alias]) {\n config[alias] = deepMerge({}, config[type], { arrayMerge: arrayMerge });\n }\n });\n };\n for (var type in typeToAliases) {\n _loop_1(type);\n }\n return config;\n };\n ChartTheme.prototype.getConfig = function (path, defaultValue) {\n var value = getValue(this.config, path, defaultValue);\n if (Array.isArray(value)) {\n return deepMerge([], value, { arrayMerge: arrayMerge });\n }\n if (isObject(value)) {\n return deepMerge({}, value, { arrayMerge: arrayMerge });\n }\n return value;\n };\n /**\n * Meant to be overridden in subclasses. For example:\n * ```\n * getDefaults() {\n * const subclassDefaults = { ... };\n * return this.mergeWithParentDefaults(subclassDefaults);\n * }\n * ```\n */\n ChartTheme.prototype.getDefaults = function () {\n return deepMerge({}, ChartTheme.defaults, { arrayMerge: arrayMerge });\n };\n ChartTheme.prototype.mergeWithParentDefaults = function (defaults) {\n var mergeOptions = { arrayMerge: arrayMerge };\n var proto = Object.getPrototypeOf(Object.getPrototypeOf(this));\n if (proto === Object.prototype) {\n var config = deepMerge({}, ChartTheme.defaults, mergeOptions);\n config = deepMerge(config, defaults, mergeOptions);\n return config;\n }\n var parentDefaults = proto.getDefaults();\n return deepMerge(parentDefaults, defaults, mergeOptions);\n };\n ChartTheme.prototype.setSeriesColors = function (series, seriesOptions, firstColorIndex) {\n var palette = this.palette;\n var colorCount = this.getSeriesColorCount(seriesOptions);\n if (colorCount === Infinity) {\n series.setColors(palette.fills, palette.strokes);\n }\n else {\n var fills = copy(palette.fills, firstColorIndex, colorCount);\n var strokes = copy(palette.strokes, firstColorIndex, colorCount);\n series.setColors(fills, strokes);\n firstColorIndex += colorCount;\n }\n return firstColorIndex;\n };\n /**\n * This would typically correspond to the number of dependent variables the series plots.\n * If the color count is not fixed, for example it's data-dependent with one color per data point,\n * return Infinity to fetch all unique colors and manage them in the series.\n */\n ChartTheme.prototype.getSeriesColorCount = function (seriesOptions) {\n var type = seriesOptions.type;\n switch (type) {\n case 'bar':\n case 'column':\n case 'area':\n return seriesOptions.yKeys ? seriesOptions.yKeys.length : 0;\n case 'pie':\n return Infinity;\n default:\n return 1;\n }\n };\n ChartTheme.fontFamily = 'Verdana, sans-serif';\n ChartTheme.cartesianDefaults = __assign(__assign({}, ChartTheme.getChartDefaults()), { axes: {\n number: __assign({}, ChartTheme.getAxisDefaults()),\n log: __assign(__assign({}, ChartTheme.getAxisDefaults()), { base: 10 }),\n category: __assign({}, ChartTheme.getAxisDefaults()),\n groupedCategory: __assign({}, ChartTheme.getAxisDefaults()),\n time: __assign({}, ChartTheme.getAxisDefaults())\n }, series: {\n column: __assign(__assign({}, ChartTheme.getBarSeriesDefaults()), { flipXY: false }),\n bar: __assign(__assign({}, ChartTheme.getBarSeriesDefaults()), { flipXY: true }),\n line: __assign(__assign({}, ChartTheme.getSeriesDefaults()), { title: undefined, xKey: '', xName: '', yKey: '', yName: '', strokeWidth: 2, strokeOpacity: 1, lineDash: undefined, lineDashOffset: 0, tooltipRenderer: undefined, highlightStyle: {\n fill: 'yellow'\n }, marker: __assign({}, ChartTheme.getCartesianSeriesMarkerDefaults()) }),\n scatter: __assign(__assign({}, ChartTheme.getSeriesDefaults()), { title: undefined, xKey: '', yKey: '', sizeKey: undefined, labelKey: undefined, xName: '', yName: '', sizeName: 'Size', labelName: 'Label', strokeWidth: 2, fillOpacity: 1, strokeOpacity: 1, tooltipRenderer: undefined, highlightStyle: {\n fill: 'yellow'\n }, marker: __assign({}, ChartTheme.getCartesianSeriesMarkerDefaults()) }),\n area: __assign(__assign({}, ChartTheme.getSeriesDefaults()), { title: undefined, xKey: '', xName: '', yKeys: [], yNames: [], normalizedTo: undefined, fillOpacity: 0.8, strokeOpacity: 1, strokeWidth: 2, lineDash: undefined, lineDashOffset: 0, shadow: {\n enabled: false,\n color: 'rgba(0, 0, 0, 0.5)',\n xOffset: 3,\n yOffset: 3,\n blur: 5\n }, tooltipRenderer: undefined, highlightStyle: {\n fill: 'yellow'\n }, marker: __assign(__assign({}, ChartTheme.getCartesianSeriesMarkerDefaults()), { enabled: false }) }),\n histogram: __assign(__assign({}, ChartTheme.getSeriesDefaults()), { title: undefined, xKey: '', yKey: '', xName: '', yName: '', strokeWidth: 1, fillOpacity: 1, strokeOpacity: 1, lineDash: undefined, lineDashOffset: 0, areaPlot: false, binCount: 10, bins: undefined, aggregation: 'sum', tooltipRenderer: undefined, highlightStyle: {\n fill: 'yellow'\n }, label: {\n enabled: false,\n fontStyle: undefined,\n fontWeight: undefined,\n fontSize: 12,\n fontFamily: ChartTheme.fontFamily,\n color: 'rgb(70, 70, 70)',\n formatter: undefined\n } })\n }, navigator: {\n enabled: false,\n height: 30,\n min: 0,\n max: 1,\n mask: {\n fill: '#999999',\n stroke: '#999999',\n strokeWidth: 1,\n fillOpacity: 0.2\n },\n minHandle: {\n fill: '#f2f2f2',\n stroke: '#999999',\n strokeWidth: 1,\n width: 8,\n height: 16,\n gripLineGap: 2,\n gripLineLength: 8\n },\n maxHandle: {\n fill: '#f2f2f2',\n stroke: '#999999',\n strokeWidth: 1,\n width: 8,\n height: 16,\n gripLineGap: 2,\n gripLineLength: 8\n }\n } });\n ChartTheme.defaults = {\n cartesian: ChartTheme.cartesianDefaults,\n groupedCategory: ChartTheme.cartesianDefaults,\n polar: __assign(__assign({}, ChartTheme.getChartDefaults()), { series: {\n pie: __assign(__assign({}, ChartTheme.getSeriesDefaults()), { title: {\n enabled: true,\n padding: new Padding(0),\n text: '',\n fontStyle: undefined,\n fontWeight: undefined,\n fontSize: 12,\n fontFamily: ChartTheme.fontFamily,\n color: 'rgb(70, 70, 70)'\n }, angleKey: '', angleName: '', radiusKey: undefined, radiusName: undefined, labelKey: undefined, labelName: undefined, label: {\n enabled: true,\n fontStyle: undefined,\n fontWeight: undefined,\n fontSize: 12,\n fontFamily: ChartTheme.fontFamily,\n color: 'rgb(70, 70, 70)',\n offset: 3,\n minAngle: 20\n }, callout: {\n length: 10,\n strokeWidth: 2\n }, fillOpacity: 1, strokeOpacity: 1, strokeWidth: 1, lineDash: undefined, lineDashOffset: 0, rotation: 0, outerRadiusOffset: 0, innerRadiusOffset: 0, highlightStyle: {\n fill: 'yellow'\n }, shadow: {\n enabled: false,\n color: 'rgba(0, 0, 0, 0.5)',\n xOffset: 3,\n yOffset: 3,\n blur: 5\n } })\n } }),\n hierarchy: __assign(__assign({}, ChartTheme.getChartDefaults()), { series: {\n treemap: __assign(__assign({}, ChartTheme.getSeriesDefaults()), { showInLegend: false, labelKey: 'label', sizeKey: 'size', colorKey: 'color', colorDomain: [-5, 5], colorRange: ['#cb4b3f', '#6acb64'], colorParents: false, gradient: true, nodePadding: 2, title: {\n enabled: true,\n color: 'white',\n fontStyle: undefined,\n fontWeight: 'bold',\n fontSize: 12,\n fontFamily: 'Verdana, sans-serif',\n padding: 15\n }, subtitle: {\n enabled: true,\n color: 'white',\n fontStyle: undefined,\n fontWeight: undefined,\n fontSize: 9,\n fontFamily: 'Verdana, sans-serif',\n padding: 13\n }, labels: {\n large: {\n enabled: true,\n fontStyle: undefined,\n fontWeight: 'bold',\n fontSize: 18,\n fontFamily: 'Verdana, sans-serif',\n color: 'white'\n },\n medium: {\n enabled: true,\n fontStyle: undefined,\n fontWeight: 'bold',\n fontSize: 14,\n fontFamily: 'Verdana, sans-serif',\n color: 'white'\n },\n small: {\n enabled: true,\n fontStyle: undefined,\n fontWeight: 'bold',\n fontSize: 10,\n fontFamily: 'Verdana, sans-serif',\n color: 'white'\n },\n color: {\n enabled: true,\n fontStyle: undefined,\n fontWeight: undefined,\n fontSize: 12,\n fontFamily: 'Verdana, sans-serif',\n color: 'white'\n }\n } })\n } })\n };\n ChartTheme.cartesianSeriesTypes = ['line', 'area', 'bar', 'column', 'scatter', 'histogram'];\n ChartTheme.polarSeriesTypes = ['pie'];\n ChartTheme.hierarchySeriesTypes = ['treemap'];\n ChartTheme.seriesTypes = ChartTheme.cartesianSeriesTypes.concat(ChartTheme.polarSeriesTypes);\n return ChartTheme;\n}());\nexport { ChartTheme };\nfunction arrayMerge(target, source, options) {\n return source;\n}\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nimport { ChartTheme } from \"./chartTheme\";\nvar DarkTheme = /** @class */ (function (_super) {\n __extends(DarkTheme, _super);\n function DarkTheme(options) {\n return _super.call(this, options) || this;\n }\n DarkTheme.prototype.getDefaults = function () {\n var fontColor = 'rgb(200, 200, 200)';\n var mutedFontColor = 'rgb(150, 150, 150)';\n var axisDefaults = {\n title: {\n color: fontColor\n },\n label: {\n color: fontColor\n },\n gridStyle: [{\n stroke: 'rgb(88, 88, 88)',\n lineDash: [4, 2]\n }]\n };\n var seriesLabelDefaults = {\n label: {\n color: fontColor\n }\n };\n var chartDefaults = {\n background: {\n fill: 'rgb(34, 38, 41)'\n },\n title: {\n color: fontColor\n },\n subtitle: {\n color: mutedFontColor\n },\n axes: {\n number: __assign({}, axisDefaults),\n category: __assign({}, axisDefaults),\n time: __assign({}, axisDefaults)\n },\n legend: {\n item: {\n label: {\n color: fontColor\n }\n }\n }\n };\n return this.mergeWithParentDefaults({\n cartesian: __assign(__assign({}, chartDefaults), { series: {\n bar: __assign({}, seriesLabelDefaults),\n column: __assign({}, seriesLabelDefaults),\n histogram: __assign({}, seriesLabelDefaults)\n } }),\n polar: __assign(__assign({}, chartDefaults), { series: {\n pie: __assign(__assign({}, seriesLabelDefaults), { title: {\n color: fontColor\n } })\n } })\n });\n };\n return DarkTheme;\n}(ChartTheme));\nexport { DarkTheme };\n","var __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar _a, _b, _c, _d, _e;\nimport { Padding } from \"../util/padding\";\nimport { CartesianChart } from \"./cartesianChart\";\nimport { GroupedCategoryChart } from \"./groupedCategoryChart\";\nimport { NumberAxis } from \"./axis/numberAxis\";\nimport { CategoryAxis } from \"./axis/categoryAxis\";\nimport { GroupedCategoryAxis } from \"./axis/groupedCategoryAxis\";\nimport { LineSeries } from \"./series/cartesian/lineSeries\";\nimport { BarSeries } from \"./series/cartesian/barSeries\";\nimport { HistogramSeries } from \"./series/cartesian/histogramSeries\";\nimport { ScatterSeries } from \"./series/cartesian/scatterSeries\";\nimport { AreaSeries } from \"./series/cartesian/areaSeries\";\nimport { PolarChart } from \"./polarChart\";\nimport { PieSeries } from \"./series/polar/pieSeries\";\nimport { AxisLabel, AxisTick } from \"../axis\";\nimport { TimeAxis } from \"./axis/timeAxis\";\nimport { Caption } from \"../caption\";\nimport { DropShadow } from \"../scene/dropShadow\";\nimport { Legend, LegendPosition, LegendItem, LegendMarker, LegendLabel } from \"./legend\";\nimport { Navigator } from \"./navigator/navigator\";\nimport { NavigatorMask } from \"./navigator/navigatorMask\";\nimport { NavigatorHandle } from \"./navigator/navigatorHandle\";\nimport { CartesianSeriesMarker } from \"./series/cartesian/cartesianSeries\";\nimport { Chart } from \"./chart\";\nimport { HierarchyChart } from \"./hierarchyChart\";\nimport { TreemapSeries, TreemapSeriesLabel } from \"./series/hierarchy/treemapSeries\";\nimport { LogAxis } from \"./axis/logAxis\";\nimport { Label } from \"./label\";\n/*\n This file defines the specs for creating different kinds of charts, but\n contains no code that uses the specs to actually create charts\n*/\nvar chartPadding = 20;\nvar commonChartMappings = {\n background: {\n meta: {\n defaults: {\n visible: true,\n fill: 'white'\n }\n }\n },\n padding: {\n meta: {\n constructor: Padding,\n defaults: {\n top: chartPadding,\n right: chartPadding,\n bottom: chartPadding,\n left: chartPadding\n }\n }\n },\n tooltip: {\n meta: {\n defaults: {\n enabled: true,\n tracking: true,\n delay: 0,\n class: Chart.defaultTooltipClass\n }\n }\n },\n title: {\n meta: {\n constructor: Caption,\n defaults: {\n enabled: false,\n padding: {\n meta: {\n constructor: Padding,\n defaults: {\n top: 10,\n right: 10,\n bottom: 10,\n left: 10\n }\n }\n },\n text: 'Title',\n fontStyle: undefined,\n fontWeight: 'bold',\n fontSize: 14,\n fontFamily: 'Verdana, sans-serif',\n color: 'rgb(70, 70, 70)'\n }\n }\n },\n subtitle: {\n meta: {\n constructor: Caption,\n defaults: {\n enabled: false,\n padding: {\n meta: {\n constructor: Padding,\n defaults: {\n top: 10,\n right: 10,\n bottom: 10,\n left: 10\n }\n }\n },\n text: 'Subtitle',\n fontStyle: undefined,\n fontWeight: undefined,\n fontSize: 12,\n fontFamily: 'Verdana, sans-serif',\n color: 'rgb(140, 140, 140)'\n }\n }\n },\n legend: {\n meta: {\n constructor: Legend,\n defaults: {\n enabled: true,\n position: LegendPosition.Right,\n spacing: 20\n }\n },\n item: {\n meta: {\n constructor: LegendItem,\n defaults: {\n paddingX: 16,\n paddingY: 8\n }\n },\n marker: {\n meta: {\n constructor: LegendMarker,\n defaults: {\n shape: undefined,\n size: 15,\n strokeWidth: 1,\n padding: 8\n }\n }\n },\n label: {\n meta: {\n constructor: LegendLabel,\n defaults: {\n color: 'black',\n fontStyle: undefined,\n fontWeight: undefined,\n fontSize: 12,\n fontFamily: 'Verdana, sans-serif',\n formatter: undefined\n }\n }\n }\n }\n }\n};\nvar chartDefaults = {\n container: undefined,\n autoSize: true,\n width: 600,\n height: 300,\n data: [],\n title: undefined,\n subtitle: undefined,\n padding: {},\n background: {},\n legend: {\n item: {\n marker: {},\n label: {}\n }\n },\n navigator: {\n mask: {},\n minHandle: {},\n maxHandle: {}\n },\n listeners: undefined\n};\nvar chartMeta = {\n // Charts components' constructors normally don't take any parameters (which makes things consistent -- everything\n // is configured the same way, via the properties, and makes the factory pattern work well) but the charts\n // themselves are the exceptions.\n // If a chart config has the (optional) `document` property, it will be passed to the constructor.\n // There is no actual `document` property on the chart, it can only be supplied during instantiation.\n constructorParams: ['document'],\n setAsIs: ['container', 'data', 'tooltipOffset'],\n nonSerializable: ['container', 'data']\n};\nvar axisDefaults = {\n defaults: {\n visibleRange: [0, 1],\n thickness: 0,\n label: {},\n tick: {},\n title: {},\n line: {},\n gridStyle: [{\n stroke: 'rgb(219, 219, 219)',\n lineDash: [4, 2]\n }]\n }\n};\nvar seriesDefaults = {\n visible: true,\n showInLegend: true,\n cursor: 'default',\n listeners: undefined\n};\nvar columnSeriesDefaults = {\n fillOpacity: 1,\n strokeOpacity: 1,\n xKey: '',\n xName: '',\n yKeys: [],\n yNames: {},\n grouped: false,\n normalizedTo: undefined,\n strokeWidth: 1,\n lineDash: undefined,\n lineDashOffset: 0,\n shadow: undefined,\n highlightStyle: {\n fill: 'yellow'\n }\n};\nvar shadowMapping = {\n shadow: {\n meta: {\n constructor: DropShadow,\n defaults: {\n enabled: true,\n color: 'rgba(0, 0, 0, 0.5)',\n xOffset: 0,\n yOffset: 0,\n blur: 5\n }\n }\n }\n};\nvar labelDefaults = {\n enabled: true,\n fontStyle: undefined,\n fontWeight: undefined,\n fontSize: 12,\n fontFamily: 'Verdana, sans-serif',\n color: 'rgb(70, 70, 70)'\n};\nvar barLabelMapping = {\n label: {\n meta: {\n defaults: __assign(__assign({}, labelDefaults), { formatter: undefined, placement: 'inside' })\n }\n }\n};\nvar tooltipMapping = {\n tooltip: {\n meta: {\n defaults: {\n enabled: true,\n renderer: undefined,\n format: undefined\n }\n }\n }\n};\nvar axisMappings = {\n line: {\n meta: {\n defaults: {\n width: 1,\n color: 'rgb(195, 195, 195)'\n }\n }\n },\n title: {\n meta: {\n constructor: Caption,\n defaults: {\n padding: {\n meta: {\n constructor: Padding,\n defaults: {\n top: 10,\n right: 10,\n bottom: 10,\n left: 10\n }\n }\n },\n text: 'Axis Title',\n fontStyle: undefined,\n fontWeight: 'bold',\n fontSize: 12,\n fontFamily: 'Verdana, sans-serif',\n color: 'rgb(70, 70, 70)'\n }\n }\n },\n label: {\n meta: {\n constructor: AxisLabel,\n defaults: {\n fontStyle: undefined,\n fontWeight: undefined,\n fontSize: 12,\n fontFamily: 'Verdana, sans-serif',\n padding: 5,\n rotation: 0,\n color: 'rgb(87, 87, 87)',\n formatter: undefined\n }\n }\n },\n tick: {\n meta: {\n constructor: AxisTick,\n defaults: {\n width: 1,\n size: 6,\n color: 'rgb(195, 195, 195)',\n count: 10\n }\n }\n }\n};\nvar mappings = (_a = {},\n _a[CartesianChart.type] = __assign(__assign({ meta: __assign(__assign({ constructor: CartesianChart }, chartMeta), { defaults: __assign(__assign({}, chartDefaults), { axes: [{\n type: NumberAxis.type,\n position: 'left'\n }, {\n type: CategoryAxis.type,\n position: 'bottom'\n }] }) }) }, commonChartMappings), { axes: (_b = {},\n _b[NumberAxis.type] = __assign({ meta: __assign({ constructor: NumberAxis, setAsIs: ['gridStyle', 'visibleRange'] }, axisDefaults) }, axisMappings),\n _b[LogAxis.type] = __assign({ meta: __assign(__assign({ constructor: LogAxis, setAsIs: ['gridStyle', 'visibleRange'] }, axisDefaults), { base: 10 }) }, axisMappings),\n _b[CategoryAxis.type] = __assign({ meta: __assign({ constructor: CategoryAxis, setAsIs: ['gridStyle', 'visibleRange'] }, axisDefaults) }, axisMappings),\n _b[GroupedCategoryAxis.type] = __assign({ meta: __assign({ constructor: GroupedCategoryAxis, setAsIs: ['gridStyle', 'visibleRange'] }, axisDefaults) }, axisMappings),\n _b[TimeAxis.type] = __assign({ meta: __assign({ constructor: TimeAxis, setAsIs: ['gridStyle', 'visibleRange'] }, axisDefaults) }, axisMappings),\n _b), series: (_c = {\n column: __assign(__assign(__assign({ meta: {\n constructor: BarSeries,\n setAsIs: ['lineDash', 'yNames'],\n defaults: __assign(__assign({ flipXY: false }, seriesDefaults), columnSeriesDefaults)\n }, highlightStyle: {} }, tooltipMapping), barLabelMapping), shadowMapping)\n },\n _c[BarSeries.type] = __assign(__assign(__assign({ meta: {\n constructor: BarSeries,\n setAsIs: ['lineDash', 'yNames'],\n defaults: __assign(__assign({ flipXY: true }, seriesDefaults), columnSeriesDefaults)\n }, highlightStyle: {} }, tooltipMapping), barLabelMapping), shadowMapping),\n _c[LineSeries.type] = __assign(__assign({ meta: {\n constructor: LineSeries,\n setAsIs: ['lineDash'],\n defaults: __assign(__assign({}, seriesDefaults), { title: undefined, xKey: '', xName: '', yKey: '', yName: '', strokeWidth: 2, strokeOpacity: 1, lineDash: undefined, lineDashOffset: 0, highlightStyle: {\n fill: 'yellow'\n } })\n } }, tooltipMapping), { highlightStyle: {}, marker: {\n meta: {\n constructor: CartesianSeriesMarker,\n defaults: {\n enabled: true,\n shape: 'circle',\n size: 6,\n maxSize: 30,\n strokeWidth: 1,\n formatter: undefined\n }\n }\n } }),\n _c[ScatterSeries.type] = __assign(__assign({ meta: {\n constructor: ScatterSeries,\n defaults: __assign(__assign({}, seriesDefaults), { title: undefined, xKey: '', yKey: '', sizeKey: undefined, labelKey: undefined, xName: '', yName: '', sizeName: 'Size', labelName: 'Label', strokeWidth: 2, fillOpacity: 1, strokeOpacity: 1, highlightStyle: {\n fill: 'yellow'\n } })\n } }, tooltipMapping), { highlightStyle: {}, marker: {\n meta: {\n constructor: CartesianSeriesMarker,\n defaults: {\n enabled: true,\n shape: 'circle',\n size: 6,\n maxSize: 30,\n strokeWidth: 1,\n formatter: undefined\n }\n }\n } }),\n _c[AreaSeries.type] = __assign(__assign(__assign({ meta: {\n constructor: AreaSeries,\n setAsIs: ['lineDash'],\n defaults: __assign(__assign({}, seriesDefaults), { xKey: '', xName: '', yKeys: [], yNames: [], normalizedTo: undefined, fillOpacity: 1, strokeOpacity: 1, strokeWidth: 2, lineDash: undefined, lineDashOffset: 0, shadow: undefined, highlightStyle: {\n fill: 'yellow'\n } })\n } }, tooltipMapping), { highlightStyle: {}, marker: {\n meta: {\n constructor: CartesianSeriesMarker,\n defaults: {\n enabled: true,\n shape: 'circle',\n size: 6,\n maxSize: 30,\n strokeWidth: 1,\n formatter: undefined\n }\n }\n } }), shadowMapping),\n _c[HistogramSeries.type] = __assign(__assign(__assign({ meta: {\n constructor: HistogramSeries,\n setAsIs: ['lineDash'],\n defaults: __assign(__assign({}, seriesDefaults), { title: undefined, xKey: '', yKey: '', xName: '', yName: '', strokeWidth: 1, fillOpacity: 1, strokeOpacity: 1, lineDash: undefined, lineDashOffset: 0, areaPlot: false, binCount: undefined, bins: undefined, aggregation: 'sum', highlightStyle: {\n fill: 'yellow'\n } })\n } }, tooltipMapping), { highlightStyle: {}, label: {\n meta: {\n defaults: __assign(__assign({}, labelDefaults), { formatter: undefined })\n }\n } }), shadowMapping),\n _c), navigator: {\n meta: {\n constructor: Navigator,\n defaults: {\n enabled: false,\n height: 30,\n min: 0,\n max: 1\n }\n },\n mask: {\n meta: {\n constructor: NavigatorMask,\n defaults: {\n fill: '#999999',\n stroke: '#999999',\n strokeWidth: 1,\n fillOpacity: 0.2\n }\n }\n },\n minHandle: {\n meta: {\n constructor: NavigatorHandle,\n defaults: {\n fill: '#f2f2f2',\n stroke: '#999999',\n strokeWidth: 1,\n width: 8,\n height: 16,\n gripLineGap: 2,\n gripLineLength: 8\n }\n }\n },\n maxHandle: {\n meta: {\n constructor: NavigatorHandle,\n defaults: {\n fill: '#f2f2f2',\n stroke: '#999999',\n strokeWidth: 1,\n width: 8,\n height: 16,\n gripLineGap: 2,\n gripLineLength: 8\n }\n }\n }\n } }),\n _a[PolarChart.type] = __assign(__assign({ meta: __assign(__assign({ constructor: PolarChart }, chartMeta), { defaults: __assign(__assign({}, chartDefaults), { padding: {\n meta: {\n constructor: Padding,\n defaults: {\n top: 40,\n right: 40,\n bottom: 40,\n left: 40\n }\n }\n } }) }) }, commonChartMappings), { series: (_d = {},\n _d[PieSeries.type] = __assign(__assign(__assign({ meta: {\n constructor: PieSeries,\n setAsIs: ['lineDash'],\n defaults: __assign(__assign({}, seriesDefaults), { title: undefined, angleKey: '', angleName: '', radiusKey: undefined, radiusName: undefined, labelKey: undefined, labelName: undefined, callout: {}, fillOpacity: 1, strokeOpacity: 1, rotation: 0, outerRadiusOffset: 0, innerRadiusOffset: 0, strokeWidth: 1, lineDash: undefined, lineDashOffset: 0, shadow: undefined })\n } }, tooltipMapping), { highlightStyle: {}, title: {\n meta: {\n constructor: Caption,\n defaults: {\n enabled: true,\n padding: {\n meta: {\n constructor: Padding,\n defaults: {\n top: 10,\n right: 10,\n bottom: 10,\n left: 10\n }\n }\n },\n text: 'Series Title',\n fontStyle: undefined,\n fontWeight: 'bold',\n fontSize: 14,\n fontFamily: 'Verdana, sans-serif',\n color: 'black'\n }\n }\n }, label: {\n meta: {\n defaults: __assign(__assign({}, labelDefaults), { offset: 3, minAngle: 20 })\n }\n }, callout: {\n meta: {\n defaults: {\n length: 10,\n strokeWidth: 1\n }\n }\n } }), shadowMapping),\n _d) }),\n _a[HierarchyChart.type] = __assign(__assign({ meta: __assign(__assign({ constructor: HierarchyChart }, chartMeta), { defaults: __assign({}, chartDefaults) }) }, commonChartMappings), { series: (_e = {},\n _e[TreemapSeries.type] = __assign(__assign({ meta: {\n constructor: TreemapSeries,\n defaults: __assign(__assign({}, seriesDefaults), { showInLegend: false, labelKey: 'label', sizeKey: 'size', colorKey: 'color', colorDomain: [-5, 5], colorRange: ['#cb4b3f', '#6acb64'], colorParents: false, gradient: true, nodePadding: 2, title: {}, subtitle: {}, labels: {\n large: {},\n medium: {},\n small: {},\n color: {}\n } })\n } }, tooltipMapping), { title: {\n meta: {\n constructor: TreemapSeriesLabel,\n defaults: {\n enabled: true,\n color: 'white',\n fontStyle: undefined,\n fontWeight: 'bold',\n fontSize: 12,\n fontFamily: 'Verdana, sans-serif',\n padding: 15\n }\n }\n }, subtitle: {\n meta: {\n constructor: TreemapSeriesLabel,\n defaults: {\n enabled: true,\n color: 'white',\n fontStyle: undefined,\n fontWeight: undefined,\n fontSize: 9,\n fontFamily: 'Verdana, sans-serif',\n padding: 13\n }\n }\n }, labels: {\n meta: {\n defaults: {\n large: {},\n medium: {},\n small: {},\n color: {}\n }\n },\n large: {\n meta: {\n constructor: Label,\n defaults: {\n enabled: true,\n fontStyle: undefined,\n fontWeight: 'bold',\n fontSize: 18,\n fontFamily: 'Verdana, sans-serif',\n color: 'white'\n }\n }\n },\n medium: {\n meta: {\n constructor: Label,\n defaults: {\n enabled: true,\n fontStyle: undefined,\n fontWeight: 'bold',\n fontSize: 14,\n fontFamily: 'Verdana, sans-serif',\n color: 'white'\n }\n }\n },\n small: {\n meta: {\n constructor: Label,\n defaults: {\n enabled: true,\n fontStyle: undefined,\n fontWeight: 'bold',\n fontSize: 10,\n fontFamily: 'Verdana, sans-serif',\n color: 'white'\n }\n }\n },\n color: {\n meta: {\n constructor: Label,\n defaults: {\n enabled: true,\n fontStyle: undefined,\n fontWeight: undefined,\n fontSize: 12,\n fontFamily: 'Verdana, sans-serif',\n color: 'white'\n }\n }\n }\n } }),\n _e) }),\n _a);\n// Amend the `mappings` object with aliases for different chart types.\n{\n var typeToAliases = {\n cartesian: ['line', 'area', 'bar', 'column'],\n polar: ['pie'],\n hierarchy: ['treemap']\n };\n var _loop_1 = function (type) {\n typeToAliases[type].forEach(function (alias) {\n mappings[alias] = mappings[type];\n });\n };\n for (var type in typeToAliases) {\n _loop_1(type);\n }\n}\n// Special handling for scatter and histogram charts, for which both axes should default to type `number`.\nmappings['scatter'] =\n mappings['histogram'] = __assign(__assign({}, mappings.cartesian), { meta: __assign(__assign({}, mappings.cartesian.meta), { defaults: __assign(__assign({}, chartDefaults), { axes: [{\n type: 'number',\n position: 'bottom'\n }, {\n type: 'number',\n position: 'left'\n }] }) }) });\nvar groupedCategoryChartMapping = Object.create(mappings[CartesianChart.type]);\nvar groupedCategoryChartMeta = Object.create(groupedCategoryChartMapping.meta);\ngroupedCategoryChartMeta.constructor = GroupedCategoryChart;\ngroupedCategoryChartMapping.meta = groupedCategoryChartMeta;\nmappings[GroupedCategoryChart.type] = groupedCategoryChartMapping;\nexport default mappings;\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { ChartTheme } from \"./chartTheme\";\nvar palette = {\n fills: [\n '#f44336',\n '#e91e63',\n '#9c27b0',\n '#673ab7',\n '#3f51b5',\n '#2196f3',\n '#03a9f4',\n '#00bcd4',\n '#009688',\n '#4caf50',\n '#8bc34a',\n '#cddc39',\n '#ffeb3b',\n '#ffc107',\n '#ff9800',\n '#ff5722'\n ],\n strokes: [\n '#ab2f26',\n '#a31545',\n '#6d1b7b',\n '#482980',\n '#2c397f',\n '#1769aa',\n '#0276ab',\n '#008494',\n '#00695f',\n '#357a38',\n '#618834',\n '#909a28',\n '#b3a429',\n '#b38705',\n '#b36a00',\n '#b33d18'\n ]\n};\nvar MaterialLight = /** @class */ (function (_super) {\n __extends(MaterialLight, _super);\n function MaterialLight() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n MaterialLight.prototype.getPalette = function () {\n return palette;\n };\n return MaterialLight;\n}(ChartTheme));\nexport { MaterialLight };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { DarkTheme } from \"./darkTheme\";\nvar palette = {\n fills: [\n '#f44336',\n '#e91e63',\n '#9c27b0',\n '#673ab7',\n '#3f51b5',\n '#2196f3',\n '#03a9f4',\n '#00bcd4',\n '#009688',\n '#4caf50',\n '#8bc34a',\n '#cddc39',\n '#ffeb3b',\n '#ffc107',\n '#ff9800',\n '#ff5722'\n ],\n strokes: [\n '#ab2f26',\n '#a31545',\n '#6d1b7b',\n '#482980',\n '#2c397f',\n '#1769aa',\n '#0276ab',\n '#008494',\n '#00695f',\n '#357a38',\n '#618834',\n '#909a28',\n '#b3a429',\n '#b38705',\n '#b36a00',\n '#b33d18'\n ]\n};\nvar MaterialDark = /** @class */ (function (_super) {\n __extends(MaterialDark, _super);\n function MaterialDark() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n MaterialDark.prototype.getPalette = function () {\n return palette;\n };\n return MaterialDark;\n}(DarkTheme));\nexport { MaterialDark };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { ChartTheme } from \"./chartTheme\";\nvar palette = {\n fills: [\n '#c16068',\n '#a2bf8a',\n '#ebcc87',\n '#80a0c3',\n '#b58dae',\n '#85c0d1'\n ],\n strokes: [\n '#874349',\n '#718661',\n '#a48f5f',\n '#5a7088',\n '#7f637a',\n '#5d8692'\n ]\n};\nvar PastelLight = /** @class */ (function (_super) {\n __extends(PastelLight, _super);\n function PastelLight() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n PastelLight.prototype.getPalette = function () {\n return palette;\n };\n return PastelLight;\n}(ChartTheme));\nexport { PastelLight };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { DarkTheme } from \"./darkTheme\";\nvar palette = {\n fills: [\n '#c16068',\n '#a2bf8a',\n '#ebcc87',\n '#80a0c3',\n '#b58dae',\n '#85c0d1'\n ],\n strokes: [\n '#874349',\n '#718661',\n '#a48f5f',\n '#5a7088',\n '#7f637a',\n '#5d8692'\n ]\n};\nvar PastelDark = /** @class */ (function (_super) {\n __extends(PastelDark, _super);\n function PastelDark() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n PastelDark.prototype.getPalette = function () {\n return palette;\n };\n return PastelDark;\n}(DarkTheme));\nexport { PastelDark };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { ChartTheme } from \"./chartTheme\";\nvar palette = {\n fills: [\n '#febe76',\n '#ff7979',\n '#badc58',\n '#f9ca23',\n '#f0932b',\n '#eb4c4b',\n '#6ab04c',\n '#7ed6df',\n '#e056fd',\n '#686de0'\n ],\n strokes: [\n '#b28553',\n '#b35555',\n '#829a3e',\n '#ae8d19',\n '#a8671e',\n '#a43535',\n '#4a7b35',\n '#58969c',\n '#9d3cb1',\n '#494c9d'\n ]\n};\nvar SolarLight = /** @class */ (function (_super) {\n __extends(SolarLight, _super);\n function SolarLight() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n SolarLight.prototype.getPalette = function () {\n return palette;\n };\n return SolarLight;\n}(ChartTheme));\nexport { SolarLight };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { DarkTheme } from \"./darkTheme\";\nvar palette = {\n fills: [\n '#febe76',\n '#ff7979',\n '#badc58',\n '#f9ca23',\n '#f0932b',\n '#eb4c4b',\n '#6ab04c',\n '#7ed6df',\n '#e056fd',\n '#686de0'\n ],\n strokes: [\n '#b28553',\n '#b35555',\n '#829a3e',\n '#ae8d19',\n '#a8671e',\n '#a43535',\n '#4a7b35',\n '#58969c',\n '#9d3cb1',\n '#494c9d'\n ]\n};\nvar SolarDark = /** @class */ (function (_super) {\n __extends(SolarDark, _super);\n function SolarDark() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n SolarDark.prototype.getPalette = function () {\n return palette;\n };\n return SolarDark;\n}(DarkTheme));\nexport { SolarDark };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { ChartTheme } from \"./chartTheme\";\nvar palette = {\n fills: [\n '#5BC0EB',\n '#FDE74C',\n '#9BC53D',\n '#E55934',\n '#FA7921',\n '#fa3081'\n ],\n strokes: [\n '#4086a4',\n '#b1a235',\n '#6c8a2b',\n '#a03e24',\n '#af5517',\n '#af225a'\n ]\n};\nvar VividLight = /** @class */ (function (_super) {\n __extends(VividLight, _super);\n function VividLight() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n VividLight.prototype.getPalette = function () {\n return palette;\n };\n return VividLight;\n}(ChartTheme));\nexport { VividLight };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { DarkTheme } from \"./darkTheme\";\nvar palette = {\n fills: [\n '#5BC0EB',\n '#FDE74C',\n '#9BC53D',\n '#E55934',\n '#FA7921',\n '#fa3081'\n ],\n strokes: [\n '#4086a4',\n '#b1a235',\n '#6c8a2b',\n '#a03e24',\n '#af5517',\n '#af225a'\n ]\n};\nvar VividDark = /** @class */ (function (_super) {\n __extends(VividDark, _super);\n function VividDark() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n VividDark.prototype.getPalette = function () {\n return palette;\n };\n return VividDark;\n}(DarkTheme));\nexport { VividDark };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport ContinuousScale, { identity } from \"./continuousScale\";\nimport ticks from \"../util/ticks\";\nimport { format } from \"../util/numberFormat\";\nvar LogScale = /** @class */ (function (_super) {\n __extends(LogScale, _super);\n function LogScale() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = 'log';\n _this._domain = [1, 10];\n _this.baseLog = identity; // takes a log with base `base` of `x`\n _this.basePow = identity; // raises `base` to the power of `x`\n _this._base = 10;\n return _this;\n }\n LogScale.prototype.setDomain = function (values) {\n var df = values[0];\n var dl = values[values.length - 1];\n if (df === 0 || dl === 0 || df < 0 && dl > 0 || df > 0 && dl < 0) {\n console.warn('Log scale domain should not start at, end at or cross zero.');\n if (df === 0 && dl > 0) {\n df = Number.EPSILON;\n }\n else if (dl === 0 && df < 0) {\n dl = -Number.EPSILON;\n }\n else if (df < 0 && dl > 0) {\n if (Math.abs(dl) >= Math.abs(df)) {\n df = Number.EPSILON;\n }\n else {\n dl = -Number.EPSILON;\n }\n }\n else if (df > 0 && dl < 0) {\n if (Math.abs(dl) >= Math.abs(df)) {\n df = -Number.EPSILON;\n }\n else {\n dl = Number.EPSILON;\n }\n }\n values = values.slice();\n values[0] = df;\n values[values.length - 1] = dl;\n }\n _super.prototype.setDomain.call(this, values);\n };\n LogScale.prototype.getDomain = function () {\n return _super.prototype.getDomain.call(this);\n };\n Object.defineProperty(LogScale.prototype, \"base\", {\n get: function () {\n return this._base;\n },\n set: function (value) {\n if (this._base !== value) {\n this._base = value;\n this.rescale();\n }\n },\n enumerable: true,\n configurable: true\n });\n LogScale.prototype.rescale = function () {\n var base = this.base;\n var baseLog = LogScale.makeLogFn(base);\n var basePow = LogScale.makePowFn(base);\n if (this.domain[0] < 0) {\n baseLog = this.reflect(baseLog);\n basePow = this.reflect(basePow);\n this.transform = function (x) { return -Math.log(-x); };\n this.untransform = function (x) { return -Math.exp(-x); };\n }\n else {\n this.transform = function (x) { return Math.log(x); };\n this.untransform = function (x) { return Math.exp(x); };\n }\n this.baseLog = baseLog;\n this.basePow = basePow;\n _super.prototype.rescale.call(this);\n };\n /**\n * For example, if `f` is `Math.log10`, we have\n *\n * f(100) == 2\n * f(-100) == NaN\n * rf = reflect(f)\n * rf(-100) == -2\n *\n * @param f\n */\n LogScale.prototype.reflect = function (f) {\n return function (x) { return -f(-x); };\n };\n LogScale.prototype.nice = function () {\n var _a, _b;\n var domain = this.domain;\n var i0 = 0;\n var i1 = domain.length - 1;\n var x0 = domain[i0];\n var x1 = domain[i1];\n if (x1 < x0) {\n _a = [i1, i0], i0 = _a[0], i1 = _a[1];\n _b = [x1, x0], x0 = _b[0], x1 = _b[1];\n }\n // For example, for base == 10:\n // [ 50, 900] becomes [ 10, 1000 ]\n domain[i0] = this.basePow(Math.floor(this.baseLog(x0)));\n domain[i1] = this.basePow(Math.ceil(this.baseLog(x1)));\n this.domain = domain;\n };\n LogScale.pow10 = function (x) {\n return isFinite(x)\n ? +('1e' + x) // to avoid precision issues, e.g. Math.pow(10, -4) is not 0.0001\n : x < 0\n ? 0\n : x;\n };\n LogScale.makePowFn = function (base) {\n if (base === 10) {\n return LogScale.pow10;\n }\n if (base === Math.E) {\n return Math.exp;\n }\n return function (x) { return Math.pow(base, x); };\n };\n // Make a log function witn an arbitrary base or return a native function if exists.\n LogScale.makeLogFn = function (base) {\n if (base === Math.E) {\n return Math.log;\n }\n if (base === 10) {\n return Math.log10;\n }\n if (base === 2) {\n return Math.log2;\n }\n var logBase = Math.log(base);\n return function (x) { return Math.log(x) / logBase; };\n };\n LogScale.prototype.ticks = function (count) {\n var _a;\n if (count === void 0) { count = 10; }\n var n = count == null ? 10 : +count;\n var base = this.base;\n var domain = this.domain;\n var d0 = domain[0];\n var d1 = domain[domain.length - 1];\n var isReversed = d1 < d0;\n if (isReversed) {\n _a = [d1, d0], d0 = _a[0], d1 = _a[1];\n }\n var p0 = this.baseLog(d0);\n var p1 = this.baseLog(d1);\n var z = [];\n // if `base` is an integer and delta in order of magnitudes is less than n\n if (!(base % 1) && p1 - p0 < n) {\n // For example, if n == 10, base == 10 and domain == [10^2, 10^6]\n // then p1 - p0 < n == true.\n p0 = Math.round(p0) - 1;\n p1 = Math.round(p1) + 1;\n if (d0 > 0) {\n for (; p0 < p1; ++p0) {\n for (var k = 1, p = this.basePow(p0); k < base; ++k) {\n var t = p * k;\n // The `t` checks are needed because we expanded the [p0, p1] by 1 in each direction.\n if (t < d0)\n continue;\n if (t > d1)\n break;\n z.push(t);\n }\n }\n }\n else {\n for (; p0 < p1; ++p0) {\n for (var k = base - 1, p = this.basePow(p0); k >= 1; --k) {\n var t = p * k;\n if (t < d0)\n continue;\n if (t > d1)\n break;\n z.push(t);\n }\n }\n }\n if (z.length * 2 < n) {\n z = ticks(d0, d1, n);\n }\n }\n else {\n // For example, if n == 4, base == 10 and domain == [10^2, 10^6]\n // then p1 - p0 < n == false.\n // `ticks` return [2, 3, 4, 5, 6], then mapped to [10^2, 10^3, 10^4, 10^5, 10^6].\n z = ticks(p0, p1, Math.min(p1 - p0, n)).map(this.basePow);\n }\n return isReversed ? z.reverse() : z;\n };\n LogScale.prototype.tickFormat = function (count, specifier) {\n var _this = this;\n var base = this.base;\n if (specifier == null) {\n specifier = (base === 10 ? '.0e' : ',');\n }\n if (typeof specifier !== 'function') {\n specifier = format(specifier);\n }\n if (count === Infinity) {\n return specifier;\n }\n if (count == null) {\n count = 10;\n }\n var k = Math.max(1, base * count / this.ticks().length);\n return function (d) {\n var i = d / _this.basePow(Math.round(_this.baseLog(d)));\n if (i * base < base - 0.5) {\n i *= base;\n }\n return i <= k ? specifier(d) : '';\n };\n };\n return LogScale;\n}(ContinuousScale));\nexport { LogScale };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { LogScale } from \"../../scale/logScale\";\nimport { NumberAxis } from \"./numberAxis\";\nvar LogAxis = /** @class */ (function (_super) {\n __extends(LogAxis, _super);\n function LogAxis() {\n var _this = _super.call(this) || this;\n _this.scale = new LogScale();\n return _this;\n }\n Object.defineProperty(LogAxis.prototype, \"base\", {\n get: function () {\n return this.scale.base;\n },\n set: function (value) {\n this.scale.base = value;\n },\n enumerable: true,\n configurable: true\n });\n LogAxis.className = 'LogAxis';\n LogAxis.type = 'log';\n return LogAxis;\n}(NumberAxis));\nexport { LogAxis };\n","var __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __spreadArrays = (this && this.__spreadArrays) || function () {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n r[k] = a[j];\n return r;\n};\nimport { Series } from \"./series/series\";\nimport { LegendMarker } from \"./legend\";\nimport { ChartTheme } from \"./themes/chartTheme\";\nimport { DarkTheme } from './themes/darkTheme';\nimport { MaterialLight } from \"./themes/materialLight\";\nimport { MaterialDark } from \"./themes/materialDark\";\nimport { PastelLight } from \"./themes/pastelLight\";\nimport { PastelDark } from \"./themes/pastelDark\";\nimport { SolarLight } from \"./themes/solarLight\";\nimport { SolarDark } from \"./themes/solarDark\";\nimport { VividLight } from \"./themes/vividLight\";\nimport { VividDark } from \"./themes/vividDark\";\nimport { find } from \"../util/array\";\nimport { deepMerge, getValue, isObject } from \"../util/object\";\nimport mappings from './agChartMappings';\nvar lightTheme = new ChartTheme();\nvar darkTheme = new DarkTheme();\nexport var lightThemes = {\n 'undefined': lightTheme,\n 'null': lightTheme,\n 'ag-default': lightTheme,\n 'ag-material': new MaterialLight(),\n 'ag-pastel': new PastelLight(),\n 'ag-solar': new SolarLight(),\n 'ag-vivid': new VividLight(),\n};\nexport var darkThemes = {\n 'undefined': darkTheme,\n 'null': darkTheme,\n 'ag-default-dark': darkTheme,\n 'ag-material-dark': new MaterialDark(),\n 'ag-pastel-dark': new PastelDark(),\n 'ag-solar-dark': new SolarDark(),\n 'ag-vivid-dark': new VividDark(),\n};\nexport var themes = __assign(__assign({}, darkThemes), lightThemes);\nexport function getChartTheme(value) {\n if (value instanceof ChartTheme) {\n return value;\n }\n var stockTheme = themes[value];\n if (stockTheme) {\n return stockTheme;\n }\n value = value;\n if (value.baseTheme || value.overrides || value.palette) {\n var baseTheme = getChartTheme(value.baseTheme);\n return new baseTheme.constructor(value);\n }\n return lightTheme;\n}\nvar firstColorIndex = 0;\nvar AgChart = /** @class */ (function () {\n function AgChart() {\n }\n AgChart.create = function (options, container, data) {\n options = Object.create(options); // avoid mutating user provided options\n if (container) {\n options.container = container;\n }\n if (data) {\n options.data = data;\n }\n // special handling when both `autoSize` and `width` / `height` are present in the options\n var autoSize = options && options.autoSize !== false;\n var theme = getChartTheme(options.theme);\n firstColorIndex = 0;\n var chart = create(options, undefined, undefined, theme);\n if (chart) {\n if (autoSize) { // `autoSize` takes precedence over `width` / `height`\n chart.autoSize = true;\n }\n }\n return chart;\n };\n AgChart.update = function (chart, options, container, data) {\n if (!(chart && options)) {\n return;\n }\n options = Object.create(options);\n if (container) {\n options.container = container;\n }\n if (data) {\n options.data = data;\n }\n var autoSize = options && options.autoSize !== false;\n var theme = getChartTheme(options.theme);\n firstColorIndex = 0;\n update(chart, options, undefined, theme);\n if (autoSize) {\n chart.autoSize = true;\n }\n };\n AgChart.save = function (component) {\n var target = {};\n save(component, target);\n return target;\n };\n AgChart.createComponent = create;\n return AgChart;\n}());\nexport { AgChart };\nvar pathToSeriesTypeMap = {\n 'cartesian.series': 'line',\n 'line.series': 'line',\n 'area.series': 'area',\n 'bar.series': 'bar',\n 'column.series': 'column',\n 'histogram.series': 'histogram',\n 'scatter.series': 'scatter',\n 'polar.series': 'pie',\n 'pie.series': 'pie'\n};\nvar actualSeriesTypeMap = (function () {\n var map = {};\n var actualSeries = ['area', 'bar', 'histogram', 'line', 'pie', 'scatter'];\n actualSeries.forEach(function (series) { return map[series] = series; });\n // Aliases:\n map['column'] = 'bar';\n return map;\n})();\nfunction save(component, target, mapping) {\n if (target === void 0) { target = {}; }\n if (mapping === void 0) { mapping = mappings; }\n if (component.constructor && component.constructor.type && !mapping.meta) {\n mapping = mapping[component.constructor.type];\n }\n var defaults = mapping && mapping.meta && mapping.meta.defaults;\n var keys = Object.keys(defaults);\n keys.forEach(function (key) {\n var value = component[key];\n if (isObject(value) && (!mapping.meta.nonSerializable || mapping.meta.nonSerializable.indexOf(key) < 0)) {\n target[key] = {};\n // save(value, target[key], mapping[key]);\n }\n else if (Array.isArray(value)) {\n // target[key] = [];\n // save(value, target[key], map[key]);\n }\n else {\n target[key] = component[key];\n }\n });\n}\nfunction create(options, path, component, theme) {\n var _a;\n // Deprecate `chart.legend.item.marker.type` in integrated chart options.\n options = Object.create(options);\n if (component instanceof LegendMarker) {\n if (options.type) {\n options.shape = options.type;\n }\n }\n else {\n options = provideDefaultType(options, path);\n if (path) {\n if (options.type) {\n path = path + '.' + options.type;\n }\n }\n else {\n path = options.type;\n }\n }\n if (!path) {\n return;\n }\n var mapping = getValue(mappings, path);\n if (mapping) {\n options = provideDefaultOptions(path, options, mapping, theme);\n var meta = mapping.meta || {};\n var constructorParams = meta.constructorParams || [];\n var skipKeys = ['type', 'listeners'].concat(constructorParams);\n // TODO: Constructor params processing could be improved, but it's good enough for current params.\n var constructorParamValues = constructorParams\n .map(function (param) { return options[param]; })\n .filter(function (value) { return value !== undefined; });\n if (!component) {\n component = new ((_a = meta.constructor).bind.apply(_a, __spreadArrays([void 0], constructorParamValues)))();\n if (theme && component instanceof Series) {\n firstColorIndex = theme.setSeriesColors(component, options, firstColorIndex);\n }\n }\n var _loop_1 = function (key) {\n // Process every non-special key in the config object.\n if (skipKeys.indexOf(key) < 0) {\n var value = options[key];\n if (value && key in mapping && !(meta.setAsIs && meta.setAsIs.indexOf(key) >= 0)) {\n if (Array.isArray(value)) {\n var subComponents = value\n .map(function (config) {\n var axis = create(config, path + '.' + key, undefined, theme);\n if (theme && key === 'axes') {\n var fakeTheme = {\n getConfig: function (path) {\n var parts = path.split('.');\n var modifiedPath = parts.slice(0, 3).join('.') + '.' + axis.position;\n var after = parts.slice(3);\n if (after.length) {\n modifiedPath += '.' + after.join('.');\n }\n var config = theme.getConfig(path);\n var modifiedConfig = theme.getConfig(modifiedPath);\n isObject(theme.getConfig(modifiedPath));\n if (isObject(config) && isObject(modifiedConfig)) {\n return deepMerge(config, modifiedConfig);\n }\n return modifiedConfig;\n }\n };\n update(axis, config, path + '.' + key, fakeTheme);\n }\n return axis;\n })\n .filter(function (instance) { return !!instance; });\n component[key] = subComponents;\n }\n else {\n if (mapping[key] && component[key]) {\n // The instance property already exists on the component (e.g. chart.legend).\n // Simply configure the existing instance, without creating a new one.\n create(value, path + '.' + key, component[key], theme);\n }\n else {\n var subComponent = create(value, value.type ? path : path + '.' + key, undefined, theme);\n if (subComponent) {\n component[key] = subComponent;\n }\n }\n }\n }\n else { // if (key in meta.constructor.defaults) { // prevent users from creating custom properties\n component[key] = value;\n }\n }\n };\n for (var key in options) {\n _loop_1(key);\n }\n var listeners = options.listeners;\n if (component && component.addEventListener && listeners) {\n for (var key in listeners) {\n if (listeners.hasOwnProperty(key)) {\n var listener = listeners[key];\n if (typeof listener === 'function') {\n component.addEventListener(key, listener);\n }\n }\n }\n }\n return component;\n }\n}\nfunction update(component, options, path, theme) {\n if (!(options && isObject(options))) {\n return;\n }\n // Deprecate `chart.legend.item.marker.type` in integrated chart options.\n if (component instanceof LegendMarker) {\n if (options.type) {\n options.shape = options.type;\n }\n }\n else {\n options = provideDefaultType(options, path);\n if (path) {\n if (options.type) {\n path = path + '.' + options.type;\n }\n }\n else {\n path = options.type;\n }\n }\n if (!path) {\n return;\n }\n var chart = path in mappings ? component : undefined;\n var mapping = getValue(mappings, path);\n if (mapping) {\n options = provideDefaultOptions(path, options, mapping, theme);\n var meta = mapping.meta || {};\n var constructorParams = meta && meta.constructorParams || [];\n var skipKeys = ['type'].concat(constructorParams);\n for (var key in options) {\n if (skipKeys.indexOf(key) < 0) {\n var value = options[key];\n var keyPath = path + '.' + key;\n if (meta.setAsIs && meta.setAsIs.indexOf(key) >= 0) {\n component[key] = value;\n }\n else {\n var oldValue = component[key];\n if (Array.isArray(oldValue) && Array.isArray(value)) {\n if (chart) {\n if (key === 'series') {\n updateSeries(component, value, keyPath, theme);\n }\n else if (key === 'axes') {\n updateAxes(component, value, keyPath, theme);\n }\n }\n else {\n component[key] = value;\n }\n }\n else if (isObject(oldValue)) {\n if (value) {\n update(oldValue, value, value.type ? path : keyPath, theme);\n }\n else if (key in options) {\n component[key] = value;\n }\n }\n else {\n var subComponent = isObject(value) && create(value, value.type ? path : keyPath, undefined, theme);\n if (subComponent) {\n component[key] = subComponent;\n }\n else {\n if (chart && options.autoSize && (key === 'width' || key === 'height')) {\n continue;\n }\n component[key] = value;\n }\n }\n }\n }\n }\n }\n if (chart) {\n chart.layoutPending = true;\n }\n}\nfunction updateSeries(chart, configs, keyPath, theme) {\n var allSeries = chart.series.slice();\n var prevSeries;\n var i = 0;\n for (; i < configs.length; i++) {\n var config = configs[i];\n var series = allSeries[i];\n if (series) {\n config = provideDefaultType(config, keyPath);\n var type = actualSeriesTypeMap[config.type];\n if (series.type === type) {\n if (theme) {\n firstColorIndex = theme.setSeriesColors(series, config, firstColorIndex);\n }\n update(series, config, keyPath, theme);\n }\n else {\n var newSeries = create(config, keyPath, undefined, theme);\n chart.removeSeries(series);\n chart.addSeriesAfter(newSeries, prevSeries);\n series = newSeries;\n }\n }\n else { // more new configs than existing series\n var newSeries = create(config, keyPath, undefined, theme);\n chart.addSeries(newSeries);\n }\n prevSeries = series;\n }\n // more existing series than new configs\n for (; i < allSeries.length; i++) {\n var series = allSeries[i];\n if (series) {\n chart.removeSeries(series);\n }\n }\n}\nfunction updateAxes(chart, configs, keyPath, theme) {\n var axes = chart.axes;\n var axesToAdd = [];\n var axesToUpdate = [];\n var _loop_2 = function (config) {\n var axisToUpdate = find(axes, function (axis) {\n return axis.type === config.type && axis.position === config.position;\n });\n if (axisToUpdate) {\n axesToUpdate.push(axisToUpdate);\n update(axisToUpdate, config, keyPath, theme);\n }\n else {\n var axisToAdd = create(config, keyPath, undefined, theme);\n if (axisToAdd) {\n axesToAdd.push(axisToAdd);\n }\n }\n };\n for (var _i = 0, configs_1 = configs; _i < configs_1.length; _i++) {\n var config = configs_1[_i];\n _loop_2(config);\n }\n chart.axes = axesToUpdate.concat(axesToAdd);\n}\nfunction provideDefaultChartType(options) {\n if (options.type) {\n return options;\n }\n // If chart type is not specified, try to infer it from the type of first series.\n var series = options.series && options.series[0];\n if (series && series.type) {\n outerLoop: for (var chartType in mappings) {\n for (var seriesType in mappings[chartType].series) {\n if (series.type === seriesType) {\n options = Object.create(options);\n options.type = chartType;\n break outerLoop;\n }\n }\n }\n }\n if (!options.type) {\n options = Object.create(options);\n options.type = 'cartesian';\n }\n return options;\n}\nfunction provideDefaultType(options, path) {\n if (!path) { // if `path` is undefined, `options` is a top-level (chart) config\n path = '';\n options = provideDefaultChartType(options);\n }\n if (!options.type) {\n var seriesType = pathToSeriesTypeMap[path];\n if (seriesType) {\n options = Object.create(options);\n options.type = seriesType;\n }\n }\n return options;\n}\nfunction skipThemeKey(key) {\n return ['axes', 'series'].indexOf(key) >= 0;\n}\nvar enabledKey = 'enabled';\n/**\n * If certain options were not provided by the user, use the defaults from the theme and the mapping.\n * All three objects are provided for the current path in the config tree, not necessarily top-level.\n */\nfunction provideDefaultOptions(path, options, mapping, theme) {\n var isChartConfig = path.indexOf('.') < 0;\n var themeDefaults = theme && theme.getConfig(path);\n var defaults = mapping && mapping.meta && mapping.meta.defaults;\n var isExplicitlyDisabled = options.enabled === false; // by the user\n if (defaults || themeDefaults) {\n options = Object.create(options);\n }\n // Fill in the gaps for properties not configured by the user using theme provided values.\n for (var key in themeDefaults) {\n // The default values for these special chart configs always come from the mappings, not theme.\n if (isChartConfig && skipThemeKey(key)) {\n continue;\n }\n if (!(key in options)) {\n options[key] = themeDefaults[key];\n }\n }\n // Fill in the gaps for properties not configured by the user, nor theme using chart mappings.\n for (var key in defaults) {\n if ((!themeDefaults || !(key in themeDefaults) || skipThemeKey(key)) && !(key in options)) {\n options[key] = defaults[key];\n }\n }\n // Special handling for the 'enabled' property. For example:\n // title: { text: 'Quarterly Revenue' } // means title is enabled\n // legend: {} // means legend is enabled\n var hasEnabledKey = (themeDefaults && enabledKey in themeDefaults) ||\n (defaults && enabledKey in defaults);\n if (hasEnabledKey && !isExplicitlyDisabled) {\n options[enabledKey] = true;\n }\n return options;\n}\n","export * from \"./caption\";\nexport * from \"./chart/axis/numberAxis\";\nexport * from \"./chart/axis/categoryAxis\";\nexport * from \"./chart/axis/groupedCategoryAxis\";\nexport * from \"./chart/axis/timeAxis\";\nexport * from \"./chart/cartesianChart\";\nexport * from \"./chart/hierarchyChart\";\nexport * from \"./chart/chart\";\nexport * from \"./chart/chartAxis\";\nexport * from \"./chart/groupedCategoryChart\";\nexport * from \"./chart/polarChart\";\nexport * from \"./chart/marker/marker\";\nexport * from \"./chart/legend\";\nexport * from \"./chart/series/cartesian/areaSeries\";\nexport * from \"./chart/series/cartesian/barSeries\";\nexport * from \"./chart/series/cartesian/lineSeries\";\nexport * from \"./chart/series/cartesian/scatterSeries\";\nexport * from \"./chart/series/cartesian/histogramSeries\";\nexport * from \"./chart/series/hierarchy/treemapSeries\";\nexport * from \"./chart/series/polar/pieSeries\";\nexport * from \"./scale/bandScale\";\nexport * from \"./scale/linearScale\";\nexport * from \"./scene/clipRect\";\nexport * from \"./scene/dropShadow\";\nexport * from \"./scene/group\";\nexport * from \"./scene/scene\";\nexport * from \"./scene/shape/arc\";\nexport * from \"./scene/shape/line\";\nexport * from \"./scene/shape/path\";\nexport * from \"./scene/shape/rect\";\nexport * from \"./scene/shape/sector\";\nexport * from \"./scene/shape/shape\";\nexport * from \"./util/angle\";\nexport * from \"./util/array\";\nexport * from \"./util/padding\";\nimport { millisecond } from \"./util/time/millisecond\";\nimport { second } from \"./util/time/second\";\nimport { minute } from \"./util/time/minute\";\nimport { hour } from \"./util/time/hour\";\nimport { day } from \"./util/time/day\";\nimport { sunday, monday, tuesday, wednesday, thursday, friday, saturday } from \"./util/time/week\";\nimport { month } from \"./util/time/month\";\nimport { year } from \"./util/time/year\";\nimport { utcMinute } from \"./util/time/utcMinute\";\nimport { utcHour } from \"./util/time/utcHour\";\nimport { utcDay } from \"./util/time/utcDay\";\nimport { utcMonth } from \"./util/time/utcMonth\";\nimport { utcYear } from \"./util/time/utcYear\";\nexport var time = {\n millisecond: millisecond,\n second: second,\n minute: minute,\n hour: hour,\n day: day,\n sunday: sunday, monday: monday, tuesday: tuesday, wednesday: wednesday, thursday: thursday, friday: friday, saturday: saturday,\n month: month,\n year: year,\n utcMinute: utcMinute,\n utcHour: utcHour,\n utcDay: utcDay,\n utcMonth: utcMonth,\n utcYear: utcYear\n};\nexport * from \"./chart/agChart\";\nexport * from \"./chart/themes/chartTheme\";\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n 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;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nimport { Component, Vue } from 'vue-property-decorator';\nimport { AgChart } from 'ag-charts-community';\nvar AgChartsVue = /** @class */ (function (_super) {\n __extends(AgChartsVue, _super);\n function AgChartsVue() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.isCreated = false;\n _this.isDestroyed = false;\n return _this;\n }\n AgChartsVue.prototype.render = function (h) {\n return h('div', { style: { height: '100%' } });\n };\n AgChartsVue.prototype.mounted = function () {\n var _this = this;\n var options = this.applyContainerIfNotSet(this.options);\n this.chart = AgChart.create(options);\n this.$watch('options', function (newValue, oldValue) {\n _this.processChanges(newValue, oldValue);\n });\n this.isCreated = true;\n };\n AgChartsVue.prototype.destroyed = function () {\n if (this.isCreated) {\n if (this.chart) {\n this.chart.destroy();\n }\n this.isDestroyed = true;\n }\n };\n AgChartsVue.prototype.processChanges = function (currentValue, previousValue) {\n if (this.isCreated) {\n AgChart.update(this.chart, this.applyContainerIfNotSet(this.options));\n }\n };\n AgChartsVue.prototype.applyContainerIfNotSet = function (propsOptions) {\n if (propsOptions.container) {\n return propsOptions;\n }\n return __assign(__assign({}, propsOptions), { container: this.$el });\n };\n AgChartsVue = __decorate([\n Component({\n props: {\n options: {},\n },\n })\n ], AgChartsVue);\n return AgChartsVue;\n}(Vue));\nexport { AgChartsVue };\n","\"use strict\";\nfunction __export(m) {\n for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];\n}\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__export(require(\"./lib/AgChartsVue\"));\n\n","module.exports = __WEBPACK_EXTERNAL_MODULE__740__;","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = function(module) {\n\tvar getter = module && module.__esModule ?\n\t\tfunction() { return module['default']; } :\n\t\tfunction() { return module; };\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = function(exports, definition) {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }","// define __esModule on exports\n__webpack_require__.r = function(exports) {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","__webpack_require__.p = \"\";","/* eslint-disable no-var */\n// This file is imported into lib/wc client bundles.\n\nif (typeof window !== 'undefined') {\n var currentScript = window.document.currentScript\n if (process.env.NEED_CURRENTSCRIPT_POLYFILL) {\n var getCurrentScript = require('@soda/get-current-script')\n currentScript = getCurrentScript()\n\n // for backward compatibility, because previously we directly included the polyfill\n if (!('currentScript' in document)) {\n Object.defineProperty(document, 'currentScript', { get: getCurrentScript })\n }\n }\n\n var src = currentScript && currentScript.src.match(/(.+\\/)[^/]+\\.js(\\?.*)?$/)\n if (src) {\n __webpack_public_path__ = src[1] // eslint-disable-line\n }\n}\n\n// Indicate to webpack that this file can be concatenated\nexport default null\n","var render = function render(){var _vm=this,_c=_vm._self._c;return _c('ag-charts-vue',{staticClass:\"gu-chart\",attrs:{\"options\":_vm.options}})\n}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\n\n\n\n","import mod from \"-!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js??clonedRuleSet-124.use[1]!../../node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./GuChart.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js??clonedRuleSet-124.use[1]!../../node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./GuChart.vue?vue&type=script&lang=js&\"","/* globals __VUE_SSR_CONTEXT__ */\n\n// IMPORTANT: Do NOT use ES2015 features in this file (except for modules).\n// This module is a runtime utility for cleaner component module output and will\n// be included in the final webpack user bundle.\n\nexport default function normalizeComponent(\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier /* server only */,\n shadowMode /* vue-cli only */\n) {\n // Vue.extend constructor export interop\n var options =\n typeof scriptExports === 'function' ? scriptExports.options : scriptExports\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) {\n // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () {\n injectStyles.call(\n this,\n (options.functional ? this.parent : this).$root.$options.shadowRoot\n )\n }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functional component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection(h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing ? [].concat(existing, hook) : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}\n","import { render, staticRenderFns } from \"./GuChart.vue?vue&type=template&id=344c9c82&\"\nimport script from \"./GuChart.vue?vue&type=script&lang=js&\"\nexport * from \"./GuChart.vue?vue&type=script&lang=js&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../node_modules/@vue/vue-loader-v15/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","import GuChart from '@/components/GuChart.vue'\n\nexport default {\n install: (Vue, options) => {\n Vue.component('GuChart', GuChart)\n }\n}\n","import './setPublicPath'\nimport mod from '~entry'\nexport default mod\nexport * from '~entry'\n"],"names":["root","factory","exports","module","require","define","amd","self","this","__WEBPACK_EXTERNAL_MODULE__740__","_typeof","obj","Symbol","iterator","constructor","prototype","_defineProperty","key","value","Object","defineProperty","enumerable","configurable","writable","_toConsumableArray","arr","_arrayWithoutHoles","_iterableToArray","_nonIterableSpread","Array","isArray","i","arr2","length","iter","toString","call","from","TypeError","reflectionIsSupported","Reflect","defineMetadata","getOwnMetadataKeys","copyReflectionMetadata","to","forwardMetadata","getOwnPropertyNames","forEach","propertyKey","metaKeys","metaKey","metadata","getOwnMetadata","fakeArray","__proto__","hasProto","isPrimitive","type","collectDataFromConstructor","vm","Component","originalInit","_init","_this","keys","$options","props","hasOwnProperty","push","get","set","data","plainData","undefined","$internalHooks","componentFactory","options","arguments","name","_componentTag","proto","indexOf","descriptor","getOwnPropertyDescriptor","methods","mixins","computed","decorators","__decorators__","fn","superProto","getPrototypeOf","Super","Extended","extend","forwardStaticMembers","shouldIgnore","callee","caller","Original","extendedDescriptor","superDescriptor","registerHooks","apply","getMetadata","PointerEvents","Padding","top","right","bottom","left","clear","BBox","x","y","width","height","isValid","isFinite","dilate","containsPoint","render","ctx","params","noParams","save","resetTransform","setTransform","strokeStyle","lineWidth","strokeRect","label","fillStyle","textBaseline","fillText","restore","Matrix","elements","setElements","e","setIdentityElements","AxB","A","B","C","m11","m12","m21","m22","m31","m32","o11","o12","o21","o22","o31","o32","multiplySelf","other","multiply","preMultiplySelf","inverse","_a","a","b","c","d","f","rD","inverseTo","invertSelf","clone","slice","transformPoint","transformBBox","bbox","radius","target","w","h","xx","xy","yx","yy","h_w","h_h","cx","cy","sx","Math","sqrt","sy","abs","toContext","identity","transform","flyweight","matrix","createId","instance","className","Error","id","Node","tag","NaN","isContainerNode","_children","childSet","inverseMatrix","_dirtyTransform","_scalingX","_scalingY","_scalingCenterX","_scalingCenterY","_rotationCenterX","_rotationCenterY","_rotation","_translationX","_translationY","_dirty","_visible","pointerEvents","All","isNode","node","_setScene","_scene","children","n","_setParent","_parent","countChildren","depth","MAX_SAFE_INTEGER","size","append","nodes","parent","scene","dirty","appendChild","removeChild","splice","insertBefore","nextNode","index","inverseTransformPoint","dirtyTransform","rotation","PI","pickNode","visible","None","hit","computeBBox","computeBBoxCenter","computeTransformMatrix","scx","scy","bbcx","bbcy","scalingX","scalingY","scalingCenterX","scalingCenterY","rcx","rcy","r","cos","sin","rotationCenterX","rotationCenterY","tx","translationX","ty","translationY","tx4","ty4","pow","chainObjects","child","create","prop","getValue","object","path","defaultValue","parts","split","part","emptyTarget","cloneUnlessOtherwiseSpecified","isMergeableObject","deepMerge","defaultArrayMerge","source","concat","map","element","getMergeFunction","customMerge","getEnumerableOwnPropertySymbols","getOwnPropertySymbols","filter","symbol","propertyIsEnumerable","getKeys","propertyIsOnObject","property","_","propertyIsUnsafe","mergeObject","destination","defaultIsMergeableObject","isNonNullObject","isSpecial","stringValue","arrayMerge","sourceIsArray","targetIsArray","sourceAndTargetTypesMatch","isObject","__extends","extendStatics","setPrototypeOf","p","__","Shape","_super","lastInstanceId","_fillOpacity","_strokeOpacity","_fill","defaultStyles","fill","_stroke","stroke","_strokeWidth","strokeWidth","_lineDash","lineDash","_lineDashOffset","lineDashOffset","_lineCap","lineCap","_lineJoin","lineJoin","_opacity","opacity","onShadowChange","_fillShadow","fillShadow","_strokeShadow","strokeShadow","createInstance","template","shape","String","restoreOwnStyles","styles","restoreAllStyles","restoreOverriddenStyles","protoStyles","floor","align","alignment","start","oldValue","identical","min","max","removeEventListener","addEventListener","fillStroke","pixelRatio","canvas","globalAlpha","fillOpacity","enabled","shadowColor","color","shadowOffsetX","xOffset","shadowOffsetY","yOffset","shadowBlur","blur","strokeOpacity","setLineDash","isPointInPath","HdpiCanvas","document","window","_container","_pixelRatio","createElement","context","getContext","style","userSelect","display","setPixelRatio","resize","remove","parentNode","destroy","_canvas","freeze","toImage","img","src","getDataURL","toDataURL","download","fileName","trim","dataUrl","navigator","msSaveOrOpenBlob","binary","atob","array","charCodeAt","blob","Blob","Uint8Array","href","body","click","ratio","devicePixelRatio","overrideScale","imageRendering","_width","_height","round","_textMeasuringContext","_svgText","xmlns","svg","createElementNS","setAttribute","classList","add","position","visibility","svgText","_has","isChrome","userAgent","isFirefox","isSafari","textMetrics","textMeasuringContext","measureText","actualBoundingBoxDescent","getTransform","text","font","textAlign","getTextSize","has","metrics","actualBoundingBoxAscent","measureSvgText","cache","textSizeCache","fontCache","size_1","textContent","getBBox","scale","overrides","$save","$restore","$setTransform","name_1","Text","_x","_y","lineBreakRegex","lines","_text","_dirtyFont","_fontSize","_fontFamily","_textAlign","_textBaseline","_lineHeight","splitText","str","dirtyFont","_font","fontStyle","fontWeight","fontSize","fontFamily","join","_fontStyle","_fontWeight","getPreciseBBox","getApproximateBBox","actualBoundingBoxLeft","point","isPointInStroke","_b","_c","strokeText","__assign","assign","t","s","Observable","allPropertyListeners","Map","allEventListeners","addPropertyListener","listener","scope","propertyListeners","scopes_1","Set","scopes","removePropertyListener","delete","notifyPropertyListeners","eventListeners","scopes_2","notifyEventListeners","types","listeners","fireEvent","event","privateKeyPrefix","reactive","events","_i","privateKey","privateKeyEvents","events_1","__decorate","desc","decorate","Caption","padding","date","Date","msA","msB","setTime","nb","na","k","Color","g","fromString","fromHexString","hex","nameToHex","fromRgbaString","values","match","hexRe","parseInt","shortHexRe","rgbRe","rgbaRe","fromArray","fromHSB","alpha","rgb","HSBtoRGB","padHex","toHexString","toRgbaString","fractionDigits","components","toHSB","RGBtoHSB","S","H","delta","rc","gc","bc","isNaN","q","derive","hueShift","saturationFactor","brightnessFactor","opacityFactor","hsb","rgba","brighter","darker","aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkgrey","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkslategrey","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dimgrey","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","green","greenyellow","grey","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightgrey","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightslategrey","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","slategrey","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen","number","constant","valueOf","ascending","bisectRight","list","comparator","lo","hi","mid","complexBisectRight","ascendingComparator","item","clamper","domain","ContinuousScale","unknown","_clamp","_domain","_range","untransform","_interpolate","rescale","setDomain","v","getDomain","range","piecewise","polymap","bimap","output","input","normalize","interpolate","xt","x0","x1","y0","y1","reverse","dt","tr","convert","invert","count","step","tickStep","ceil","e10","e5","e2","rawStep","log","LN10","error","tickIncrement","power","NumericTicks","absStep","prefixExponent","formatDefaultLocale","format","formatPrefix","formatTypes","toFixed","formatDecimal","toExponential","toPrecision","formatRounded","formatPrefixAuto","toUpperCase","prefixes","FormatSpecifier","specifier","sign","zero","comma","precision","string","formatRegEx","interpolateRegEx","makeFormatSpecifier","found","replace","exec","tickFormat","stop","formatSpecifier","precisionPrefix","precisionRound","Number","precisionFixed","formatDecimalParts","coefficient","exponent","toLocaleString","formatGroup","grouping","thousands","j","substring","formatNumerals","numerals","formatTrim","i0","i1","out","defaultLocale","definition","formatLocale","locale","group","currencyPrefix","currency","currencySuffix","decimal","percent","minus","nan","newFormat","prefix","test","toLowerCase","suffix","formatType","maybeSuffix","valuePrefix","valueSuffix","valueNegative","signPrefix","signSuffix","Infinity","LinearScale","ticks","nice","Group","parent_1","EnterNode","datum","next","Selection","groups","parents","select","selectAll","Class","appendFn","creator","selector","numGroups","subgroups","groupSize","subgroup","subnode","selectByClass","selectByTag","selectAllByClass","selectAllByTag","selectNone","selectorAll","groupCount","groupLength","each","cb","merge","groups0","groups1","m0","m1","m","merges","group0","group1","attr","attrFn","enterGroups","exitGroups","setDatum","setData","data_1","updateGroups","parent_2","dataSize","enterGroup","updateGroup","exitGroup","bindKey","bindIndex","previous","result","enter","update","exit","keyValues","nodeByKeyValue","keyValue","keyPrefix","Line","_x1","_y1","_x2","_y2","x2","y2","beginPath","moveTo","lineTo","linearRoot","quadraticRoots","D","roots","t1","t2","cubicRoots","Q","R","third","T","Im","t_1","theta","acos","thirdA","twoSqrtQ","t3","segmentIntersection","ax1","ay1","ax2","ay2","bx1","by1","bx2","by2","ua","ub","cubicSegmentIntersections","px1","py1","px2","py2","px3","py3","px4","py4","intersections","bx","bezierCoefficients","by","tt","ttt","P1","P2","P3","P4","Path2D","commands","_closedPath","rect","closePath","arcTo","rx","ry","fA","fS","hdx","hdy","sinPhi","cosPhi","xp","yp","ratX","ratY","lambda","cpx","cpy","theta1","atan2","deltaTheta","cubicArc","phi","theta2","anticlockwise","temp","f90","sinTheta1","cosTheta1","rightAngle","lastX","sinPhi2","cosPhi2","C2x","C2y","deCasteljau","points","newPoints","last","approximateCurve","xy_1","quadraticCurveTo","cubicCurveTo","cx1","cy1","cx2","cy2","cn","ox","oy","px","py","intersectionCount","ci","pi","setFromString","parseSvgPath","splitCommandsRe","strParams","matchParamsRe","command","substr","parseFloat","prettifySvgPath","lastCommand","checkQuadraticCP","quadraticCommandRe","checkCubicCP","cubicCommandRe","toPrettyString","toSvg","xmlDeclaration","toDebugSvg","toCubicPaths","paths","cubicPathToString","Path","_dirtyPath","_svgPath","closedPath","updatePath","dirtyPath","appendPath","twoPi","normalizeAngle360","radians","normalizeAngle360Inclusive","normalizeAngle180","toRadians","degrees","isEqual","epsilon","fractionOrSignificantDigits","EPSILON","ArcType","Tags","Arc","_centerX","_centerY","_radiusX","_radiusY","_startAngle","_endAngle","_counterClockwise","_type","Open","startAngle","endAngle","centerX","centerY","radiusX","radiusY","counterClockwise","Chord","Round","fullPie","ChartAxisDirection","ChartAxisPosition","AxisTick","AxisLabel","mirrored","parallel","_format","onFormatChange","Axis","lineNode","line","tick","translation","_visibleRange","_title","_gridLength","gridStyle","_radialGrid","thickness","groupSelection","onLabelFormatChange","bind","_scale","requestedRange","getMeta","updateRange","rr","vr","visibleRange","span","shift","inRange","tolerance","inRangeEx","labelFormatter","oldTitle","requestedRangeMin","requestedRangeMax","parallelLabels","labelRotation","halfBandwidth","bandwidth","sideFlag","parallelFlipRotation","parallelFlipFlag","regularFlipRotation","regularFlipFlag","alignFlag","Tick","gridLength","radialGrid","GridLine","styleCount_1","gridLines","angularGridLength_1","arc","gridLine","labelSelection","formatTickDatum","labelX","autoRotation","title","titleVisible","titleNode","excludeTitle","titleRotationFlag","meta","formatter","axis","formatDatum","labels","labelBBox","flipChartAxisDirection","direction","X","Y","ChartAxis","boundSeries","_position","Top","Right","Bottom","Left","NumberAxis","_nice","_min","_max","clamp","BandScale","ordinalRange","_bandwidth","_paddingInner","_paddingOuter","_round","_align","reversed","CategoryAxis","paddingInner","paddingOuter","find","predicate","finiteExtent","numericExtent","calculatedExtent","getTime","findMinMax","values_1","copy","TreeNode","subtreeLeft","subtreeRight","screenX","screenY","leafCount","prelim","mod","ancestor","change","getLeftSibling","getLeftmostSibling","nextLeft","thread","nextRight","getSiblings","ticksToTree","pad","unshift","insertTick","pathParts","lastPartIndex","pathPart","partIndex","existingNode","isNotLeaf","moveSubtree","wm","wp","subtrees","vim","defaultAncestor","executeShifts","apportion","distance","vop","vip","vom","sip","sop","sim","som","firstWalk","defaultAncestor_1","midpoint","leftSibling","Dimensions","secondWalk","layout","thirdWalk","treeLayout","TreeLayout","dimensions","leafNodes","nonLeafNodes","shiftX","shiftY","flipX","xSteps","ySteps","existingSpacingX","desiredSpacingX","existingSpacingY","desiredSpacingY","screenDimensions","offsetX","offsetY","GroupedCategoryAxisLabel","grid","GroupedCategoryAxis","tickScale","longestSeparatorLength","labelColor","gridLineSelection","axisLineSelection","separatorSelection","tickTree","tickTreeLayout","resizeTickTree","lineHeight","rangeStart","rangeEnd","rangeLength","isHorizontal","treeLabels","isLabelTree","updateGridLines","enterGridLines","updateLabels","enterLabels","maxLeafLabelWidth","labelGrid","separatorData","minX","updateSeparators","enterSeparators","lineCount","updateAxisLines","enterAxisLines","styles_1","includeTitle","t0","TimeInterval","offset","_floor","_offset","d0","d1","ms","CountableTimeInterval","field","_count","_field","end","every","field_1","milliseconds","millisecond","durationSecond","durationMinute","durationHour","durationDay","durationWeek","durationMonth","durationYear","getMilliseconds","seconds","second","getSeconds","minutes","getMinutes","minute","hours","getHours","hour","setHours","days","setDate","getDate","tzMinuteDelta","getTimezoneOffset","day","weekday","getDay","weeks","msDelta","sunday","monday","thursday","months","setMonth","getMonth","getFullYear","month","years","setFullYear","year","setUTCHours","setUTCDate","getUTCDate","utcDay","setUTCMonth","setUTCFullYear","getUTCFullYear","utcYear","getUTCDay","utcSunday","utcMonday","utcThursday","localDate","M","L","utcDate","UTC","formatLookup","names","newYear","percentCharCode","numberRe","percentRe","requoteRe","requote","formatRe","RegExp","pads","timeLocale","lDateTime","dateTime","lDate","lTime","time","lPeriods","periods","lWeekdays","lShortWeekdays","shortDays","lMonths","lShortMonths","shortMonths","periodRe","periodLookup","weekdayRe","weekdayLookup","shortWeekdayRe","shortWeekdayLookup","monthRe","monthLookup","shortMonthRe","shortMonthLookup","formats","formatShortWeekday","formatWeekday","formatShortMonth","formatMonth","formatDayOfMonth","formatMicroseconds","formatHour24","formatHour12","formatDayOfYear","formatMilliseconds","formatMonthNumber","formatMinutes","formatPeriod","formatUnixTimestamp","formatUnixTimestampSeconds","formatSeconds","formatWeekdayNumberMonday","formatWeekNumberSunday","formatWeekNumberISO","formatWeekdayNumberSunday","formatWeekNumberMonday","formatYear","formatFullYear","formatZone","formatLiteralPercent","utcFormats","formatUTCShortWeekday","formatUTCWeekday","formatUTCShortMonth","formatUTCMonth","formatUTCDayOfMonth","formatUTCMicroseconds","formatUTCHour24","formatUTCHour12","formatUTCDayOfYear","formatUTCMilliseconds","formatUTCMonthNumber","formatUTCMinutes","formatUTCPeriod","formatUTCSeconds","formatUTCWeekdayNumberMonday","formatUTCWeekNumberSunday","formatUTCWeekNumberISO","formatUTCWeekdayNumberSunday","formatUTCWeekNumberMonday","formatUTCYear","formatUTCFullYear","formatUTCZone","parses","parseShortWeekday","parseWeekday","parseShortMonth","parseMonth","parseLocaleDateTime","parseDayOfMonth","parseMicroseconds","parseHour24","parseDayOfYear","parseMilliseconds","parseMonthNumber","parseMinutes","parsePeriod","parseUnixTimestamp","parseUnixTimestampSeconds","parseSeconds","parseWeekdayNumberMonday","parseWeekNumberSunday","parseWeekNumberISO","parseWeekdayNumberSunday","parseWeekNumberMonday","parseLocaleDate","parseLocaleTime","parseYear","parseFullYear","parseZone","parseLiteralPercent","newParse","newDate","parseSpecifier","V","week","getUTCMonth","u","W","U","Z","charAt","pad_1","code","char","parse","dayOfWeek","yearStart","z","getUTCMilliseconds","getUTCSeconds","getUTCMinutes","getUTCHours","utcFormat","utcParse","setDefaultLocale","RectSizing","TimeScale","tickIntervals","formatMillisecond","formatSecond","formatMinute","formatHour","formatDay","formatWeek","defaultTickFormat","tickInterval","interval","tickCount","TimeAxis","datumFormat","datumFormatter","Scene","animationFrameId","_root","debug","renderFrameIndex","renderBoundingBoxes","_frameIndex","pendingSize","clearRect","fillRect","frameIndex","container","requestAnimationFrame","cancelRender","cancelAnimationFrame","bezierCurveTo","Gradient","stops","LinearGradient","angle","generateGradient","l","atan","gradient_1","createLinearGradient","addColorStop","Rect","_radius","_crisp","_gradient","effectiveStrokeWidth","_sizing","Content","updateGradientInstance","gradient","gradientInstance","crisp","sizing","Border","borderSizing","halfWidth","halfHeight","al","Marker","_size","half","Square","hs","MarkerLabel","_marker","_markerSize","_spacing","marker","markerSize","spacing","Circle","Cross","Diamond","Heart","rad","degree","Plus","Triangle","getMarker","LegendOrientation","LegendPosition","LegendLabel","LegendMarker","LegendItem","paddingX","paddingY","changeListener","layoutChangeListener","Legend","itemSelection","oldSize","orientation","Vertical","onDataChange","onEnabledChange","onPositionChange","onMarkerShapeChange","Horizontal","performLayout","updateSelection","MarkerShape","itemId","enterSelection","itemCount","bboxes","itemMarker","itemLabel","markerLabel","itemHeight","rowCount","columnWidth","paddedItemsWidth","paddedItemsHeight","columnCount","itemsWidth","itemsHeight","columnCount_1","startX","startY","markerFill","markerStroke","markerStrokeWidth","markerFillOpacity","markerStrokeOpacity","getDatumForPoint","SizeMonitor","init","NativeResizeObserver","ResizeObserver","resizeObserver","entries","entries_1","entry","contentRect","checkSize","clientWidth","clientHeight","setInterval","ready","observe","unobserve","requestAnimationFrameId","SeriesTooltip","Series","directions","tooltipEnabled","showInLegend","cursor","scheduleLayout","scheduleData","setColors","fills","strokes","directionKeys","getNodeData","fireNodeClickEvent","toggleSeriesItem","onHighlightChange","fixNumericExtent","extent","SeriesMarker","maxSize","CartesianSeries","CartesianSeriesMarker","defaultTooltipCss","toTooltipHtml","defaults","content","_d","backgroundColor","titleHtml","Chart","defaultTooltipClass","ChartTooltip","chart","class","delay","tracking","showTimeout","constrained","tooltipRoot","IntersectionObserver","target_1","observer","intersectionRatio","toggle","isVisible","contains","classes","getAttribute","updateClass","show","html","instantly","el","innerHTML","pageX","pageY","tooltipRect","getBoundingClientRect","minLeft","maxLeft","innerWidth","pageYOffset","setTimeout","clearTimeout","lastPick","dehighlightDatum","background","legend","legendAutoPadding","captionAutoPadding","_data","_autoSize","_tooltipClass","tooltipTracking","_axes","_series","_axesChanged","_seriesChanged","layoutCallbackId","_performLayout","layoutPending","dataCallbackId","_onMouseDown","onMouseDown","_onMouseUp","onMouseUp","_onMouseMove","onMouseMove","_onMouseOut","onMouseOut","_onClick","onClick","_element","autoSize","onLayoutChange","updateLegend","onLegendPositionChange","tooltip","tooltipDocuments","styleElement","head","querySelector","setupDomListeners","onCaptionChange","series","chart_1","cleanupDomListeners","detachAxis","linkedTo","attachAxis","axesChanged","seriesRoot","removeAllSeries","addSeries","dataPending","before","allSeries","canAdd","beforeIndex","initSeries","seriesChanged","onSeriesNodeClick","freeSeries","addSeriesAfter","after","afterIndex","removeSeries","assignSeriesToAxes","axes","axisName","assignAxesToSeries","force","directionToAxesMap","directionAxes","findMatchingAxis","xAxis","console","warn","yAxis","axisKeys","processData","legendData","listSeriesItems","positionCaptions","subtitle","subtitleVisible","paddingTop","titleBBox","subtitleBBox","positionLegend","legendBBox","legendGroup","legendSpacing","chartElement","getSeriesRect","seriesRect","pickSeriesNode","pickClosestSeriesNodeDatum","closestDatum","minDistance","_loop_1","hitPoint","getDistance","p1","p2","handleTooltip","nodeDatum","pick","onSeriesDatumPick","hideTooltip","canvasRect","pageXOffset","checkSeriesNodeClick","checkLegendClick","event_1","id_1","highlightDatum","getTooltipHtml","highlightedDatum","ClipRect","_enabled","clip","RangeHandle","_gripLineGap","_gripLineLength","ax","ay","axw","ayh","dx","gripLineGap","dy","gripLineLength","RangeMask","minRange","onRangeChange","computeVisibleRangeBBox","maxX","RangeSelector","minHandle","maxHandle","mask","updateHandles","NavigatorMask","rangeMask","rm","NavigatorHandle","rangeHandle","rh","Navigator","rs","minHandleDragging","maxHandleDragging","panHandleOffset","_margin","updateAxes","clipSeries","onDragStart","onDrag","getRatio","onDragStop","stopHandleDragging","CartesianChart","_seriesRoot","shrinkRect","legendPadding","margin","bottomAxesHeight","axisThickness","_onTouchStart","onTouchStart","_onTouchMove","onTouchMove","_onTouchEnd","onTouchEnd","_onTouchCancel","onTouchCancel","getTouchOffset","touch","touches","clientX","clientY","domains_1","HierarchyChart","GroupedCategoryChart","domains","isNumericX","domain_1","PolarSeries","PolarSeriesMarker","PolarChart","equal","length_1","flags","interpolatePattern","valueName","formatName","locales","toDateString","BarSeriesNodeTag","BarLabelPlacement","AreaSeriesTooltip","AreaSeries","areaGroup","strokeGroup","markerGroup","areaSelection","strokeSelection","markerSelection","markerSelectionData","seriesItemEnabled","xData","yData","yDomain","_xKey","xName","_yKeys","yNames","highlightStyle","seriesItemEnabled_1","_normalizedTo","absValue","updateMarkerNodes","xKey","yKeys","keysFound","yKey","yMin","yMax","normalizedTo","yMinMax","yLargestMinMax","findLargestMinMax","stack","totals","totals_1","total","selectionData","generateSelectionData","areaSelectionData","updateAreaSelection","updateStrokeSelection","updateMarkerSelection","xScale","yScale","xDatum","yDatum","seriesDatum","prevMin","prevMax","curr","prev","yValue","areaDatum","areaPoints","shadow","updateAreas","enterAreas","updateStrokes","enterStrokes","updateMarkers","enterMarkers","markerFormatter","highlightFill","highlightStroke","highlighted","markerFormat","yGroup","renderer","tooltipRenderer","tooltipFormat","yKeyIndex","xValue","processedYValue","yName","xString","yString","Label","BarSeriesLabel","placement","Inside","BarSeriesTooltip","flat","HistogramSeriesNodeTag","BarSeries","rectGroup","textGroup","rectSelection","textSelection","flipXY","groupScale","_xName","cumYKeyCount","flatYKeys","hideInLegend","_grouped","_yNames","grouped","prevYKeyCount_1","visibleStacks_1","map_1","_shadow","updateRectNodes","tallestStackMin","tallestStackMax","groups_1","group_1","getCategoryAxis","getValueAxis","generateNodeData","labelFontStyle","labelFontWeight","labelFontSize","labelFontFamily","labelPlacement","barWidth","nodeData","groupIndex","groupYs","stackIndex","stackYs","prevMinY","prevMaxY","levelIndex","currY","barX","prevY","bottomY","yValueIsNumber","labelText","labelY","labelTextAlign","labelTextBaseline","colorIndex","updateRectSelection","updateTextSelection","updateTextNodes","updateRects","enterRects","Bar","rectFill","rectStroke","updateTexts","enterTexts","labelEnabled","fillIndex","visibleStacks","LineSeriesTooltip","LineSeries","xDomain","nodeSelection","_yKey","onMarkerEnabledChange","isContinuousX","isContinuousY","updateNodes","updateLinePath","updateNodeSelection","getXYDatums","noDatum","linePath","prevXInRange","nextXYDatums","xyDatums","xInRange","nextXInRange","ScatterSeriesTooltip","ScatterSeries","sizeData","sizeScale","sizeName","labelName","sizeKey","labelKey","il","jl","HistogramSeriesLabel","defaultBinCount","aggregationFunctions","bin","sum","reduce","acc","mean","HistogramBin","domainMin","domainMax","aggregatedValue","frequency","addDatum","domainWidth","calculateAggregatedValue","aggregationName","aggregationFunction","getY","areaPlot","relativeHeight","HistogramSeriesTooltip","HistogramSeries","binnedData","_areaPlot","_bins","_aggregation","_binCount","_yName","bins","aggregation","binCount","deriveBins","binStarts","binSize","firstBinEnd","expandStartToBin","placeDataInBins","derivedBins","sortedData","sort","currentBin","loop","ln","NEGATIVE_INFINITY","firstBin","lastBin","xMin","xMax","defaultLabelFormatter","binOfData","xDomainMin","xDomainMax","xMinPx","xMaxPx","yZeroPx","yMaxPx","selectionDatumLabel","Bin","rangeMin","rangeMax","HierarchySeries","DropShadow","dice","roundNode","squarifyRatio","nodeValue","sumValue","minValue","maxValue","newRatio","minRatio","beta","rows","row","squarify","custom","Treemap","paddingStack","tile","paddingRight","paddingBottom","paddingLeft","eachBefore","positionNode","HierarchyNode","countFn","eachAfter","callback","pop","compare","leastCommonAncestor","ancestors","descendants","leaves","links","current","doLoop","hierarchy","mapChildren","objectChildren","childs","computeHeight","aNodes","bNodes","TextNodeTag","TreemapSeriesTooltip","TreemapSeriesLabel","PieNodeTag","TreemapSeries","labelMap","large","medium","small","_nodePadding","colorKey","colorDomain","colorRange","colorParents","colorName","rootName","updateLayoutPadding","nodePadding","textSize","innerNodeWidth","hasTitle","dataRoot","colorScale","traverse","colorValue","getLabelCenterX","getLabelCenterY","Name","Value","isLeaf","innerNodeHeight","textBBox","hasLabel","nameNode","Sector","_centerOffset","_innerRadius","_outerRadius","_angleOffset","outerRadius","angleOffset","midAngle","innerRadius","centerOffset","PieSeriesLabel","minAngle","PieSeriesCallout","colors","PieSeriesTooltip","PieSeries","radiusScale","groupSelectionData","angleScale","callout","angleKey","angleName","_fills","_strokes","outerRadiusOffset","innerRadiusOffset","radiusKey","angleData","angleDataTotal","angleDataRatios","labelData","radiusData","radiusMin","radiusMax","radii","min_1","delta_1","halfPi","datumIndex","midCos","midSin","labelMinAngle","labelVisible","midAngle180","quadrantStart","updateGroupSelection","Callout","centerOffsets","sector","sectorFill","sectorStroke","calloutColors","calloutLength","calloutStrokeWidth","offset_1","fontStyle_1","fontWeight_1","fontSize_1","fontFamily_1","color_1","labelRadius","radiusName","angleValue","formattedAngleValue","radiusValue","fills_1","strokes_1","setUTCSeconds","setUTCMinutes","palette","ChartTheme","createChartConfigPerSeries","getDefaults","mergeOptions_1","overrides_1","common","seriesTypes","seriesType","cartesian","cartesianSeriesTypes","polar","polarSeriesTypes","hierarchySeriesTypes","chartConfig","getPalette","config","getAxisDefaults","getSeriesDefaults","getBarSeriesDefaults","getCartesianSeriesMarkerDefaults","getChartDefaults","typeToAliases","alias","getConfig","mergeWithParentDefaults","mergeOptions","parentDefaults","setSeriesColors","seriesOptions","firstColorIndex","colorCount","getSeriesColorCount","cartesianDefaults","base","category","groupedCategory","column","bar","scatter","area","histogram","pie","treemap","_e","DarkTheme","fontColor","mutedFontColor","axisDefaults","seriesLabelDefaults","chartDefaults","MaterialLight","MaterialDark","PastelLight","PastelDark","SolarLight","SolarDark","VividLight","VividDark","LogScale","baseLog","basePow","_base","df","dl","makeLogFn","makePowFn","reflect","exp","pow10","E","log10","log2","logBase","isReversed","p0","LogAxis","chartPadding","commonChartMappings","chartMeta","constructorParams","setAsIs","nonSerializable","seriesDefaults","columnSeriesDefaults","shadowMapping","labelDefaults","barLabelMapping","tooltipMapping","axisMappings","mappings","groupedCategoryChartMapping","groupedCategoryChartMeta","lightTheme","darkTheme","lightThemes","darkThemes","themes","getChartTheme","stockTheme","baseTheme","AgChart","theme","component","createComponent","pathToSeriesTypeMap","actualSeriesTypeMap","actualSeries","mapping","provideDefaultType","provideDefaultOptions","skipKeys","constructorParamValues","param","subComponents","fakeTheme","modifiedPath","modifiedConfig","subComponent","keyPath","updateSeries","configs","prevSeries","newSeries","axesToAdd","axesToUpdate","_loop_2","axisToUpdate","axisToAdd","configs_1","provideDefaultChartType","outerLoop","chartType","skipThemeKey","enabledKey","isChartConfig","themeDefaults","isExplicitlyDisabled","hasEnabledKey","AgChartsVue","isCreated","isDestroyed","mounted","applyContainerIfNotSet","$watch","newValue","processChanges","destroyed","currentValue","previousValue","propsOptions","$el","__export","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","__webpack_modules__","getter","__esModule","o","toStringTag","currentScript","_vm","_self","staticClass","attrs","staticRenderFns","default","description","normalizeComponent","scriptExports","functionalTemplate","injectStyles","scopeId","moduleIdentifier","shadowMode","hook","_compiled","functional","_scopeId","$vnode","ssrContext","__VUE_SSR_CONTEXT__","_registeredComponents","_ssrRegister","$root","shadowRoot","_injectStyles","originalRender","existing","beforeCreate","install","Vue","GuChart"],"sourceRoot":""}