Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
package.dist.choropleth-0DsmaWsP.mjs.map Maven / Gradle / Ivy
{"version":3,"file":"choropleth-0DsmaWsP.mjs","sources":["../../../node_modules/lodash-es/_arrayReduce.js","../../../node_modules/lodash-es/_basePropertyOf.js","../../../node_modules/lodash-es/_deburrLetter.js","../../../node_modules/lodash-es/deburr.js","../../../node_modules/lodash-es/_asciiWords.js","../../../node_modules/lodash-es/_hasUnicodeWord.js","../../../node_modules/lodash-es/_unicodeWords.js","../../../node_modules/lodash-es/words.js","../../../node_modules/lodash-es/_createCompounder.js","../../../node_modules/lodash-es/_baseClamp.js","../../../node_modules/lodash-es/clamp.js","../../../node_modules/lodash-es/_baseDelay.js","../../../node_modules/lodash-es/delay.js","../../../node_modules/lodash-es/_baseMap.js","../../../node_modules/lodash-es/map.js","../../../node_modules/lodash-es/flatMapDeep.js","../../../node_modules/lodash-es/isEqual.js","../../../node_modules/lodash-es/kebabCase.js","../../../node_modules/lodash-es/_baseSome.js","../../../node_modules/lodash-es/some.js","../../../node_modules/d3-array/src/fsum.js","../../../node_modules/d3-array/src/merge.js","../../../node_modules/d3-axis/src/identity.js","../../../node_modules/d3-axis/src/axis.js","../../../node_modules/d3-drag/src/noevent.js","../../../node_modules/d3-drag/src/nodrag.js","../../../node_modules/d3-interpolate/src/quantize.js","../../../node_modules/d3-ease/src/linear.js","../../../node_modules/d3-brush/src/constant.js","../../../node_modules/d3-brush/src/event.js","../../../node_modules/d3-brush/src/noevent.js","../../../node_modules/d3-brush/src/brush.js","../../../node_modules/d3-path/src/path.js","../../../node_modules/d3-geo/src/math.js","../../../node_modules/d3-geo/src/noop.js","../../../node_modules/d3-geo/src/stream.js","../../../node_modules/d3-geo/src/cartesian.js","../../../node_modules/d3-geo/src/compose.js","../../../node_modules/d3-geo/src/rotation.js","../../../node_modules/d3-geo/src/circle.js","../../../node_modules/d3-geo/src/clip/buffer.js","../../../node_modules/d3-geo/src/pointEqual.js","../../../node_modules/d3-geo/src/clip/rejoin.js","../../../node_modules/d3-geo/src/polygonContains.js","../../../node_modules/d3-geo/src/clip/index.js","../../../node_modules/d3-geo/src/clip/antimeridian.js","../../../node_modules/d3-geo/src/clip/circle.js","../../../node_modules/d3-geo/src/clip/line.js","../../../node_modules/d3-geo/src/clip/rectangle.js","../../../node_modules/d3-geo/src/identity.js","../../../node_modules/d3-geo/src/path/area.js","../../../node_modules/d3-geo/src/path/bounds.js","../../../node_modules/d3-geo/src/path/centroid.js","../../../node_modules/d3-geo/src/path/context.js","../../../node_modules/d3-geo/src/path/measure.js","../../../node_modules/d3-geo/src/path/string.js","../../../node_modules/d3-geo/src/path/index.js","../../../node_modules/d3-geo/src/transform.js","../../../node_modules/d3-geo/src/projection/fit.js","../../../node_modules/d3-geo/src/projection/resample.js","../../../node_modules/d3-geo/src/projection/index.js","../../../node_modules/d3-geo/src/projection/conic.js","../../../node_modules/d3-geo/src/projection/cylindricalEqualArea.js","../../../node_modules/d3-geo/src/projection/conicEqualArea.js","../../../node_modules/d3-geo/src/projection/albers.js","../../../node_modules/d3-geo/src/projection/mercator.js","../../../node_modules/d3-geo/src/projection/equirectangular.js","../../../node_modules/d3-geo/src/projection/conicEquidistant.js","../../../node_modules/d3-geo/src/projection/equalEarth.js","../../../node_modules/d3-geo/src/projection/naturalEarth1.js","../../../node_modules/d3-hierarchy/src/cluster.js","../../../node_modules/d3-hierarchy/src/hierarchy/count.js","../../../node_modules/d3-hierarchy/src/hierarchy/each.js","../../../node_modules/d3-hierarchy/src/hierarchy/eachBefore.js","../../../node_modules/d3-hierarchy/src/hierarchy/eachAfter.js","../../../node_modules/d3-hierarchy/src/hierarchy/find.js","../../../node_modules/d3-hierarchy/src/hierarchy/sum.js","../../../node_modules/d3-hierarchy/src/hierarchy/sort.js","../../../node_modules/d3-hierarchy/src/hierarchy/path.js","../../../node_modules/d3-hierarchy/src/hierarchy/ancestors.js","../../../node_modules/d3-hierarchy/src/hierarchy/descendants.js","../../../node_modules/d3-hierarchy/src/hierarchy/leaves.js","../../../node_modules/d3-hierarchy/src/hierarchy/links.js","../../../node_modules/d3-hierarchy/src/hierarchy/iterator.js","../../../node_modules/d3-hierarchy/src/hierarchy/index.js","../../../node_modules/d3-hierarchy/src/accessors.js","../../../node_modules/d3-hierarchy/src/constant.js","../../../node_modules/d3-hierarchy/src/lcg.js","../../../node_modules/d3-hierarchy/src/array.js","../../../node_modules/d3-hierarchy/src/pack/enclose.js","../../../node_modules/d3-hierarchy/src/pack/siblings.js","../../../node_modules/d3-hierarchy/src/pack/index.js","../../../node_modules/d3-hierarchy/src/treemap/round.js","../../../node_modules/d3-hierarchy/src/treemap/dice.js","../../../node_modules/d3-hierarchy/src/tree.js","../../../node_modules/d3-hierarchy/src/treemap/slice.js","../../../node_modules/d3-hierarchy/src/treemap/squarify.js","../../../node_modules/d3-hierarchy/src/treemap/index.js","../../../node_modules/d3/node_modules/d3-shape/src/path.js","../../../node_modules/d3/node_modules/d3-shape/src/arc.js","../../../node_modules/d3/node_modules/d3-shape/src/point.js","../../../node_modules/d3/node_modules/d3-shape/src/line.js","../../../node_modules/d3/node_modules/d3-shape/src/area.js","../../../node_modules/d3/node_modules/d3-shape/src/descending.js","../../../node_modules/d3/node_modules/d3-shape/src/identity.js","../../../node_modules/d3/node_modules/d3-shape/src/pie.js","../../../node_modules/d3/node_modules/d3-shape/src/curve/radial.js","../../../node_modules/d3/node_modules/d3-shape/src/lineRadial.js","../../../node_modules/d3/node_modules/d3-shape/src/curve/bump.js","../../../node_modules/d3/node_modules/d3-shape/src/link.js","../src/components/component.ts","../../../node_modules/dompurify/dist/purify.es.mjs","../src/utils/sanitizeHtml.ts","../src/components/axes/toolbar.ts","../src/components/layout/layout.ts","../src/components/layout/spacer.ts","../../../node_modules/carbon-components/es/globals/js/settings.js","../../../node_modules/carbon-components/es/globals/js/misc/mixin.js","../../../node_modules/carbon-components/es/globals/js/mixins/create-component.js","../../../node_modules/carbon-components/es/globals/js/mixins/handles.js","../../../node_modules/carbon-components/es/globals/js/misc/on.js","../../../node_modules/carbon-components/es/globals/js/mixins/evented-state.js","../../../node_modules/carbon-components/es/globals/js/misc/event-matches.js","../../../node_modules/carbon-components/es/globals/js/misc/get-launching-details.js","../../../node_modules/carbon-components/es/globals/js/mixins/evented-show-hide-state.js","../../../node_modules/warning/browser.js","../../../node_modules/carbon-components/es/globals/js/mixins/init-component-by-launcher.js","../../../node_modules/carbon-components/es/components/modal/modal.js","../src/components/essentials/modal.ts","../src/components/essentials/title.ts","../src/components/essentials/legend.ts","../src/components/axes/chart-clip.ts","../src/components/essentials/canvas-chart-clip.ts","../../../node_modules/@carbon/utils-position/index.js","../src/components/essentials/tooltip.ts","../src/components/axes/grid-brush.ts","../src/components/axes/zoom-bar.ts","../src/components/essentials/threshold.ts","../src/components/essentials/highlights.ts","../src/components/essentials/tooltip-axis.ts","../../../node_modules/d3-sankey/node_modules/d3-array/src/max.js","../../../node_modules/d3-sankey/node_modules/d3-array/src/min.js","../../../node_modules/d3-sankey/node_modules/d3-array/src/sum.js","../../../node_modules/d3-sankey/src/align.js","../../../node_modules/d3-sankey/src/constant.js","../../../node_modules/d3-sankey/src/sankey.js","../../../node_modules/d3-shape/node_modules/d3-path/src/path.js","../../../node_modules/d3-shape/src/constant.js","../../../node_modules/d3-shape/src/point.js","../../../node_modules/d3-shape/src/array.js","../../../node_modules/d3-shape/src/link/index.js","../../../node_modules/d3-sankey/src/sankeyLinkHorizontal.js","../src/components/graphs/alluvial.ts","../src/components/axes/grid.ts","../src/components/graphs/area.ts","../src/components/graphs/line.ts","../src/components/axes/ruler.ts","../src/components/graphs/scatter.ts","../src/components/axes/axis.ts","../src/components/axes/hover-axis.ts","../src/components/axes/two-dimensional-axes.ts","../src/components/graphs/skeleton.ts","../src/components/graphs/boxplot.ts","../src/components/axes/zero-line.ts","../src/components/graphs/bubble.ts","../src/components/graphs/bullet.ts","../../../node_modules/topojson-client/src/identity.js","../../../node_modules/topojson-client/src/transform.js","../../../node_modules/topojson-client/src/reverse.js","../../../node_modules/topojson-client/src/feature.js","../../../node_modules/topojson-client/src/stitch.js","../../../node_modules/topojson-client/src/merge.js","../src/components/axes/ruler-binned.ts","../src/components/axes/ruler-stacked.ts","../src/components/diagrams/buildPaths.ts","../src/components/diagrams/markerDefinitions.ts","../src/components/essentials/color-scale-legend.ts","../src/components/essentials/title-meter.ts","../src/components/graphs/bar.ts","../src/components/graphs/circle-pack.ts","../src/components/graphs/pie.ts","../src/components/graphs/donut.ts","../src/components/graphs/gauge.ts","../src/components/graphs/bar-grouped.ts","../src/components/graphs/heatmap.ts","../src/components/graphs/histogram.ts","../src/components/graphs/lollipop.ts","../src/components/graphs/meter.ts","../src/components/graphs/radar.ts","../src/components/graphs/bar-simple.ts","../src/components/graphs/skeleton-lines.ts","../src/components/graphs/area-stacked.ts","../src/components/graphs/bar-stacked.ts","../src/components/graphs/scatter-stacked.ts","../src/components/graphs/tree.ts","../../../node_modules/@carbon/colors/es/index.js","../src/components/graphs/treemap.ts","../../../node_modules/d3-cloud/node_modules/d3-dispatch/src/dispatch.js","../../../node_modules/d3-cloud/index.js","../src/components/graphs/wordcloud.ts","../src/components/essentials/geo-projection.ts","../src/components/graphs/choropleth.ts"],"sourcesContent":["/**\n * A specialized version of `_.reduce` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @param {boolean} [initAccum] Specify using the first element of `array` as\n * the initial value.\n * @returns {*} Returns the accumulated value.\n */\nfunction arrayReduce(array, iteratee, accumulator, initAccum) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n if (initAccum && length) {\n accumulator = array[++index];\n }\n while (++index < length) {\n accumulator = iteratee(accumulator, array[index], index, array);\n }\n return accumulator;\n}\n\nexport default arrayReduce;\n","/**\n * The base implementation of `_.propertyOf` without support for deep paths.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Function} Returns the new accessor function.\n */\nfunction basePropertyOf(object) {\n return function(key) {\n return object == null ? undefined : object[key];\n };\n}\n\nexport default basePropertyOf;\n","import basePropertyOf from './_basePropertyOf.js';\n\n/** Used to map Latin Unicode letters to basic Latin letters. */\nvar deburredLetters = {\n // Latin-1 Supplement block.\n '\\xc0': 'A', '\\xc1': 'A', '\\xc2': 'A', '\\xc3': 'A', '\\xc4': 'A', '\\xc5': 'A',\n '\\xe0': 'a', '\\xe1': 'a', '\\xe2': 'a', '\\xe3': 'a', '\\xe4': 'a', '\\xe5': 'a',\n '\\xc7': 'C', '\\xe7': 'c',\n '\\xd0': 'D', '\\xf0': 'd',\n '\\xc8': 'E', '\\xc9': 'E', '\\xca': 'E', '\\xcb': 'E',\n '\\xe8': 'e', '\\xe9': 'e', '\\xea': 'e', '\\xeb': 'e',\n '\\xcc': 'I', '\\xcd': 'I', '\\xce': 'I', '\\xcf': 'I',\n '\\xec': 'i', '\\xed': 'i', '\\xee': 'i', '\\xef': 'i',\n '\\xd1': 'N', '\\xf1': 'n',\n '\\xd2': 'O', '\\xd3': 'O', '\\xd4': 'O', '\\xd5': 'O', '\\xd6': 'O', '\\xd8': 'O',\n '\\xf2': 'o', '\\xf3': 'o', '\\xf4': 'o', '\\xf5': 'o', '\\xf6': 'o', '\\xf8': 'o',\n '\\xd9': 'U', '\\xda': 'U', '\\xdb': 'U', '\\xdc': 'U',\n '\\xf9': 'u', '\\xfa': 'u', '\\xfb': 'u', '\\xfc': 'u',\n '\\xdd': 'Y', '\\xfd': 'y', '\\xff': 'y',\n '\\xc6': 'Ae', '\\xe6': 'ae',\n '\\xde': 'Th', '\\xfe': 'th',\n '\\xdf': 'ss',\n // Latin Extended-A block.\n '\\u0100': 'A', '\\u0102': 'A', '\\u0104': 'A',\n '\\u0101': 'a', '\\u0103': 'a', '\\u0105': 'a',\n '\\u0106': 'C', '\\u0108': 'C', '\\u010a': 'C', '\\u010c': 'C',\n '\\u0107': 'c', '\\u0109': 'c', '\\u010b': 'c', '\\u010d': 'c',\n '\\u010e': 'D', '\\u0110': 'D', '\\u010f': 'd', '\\u0111': 'd',\n '\\u0112': 'E', '\\u0114': 'E', '\\u0116': 'E', '\\u0118': 'E', '\\u011a': 'E',\n '\\u0113': 'e', '\\u0115': 'e', '\\u0117': 'e', '\\u0119': 'e', '\\u011b': 'e',\n '\\u011c': 'G', '\\u011e': 'G', '\\u0120': 'G', '\\u0122': 'G',\n '\\u011d': 'g', '\\u011f': 'g', '\\u0121': 'g', '\\u0123': 'g',\n '\\u0124': 'H', '\\u0126': 'H', '\\u0125': 'h', '\\u0127': 'h',\n '\\u0128': 'I', '\\u012a': 'I', '\\u012c': 'I', '\\u012e': 'I', '\\u0130': 'I',\n '\\u0129': 'i', '\\u012b': 'i', '\\u012d': 'i', '\\u012f': 'i', '\\u0131': 'i',\n '\\u0134': 'J', '\\u0135': 'j',\n '\\u0136': 'K', '\\u0137': 'k', '\\u0138': 'k',\n '\\u0139': 'L', '\\u013b': 'L', '\\u013d': 'L', '\\u013f': 'L', '\\u0141': 'L',\n '\\u013a': 'l', '\\u013c': 'l', '\\u013e': 'l', '\\u0140': 'l', '\\u0142': 'l',\n '\\u0143': 'N', '\\u0145': 'N', '\\u0147': 'N', '\\u014a': 'N',\n '\\u0144': 'n', '\\u0146': 'n', '\\u0148': 'n', '\\u014b': 'n',\n '\\u014c': 'O', '\\u014e': 'O', '\\u0150': 'O',\n '\\u014d': 'o', '\\u014f': 'o', '\\u0151': 'o',\n '\\u0154': 'R', '\\u0156': 'R', '\\u0158': 'R',\n '\\u0155': 'r', '\\u0157': 'r', '\\u0159': 'r',\n '\\u015a': 'S', '\\u015c': 'S', '\\u015e': 'S', '\\u0160': 'S',\n '\\u015b': 's', '\\u015d': 's', '\\u015f': 's', '\\u0161': 's',\n '\\u0162': 'T', '\\u0164': 'T', '\\u0166': 'T',\n '\\u0163': 't', '\\u0165': 't', '\\u0167': 't',\n '\\u0168': 'U', '\\u016a': 'U', '\\u016c': 'U', '\\u016e': 'U', '\\u0170': 'U', '\\u0172': 'U',\n '\\u0169': 'u', '\\u016b': 'u', '\\u016d': 'u', '\\u016f': 'u', '\\u0171': 'u', '\\u0173': 'u',\n '\\u0174': 'W', '\\u0175': 'w',\n '\\u0176': 'Y', '\\u0177': 'y', '\\u0178': 'Y',\n '\\u0179': 'Z', '\\u017b': 'Z', '\\u017d': 'Z',\n '\\u017a': 'z', '\\u017c': 'z', '\\u017e': 'z',\n '\\u0132': 'IJ', '\\u0133': 'ij',\n '\\u0152': 'Oe', '\\u0153': 'oe',\n '\\u0149': \"'n\", '\\u017f': 's'\n};\n\n/**\n * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A\n * letters to basic Latin letters.\n *\n * @private\n * @param {string} letter The matched letter to deburr.\n * @returns {string} Returns the deburred letter.\n */\nvar deburrLetter = basePropertyOf(deburredLetters);\n\nexport default deburrLetter;\n","import deburrLetter from './_deburrLetter.js';\nimport toString from './toString.js';\n\n/** Used to match Latin Unicode letters (excluding mathematical operators). */\nvar reLatin = /[\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\xff\\u0100-\\u017f]/g;\n\n/** Used to compose unicode character classes. */\nvar rsComboMarksRange = '\\\\u0300-\\\\u036f',\n reComboHalfMarksRange = '\\\\ufe20-\\\\ufe2f',\n rsComboSymbolsRange = '\\\\u20d0-\\\\u20ff',\n rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange;\n\n/** Used to compose unicode capture groups. */\nvar rsCombo = '[' + rsComboRange + ']';\n\n/**\n * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and\n * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols).\n */\nvar reComboMark = RegExp(rsCombo, 'g');\n\n/**\n * Deburrs `string` by converting\n * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)\n * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A)\n * letters to basic Latin letters and removing\n * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to deburr.\n * @returns {string} Returns the deburred string.\n * @example\n *\n * _.deburr('déjà vu');\n * // => 'deja vu'\n */\nfunction deburr(string) {\n string = toString(string);\n return string && string.replace(reLatin, deburrLetter).replace(reComboMark, '');\n}\n\nexport default deburr;\n","/** Used to match words composed of alphanumeric characters. */\nvar reAsciiWord = /[^\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\x7f]+/g;\n\n/**\n * Splits an ASCII `string` into an array of its words.\n *\n * @private\n * @param {string} The string to inspect.\n * @returns {Array} Returns the words of `string`.\n */\nfunction asciiWords(string) {\n return string.match(reAsciiWord) || [];\n}\n\nexport default asciiWords;\n","/** Used to detect strings that need a more robust regexp to match words. */\nvar reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;\n\n/**\n * Checks if `string` contains a word composed of Unicode symbols.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {boolean} Returns `true` if a word is found, else `false`.\n */\nfunction hasUnicodeWord(string) {\n return reHasUnicodeWord.test(string);\n}\n\nexport default hasUnicodeWord;\n","/** Used to compose unicode character classes. */\nvar rsAstralRange = '\\\\ud800-\\\\udfff',\n rsComboMarksRange = '\\\\u0300-\\\\u036f',\n reComboHalfMarksRange = '\\\\ufe20-\\\\ufe2f',\n rsComboSymbolsRange = '\\\\u20d0-\\\\u20ff',\n rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,\n rsDingbatRange = '\\\\u2700-\\\\u27bf',\n rsLowerRange = 'a-z\\\\xdf-\\\\xf6\\\\xf8-\\\\xff',\n rsMathOpRange = '\\\\xac\\\\xb1\\\\xd7\\\\xf7',\n rsNonCharRange = '\\\\x00-\\\\x2f\\\\x3a-\\\\x40\\\\x5b-\\\\x60\\\\x7b-\\\\xbf',\n rsPunctuationRange = '\\\\u2000-\\\\u206f',\n rsSpaceRange = ' \\\\t\\\\x0b\\\\f\\\\xa0\\\\ufeff\\\\n\\\\r\\\\u2028\\\\u2029\\\\u1680\\\\u180e\\\\u2000\\\\u2001\\\\u2002\\\\u2003\\\\u2004\\\\u2005\\\\u2006\\\\u2007\\\\u2008\\\\u2009\\\\u200a\\\\u202f\\\\u205f\\\\u3000',\n rsUpperRange = 'A-Z\\\\xc0-\\\\xd6\\\\xd8-\\\\xde',\n rsVarRange = '\\\\ufe0e\\\\ufe0f',\n rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;\n\n/** Used to compose unicode capture groups. */\nvar rsApos = \"['\\u2019]\",\n rsBreak = '[' + rsBreakRange + ']',\n rsCombo = '[' + rsComboRange + ']',\n rsDigits = '\\\\d+',\n rsDingbat = '[' + rsDingbatRange + ']',\n rsLower = '[' + rsLowerRange + ']',\n rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']',\n rsFitz = '\\\\ud83c[\\\\udffb-\\\\udfff]',\n rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',\n rsNonAstral = '[^' + rsAstralRange + ']',\n rsRegional = '(?:\\\\ud83c[\\\\udde6-\\\\uddff]){2}',\n rsSurrPair = '[\\\\ud800-\\\\udbff][\\\\udc00-\\\\udfff]',\n rsUpper = '[' + rsUpperRange + ']',\n rsZWJ = '\\\\u200d';\n\n/** Used to compose unicode regexes. */\nvar rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')',\n rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')',\n rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?',\n rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?',\n reOptMod = rsModifier + '?',\n rsOptVar = '[' + rsVarRange + ']?',\n rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',\n rsOrdLower = '\\\\d*(?:1st|2nd|3rd|(?![123])\\\\dth)(?=\\\\b|[A-Z_])',\n rsOrdUpper = '\\\\d*(?:1ST|2ND|3RD|(?![123])\\\\dTH)(?=\\\\b|[a-z_])',\n rsSeq = rsOptVar + reOptMod + rsOptJoin,\n rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq;\n\n/** Used to match complex or compound words. */\nvar reUnicodeWord = RegExp([\n rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')',\n rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')',\n rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower,\n rsUpper + '+' + rsOptContrUpper,\n rsOrdUpper,\n rsOrdLower,\n rsDigits,\n rsEmoji\n].join('|'), 'g');\n\n/**\n * Splits a Unicode `string` into an array of its words.\n *\n * @private\n * @param {string} The string to inspect.\n * @returns {Array} Returns the words of `string`.\n */\nfunction unicodeWords(string) {\n return string.match(reUnicodeWord) || [];\n}\n\nexport default unicodeWords;\n","import asciiWords from './_asciiWords.js';\nimport hasUnicodeWord from './_hasUnicodeWord.js';\nimport toString from './toString.js';\nimport unicodeWords from './_unicodeWords.js';\n\n/**\n * Splits `string` into an array of its words.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to inspect.\n * @param {RegExp|string} [pattern] The pattern to match words.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the words of `string`.\n * @example\n *\n * _.words('fred, barney, & pebbles');\n * // => ['fred', 'barney', 'pebbles']\n *\n * _.words('fred, barney, & pebbles', /[^, ]+/g);\n * // => ['fred', 'barney', '&', 'pebbles']\n */\nfunction words(string, pattern, guard) {\n string = toString(string);\n pattern = guard ? undefined : pattern;\n\n if (pattern === undefined) {\n return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string);\n }\n return string.match(pattern) || [];\n}\n\nexport default words;\n","import arrayReduce from './_arrayReduce.js';\nimport deburr from './deburr.js';\nimport words from './words.js';\n\n/** Used to compose unicode capture groups. */\nvar rsApos = \"['\\u2019]\";\n\n/** Used to match apostrophes. */\nvar reApos = RegExp(rsApos, 'g');\n\n/**\n * Creates a function like `_.camelCase`.\n *\n * @private\n * @param {Function} callback The function to combine each word.\n * @returns {Function} Returns the new compounder function.\n */\nfunction createCompounder(callback) {\n return function(string) {\n return arrayReduce(words(deburr(string).replace(reApos, '')), callback, '');\n };\n}\n\nexport default createCompounder;\n","/**\n * The base implementation of `_.clamp` which doesn't coerce arguments.\n *\n * @private\n * @param {number} number The number to clamp.\n * @param {number} [lower] The lower bound.\n * @param {number} upper The upper bound.\n * @returns {number} Returns the clamped number.\n */\nfunction baseClamp(number, lower, upper) {\n if (number === number) {\n if (upper !== undefined) {\n number = number <= upper ? number : upper;\n }\n if (lower !== undefined) {\n number = number >= lower ? number : lower;\n }\n }\n return number;\n}\n\nexport default baseClamp;\n","import baseClamp from './_baseClamp.js';\nimport toNumber from './toNumber.js';\n\n/**\n * Clamps `number` within the inclusive `lower` and `upper` bounds.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Number\n * @param {number} number The number to clamp.\n * @param {number} [lower] The lower bound.\n * @param {number} upper The upper bound.\n * @returns {number} Returns the clamped number.\n * @example\n *\n * _.clamp(-10, -5, 5);\n * // => -5\n *\n * _.clamp(10, -5, 5);\n * // => 5\n */\nfunction clamp(number, lower, upper) {\n if (upper === undefined) {\n upper = lower;\n lower = undefined;\n }\n if (upper !== undefined) {\n upper = toNumber(upper);\n upper = upper === upper ? upper : 0;\n }\n if (lower !== undefined) {\n lower = toNumber(lower);\n lower = lower === lower ? lower : 0;\n }\n return baseClamp(toNumber(number), lower, upper);\n}\n\nexport default clamp;\n","/** Error message constants. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/**\n * The base implementation of `_.delay` and `_.defer` which accepts `args`\n * to provide to `func`.\n *\n * @private\n * @param {Function} func The function to delay.\n * @param {number} wait The number of milliseconds to delay invocation.\n * @param {Array} args The arguments to provide to `func`.\n * @returns {number|Object} Returns the timer id or timeout object.\n */\nfunction baseDelay(func, wait, args) {\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n return setTimeout(function() { func.apply(undefined, args); }, wait);\n}\n\nexport default baseDelay;\n","import baseDelay from './_baseDelay.js';\nimport baseRest from './_baseRest.js';\nimport toNumber from './toNumber.js';\n\n/**\n * Invokes `func` after `wait` milliseconds. Any additional arguments are\n * provided to `func` when it's invoked.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to delay.\n * @param {number} wait The number of milliseconds to delay invocation.\n * @param {...*} [args] The arguments to invoke `func` with.\n * @returns {number} Returns the timer id.\n * @example\n *\n * _.delay(function(text) {\n * console.log(text);\n * }, 1000, 'later');\n * // => Logs 'later' after one second.\n */\nvar delay = baseRest(function(func, wait, args) {\n return baseDelay(func, toNumber(wait) || 0, args);\n});\n\nexport default delay;\n","import baseEach from './_baseEach.js';\nimport isArrayLike from './isArrayLike.js';\n\n/**\n * The base implementation of `_.map` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n */\nfunction baseMap(collection, iteratee) {\n var index = -1,\n result = isArrayLike(collection) ? Array(collection.length) : [];\n\n baseEach(collection, function(value, key, collection) {\n result[++index] = iteratee(value, key, collection);\n });\n return result;\n}\n\nexport default baseMap;\n","import arrayMap from './_arrayMap.js';\nimport baseIteratee from './_baseIteratee.js';\nimport baseMap from './_baseMap.js';\nimport isArray from './isArray.js';\n\n/**\n * Creates an array of values by running each element in `collection` thru\n * `iteratee`. The iteratee is invoked with three arguments:\n * (value, index|key, collection).\n *\n * Many lodash methods are guarded to work as iteratees for methods like\n * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.\n *\n * The guarded methods are:\n * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`,\n * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`,\n * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`,\n * `template`, `trim`, `trimEnd`, `trimStart`, and `words`\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n * @example\n *\n * function square(n) {\n * return n * n;\n * }\n *\n * _.map([4, 8], square);\n * // => [16, 64]\n *\n * _.map({ 'a': 4, 'b': 8 }, square);\n * // => [16, 64] (iteration order is not guaranteed)\n *\n * var users = [\n * { 'user': 'barney' },\n * { 'user': 'fred' }\n * ];\n *\n * // The `_.property` iteratee shorthand.\n * _.map(users, 'user');\n * // => ['barney', 'fred']\n */\nfunction map(collection, iteratee) {\n var func = isArray(collection) ? arrayMap : baseMap;\n return func(collection, baseIteratee(iteratee, 3));\n}\n\nexport default map;\n","import baseFlatten from './_baseFlatten.js';\nimport map from './map.js';\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0;\n\n/**\n * This method is like `_.flatMap` except that it recursively flattens the\n * mapped results.\n *\n * @static\n * @memberOf _\n * @since 4.7.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * function duplicate(n) {\n * return [[[n, n]]];\n * }\n *\n * _.flatMapDeep([1, 2], duplicate);\n * // => [1, 1, 2, 2]\n */\nfunction flatMapDeep(collection, iteratee) {\n return baseFlatten(map(collection, iteratee), INFINITY);\n}\n\nexport default flatMapDeep;\n","import baseIsEqual from './_baseIsEqual.js';\n\n/**\n * Performs a deep comparison between two values to determine if they are\n * equivalent.\n *\n * **Note:** This method supports comparing arrays, array buffers, booleans,\n * date objects, error objects, maps, numbers, `Object` objects, regexes,\n * sets, strings, symbols, and typed arrays. `Object` objects are compared\n * by their own, not inherited, enumerable properties. Functions and DOM\n * nodes are compared by strict equality, i.e. `===`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.isEqual(object, other);\n * // => true\n *\n * object === other;\n * // => false\n */\nfunction isEqual(value, other) {\n return baseIsEqual(value, other);\n}\n\nexport default isEqual;\n","import createCompounder from './_createCompounder.js';\n\n/**\n * Converts `string` to\n * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the kebab cased string.\n * @example\n *\n * _.kebabCase('Foo Bar');\n * // => 'foo-bar'\n *\n * _.kebabCase('fooBar');\n * // => 'foo-bar'\n *\n * _.kebabCase('__FOO_BAR__');\n * // => 'foo-bar'\n */\nvar kebabCase = createCompounder(function(result, word, index) {\n return result + (index ? '-' : '') + word.toLowerCase();\n});\n\nexport default kebabCase;\n","import baseEach from './_baseEach.js';\n\n/**\n * The base implementation of `_.some` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n * else `false`.\n */\nfunction baseSome(collection, predicate) {\n var result;\n\n baseEach(collection, function(value, index, collection) {\n result = predicate(value, index, collection);\n return !result;\n });\n return !!result;\n}\n\nexport default baseSome;\n","import arraySome from './_arraySome.js';\nimport baseIteratee from './_baseIteratee.js';\nimport baseSome from './_baseSome.js';\nimport isArray from './isArray.js';\nimport isIterateeCall from './_isIterateeCall.js';\n\n/**\n * Checks if `predicate` returns truthy for **any** element of `collection`.\n * Iteration is stopped once `predicate` returns truthy. The predicate is\n * invoked with three arguments: (value, index|key, collection).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n * else `false`.\n * @example\n *\n * _.some([null, 0, 'yes', false], Boolean);\n * // => true\n *\n * var users = [\n * { 'user': 'barney', 'active': true },\n * { 'user': 'fred', 'active': false }\n * ];\n *\n * // The `_.matches` iteratee shorthand.\n * _.some(users, { 'user': 'barney', 'active': false });\n * // => false\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.some(users, ['active', false]);\n * // => true\n *\n * // The `_.property` iteratee shorthand.\n * _.some(users, 'active');\n * // => true\n */\nfunction some(collection, predicate, guard) {\n var func = isArray(collection) ? arraySome : baseSome;\n if (guard && isIterateeCall(collection, predicate, guard)) {\n predicate = undefined;\n }\n return func(collection, baseIteratee(predicate, 3));\n}\n\nexport default some;\n","// https://github.com/python/cpython/blob/a74eea238f5baba15797e2e8b570d153bc8690a7/Modules/mathmodule.c#L1423\nexport class Adder {\n constructor() {\n this._partials = new Float64Array(32);\n this._n = 0;\n }\n add(x) {\n const p = this._partials;\n let i = 0;\n for (let j = 0; j < this._n && j < 32; j++) {\n const y = p[j],\n hi = x + y,\n lo = Math.abs(x) < Math.abs(y) ? x - (hi - y) : y - (hi - x);\n if (lo) p[i++] = lo;\n x = hi;\n }\n p[i] = x;\n this._n = i + 1;\n return this;\n }\n valueOf() {\n const p = this._partials;\n let n = this._n, x, y, lo, hi = 0;\n if (n > 0) {\n hi = p[--n];\n while (n > 0) {\n x = hi;\n y = p[--n];\n hi = x + y;\n lo = y - (hi - x);\n if (lo) break;\n }\n if (n > 0 && ((lo < 0 && p[n - 1] < 0) || (lo > 0 && p[n - 1] > 0))) {\n y = lo * 2;\n x = hi + y;\n if (y == x - hi) hi = x;\n }\n }\n return hi;\n }\n}\n\nexport function fsum(values, valueof) {\n const adder = new Adder();\n if (valueof === undefined) {\n for (let value of values) {\n if (value = +value) {\n adder.add(value);\n }\n }\n } else {\n let index = -1;\n for (let value of values) {\n if (value = +valueof(value, ++index, values)) {\n adder.add(value);\n }\n }\n }\n return +adder;\n}\n\nexport function fcumsum(values, valueof) {\n const adder = new Adder();\n let index = -1;\n return Float64Array.from(values, valueof === undefined\n ? v => adder.add(+v || 0)\n : v => adder.add(+valueof(v, ++index, values) || 0)\n );\n}\n","function* flatten(arrays) {\n for (const array of arrays) {\n yield* array;\n }\n}\n\nexport default function merge(arrays) {\n return Array.from(flatten(arrays));\n}\n","export default function(x) {\n return x;\n}\n","import identity from \"./identity.js\";\n\nvar top = 1,\n right = 2,\n bottom = 3,\n left = 4,\n epsilon = 1e-6;\n\nfunction translateX(x) {\n return \"translate(\" + x + \",0)\";\n}\n\nfunction translateY(y) {\n return \"translate(0,\" + y + \")\";\n}\n\nfunction number(scale) {\n return d => +scale(d);\n}\n\nfunction center(scale, offset) {\n offset = Math.max(0, scale.bandwidth() - offset * 2) / 2;\n if (scale.round()) offset = Math.round(offset);\n return d => +scale(d) + offset;\n}\n\nfunction entering() {\n return !this.__axis;\n}\n\nfunction axis(orient, scale) {\n var tickArguments = [],\n tickValues = null,\n tickFormat = null,\n tickSizeInner = 6,\n tickSizeOuter = 6,\n tickPadding = 3,\n offset = typeof window !== \"undefined\" && window.devicePixelRatio > 1 ? 0 : 0.5,\n k = orient === top || orient === left ? -1 : 1,\n x = orient === left || orient === right ? \"x\" : \"y\",\n transform = orient === top || orient === bottom ? translateX : translateY;\n\n function axis(context) {\n var values = tickValues == null ? (scale.ticks ? scale.ticks.apply(scale, tickArguments) : scale.domain()) : tickValues,\n format = tickFormat == null ? (scale.tickFormat ? scale.tickFormat.apply(scale, tickArguments) : identity) : tickFormat,\n spacing = Math.max(tickSizeInner, 0) + tickPadding,\n range = scale.range(),\n range0 = +range[0] + offset,\n range1 = +range[range.length - 1] + offset,\n position = (scale.bandwidth ? center : number)(scale.copy(), offset),\n selection = context.selection ? context.selection() : context,\n path = selection.selectAll(\".domain\").data([null]),\n tick = selection.selectAll(\".tick\").data(values, scale).order(),\n tickExit = tick.exit(),\n tickEnter = tick.enter().append(\"g\").attr(\"class\", \"tick\"),\n line = tick.select(\"line\"),\n text = tick.select(\"text\");\n\n path = path.merge(path.enter().insert(\"path\", \".tick\")\n .attr(\"class\", \"domain\")\n .attr(\"stroke\", \"currentColor\"));\n\n tick = tick.merge(tickEnter);\n\n line = line.merge(tickEnter.append(\"line\")\n .attr(\"stroke\", \"currentColor\")\n .attr(x + \"2\", k * tickSizeInner));\n\n text = text.merge(tickEnter.append(\"text\")\n .attr(\"fill\", \"currentColor\")\n .attr(x, k * spacing)\n .attr(\"dy\", orient === top ? \"0em\" : orient === bottom ? \"0.71em\" : \"0.32em\"));\n\n if (context !== selection) {\n path = path.transition(context);\n tick = tick.transition(context);\n line = line.transition(context);\n text = text.transition(context);\n\n tickExit = tickExit.transition(context)\n .attr(\"opacity\", epsilon)\n .attr(\"transform\", function(d) { return isFinite(d = position(d)) ? transform(d + offset) : this.getAttribute(\"transform\"); });\n\n tickEnter\n .attr(\"opacity\", epsilon)\n .attr(\"transform\", function(d) { var p = this.parentNode.__axis; return transform((p && isFinite(p = p(d)) ? p : position(d)) + offset); });\n }\n\n tickExit.remove();\n\n path\n .attr(\"d\", orient === left || orient === right\n ? (tickSizeOuter ? \"M\" + k * tickSizeOuter + \",\" + range0 + \"H\" + offset + \"V\" + range1 + \"H\" + k * tickSizeOuter : \"M\" + offset + \",\" + range0 + \"V\" + range1)\n : (tickSizeOuter ? \"M\" + range0 + \",\" + k * tickSizeOuter + \"V\" + offset + \"H\" + range1 + \"V\" + k * tickSizeOuter : \"M\" + range0 + \",\" + offset + \"H\" + range1));\n\n tick\n .attr(\"opacity\", 1)\n .attr(\"transform\", function(d) { return transform(position(d) + offset); });\n\n line\n .attr(x + \"2\", k * tickSizeInner);\n\n text\n .attr(x, k * spacing)\n .text(format);\n\n selection.filter(entering)\n .attr(\"fill\", \"none\")\n .attr(\"font-size\", 10)\n .attr(\"font-family\", \"sans-serif\")\n .attr(\"text-anchor\", orient === right ? \"start\" : orient === left ? \"end\" : \"middle\");\n\n selection\n .each(function() { this.__axis = position; });\n }\n\n axis.scale = function(_) {\n return arguments.length ? (scale = _, axis) : scale;\n };\n\n axis.ticks = function() {\n return tickArguments = Array.from(arguments), axis;\n };\n\n axis.tickArguments = function(_) {\n return arguments.length ? (tickArguments = _ == null ? [] : Array.from(_), axis) : tickArguments.slice();\n };\n\n axis.tickValues = function(_) {\n return arguments.length ? (tickValues = _ == null ? null : Array.from(_), axis) : tickValues && tickValues.slice();\n };\n\n axis.tickFormat = function(_) {\n return arguments.length ? (tickFormat = _, axis) : tickFormat;\n };\n\n axis.tickSize = function(_) {\n return arguments.length ? (tickSizeInner = tickSizeOuter = +_, axis) : tickSizeInner;\n };\n\n axis.tickSizeInner = function(_) {\n return arguments.length ? (tickSizeInner = +_, axis) : tickSizeInner;\n };\n\n axis.tickSizeOuter = function(_) {\n return arguments.length ? (tickSizeOuter = +_, axis) : tickSizeOuter;\n };\n\n axis.tickPadding = function(_) {\n return arguments.length ? (tickPadding = +_, axis) : tickPadding;\n };\n\n axis.offset = function(_) {\n return arguments.length ? (offset = +_, axis) : offset;\n };\n\n return axis;\n}\n\nexport function axisTop(scale) {\n return axis(top, scale);\n}\n\nexport function axisRight(scale) {\n return axis(right, scale);\n}\n\nexport function axisBottom(scale) {\n return axis(bottom, scale);\n}\n\nexport function axisLeft(scale) {\n return axis(left, scale);\n}\n","// These are typically used in conjunction with noevent to ensure that we can\n// preventDefault on the event.\nexport const nonpassive = {passive: false};\nexport const nonpassivecapture = {capture: true, passive: false};\n\nexport function nopropagation(event) {\n event.stopImmediatePropagation();\n}\n\nexport default function(event) {\n event.preventDefault();\n event.stopImmediatePropagation();\n}\n","import {select} from \"d3-selection\";\nimport noevent, {nonpassivecapture} from \"./noevent.js\";\n\nexport default function(view) {\n var root = view.document.documentElement,\n selection = select(view).on(\"dragstart.drag\", noevent, nonpassivecapture);\n if (\"onselectstart\" in root) {\n selection.on(\"selectstart.drag\", noevent, nonpassivecapture);\n } else {\n root.__noselect = root.style.MozUserSelect;\n root.style.MozUserSelect = \"none\";\n }\n}\n\nexport function yesdrag(view, noclick) {\n var root = view.document.documentElement,\n selection = select(view).on(\"dragstart.drag\", null);\n if (noclick) {\n selection.on(\"click.drag\", noevent, nonpassivecapture);\n setTimeout(function() { selection.on(\"click.drag\", null); }, 0);\n }\n if (\"onselectstart\" in root) {\n selection.on(\"selectstart.drag\", null);\n } else {\n root.style.MozUserSelect = root.__noselect;\n delete root.__noselect;\n }\n}\n","export default function(interpolator, n) {\n var samples = new Array(n);\n for (var i = 0; i < n; ++i) samples[i] = interpolator(i / (n - 1));\n return samples;\n}\n","export const linear = t => +t;\n","export default x => () => x;\n","export default function BrushEvent(type, {\n sourceEvent,\n target,\n selection,\n mode,\n dispatch\n}) {\n Object.defineProperties(this, {\n type: {value: type, enumerable: true, configurable: true},\n sourceEvent: {value: sourceEvent, enumerable: true, configurable: true},\n target: {value: target, enumerable: true, configurable: true},\n selection: {value: selection, enumerable: true, configurable: true},\n mode: {value: mode, enumerable: true, configurable: true},\n _: {value: dispatch}\n });\n}\n","export function nopropagation(event) {\n event.stopImmediatePropagation();\n}\n\nexport default function(event) {\n event.preventDefault();\n event.stopImmediatePropagation();\n}\n","import {dispatch} from \"d3-dispatch\";\nimport {dragDisable, dragEnable} from \"d3-drag\";\nimport {interpolate} from \"d3-interpolate\";\nimport {pointer, select} from \"d3-selection\";\nimport {interrupt} from \"d3-transition\";\nimport constant from \"./constant.js\";\nimport BrushEvent from \"./event.js\";\nimport noevent, {nopropagation} from \"./noevent.js\";\n\nvar MODE_DRAG = {name: \"drag\"},\n MODE_SPACE = {name: \"space\"},\n MODE_HANDLE = {name: \"handle\"},\n MODE_CENTER = {name: \"center\"};\n\nconst {abs, max, min} = Math;\n\nfunction number1(e) {\n return [+e[0], +e[1]];\n}\n\nfunction number2(e) {\n return [number1(e[0]), number1(e[1])];\n}\n\nvar X = {\n name: \"x\",\n handles: [\"w\", \"e\"].map(type),\n input: function(x, e) { return x == null ? null : [[+x[0], e[0][1]], [+x[1], e[1][1]]]; },\n output: function(xy) { return xy && [xy[0][0], xy[1][0]]; }\n};\n\nvar Y = {\n name: \"y\",\n handles: [\"n\", \"s\"].map(type),\n input: function(y, e) { return y == null ? null : [[e[0][0], +y[0]], [e[1][0], +y[1]]]; },\n output: function(xy) { return xy && [xy[0][1], xy[1][1]]; }\n};\n\nvar XY = {\n name: \"xy\",\n handles: [\"n\", \"w\", \"e\", \"s\", \"nw\", \"ne\", \"sw\", \"se\"].map(type),\n input: function(xy) { return xy == null ? null : number2(xy); },\n output: function(xy) { return xy; }\n};\n\nvar cursors = {\n overlay: \"crosshair\",\n selection: \"move\",\n n: \"ns-resize\",\n e: \"ew-resize\",\n s: \"ns-resize\",\n w: \"ew-resize\",\n nw: \"nwse-resize\",\n ne: \"nesw-resize\",\n se: \"nwse-resize\",\n sw: \"nesw-resize\"\n};\n\nvar flipX = {\n e: \"w\",\n w: \"e\",\n nw: \"ne\",\n ne: \"nw\",\n se: \"sw\",\n sw: \"se\"\n};\n\nvar flipY = {\n n: \"s\",\n s: \"n\",\n nw: \"sw\",\n ne: \"se\",\n se: \"ne\",\n sw: \"nw\"\n};\n\nvar signsX = {\n overlay: +1,\n selection: +1,\n n: null,\n e: +1,\n s: null,\n w: -1,\n nw: -1,\n ne: +1,\n se: +1,\n sw: -1\n};\n\nvar signsY = {\n overlay: +1,\n selection: +1,\n n: -1,\n e: null,\n s: +1,\n w: null,\n nw: -1,\n ne: -1,\n se: +1,\n sw: +1\n};\n\nfunction type(t) {\n return {type: t};\n}\n\n// Ignore right-click, since that should open the context menu.\nfunction defaultFilter(event) {\n return !event.ctrlKey && !event.button;\n}\n\nfunction defaultExtent() {\n var svg = this.ownerSVGElement || this;\n if (svg.hasAttribute(\"viewBox\")) {\n svg = svg.viewBox.baseVal;\n return [[svg.x, svg.y], [svg.x + svg.width, svg.y + svg.height]];\n }\n return [[0, 0], [svg.width.baseVal.value, svg.height.baseVal.value]];\n}\n\nfunction defaultTouchable() {\n return navigator.maxTouchPoints || (\"ontouchstart\" in this);\n}\n\n// Like d3.local, but with the name “__brush” rather than auto-generated.\nfunction local(node) {\n while (!node.__brush) if (!(node = node.parentNode)) return;\n return node.__brush;\n}\n\nfunction empty(extent) {\n return extent[0][0] === extent[1][0]\n || extent[0][1] === extent[1][1];\n}\n\nexport function brushSelection(node) {\n var state = node.__brush;\n return state ? state.dim.output(state.selection) : null;\n}\n\nexport function brushX() {\n return brush(X);\n}\n\nexport function brushY() {\n return brush(Y);\n}\n\nexport default function() {\n return brush(XY);\n}\n\nfunction brush(dim) {\n var extent = defaultExtent,\n filter = defaultFilter,\n touchable = defaultTouchable,\n keys = true,\n listeners = dispatch(\"start\", \"brush\", \"end\"),\n handleSize = 6,\n touchending;\n\n function brush(group) {\n var overlay = group\n .property(\"__brush\", initialize)\n .selectAll(\".overlay\")\n .data([type(\"overlay\")]);\n\n overlay.enter().append(\"rect\")\n .attr(\"class\", \"overlay\")\n .attr(\"pointer-events\", \"all\")\n .attr(\"cursor\", cursors.overlay)\n .merge(overlay)\n .each(function() {\n var extent = local(this).extent;\n select(this)\n .attr(\"x\", extent[0][0])\n .attr(\"y\", extent[0][1])\n .attr(\"width\", extent[1][0] - extent[0][0])\n .attr(\"height\", extent[1][1] - extent[0][1]);\n });\n\n group.selectAll(\".selection\")\n .data([type(\"selection\")])\n .enter().append(\"rect\")\n .attr(\"class\", \"selection\")\n .attr(\"cursor\", cursors.selection)\n .attr(\"fill\", \"#777\")\n .attr(\"fill-opacity\", 0.3)\n .attr(\"stroke\", \"#fff\")\n .attr(\"shape-rendering\", \"crispEdges\");\n\n var handle = group.selectAll(\".handle\")\n .data(dim.handles, function(d) { return d.type; });\n\n handle.exit().remove();\n\n handle.enter().append(\"rect\")\n .attr(\"class\", function(d) { return \"handle handle--\" + d.type; })\n .attr(\"cursor\", function(d) { return cursors[d.type]; });\n\n group\n .each(redraw)\n .attr(\"fill\", \"none\")\n .attr(\"pointer-events\", \"all\")\n .on(\"mousedown.brush\", started)\n .filter(touchable)\n .on(\"touchstart.brush\", started)\n .on(\"touchmove.brush\", touchmoved)\n .on(\"touchend.brush touchcancel.brush\", touchended)\n .style(\"touch-action\", \"none\")\n .style(\"-webkit-tap-highlight-color\", \"rgba(0,0,0,0)\");\n }\n\n brush.move = function(group, selection, event) {\n if (group.tween) {\n group\n .on(\"start.brush\", function(event) { emitter(this, arguments).beforestart().start(event); })\n .on(\"interrupt.brush end.brush\", function(event) { emitter(this, arguments).end(event); })\n .tween(\"brush\", function() {\n var that = this,\n state = that.__brush,\n emit = emitter(that, arguments),\n selection0 = state.selection,\n selection1 = dim.input(typeof selection === \"function\" ? selection.apply(this, arguments) : selection, state.extent),\n i = interpolate(selection0, selection1);\n\n function tween(t) {\n state.selection = t === 1 && selection1 === null ? null : i(t);\n redraw.call(that);\n emit.brush();\n }\n\n return selection0 !== null && selection1 !== null ? tween : tween(1);\n });\n } else {\n group\n .each(function() {\n var that = this,\n args = arguments,\n state = that.__brush,\n selection1 = dim.input(typeof selection === \"function\" ? selection.apply(that, args) : selection, state.extent),\n emit = emitter(that, args).beforestart();\n\n interrupt(that);\n state.selection = selection1 === null ? null : selection1;\n redraw.call(that);\n emit.start(event).brush(event).end(event);\n });\n }\n };\n\n brush.clear = function(group, event) {\n brush.move(group, null, event);\n };\n\n function redraw() {\n var group = select(this),\n selection = local(this).selection;\n\n if (selection) {\n group.selectAll(\".selection\")\n .style(\"display\", null)\n .attr(\"x\", selection[0][0])\n .attr(\"y\", selection[0][1])\n .attr(\"width\", selection[1][0] - selection[0][0])\n .attr(\"height\", selection[1][1] - selection[0][1]);\n\n group.selectAll(\".handle\")\n .style(\"display\", null)\n .attr(\"x\", function(d) { return d.type[d.type.length - 1] === \"e\" ? selection[1][0] - handleSize / 2 : selection[0][0] - handleSize / 2; })\n .attr(\"y\", function(d) { return d.type[0] === \"s\" ? selection[1][1] - handleSize / 2 : selection[0][1] - handleSize / 2; })\n .attr(\"width\", function(d) { return d.type === \"n\" || d.type === \"s\" ? selection[1][0] - selection[0][0] + handleSize : handleSize; })\n .attr(\"height\", function(d) { return d.type === \"e\" || d.type === \"w\" ? selection[1][1] - selection[0][1] + handleSize : handleSize; });\n }\n\n else {\n group.selectAll(\".selection,.handle\")\n .style(\"display\", \"none\")\n .attr(\"x\", null)\n .attr(\"y\", null)\n .attr(\"width\", null)\n .attr(\"height\", null);\n }\n }\n\n function emitter(that, args, clean) {\n var emit = that.__brush.emitter;\n return emit && (!clean || !emit.clean) ? emit : new Emitter(that, args, clean);\n }\n\n function Emitter(that, args, clean) {\n this.that = that;\n this.args = args;\n this.state = that.__brush;\n this.active = 0;\n this.clean = clean;\n }\n\n Emitter.prototype = {\n beforestart: function() {\n if (++this.active === 1) this.state.emitter = this, this.starting = true;\n return this;\n },\n start: function(event, mode) {\n if (this.starting) this.starting = false, this.emit(\"start\", event, mode);\n else this.emit(\"brush\", event);\n return this;\n },\n brush: function(event, mode) {\n this.emit(\"brush\", event, mode);\n return this;\n },\n end: function(event, mode) {\n if (--this.active === 0) delete this.state.emitter, this.emit(\"end\", event, mode);\n return this;\n },\n emit: function(type, event, mode) {\n var d = select(this.that).datum();\n listeners.call(\n type,\n this.that,\n new BrushEvent(type, {\n sourceEvent: event,\n target: brush,\n selection: dim.output(this.state.selection),\n mode,\n dispatch: listeners\n }),\n d\n );\n }\n };\n\n function started(event) {\n if (touchending && !event.touches) return;\n if (!filter.apply(this, arguments)) return;\n\n var that = this,\n type = event.target.__data__.type,\n mode = (keys && event.metaKey ? type = \"overlay\" : type) === \"selection\" ? MODE_DRAG : (keys && event.altKey ? MODE_CENTER : MODE_HANDLE),\n signX = dim === Y ? null : signsX[type],\n signY = dim === X ? null : signsY[type],\n state = local(that),\n extent = state.extent,\n selection = state.selection,\n W = extent[0][0], w0, w1,\n N = extent[0][1], n0, n1,\n E = extent[1][0], e0, e1,\n S = extent[1][1], s0, s1,\n dx = 0,\n dy = 0,\n moving,\n shifting = signX && signY && keys && event.shiftKey,\n lockX,\n lockY,\n points = Array.from(event.touches || [event], t => {\n const i = t.identifier;\n t = pointer(t, that);\n t.point0 = t.slice();\n t.identifier = i;\n return t;\n });\n\n interrupt(that);\n var emit = emitter(that, arguments, true).beforestart();\n\n if (type === \"overlay\") {\n if (selection) moving = true;\n const pts = [points[0], points[1] || points[0]];\n state.selection = selection = [[\n w0 = dim === Y ? W : min(pts[0][0], pts[1][0]),\n n0 = dim === X ? N : min(pts[0][1], pts[1][1])\n ], [\n e0 = dim === Y ? E : max(pts[0][0], pts[1][0]),\n s0 = dim === X ? S : max(pts[0][1], pts[1][1])\n ]];\n if (points.length > 1) move(event);\n } else {\n w0 = selection[0][0];\n n0 = selection[0][1];\n e0 = selection[1][0];\n s0 = selection[1][1];\n }\n\n w1 = w0;\n n1 = n0;\n e1 = e0;\n s1 = s0;\n\n var group = select(that)\n .attr(\"pointer-events\", \"none\");\n\n var overlay = group.selectAll(\".overlay\")\n .attr(\"cursor\", cursors[type]);\n\n if (event.touches) {\n emit.moved = moved;\n emit.ended = ended;\n } else {\n var view = select(event.view)\n .on(\"mousemove.brush\", moved, true)\n .on(\"mouseup.brush\", ended, true);\n if (keys) view\n .on(\"keydown.brush\", keydowned, true)\n .on(\"keyup.brush\", keyupped, true)\n\n dragDisable(event.view);\n }\n\n redraw.call(that);\n emit.start(event, mode.name);\n\n function moved(event) {\n for (const p of event.changedTouches || [event]) {\n for (const d of points)\n if (d.identifier === p.identifier) d.cur = pointer(p, that);\n }\n if (shifting && !lockX && !lockY && points.length === 1) {\n const point = points[0];\n if (abs(point.cur[0] - point[0]) > abs(point.cur[1] - point[1]))\n lockY = true;\n else\n lockX = true;\n }\n for (const point of points)\n if (point.cur) point[0] = point.cur[0], point[1] = point.cur[1];\n moving = true;\n noevent(event);\n move(event);\n }\n\n function move(event) {\n const point = points[0], point0 = point.point0;\n var t;\n\n dx = point[0] - point0[0];\n dy = point[1] - point0[1];\n\n switch (mode) {\n case MODE_SPACE:\n case MODE_DRAG: {\n if (signX) dx = max(W - w0, min(E - e0, dx)), w1 = w0 + dx, e1 = e0 + dx;\n if (signY) dy = max(N - n0, min(S - s0, dy)), n1 = n0 + dy, s1 = s0 + dy;\n break;\n }\n case MODE_HANDLE: {\n if (points[1]) {\n if (signX) w1 = max(W, min(E, points[0][0])), e1 = max(W, min(E, points[1][0])), signX = 1;\n if (signY) n1 = max(N, min(S, points[0][1])), s1 = max(N, min(S, points[1][1])), signY = 1;\n } else {\n if (signX < 0) dx = max(W - w0, min(E - w0, dx)), w1 = w0 + dx, e1 = e0;\n else if (signX > 0) dx = max(W - e0, min(E - e0, dx)), w1 = w0, e1 = e0 + dx;\n if (signY < 0) dy = max(N - n0, min(S - n0, dy)), n1 = n0 + dy, s1 = s0;\n else if (signY > 0) dy = max(N - s0, min(S - s0, dy)), n1 = n0, s1 = s0 + dy;\n }\n break;\n }\n case MODE_CENTER: {\n if (signX) w1 = max(W, min(E, w0 - dx * signX)), e1 = max(W, min(E, e0 + dx * signX));\n if (signY) n1 = max(N, min(S, n0 - dy * signY)), s1 = max(N, min(S, s0 + dy * signY));\n break;\n }\n }\n\n if (e1 < w1) {\n signX *= -1;\n t = w0, w0 = e0, e0 = t;\n t = w1, w1 = e1, e1 = t;\n if (type in flipX) overlay.attr(\"cursor\", cursors[type = flipX[type]]);\n }\n\n if (s1 < n1) {\n signY *= -1;\n t = n0, n0 = s0, s0 = t;\n t = n1, n1 = s1, s1 = t;\n if (type in flipY) overlay.attr(\"cursor\", cursors[type = flipY[type]]);\n }\n\n if (state.selection) selection = state.selection; // May be set by brush.move!\n if (lockX) w1 = selection[0][0], e1 = selection[1][0];\n if (lockY) n1 = selection[0][1], s1 = selection[1][1];\n\n if (selection[0][0] !== w1\n || selection[0][1] !== n1\n || selection[1][0] !== e1\n || selection[1][1] !== s1) {\n state.selection = [[w1, n1], [e1, s1]];\n redraw.call(that);\n emit.brush(event, mode.name);\n }\n }\n\n function ended(event) {\n nopropagation(event);\n if (event.touches) {\n if (event.touches.length) return;\n if (touchending) clearTimeout(touchending);\n touchending = setTimeout(function() { touchending = null; }, 500); // Ghost clicks are delayed!\n } else {\n dragEnable(event.view, moving);\n view.on(\"keydown.brush keyup.brush mousemove.brush mouseup.brush\", null);\n }\n group.attr(\"pointer-events\", \"all\");\n overlay.attr(\"cursor\", cursors.overlay);\n if (state.selection) selection = state.selection; // May be set by brush.move (on start)!\n if (empty(selection)) state.selection = null, redraw.call(that);\n emit.end(event, mode.name);\n }\n\n function keydowned(event) {\n switch (event.keyCode) {\n case 16: { // SHIFT\n shifting = signX && signY;\n break;\n }\n case 18: { // ALT\n if (mode === MODE_HANDLE) {\n if (signX) e0 = e1 - dx * signX, w0 = w1 + dx * signX;\n if (signY) s0 = s1 - dy * signY, n0 = n1 + dy * signY;\n mode = MODE_CENTER;\n move(event);\n }\n break;\n }\n case 32: { // SPACE; takes priority over ALT\n if (mode === MODE_HANDLE || mode === MODE_CENTER) {\n if (signX < 0) e0 = e1 - dx; else if (signX > 0) w0 = w1 - dx;\n if (signY < 0) s0 = s1 - dy; else if (signY > 0) n0 = n1 - dy;\n mode = MODE_SPACE;\n overlay.attr(\"cursor\", cursors.selection);\n move(event);\n }\n break;\n }\n default: return;\n }\n noevent(event);\n }\n\n function keyupped(event) {\n switch (event.keyCode) {\n case 16: { // SHIFT\n if (shifting) {\n lockX = lockY = shifting = false;\n move(event);\n }\n break;\n }\n case 18: { // ALT\n if (mode === MODE_CENTER) {\n if (signX < 0) e0 = e1; else if (signX > 0) w0 = w1;\n if (signY < 0) s0 = s1; else if (signY > 0) n0 = n1;\n mode = MODE_HANDLE;\n move(event);\n }\n break;\n }\n case 32: { // SPACE\n if (mode === MODE_SPACE) {\n if (event.altKey) {\n if (signX) e0 = e1 - dx * signX, w0 = w1 + dx * signX;\n if (signY) s0 = s1 - dy * signY, n0 = n1 + dy * signY;\n mode = MODE_CENTER;\n } else {\n if (signX < 0) e0 = e1; else if (signX > 0) w0 = w1;\n if (signY < 0) s0 = s1; else if (signY > 0) n0 = n1;\n mode = MODE_HANDLE;\n }\n overlay.attr(\"cursor\", cursors[type]);\n move(event);\n }\n break;\n }\n default: return;\n }\n noevent(event);\n }\n }\n\n function touchmoved(event) {\n emitter(this, arguments).moved(event);\n }\n\n function touchended(event) {\n emitter(this, arguments).ended(event);\n }\n\n function initialize() {\n var state = this.__brush || {selection: null};\n state.extent = number2(extent.apply(this, arguments));\n state.dim = dim;\n return state;\n }\n\n brush.extent = function(_) {\n return arguments.length ? (extent = typeof _ === \"function\" ? _ : constant(number2(_)), brush) : extent;\n };\n\n brush.filter = function(_) {\n return arguments.length ? (filter = typeof _ === \"function\" ? _ : constant(!!_), brush) : filter;\n };\n\n brush.touchable = function(_) {\n return arguments.length ? (touchable = typeof _ === \"function\" ? _ : constant(!!_), brush) : touchable;\n };\n\n brush.handleSize = function(_) {\n return arguments.length ? (handleSize = +_, brush) : handleSize;\n };\n\n brush.keyModifiers = function(_) {\n return arguments.length ? (keys = !!_, brush) : keys;\n };\n\n brush.on = function() {\n var value = listeners.on.apply(listeners, arguments);\n return value === listeners ? brush : value;\n };\n\n return brush;\n}\n","const pi = Math.PI,\n tau = 2 * pi,\n epsilon = 1e-6,\n tauEpsilon = tau - epsilon;\n\nfunction append(strings) {\n this._ += strings[0];\n for (let i = 1, n = strings.length; i < n; ++i) {\n this._ += arguments[i] + strings[i];\n }\n}\n\nfunction appendRound(digits) {\n let d = Math.floor(digits);\n if (!(d >= 0)) throw new Error(`invalid digits: ${digits}`);\n if (d > 15) return append;\n const k = 10 ** d;\n return function(strings) {\n this._ += strings[0];\n for (let i = 1, n = strings.length; i < n; ++i) {\n this._ += Math.round(arguments[i] * k) / k + strings[i];\n }\n };\n}\n\nexport class Path {\n constructor(digits) {\n this._x0 = this._y0 = // start of current subpath\n this._x1 = this._y1 = null; // end of current subpath\n this._ = \"\";\n this._append = digits == null ? append : appendRound(digits);\n }\n moveTo(x, y) {\n this._append`M${this._x0 = this._x1 = +x},${this._y0 = this._y1 = +y}`;\n }\n closePath() {\n if (this._x1 !== null) {\n this._x1 = this._x0, this._y1 = this._y0;\n this._append`Z`;\n }\n }\n lineTo(x, y) {\n this._append`L${this._x1 = +x},${this._y1 = +y}`;\n }\n quadraticCurveTo(x1, y1, x, y) {\n this._append`Q${+x1},${+y1},${this._x1 = +x},${this._y1 = +y}`;\n }\n bezierCurveTo(x1, y1, x2, y2, x, y) {\n this._append`C${+x1},${+y1},${+x2},${+y2},${this._x1 = +x},${this._y1 = +y}`;\n }\n arcTo(x1, y1, x2, y2, r) {\n x1 = +x1, y1 = +y1, x2 = +x2, y2 = +y2, r = +r;\n\n // Is the radius negative? Error.\n if (r < 0) throw new Error(`negative radius: ${r}`);\n\n let x0 = this._x1,\n y0 = this._y1,\n x21 = x2 - x1,\n y21 = y2 - y1,\n x01 = x0 - x1,\n y01 = y0 - y1,\n l01_2 = x01 * x01 + y01 * y01;\n\n // Is this path empty? Move to (x1,y1).\n if (this._x1 === null) {\n this._append`M${this._x1 = x1},${this._y1 = y1}`;\n }\n\n // Or, is (x1,y1) coincident with (x0,y0)? Do nothing.\n else if (!(l01_2 > epsilon));\n\n // Or, are (x0,y0), (x1,y1) and (x2,y2) collinear?\n // Equivalently, is (x1,y1) coincident with (x2,y2)?\n // Or, is the radius zero? Line to (x1,y1).\n else if (!(Math.abs(y01 * x21 - y21 * x01) > epsilon) || !r) {\n this._append`L${this._x1 = x1},${this._y1 = y1}`;\n }\n\n // Otherwise, draw an arc!\n else {\n let x20 = x2 - x0,\n y20 = y2 - y0,\n l21_2 = x21 * x21 + y21 * y21,\n l20_2 = x20 * x20 + y20 * y20,\n l21 = Math.sqrt(l21_2),\n l01 = Math.sqrt(l01_2),\n l = r * Math.tan((pi - Math.acos((l21_2 + l01_2 - l20_2) / (2 * l21 * l01))) / 2),\n t01 = l / l01,\n t21 = l / l21;\n\n // If the start tangent is not coincident with (x0,y0), line to.\n if (Math.abs(t01 - 1) > epsilon) {\n this._append`L${x1 + t01 * x01},${y1 + t01 * y01}`;\n }\n\n this._append`A${r},${r},0,0,${+(y01 * x20 > x01 * y20)},${this._x1 = x1 + t21 * x21},${this._y1 = y1 + t21 * y21}`;\n }\n }\n arc(x, y, r, a0, a1, ccw) {\n x = +x, y = +y, r = +r, ccw = !!ccw;\n\n // Is the radius negative? Error.\n if (r < 0) throw new Error(`negative radius: ${r}`);\n\n let dx = r * Math.cos(a0),\n dy = r * Math.sin(a0),\n x0 = x + dx,\n y0 = y + dy,\n cw = 1 ^ ccw,\n da = ccw ? a0 - a1 : a1 - a0;\n\n // Is this path empty? Move to (x0,y0).\n if (this._x1 === null) {\n this._append`M${x0},${y0}`;\n }\n\n // Or, is (x0,y0) not coincident with the previous point? Line to (x0,y0).\n else if (Math.abs(this._x1 - x0) > epsilon || Math.abs(this._y1 - y0) > epsilon) {\n this._append`L${x0},${y0}`;\n }\n\n // Is this arc empty? We’re done.\n if (!r) return;\n\n // Does the angle go the wrong way? Flip the direction.\n if (da < 0) da = da % tau + tau;\n\n // Is this a complete circle? Draw two arcs to complete the circle.\n if (da > tauEpsilon) {\n this._append`A${r},${r},0,1,${cw},${x - dx},${y - dy}A${r},${r},0,1,${cw},${this._x1 = x0},${this._y1 = y0}`;\n }\n\n // Is this arc non-empty? Draw an arc!\n else if (da > epsilon) {\n this._append`A${r},${r},0,${+(da >= pi)},${cw},${this._x1 = x + r * Math.cos(a1)},${this._y1 = y + r * Math.sin(a1)}`;\n }\n }\n rect(x, y, w, h) {\n this._append`M${this._x0 = this._x1 = +x},${this._y0 = this._y1 = +y}h${w = +w}v${+h}h${-w}Z`;\n }\n toString() {\n return this._;\n }\n}\n\nexport function path() {\n return new Path;\n}\n\n// Allow instanceof d3.path\npath.prototype = Path.prototype;\n\nexport function pathRound(digits = 3) {\n return new Path(+digits);\n}\n","export var epsilon = 1e-6;\nexport var epsilon2 = 1e-12;\nexport var pi = Math.PI;\nexport var halfPi = pi / 2;\nexport var quarterPi = pi / 4;\nexport var tau = pi * 2;\n\nexport var degrees = 180 / pi;\nexport var radians = pi / 180;\n\nexport var abs = Math.abs;\nexport var atan = Math.atan;\nexport var atan2 = Math.atan2;\nexport var cos = Math.cos;\nexport var ceil = Math.ceil;\nexport var exp = Math.exp;\nexport var floor = Math.floor;\nexport var hypot = Math.hypot;\nexport var log = Math.log;\nexport var pow = Math.pow;\nexport var sin = Math.sin;\nexport var sign = Math.sign || function(x) { return x > 0 ? 1 : x < 0 ? -1 : 0; };\nexport var sqrt = Math.sqrt;\nexport var tan = Math.tan;\n\nexport function acos(x) {\n return x > 1 ? 0 : x < -1 ? pi : Math.acos(x);\n}\n\nexport function asin(x) {\n return x > 1 ? halfPi : x < -1 ? -halfPi : Math.asin(x);\n}\n\nexport function haversin(x) {\n return (x = sin(x / 2)) * x;\n}\n","export default function noop() {}\n","function streamGeometry(geometry, stream) {\n if (geometry && streamGeometryType.hasOwnProperty(geometry.type)) {\n streamGeometryType[geometry.type](geometry, stream);\n }\n}\n\nvar streamObjectType = {\n Feature: function(object, stream) {\n streamGeometry(object.geometry, stream);\n },\n FeatureCollection: function(object, stream) {\n var features = object.features, i = -1, n = features.length;\n while (++i < n) streamGeometry(features[i].geometry, stream);\n }\n};\n\nvar streamGeometryType = {\n Sphere: function(object, stream) {\n stream.sphere();\n },\n Point: function(object, stream) {\n object = object.coordinates;\n stream.point(object[0], object[1], object[2]);\n },\n MultiPoint: function(object, stream) {\n var coordinates = object.coordinates, i = -1, n = coordinates.length;\n while (++i < n) object = coordinates[i], stream.point(object[0], object[1], object[2]);\n },\n LineString: function(object, stream) {\n streamLine(object.coordinates, stream, 0);\n },\n MultiLineString: function(object, stream) {\n var coordinates = object.coordinates, i = -1, n = coordinates.length;\n while (++i < n) streamLine(coordinates[i], stream, 0);\n },\n Polygon: function(object, stream) {\n streamPolygon(object.coordinates, stream);\n },\n MultiPolygon: function(object, stream) {\n var coordinates = object.coordinates, i = -1, n = coordinates.length;\n while (++i < n) streamPolygon(coordinates[i], stream);\n },\n GeometryCollection: function(object, stream) {\n var geometries = object.geometries, i = -1, n = geometries.length;\n while (++i < n) streamGeometry(geometries[i], stream);\n }\n};\n\nfunction streamLine(coordinates, stream, closed) {\n var i = -1, n = coordinates.length - closed, coordinate;\n stream.lineStart();\n while (++i < n) coordinate = coordinates[i], stream.point(coordinate[0], coordinate[1], coordinate[2]);\n stream.lineEnd();\n}\n\nfunction streamPolygon(coordinates, stream) {\n var i = -1, n = coordinates.length;\n stream.polygonStart();\n while (++i < n) streamLine(coordinates[i], stream, 1);\n stream.polygonEnd();\n}\n\nexport default function(object, stream) {\n if (object && streamObjectType.hasOwnProperty(object.type)) {\n streamObjectType[object.type](object, stream);\n } else {\n streamGeometry(object, stream);\n }\n}\n","import {asin, atan2, cos, sin, sqrt} from \"./math.js\";\n\nexport function spherical(cartesian) {\n return [atan2(cartesian[1], cartesian[0]), asin(cartesian[2])];\n}\n\nexport function cartesian(spherical) {\n var lambda = spherical[0], phi = spherical[1], cosPhi = cos(phi);\n return [cosPhi * cos(lambda), cosPhi * sin(lambda), sin(phi)];\n}\n\nexport function cartesianDot(a, b) {\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2];\n}\n\nexport function cartesianCross(a, b) {\n return [a[1] * b[2] - a[2] * b[1], a[2] * b[0] - a[0] * b[2], a[0] * b[1] - a[1] * b[0]];\n}\n\n// TODO return a\nexport function cartesianAddInPlace(a, b) {\n a[0] += b[0], a[1] += b[1], a[2] += b[2];\n}\n\nexport function cartesianScale(vector, k) {\n return [vector[0] * k, vector[1] * k, vector[2] * k];\n}\n\n// TODO return d\nexport function cartesianNormalizeInPlace(d) {\n var l = sqrt(d[0] * d[0] + d[1] * d[1] + d[2] * d[2]);\n d[0] /= l, d[1] /= l, d[2] /= l;\n}\n","export default function(a, b) {\n\n function compose(x, y) {\n return x = a(x, y), b(x[0], x[1]);\n }\n\n if (a.invert && b.invert) compose.invert = function(x, y) {\n return x = b.invert(x, y), x && a.invert(x[0], x[1]);\n };\n\n return compose;\n}\n","import compose from \"./compose.js\";\nimport {abs, asin, atan2, cos, degrees, pi, radians, sin, tau} from \"./math.js\";\n\nfunction rotationIdentity(lambda, phi) {\n if (abs(lambda) > pi) lambda -= Math.round(lambda / tau) * tau;\n return [lambda, phi];\n}\n\nrotationIdentity.invert = rotationIdentity;\n\nexport function rotateRadians(deltaLambda, deltaPhi, deltaGamma) {\n return (deltaLambda %= tau) ? (deltaPhi || deltaGamma ? compose(rotationLambda(deltaLambda), rotationPhiGamma(deltaPhi, deltaGamma))\n : rotationLambda(deltaLambda))\n : (deltaPhi || deltaGamma ? rotationPhiGamma(deltaPhi, deltaGamma)\n : rotationIdentity);\n}\n\nfunction forwardRotationLambda(deltaLambda) {\n return function(lambda, phi) {\n lambda += deltaLambda;\n if (abs(lambda) > pi) lambda -= Math.round(lambda / tau) * tau;\n return [lambda, phi];\n };\n}\n\nfunction rotationLambda(deltaLambda) {\n var rotation = forwardRotationLambda(deltaLambda);\n rotation.invert = forwardRotationLambda(-deltaLambda);\n return rotation;\n}\n\nfunction rotationPhiGamma(deltaPhi, deltaGamma) {\n var cosDeltaPhi = cos(deltaPhi),\n sinDeltaPhi = sin(deltaPhi),\n cosDeltaGamma = cos(deltaGamma),\n sinDeltaGamma = sin(deltaGamma);\n\n function rotation(lambda, phi) {\n var cosPhi = cos(phi),\n x = cos(lambda) * cosPhi,\n y = sin(lambda) * cosPhi,\n z = sin(phi),\n k = z * cosDeltaPhi + x * sinDeltaPhi;\n return [\n atan2(y * cosDeltaGamma - k * sinDeltaGamma, x * cosDeltaPhi - z * sinDeltaPhi),\n asin(k * cosDeltaGamma + y * sinDeltaGamma)\n ];\n }\n\n rotation.invert = function(lambda, phi) {\n var cosPhi = cos(phi),\n x = cos(lambda) * cosPhi,\n y = sin(lambda) * cosPhi,\n z = sin(phi),\n k = z * cosDeltaGamma - y * sinDeltaGamma;\n return [\n atan2(y * cosDeltaGamma + z * sinDeltaGamma, x * cosDeltaPhi + k * sinDeltaPhi),\n asin(k * cosDeltaPhi - x * sinDeltaPhi)\n ];\n };\n\n return rotation;\n}\n\nexport default function(rotate) {\n rotate = rotateRadians(rotate[0] * radians, rotate[1] * radians, rotate.length > 2 ? rotate[2] * radians : 0);\n\n function forward(coordinates) {\n coordinates = rotate(coordinates[0] * radians, coordinates[1] * radians);\n return coordinates[0] *= degrees, coordinates[1] *= degrees, coordinates;\n }\n\n forward.invert = function(coordinates) {\n coordinates = rotate.invert(coordinates[0] * radians, coordinates[1] * radians);\n return coordinates[0] *= degrees, coordinates[1] *= degrees, coordinates;\n };\n\n return forward;\n}\n","import {cartesian, cartesianNormalizeInPlace, spherical} from \"./cartesian.js\";\nimport constant from \"./constant.js\";\nimport {acos, cos, degrees, epsilon, radians, sin, tau} from \"./math.js\";\nimport {rotateRadians} from \"./rotation.js\";\n\n// Generates a circle centered at [0°, 0°], with a given radius and precision.\nexport function circleStream(stream, radius, delta, direction, t0, t1) {\n if (!delta) return;\n var cosRadius = cos(radius),\n sinRadius = sin(radius),\n step = direction * delta;\n if (t0 == null) {\n t0 = radius + direction * tau;\n t1 = radius - step / 2;\n } else {\n t0 = circleRadius(cosRadius, t0);\n t1 = circleRadius(cosRadius, t1);\n if (direction > 0 ? t0 < t1 : t0 > t1) t0 += direction * tau;\n }\n for (var point, t = t0; direction > 0 ? t > t1 : t < t1; t -= step) {\n point = spherical([cosRadius, -sinRadius * cos(t), -sinRadius * sin(t)]);\n stream.point(point[0], point[1]);\n }\n}\n\n// Returns the signed angle of a cartesian point relative to [cosRadius, 0, 0].\nfunction circleRadius(cosRadius, point) {\n point = cartesian(point), point[0] -= cosRadius;\n cartesianNormalizeInPlace(point);\n var radius = acos(-point[1]);\n return ((-point[2] < 0 ? -radius : radius) + tau - epsilon) % tau;\n}\n\nexport default function() {\n var center = constant([0, 0]),\n radius = constant(90),\n precision = constant(2),\n ring,\n rotate,\n stream = {point: point};\n\n function point(x, y) {\n ring.push(x = rotate(x, y));\n x[0] *= degrees, x[1] *= degrees;\n }\n\n function circle() {\n var c = center.apply(this, arguments),\n r = radius.apply(this, arguments) * radians,\n p = precision.apply(this, arguments) * radians;\n ring = [];\n rotate = rotateRadians(-c[0] * radians, -c[1] * radians, 0).invert;\n circleStream(stream, r, p, 1);\n c = {type: \"Polygon\", coordinates: [ring]};\n ring = rotate = null;\n return c;\n }\n\n circle.center = function(_) {\n return arguments.length ? (center = typeof _ === \"function\" ? _ : constant([+_[0], +_[1]]), circle) : center;\n };\n\n circle.radius = function(_) {\n return arguments.length ? (radius = typeof _ === \"function\" ? _ : constant(+_), circle) : radius;\n };\n\n circle.precision = function(_) {\n return arguments.length ? (precision = typeof _ === \"function\" ? _ : constant(+_), circle) : precision;\n };\n\n return circle;\n}\n","import noop from \"../noop.js\";\n\nexport default function() {\n var lines = [],\n line;\n return {\n point: function(x, y, m) {\n line.push([x, y, m]);\n },\n lineStart: function() {\n lines.push(line = []);\n },\n lineEnd: noop,\n rejoin: function() {\n if (lines.length > 1) lines.push(lines.pop().concat(lines.shift()));\n },\n result: function() {\n var result = lines;\n lines = [];\n line = null;\n return result;\n }\n };\n}\n","import {abs, epsilon} from \"./math.js\";\n\nexport default function(a, b) {\n return abs(a[0] - b[0]) < epsilon && abs(a[1] - b[1]) < epsilon;\n}\n","import pointEqual from \"../pointEqual.js\";\nimport {epsilon} from \"../math.js\";\n\nfunction Intersection(point, points, other, entry) {\n this.x = point;\n this.z = points;\n this.o = other; // another intersection\n this.e = entry; // is an entry?\n this.v = false; // visited\n this.n = this.p = null; // next & previous\n}\n\n// A generalized polygon clipping algorithm: given a polygon that has been cut\n// into its visible line segments, and rejoins the segments by interpolating\n// along the clip edge.\nexport default function(segments, compareIntersection, startInside, interpolate, stream) {\n var subject = [],\n clip = [],\n i,\n n;\n\n segments.forEach(function(segment) {\n if ((n = segment.length - 1) <= 0) return;\n var n, p0 = segment[0], p1 = segment[n], x;\n\n if (pointEqual(p0, p1)) {\n if (!p0[2] && !p1[2]) {\n stream.lineStart();\n for (i = 0; i < n; ++i) stream.point((p0 = segment[i])[0], p0[1]);\n stream.lineEnd();\n return;\n }\n // handle degenerate cases by moving the point\n p1[0] += 2 * epsilon;\n }\n\n subject.push(x = new Intersection(p0, segment, null, true));\n clip.push(x.o = new Intersection(p0, null, x, false));\n subject.push(x = new Intersection(p1, segment, null, false));\n clip.push(x.o = new Intersection(p1, null, x, true));\n });\n\n if (!subject.length) return;\n\n clip.sort(compareIntersection);\n link(subject);\n link(clip);\n\n for (i = 0, n = clip.length; i < n; ++i) {\n clip[i].e = startInside = !startInside;\n }\n\n var start = subject[0],\n points,\n point;\n\n while (1) {\n // Find first unvisited intersection.\n var current = start,\n isSubject = true;\n while (current.v) if ((current = current.n) === start) return;\n points = current.z;\n stream.lineStart();\n do {\n current.v = current.o.v = true;\n if (current.e) {\n if (isSubject) {\n for (i = 0, n = points.length; i < n; ++i) stream.point((point = points[i])[0], point[1]);\n } else {\n interpolate(current.x, current.n.x, 1, stream);\n }\n current = current.n;\n } else {\n if (isSubject) {\n points = current.p.z;\n for (i = points.length - 1; i >= 0; --i) stream.point((point = points[i])[0], point[1]);\n } else {\n interpolate(current.x, current.p.x, -1, stream);\n }\n current = current.p;\n }\n current = current.o;\n points = current.z;\n isSubject = !isSubject;\n } while (!current.v);\n stream.lineEnd();\n }\n}\n\nfunction link(array) {\n if (!(n = array.length)) return;\n var n,\n i = 0,\n a = array[0],\n b;\n while (++i < n) {\n a.n = b = array[i];\n b.p = a;\n a = b;\n }\n a.n = b = array[0];\n b.p = a;\n}\n","import {Adder} from \"d3-array\";\nimport {cartesian, cartesianCross, cartesianNormalizeInPlace} from \"./cartesian.js\";\nimport {abs, asin, atan2, cos, epsilon, epsilon2, halfPi, pi, quarterPi, sign, sin, tau} from \"./math.js\";\n\nfunction longitude(point) {\n return abs(point[0]) <= pi ? point[0] : sign(point[0]) * ((abs(point[0]) + pi) % tau - pi);\n}\n\nexport default function(polygon, point) {\n var lambda = longitude(point),\n phi = point[1],\n sinPhi = sin(phi),\n normal = [sin(lambda), -cos(lambda), 0],\n angle = 0,\n winding = 0;\n\n var sum = new Adder();\n\n if (sinPhi === 1) phi = halfPi + epsilon;\n else if (sinPhi === -1) phi = -halfPi - epsilon;\n\n for (var i = 0, n = polygon.length; i < n; ++i) {\n if (!(m = (ring = polygon[i]).length)) continue;\n var ring,\n m,\n point0 = ring[m - 1],\n lambda0 = longitude(point0),\n phi0 = point0[1] / 2 + quarterPi,\n sinPhi0 = sin(phi0),\n cosPhi0 = cos(phi0);\n\n for (var j = 0; j < m; ++j, lambda0 = lambda1, sinPhi0 = sinPhi1, cosPhi0 = cosPhi1, point0 = point1) {\n var point1 = ring[j],\n lambda1 = longitude(point1),\n phi1 = point1[1] / 2 + quarterPi,\n sinPhi1 = sin(phi1),\n cosPhi1 = cos(phi1),\n delta = lambda1 - lambda0,\n sign = delta >= 0 ? 1 : -1,\n absDelta = sign * delta,\n antimeridian = absDelta > pi,\n k = sinPhi0 * sinPhi1;\n\n sum.add(atan2(k * sign * sin(absDelta), cosPhi0 * cosPhi1 + k * cos(absDelta)));\n angle += antimeridian ? delta + sign * tau : delta;\n\n // Are the longitudes either side of the point’s meridian (lambda),\n // and are the latitudes smaller than the parallel (phi)?\n if (antimeridian ^ lambda0 >= lambda ^ lambda1 >= lambda) {\n var arc = cartesianCross(cartesian(point0), cartesian(point1));\n cartesianNormalizeInPlace(arc);\n var intersection = cartesianCross(normal, arc);\n cartesianNormalizeInPlace(intersection);\n var phiArc = (antimeridian ^ delta >= 0 ? -1 : 1) * asin(intersection[2]);\n if (phi > phiArc || phi === phiArc && (arc[0] || arc[1])) {\n winding += antimeridian ^ delta >= 0 ? 1 : -1;\n }\n }\n }\n }\n\n // First, determine whether the South pole is inside or outside:\n //\n // It is inside if:\n // * the polygon winds around it in a clockwise direction.\n // * the polygon does not (cumulatively) wind around it, but has a negative\n // (counter-clockwise) area.\n //\n // Second, count the (signed) number of times a segment crosses a lambda\n // from the point to the South pole. If it is zero, then the point is the\n // same side as the South pole.\n\n return (angle < -epsilon || angle < epsilon && sum < -epsilon2) ^ (winding & 1);\n}\n","import clipBuffer from \"./buffer.js\";\nimport clipRejoin from \"./rejoin.js\";\nimport {epsilon, halfPi} from \"../math.js\";\nimport polygonContains from \"../polygonContains.js\";\nimport {merge} from \"d3-array\";\n\nexport default function(pointVisible, clipLine, interpolate, start) {\n return function(sink) {\n var line = clipLine(sink),\n ringBuffer = clipBuffer(),\n ringSink = clipLine(ringBuffer),\n polygonStarted = false,\n polygon,\n segments,\n ring;\n\n var clip = {\n point: point,\n lineStart: lineStart,\n lineEnd: lineEnd,\n polygonStart: function() {\n clip.point = pointRing;\n clip.lineStart = ringStart;\n clip.lineEnd = ringEnd;\n segments = [];\n polygon = [];\n },\n polygonEnd: function() {\n clip.point = point;\n clip.lineStart = lineStart;\n clip.lineEnd = lineEnd;\n segments = merge(segments);\n var startInside = polygonContains(polygon, start);\n if (segments.length) {\n if (!polygonStarted) sink.polygonStart(), polygonStarted = true;\n clipRejoin(segments, compareIntersection, startInside, interpolate, sink);\n } else if (startInside) {\n if (!polygonStarted) sink.polygonStart(), polygonStarted = true;\n sink.lineStart();\n interpolate(null, null, 1, sink);\n sink.lineEnd();\n }\n if (polygonStarted) sink.polygonEnd(), polygonStarted = false;\n segments = polygon = null;\n },\n sphere: function() {\n sink.polygonStart();\n sink.lineStart();\n interpolate(null, null, 1, sink);\n sink.lineEnd();\n sink.polygonEnd();\n }\n };\n\n function point(lambda, phi) {\n if (pointVisible(lambda, phi)) sink.point(lambda, phi);\n }\n\n function pointLine(lambda, phi) {\n line.point(lambda, phi);\n }\n\n function lineStart() {\n clip.point = pointLine;\n line.lineStart();\n }\n\n function lineEnd() {\n clip.point = point;\n line.lineEnd();\n }\n\n function pointRing(lambda, phi) {\n ring.push([lambda, phi]);\n ringSink.point(lambda, phi);\n }\n\n function ringStart() {\n ringSink.lineStart();\n ring = [];\n }\n\n function ringEnd() {\n pointRing(ring[0][0], ring[0][1]);\n ringSink.lineEnd();\n\n var clean = ringSink.clean(),\n ringSegments = ringBuffer.result(),\n i, n = ringSegments.length, m,\n segment,\n point;\n\n ring.pop();\n polygon.push(ring);\n ring = null;\n\n if (!n) return;\n\n // No intersections.\n if (clean & 1) {\n segment = ringSegments[0];\n if ((m = segment.length - 1) > 0) {\n if (!polygonStarted) sink.polygonStart(), polygonStarted = true;\n sink.lineStart();\n for (i = 0; i < m; ++i) sink.point((point = segment[i])[0], point[1]);\n sink.lineEnd();\n }\n return;\n }\n\n // Rejoin connected segments.\n // TODO reuse ringBuffer.rejoin()?\n if (n > 1 && clean & 2) ringSegments.push(ringSegments.pop().concat(ringSegments.shift()));\n\n segments.push(ringSegments.filter(validSegment));\n }\n\n return clip;\n };\n}\n\nfunction validSegment(segment) {\n return segment.length > 1;\n}\n\n// Intersections are sorted along the clip edge. For both antimeridian cutting\n// and circle clipping, the same comparison is used.\nfunction compareIntersection(a, b) {\n return ((a = a.x)[0] < 0 ? a[1] - halfPi - epsilon : halfPi - a[1])\n - ((b = b.x)[0] < 0 ? b[1] - halfPi - epsilon : halfPi - b[1]);\n}\n","import clip from \"./index.js\";\nimport {abs, atan, cos, epsilon, halfPi, pi, sin} from \"../math.js\";\n\nexport default clip(\n function() { return true; },\n clipAntimeridianLine,\n clipAntimeridianInterpolate,\n [-pi, -halfPi]\n);\n\n// Takes a line and cuts into visible segments. Return values: 0 - there were\n// intersections or the line was empty; 1 - no intersections; 2 - there were\n// intersections, and the first and last segments should be rejoined.\nfunction clipAntimeridianLine(stream) {\n var lambda0 = NaN,\n phi0 = NaN,\n sign0 = NaN,\n clean; // no intersections\n\n return {\n lineStart: function() {\n stream.lineStart();\n clean = 1;\n },\n point: function(lambda1, phi1) {\n var sign1 = lambda1 > 0 ? pi : -pi,\n delta = abs(lambda1 - lambda0);\n if (abs(delta - pi) < epsilon) { // line crosses a pole\n stream.point(lambda0, phi0 = (phi0 + phi1) / 2 > 0 ? halfPi : -halfPi);\n stream.point(sign0, phi0);\n stream.lineEnd();\n stream.lineStart();\n stream.point(sign1, phi0);\n stream.point(lambda1, phi0);\n clean = 0;\n } else if (sign0 !== sign1 && delta >= pi) { // line crosses antimeridian\n if (abs(lambda0 - sign0) < epsilon) lambda0 -= sign0 * epsilon; // handle degeneracies\n if (abs(lambda1 - sign1) < epsilon) lambda1 -= sign1 * epsilon;\n phi0 = clipAntimeridianIntersect(lambda0, phi0, lambda1, phi1);\n stream.point(sign0, phi0);\n stream.lineEnd();\n stream.lineStart();\n stream.point(sign1, phi0);\n clean = 0;\n }\n stream.point(lambda0 = lambda1, phi0 = phi1);\n sign0 = sign1;\n },\n lineEnd: function() {\n stream.lineEnd();\n lambda0 = phi0 = NaN;\n },\n clean: function() {\n return 2 - clean; // if intersections, rejoin first and last segments\n }\n };\n}\n\nfunction clipAntimeridianIntersect(lambda0, phi0, lambda1, phi1) {\n var cosPhi0,\n cosPhi1,\n sinLambda0Lambda1 = sin(lambda0 - lambda1);\n return abs(sinLambda0Lambda1) > epsilon\n ? atan((sin(phi0) * (cosPhi1 = cos(phi1)) * sin(lambda1)\n - sin(phi1) * (cosPhi0 = cos(phi0)) * sin(lambda0))\n / (cosPhi0 * cosPhi1 * sinLambda0Lambda1))\n : (phi0 + phi1) / 2;\n}\n\nfunction clipAntimeridianInterpolate(from, to, direction, stream) {\n var phi;\n if (from == null) {\n phi = direction * halfPi;\n stream.point(-pi, phi);\n stream.point(0, phi);\n stream.point(pi, phi);\n stream.point(pi, 0);\n stream.point(pi, -phi);\n stream.point(0, -phi);\n stream.point(-pi, -phi);\n stream.point(-pi, 0);\n stream.point(-pi, phi);\n } else if (abs(from[0] - to[0]) > epsilon) {\n var lambda = from[0] < to[0] ? pi : -pi;\n phi = direction * lambda / 2;\n stream.point(-lambda, phi);\n stream.point(0, phi);\n stream.point(lambda, phi);\n } else {\n stream.point(to[0], to[1]);\n }\n}\n","import {cartesian, cartesianAddInPlace, cartesianCross, cartesianDot, cartesianScale, spherical} from \"../cartesian.js\";\nimport {circleStream} from \"../circle.js\";\nimport {abs, cos, epsilon, pi, radians, sqrt} from \"../math.js\";\nimport pointEqual from \"../pointEqual.js\";\nimport clip from \"./index.js\";\n\nexport default function(radius) {\n var cr = cos(radius),\n delta = 2 * radians,\n smallRadius = cr > 0,\n notHemisphere = abs(cr) > epsilon; // TODO optimise for this common case\n\n function interpolate(from, to, direction, stream) {\n circleStream(stream, radius, delta, direction, from, to);\n }\n\n function visible(lambda, phi) {\n return cos(lambda) * cos(phi) > cr;\n }\n\n // Takes a line and cuts into visible segments. Return values used for polygon\n // clipping: 0 - there were intersections or the line was empty; 1 - no\n // intersections 2 - there were intersections, and the first and last segments\n // should be rejoined.\n function clipLine(stream) {\n var point0, // previous point\n c0, // code for previous point\n v0, // visibility of previous point\n v00, // visibility of first point\n clean; // no intersections\n return {\n lineStart: function() {\n v00 = v0 = false;\n clean = 1;\n },\n point: function(lambda, phi) {\n var point1 = [lambda, phi],\n point2,\n v = visible(lambda, phi),\n c = smallRadius\n ? v ? 0 : code(lambda, phi)\n : v ? code(lambda + (lambda < 0 ? pi : -pi), phi) : 0;\n if (!point0 && (v00 = v0 = v)) stream.lineStart();\n if (v !== v0) {\n point2 = intersect(point0, point1);\n if (!point2 || pointEqual(point0, point2) || pointEqual(point1, point2))\n point1[2] = 1;\n }\n if (v !== v0) {\n clean = 0;\n if (v) {\n // outside going in\n stream.lineStart();\n point2 = intersect(point1, point0);\n stream.point(point2[0], point2[1]);\n } else {\n // inside going out\n point2 = intersect(point0, point1);\n stream.point(point2[0], point2[1], 2);\n stream.lineEnd();\n }\n point0 = point2;\n } else if (notHemisphere && point0 && smallRadius ^ v) {\n var t;\n // If the codes for two points are different, or are both zero,\n // and there this segment intersects with the small circle.\n if (!(c & c0) && (t = intersect(point1, point0, true))) {\n clean = 0;\n if (smallRadius) {\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n } else {\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n stream.lineStart();\n stream.point(t[0][0], t[0][1], 3);\n }\n }\n }\n if (v && (!point0 || !pointEqual(point0, point1))) {\n stream.point(point1[0], point1[1]);\n }\n point0 = point1, v0 = v, c0 = c;\n },\n lineEnd: function() {\n if (v0) stream.lineEnd();\n point0 = null;\n },\n // Rejoin first and last segments if there were intersections and the first\n // and last points were visible.\n clean: function() {\n return clean | ((v00 && v0) << 1);\n }\n };\n }\n\n // Intersects the great circle between a and b with the clip circle.\n function intersect(a, b, two) {\n var pa = cartesian(a),\n pb = cartesian(b);\n\n // We have two planes, n1.p = d1 and n2.p = d2.\n // Find intersection line p(t) = c1 n1 + c2 n2 + t (n1 ⨯ n2).\n var n1 = [1, 0, 0], // normal\n n2 = cartesianCross(pa, pb),\n n2n2 = cartesianDot(n2, n2),\n n1n2 = n2[0], // cartesianDot(n1, n2),\n determinant = n2n2 - n1n2 * n1n2;\n\n // Two polar points.\n if (!determinant) return !two && a;\n\n var c1 = cr * n2n2 / determinant,\n c2 = -cr * n1n2 / determinant,\n n1xn2 = cartesianCross(n1, n2),\n A = cartesianScale(n1, c1),\n B = cartesianScale(n2, c2);\n cartesianAddInPlace(A, B);\n\n // Solve |p(t)|^2 = 1.\n var u = n1xn2,\n w = cartesianDot(A, u),\n uu = cartesianDot(u, u),\n t2 = w * w - uu * (cartesianDot(A, A) - 1);\n\n if (t2 < 0) return;\n\n var t = sqrt(t2),\n q = cartesianScale(u, (-w - t) / uu);\n cartesianAddInPlace(q, A);\n q = spherical(q);\n\n if (!two) return q;\n\n // Two intersection points.\n var lambda0 = a[0],\n lambda1 = b[0],\n phi0 = a[1],\n phi1 = b[1],\n z;\n\n if (lambda1 < lambda0) z = lambda0, lambda0 = lambda1, lambda1 = z;\n\n var delta = lambda1 - lambda0,\n polar = abs(delta - pi) < epsilon,\n meridian = polar || delta < epsilon;\n\n if (!polar && phi1 < phi0) z = phi0, phi0 = phi1, phi1 = z;\n\n // Check that the first point is between a and b.\n if (meridian\n ? polar\n ? phi0 + phi1 > 0 ^ q[1] < (abs(q[0] - lambda0) < epsilon ? phi0 : phi1)\n : phi0 <= q[1] && q[1] <= phi1\n : delta > pi ^ (lambda0 <= q[0] && q[0] <= lambda1)) {\n var q1 = cartesianScale(u, (-w + t) / uu);\n cartesianAddInPlace(q1, A);\n return [q, spherical(q1)];\n }\n }\n\n // Generates a 4-bit vector representing the location of a point relative to\n // the small circle's bounding box.\n function code(lambda, phi) {\n var r = smallRadius ? radius : pi - radius,\n code = 0;\n if (lambda < -r) code |= 1; // left\n else if (lambda > r) code |= 2; // right\n if (phi < -r) code |= 4; // below\n else if (phi > r) code |= 8; // above\n return code;\n }\n\n return clip(visible, clipLine, interpolate, smallRadius ? [0, -radius] : [-pi, radius - pi]);\n}\n","export default function(a, b, x0, y0, x1, y1) {\n var ax = a[0],\n ay = a[1],\n bx = b[0],\n by = b[1],\n t0 = 0,\n t1 = 1,\n dx = bx - ax,\n dy = by - ay,\n r;\n\n r = x0 - ax;\n if (!dx && r > 0) return;\n r /= dx;\n if (dx < 0) {\n if (r < t0) return;\n if (r < t1) t1 = r;\n } else if (dx > 0) {\n if (r > t1) return;\n if (r > t0) t0 = r;\n }\n\n r = x1 - ax;\n if (!dx && r < 0) return;\n r /= dx;\n if (dx < 0) {\n if (r > t1) return;\n if (r > t0) t0 = r;\n } else if (dx > 0) {\n if (r < t0) return;\n if (r < t1) t1 = r;\n }\n\n r = y0 - ay;\n if (!dy && r > 0) return;\n r /= dy;\n if (dy < 0) {\n if (r < t0) return;\n if (r < t1) t1 = r;\n } else if (dy > 0) {\n if (r > t1) return;\n if (r > t0) t0 = r;\n }\n\n r = y1 - ay;\n if (!dy && r < 0) return;\n r /= dy;\n if (dy < 0) {\n if (r > t1) return;\n if (r > t0) t0 = r;\n } else if (dy > 0) {\n if (r < t0) return;\n if (r < t1) t1 = r;\n }\n\n if (t0 > 0) a[0] = ax + t0 * dx, a[1] = ay + t0 * dy;\n if (t1 < 1) b[0] = ax + t1 * dx, b[1] = ay + t1 * dy;\n return true;\n}\n","import {abs, epsilon} from \"../math.js\";\nimport clipBuffer from \"./buffer.js\";\nimport clipLine from \"./line.js\";\nimport clipRejoin from \"./rejoin.js\";\nimport {merge} from \"d3-array\";\n\nvar clipMax = 1e9, clipMin = -clipMax;\n\n// TODO Use d3-polygon’s polygonContains here for the ring check?\n// TODO Eliminate duplicate buffering in clipBuffer and polygon.push?\n\nexport default function clipRectangle(x0, y0, x1, y1) {\n\n function visible(x, y) {\n return x0 <= x && x <= x1 && y0 <= y && y <= y1;\n }\n\n function interpolate(from, to, direction, stream) {\n var a = 0, a1 = 0;\n if (from == null\n || (a = corner(from, direction)) !== (a1 = corner(to, direction))\n || comparePoint(from, to) < 0 ^ direction > 0) {\n do stream.point(a === 0 || a === 3 ? x0 : x1, a > 1 ? y1 : y0);\n while ((a = (a + direction + 4) % 4) !== a1);\n } else {\n stream.point(to[0], to[1]);\n }\n }\n\n function corner(p, direction) {\n return abs(p[0] - x0) < epsilon ? direction > 0 ? 0 : 3\n : abs(p[0] - x1) < epsilon ? direction > 0 ? 2 : 1\n : abs(p[1] - y0) < epsilon ? direction > 0 ? 1 : 0\n : direction > 0 ? 3 : 2; // abs(p[1] - y1) < epsilon\n }\n\n function compareIntersection(a, b) {\n return comparePoint(a.x, b.x);\n }\n\n function comparePoint(a, b) {\n var ca = corner(a, 1),\n cb = corner(b, 1);\n return ca !== cb ? ca - cb\n : ca === 0 ? b[1] - a[1]\n : ca === 1 ? a[0] - b[0]\n : ca === 2 ? a[1] - b[1]\n : b[0] - a[0];\n }\n\n return function(stream) {\n var activeStream = stream,\n bufferStream = clipBuffer(),\n segments,\n polygon,\n ring,\n x__, y__, v__, // first point\n x_, y_, v_, // previous point\n first,\n clean;\n\n var clipStream = {\n point: point,\n lineStart: lineStart,\n lineEnd: lineEnd,\n polygonStart: polygonStart,\n polygonEnd: polygonEnd\n };\n\n function point(x, y) {\n if (visible(x, y)) activeStream.point(x, y);\n }\n\n function polygonInside() {\n var winding = 0;\n\n for (var i = 0, n = polygon.length; i < n; ++i) {\n for (var ring = polygon[i], j = 1, m = ring.length, point = ring[0], a0, a1, b0 = point[0], b1 = point[1]; j < m; ++j) {\n a0 = b0, a1 = b1, point = ring[j], b0 = point[0], b1 = point[1];\n if (a1 <= y1) { if (b1 > y1 && (b0 - a0) * (y1 - a1) > (b1 - a1) * (x0 - a0)) ++winding; }\n else { if (b1 <= y1 && (b0 - a0) * (y1 - a1) < (b1 - a1) * (x0 - a0)) --winding; }\n }\n }\n\n return winding;\n }\n\n // Buffer geometry within a polygon and then clip it en masse.\n function polygonStart() {\n activeStream = bufferStream, segments = [], polygon = [], clean = true;\n }\n\n function polygonEnd() {\n var startInside = polygonInside(),\n cleanInside = clean && startInside,\n visible = (segments = merge(segments)).length;\n if (cleanInside || visible) {\n stream.polygonStart();\n if (cleanInside) {\n stream.lineStart();\n interpolate(null, null, 1, stream);\n stream.lineEnd();\n }\n if (visible) {\n clipRejoin(segments, compareIntersection, startInside, interpolate, stream);\n }\n stream.polygonEnd();\n }\n activeStream = stream, segments = polygon = ring = null;\n }\n\n function lineStart() {\n clipStream.point = linePoint;\n if (polygon) polygon.push(ring = []);\n first = true;\n v_ = false;\n x_ = y_ = NaN;\n }\n\n // TODO rather than special-case polygons, simply handle them separately.\n // Ideally, coincident intersection points should be jittered to avoid\n // clipping issues.\n function lineEnd() {\n if (segments) {\n linePoint(x__, y__);\n if (v__ && v_) bufferStream.rejoin();\n segments.push(bufferStream.result());\n }\n clipStream.point = point;\n if (v_) activeStream.lineEnd();\n }\n\n function linePoint(x, y) {\n var v = visible(x, y);\n if (polygon) ring.push([x, y]);\n if (first) {\n x__ = x, y__ = y, v__ = v;\n first = false;\n if (v) {\n activeStream.lineStart();\n activeStream.point(x, y);\n }\n } else {\n if (v && v_) activeStream.point(x, y);\n else {\n var a = [x_ = Math.max(clipMin, Math.min(clipMax, x_)), y_ = Math.max(clipMin, Math.min(clipMax, y_))],\n b = [x = Math.max(clipMin, Math.min(clipMax, x)), y = Math.max(clipMin, Math.min(clipMax, y))];\n if (clipLine(a, b, x0, y0, x1, y1)) {\n if (!v_) {\n activeStream.lineStart();\n activeStream.point(a[0], a[1]);\n }\n activeStream.point(b[0], b[1]);\n if (!v) activeStream.lineEnd();\n clean = false;\n } else if (v) {\n activeStream.lineStart();\n activeStream.point(x, y);\n clean = false;\n }\n }\n }\n x_ = x, y_ = y, v_ = v;\n }\n\n return clipStream;\n };\n}\n","export default x => x;\n","import {Adder} from \"d3-array\";\nimport {abs} from \"../math.js\";\nimport noop from \"../noop.js\";\n\nvar areaSum = new Adder(),\n areaRingSum = new Adder(),\n x00,\n y00,\n x0,\n y0;\n\nvar areaStream = {\n point: noop,\n lineStart: noop,\n lineEnd: noop,\n polygonStart: function() {\n areaStream.lineStart = areaRingStart;\n areaStream.lineEnd = areaRingEnd;\n },\n polygonEnd: function() {\n areaStream.lineStart = areaStream.lineEnd = areaStream.point = noop;\n areaSum.add(abs(areaRingSum));\n areaRingSum = new Adder();\n },\n result: function() {\n var area = areaSum / 2;\n areaSum = new Adder();\n return area;\n }\n};\n\nfunction areaRingStart() {\n areaStream.point = areaPointFirst;\n}\n\nfunction areaPointFirst(x, y) {\n areaStream.point = areaPoint;\n x00 = x0 = x, y00 = y0 = y;\n}\n\nfunction areaPoint(x, y) {\n areaRingSum.add(y0 * x - x0 * y);\n x0 = x, y0 = y;\n}\n\nfunction areaRingEnd() {\n areaPoint(x00, y00);\n}\n\nexport default areaStream;\n","import noop from \"../noop.js\";\n\nvar x0 = Infinity,\n y0 = x0,\n x1 = -x0,\n y1 = x1;\n\nvar boundsStream = {\n point: boundsPoint,\n lineStart: noop,\n lineEnd: noop,\n polygonStart: noop,\n polygonEnd: noop,\n result: function() {\n var bounds = [[x0, y0], [x1, y1]];\n x1 = y1 = -(y0 = x0 = Infinity);\n return bounds;\n }\n};\n\nfunction boundsPoint(x, y) {\n if (x < x0) x0 = x;\n if (x > x1) x1 = x;\n if (y < y0) y0 = y;\n if (y > y1) y1 = y;\n}\n\nexport default boundsStream;\n","import {sqrt} from \"../math.js\";\n\n// TODO Enforce positive area for exterior, negative area for interior?\n\nvar X0 = 0,\n Y0 = 0,\n Z0 = 0,\n X1 = 0,\n Y1 = 0,\n Z1 = 0,\n X2 = 0,\n Y2 = 0,\n Z2 = 0,\n x00,\n y00,\n x0,\n y0;\n\nvar centroidStream = {\n point: centroidPoint,\n lineStart: centroidLineStart,\n lineEnd: centroidLineEnd,\n polygonStart: function() {\n centroidStream.lineStart = centroidRingStart;\n centroidStream.lineEnd = centroidRingEnd;\n },\n polygonEnd: function() {\n centroidStream.point = centroidPoint;\n centroidStream.lineStart = centroidLineStart;\n centroidStream.lineEnd = centroidLineEnd;\n },\n result: function() {\n var centroid = Z2 ? [X2 / Z2, Y2 / Z2]\n : Z1 ? [X1 / Z1, Y1 / Z1]\n : Z0 ? [X0 / Z0, Y0 / Z0]\n : [NaN, NaN];\n X0 = Y0 = Z0 =\n X1 = Y1 = Z1 =\n X2 = Y2 = Z2 = 0;\n return centroid;\n }\n};\n\nfunction centroidPoint(x, y) {\n X0 += x;\n Y0 += y;\n ++Z0;\n}\n\nfunction centroidLineStart() {\n centroidStream.point = centroidPointFirstLine;\n}\n\nfunction centroidPointFirstLine(x, y) {\n centroidStream.point = centroidPointLine;\n centroidPoint(x0 = x, y0 = y);\n}\n\nfunction centroidPointLine(x, y) {\n var dx = x - x0, dy = y - y0, z = sqrt(dx * dx + dy * dy);\n X1 += z * (x0 + x) / 2;\n Y1 += z * (y0 + y) / 2;\n Z1 += z;\n centroidPoint(x0 = x, y0 = y);\n}\n\nfunction centroidLineEnd() {\n centroidStream.point = centroidPoint;\n}\n\nfunction centroidRingStart() {\n centroidStream.point = centroidPointFirstRing;\n}\n\nfunction centroidRingEnd() {\n centroidPointRing(x00, y00);\n}\n\nfunction centroidPointFirstRing(x, y) {\n centroidStream.point = centroidPointRing;\n centroidPoint(x00 = x0 = x, y00 = y0 = y);\n}\n\nfunction centroidPointRing(x, y) {\n var dx = x - x0,\n dy = y - y0,\n z = sqrt(dx * dx + dy * dy);\n\n X1 += z * (x0 + x) / 2;\n Y1 += z * (y0 + y) / 2;\n Z1 += z;\n\n z = y0 * x - x0 * y;\n X2 += z * (x0 + x);\n Y2 += z * (y0 + y);\n Z2 += z * 3;\n centroidPoint(x0 = x, y0 = y);\n}\n\nexport default centroidStream;\n","import {tau} from \"../math.js\";\nimport noop from \"../noop.js\";\n\nexport default function PathContext(context) {\n this._context = context;\n}\n\nPathContext.prototype = {\n _radius: 4.5,\n pointRadius: function(_) {\n return this._radius = _, this;\n },\n polygonStart: function() {\n this._line = 0;\n },\n polygonEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._point = 0;\n },\n lineEnd: function() {\n if (this._line === 0) this._context.closePath();\n this._point = NaN;\n },\n point: function(x, y) {\n switch (this._point) {\n case 0: {\n this._context.moveTo(x, y);\n this._point = 1;\n break;\n }\n case 1: {\n this._context.lineTo(x, y);\n break;\n }\n default: {\n this._context.moveTo(x + this._radius, y);\n this._context.arc(x, y, this._radius, 0, tau);\n break;\n }\n }\n },\n result: noop\n};\n","import {Adder} from \"d3-array\";\nimport {sqrt} from \"../math.js\";\nimport noop from \"../noop.js\";\n\nvar lengthSum = new Adder(),\n lengthRing,\n x00,\n y00,\n x0,\n y0;\n\nvar lengthStream = {\n point: noop,\n lineStart: function() {\n lengthStream.point = lengthPointFirst;\n },\n lineEnd: function() {\n if (lengthRing) lengthPoint(x00, y00);\n lengthStream.point = noop;\n },\n polygonStart: function() {\n lengthRing = true;\n },\n polygonEnd: function() {\n lengthRing = null;\n },\n result: function() {\n var length = +lengthSum;\n lengthSum = new Adder();\n return length;\n }\n};\n\nfunction lengthPointFirst(x, y) {\n lengthStream.point = lengthPoint;\n x00 = x0 = x, y00 = y0 = y;\n}\n\nfunction lengthPoint(x, y) {\n x0 -= x, y0 -= y;\n lengthSum.add(sqrt(x0 * x0 + y0 * y0));\n x0 = x, y0 = y;\n}\n\nexport default lengthStream;\n","// Simple caching for constant-radius points.\nlet cacheDigits, cacheAppend, cacheRadius, cacheCircle;\n\nexport default class PathString {\n constructor(digits) {\n this._append = digits == null ? append : appendRound(digits);\n this._radius = 4.5;\n this._ = \"\";\n }\n pointRadius(_) {\n this._radius = +_;\n return this;\n }\n polygonStart() {\n this._line = 0;\n }\n polygonEnd() {\n this._line = NaN;\n }\n lineStart() {\n this._point = 0;\n }\n lineEnd() {\n if (this._line === 0) this._ += \"Z\";\n this._point = NaN;\n }\n point(x, y) {\n switch (this._point) {\n case 0: {\n this._append`M${x},${y}`;\n this._point = 1;\n break;\n }\n case 1: {\n this._append`L${x},${y}`;\n break;\n }\n default: {\n this._append`M${x},${y}`;\n if (this._radius !== cacheRadius || this._append !== cacheAppend) {\n const r = this._radius;\n const s = this._;\n this._ = \"\"; // stash the old string so we can cache the circle path fragment\n this._append`m0,${r}a${r},${r} 0 1,1 0,${-2 * r}a${r},${r} 0 1,1 0,${2 * r}z`;\n cacheRadius = r;\n cacheAppend = this._append;\n cacheCircle = this._;\n this._ = s;\n }\n this._ += cacheCircle;\n break;\n }\n }\n }\n result() {\n const result = this._;\n this._ = \"\";\n return result.length ? result : null;\n }\n}\n\nfunction append(strings) {\n let i = 1;\n this._ += strings[0];\n for (const j = strings.length; i < j; ++i) {\n this._ += arguments[i] + strings[i];\n }\n}\n\nfunction appendRound(digits) {\n const d = Math.floor(digits);\n if (!(d >= 0)) throw new RangeError(`invalid digits: ${digits}`);\n if (d > 15) return append;\n if (d !== cacheDigits) {\n const k = 10 ** d;\n cacheDigits = d;\n cacheAppend = function append(strings) {\n let i = 1;\n this._ += strings[0];\n for (const j = strings.length; i < j; ++i) {\n this._ += Math.round(arguments[i] * k) / k + strings[i];\n }\n };\n }\n return cacheAppend;\n}\n","import identity from \"../identity.js\";\nimport stream from \"../stream.js\";\nimport pathArea from \"./area.js\";\nimport pathBounds from \"./bounds.js\";\nimport pathCentroid from \"./centroid.js\";\nimport PathContext from \"./context.js\";\nimport pathMeasure from \"./measure.js\";\nimport PathString from \"./string.js\";\n\nexport default function(projection, context) {\n let digits = 3,\n pointRadius = 4.5,\n projectionStream,\n contextStream;\n\n function path(object) {\n if (object) {\n if (typeof pointRadius === \"function\") contextStream.pointRadius(+pointRadius.apply(this, arguments));\n stream(object, projectionStream(contextStream));\n }\n return contextStream.result();\n }\n\n path.area = function(object) {\n stream(object, projectionStream(pathArea));\n return pathArea.result();\n };\n\n path.measure = function(object) {\n stream(object, projectionStream(pathMeasure));\n return pathMeasure.result();\n };\n\n path.bounds = function(object) {\n stream(object, projectionStream(pathBounds));\n return pathBounds.result();\n };\n\n path.centroid = function(object) {\n stream(object, projectionStream(pathCentroid));\n return pathCentroid.result();\n };\n\n path.projection = function(_) {\n if (!arguments.length) return projection;\n projectionStream = _ == null ? (projection = null, identity) : (projection = _).stream;\n return path;\n };\n\n path.context = function(_) {\n if (!arguments.length) return context;\n contextStream = _ == null ? (context = null, new PathString(digits)) : new PathContext(context = _);\n if (typeof pointRadius !== \"function\") contextStream.pointRadius(pointRadius);\n return path;\n };\n\n path.pointRadius = function(_) {\n if (!arguments.length) return pointRadius;\n pointRadius = typeof _ === \"function\" ? _ : (contextStream.pointRadius(+_), +_);\n return path;\n };\n\n path.digits = function(_) {\n if (!arguments.length) return digits;\n if (_ == null) digits = null;\n else {\n const d = Math.floor(_);\n if (!(d >= 0)) throw new RangeError(`invalid digits: ${_}`);\n digits = d;\n }\n if (context === null) contextStream = new PathString(digits);\n return path;\n };\n\n return path.projection(projection).digits(digits).context(context);\n}\n","export default function(methods) {\n return {\n stream: transformer(methods)\n };\n}\n\nexport function transformer(methods) {\n return function(stream) {\n var s = new TransformStream;\n for (var key in methods) s[key] = methods[key];\n s.stream = stream;\n return s;\n };\n}\n\nfunction TransformStream() {}\n\nTransformStream.prototype = {\n constructor: TransformStream,\n point: function(x, y) { this.stream.point(x, y); },\n sphere: function() { this.stream.sphere(); },\n lineStart: function() { this.stream.lineStart(); },\n lineEnd: function() { this.stream.lineEnd(); },\n polygonStart: function() { this.stream.polygonStart(); },\n polygonEnd: function() { this.stream.polygonEnd(); }\n};\n","import {default as geoStream} from \"../stream.js\";\nimport boundsStream from \"../path/bounds.js\";\n\nfunction fit(projection, fitBounds, object) {\n var clip = projection.clipExtent && projection.clipExtent();\n projection.scale(150).translate([0, 0]);\n if (clip != null) projection.clipExtent(null);\n geoStream(object, projection.stream(boundsStream));\n fitBounds(boundsStream.result());\n if (clip != null) projection.clipExtent(clip);\n return projection;\n}\n\nexport function fitExtent(projection, extent, object) {\n return fit(projection, function(b) {\n var w = extent[1][0] - extent[0][0],\n h = extent[1][1] - extent[0][1],\n k = Math.min(w / (b[1][0] - b[0][0]), h / (b[1][1] - b[0][1])),\n x = +extent[0][0] + (w - k * (b[1][0] + b[0][0])) / 2,\n y = +extent[0][1] + (h - k * (b[1][1] + b[0][1])) / 2;\n projection.scale(150 * k).translate([x, y]);\n }, object);\n}\n\nexport function fitSize(projection, size, object) {\n return fitExtent(projection, [[0, 0], size], object);\n}\n\nexport function fitWidth(projection, width, object) {\n return fit(projection, function(b) {\n var w = +width,\n k = w / (b[1][0] - b[0][0]),\n x = (w - k * (b[1][0] + b[0][0])) / 2,\n y = -k * b[0][1];\n projection.scale(150 * k).translate([x, y]);\n }, object);\n}\n\nexport function fitHeight(projection, height, object) {\n return fit(projection, function(b) {\n var h = +height,\n k = h / (b[1][1] - b[0][1]),\n x = -k * b[0][0],\n y = (h - k * (b[1][1] + b[0][1])) / 2;\n projection.scale(150 * k).translate([x, y]);\n }, object);\n}\n","import {cartesian} from \"../cartesian.js\";\nimport {abs, asin, atan2, cos, epsilon, radians, sqrt} from \"../math.js\";\nimport {transformer} from \"../transform.js\";\n\nvar maxDepth = 16, // maximum depth of subdivision\n cosMinDistance = cos(30 * radians); // cos(minimum angular distance)\n\nexport default function(project, delta2) {\n return +delta2 ? resample(project, delta2) : resampleNone(project);\n}\n\nfunction resampleNone(project) {\n return transformer({\n point: function(x, y) {\n x = project(x, y);\n this.stream.point(x[0], x[1]);\n }\n });\n}\n\nfunction resample(project, delta2) {\n\n function resampleLineTo(x0, y0, lambda0, a0, b0, c0, x1, y1, lambda1, a1, b1, c1, depth, stream) {\n var dx = x1 - x0,\n dy = y1 - y0,\n d2 = dx * dx + dy * dy;\n if (d2 > 4 * delta2 && depth--) {\n var a = a0 + a1,\n b = b0 + b1,\n c = c0 + c1,\n m = sqrt(a * a + b * b + c * c),\n phi2 = asin(c /= m),\n lambda2 = abs(abs(c) - 1) < epsilon || abs(lambda0 - lambda1) < epsilon ? (lambda0 + lambda1) / 2 : atan2(b, a),\n p = project(lambda2, phi2),\n x2 = p[0],\n y2 = p[1],\n dx2 = x2 - x0,\n dy2 = y2 - y0,\n dz = dy * dx2 - dx * dy2;\n if (dz * dz / d2 > delta2 // perpendicular projected distance\n || abs((dx * dx2 + dy * dy2) / d2 - 0.5) > 0.3 // midpoint close to an end\n || a0 * a1 + b0 * b1 + c0 * c1 < cosMinDistance) { // angular distance\n resampleLineTo(x0, y0, lambda0, a0, b0, c0, x2, y2, lambda2, a /= m, b /= m, c, depth, stream);\n stream.point(x2, y2);\n resampleLineTo(x2, y2, lambda2, a, b, c, x1, y1, lambda1, a1, b1, c1, depth, stream);\n }\n }\n }\n return function(stream) {\n var lambda00, x00, y00, a00, b00, c00, // first point\n lambda0, x0, y0, a0, b0, c0; // previous point\n\n var resampleStream = {\n point: point,\n lineStart: lineStart,\n lineEnd: lineEnd,\n polygonStart: function() { stream.polygonStart(); resampleStream.lineStart = ringStart; },\n polygonEnd: function() { stream.polygonEnd(); resampleStream.lineStart = lineStart; }\n };\n\n function point(x, y) {\n x = project(x, y);\n stream.point(x[0], x[1]);\n }\n\n function lineStart() {\n x0 = NaN;\n resampleStream.point = linePoint;\n stream.lineStart();\n }\n\n function linePoint(lambda, phi) {\n var c = cartesian([lambda, phi]), p = project(lambda, phi);\n resampleLineTo(x0, y0, lambda0, a0, b0, c0, x0 = p[0], y0 = p[1], lambda0 = lambda, a0 = c[0], b0 = c[1], c0 = c[2], maxDepth, stream);\n stream.point(x0, y0);\n }\n\n function lineEnd() {\n resampleStream.point = point;\n stream.lineEnd();\n }\n\n function ringStart() {\n lineStart();\n resampleStream.point = ringPoint;\n resampleStream.lineEnd = ringEnd;\n }\n\n function ringPoint(lambda, phi) {\n linePoint(lambda00 = lambda, phi), x00 = x0, y00 = y0, a00 = a0, b00 = b0, c00 = c0;\n resampleStream.point = linePoint;\n }\n\n function ringEnd() {\n resampleLineTo(x0, y0, lambda0, a0, b0, c0, x00, y00, lambda00, a00, b00, c00, maxDepth, stream);\n resampleStream.lineEnd = lineEnd;\n lineEnd();\n }\n\n return resampleStream;\n };\n}\n","import clipAntimeridian from \"../clip/antimeridian.js\";\nimport clipCircle from \"../clip/circle.js\";\nimport clipRectangle from \"../clip/rectangle.js\";\nimport compose from \"../compose.js\";\nimport identity from \"../identity.js\";\nimport {cos, degrees, radians, sin, sqrt} from \"../math.js\";\nimport {rotateRadians} from \"../rotation.js\";\nimport {transformer} from \"../transform.js\";\nimport {fitExtent, fitSize, fitWidth, fitHeight} from \"./fit.js\";\nimport resample from \"./resample.js\";\n\nvar transformRadians = transformer({\n point: function(x, y) {\n this.stream.point(x * radians, y * radians);\n }\n});\n\nfunction transformRotate(rotate) {\n return transformer({\n point: function(x, y) {\n var r = rotate(x, y);\n return this.stream.point(r[0], r[1]);\n }\n });\n}\n\nfunction scaleTranslate(k, dx, dy, sx, sy) {\n function transform(x, y) {\n x *= sx; y *= sy;\n return [dx + k * x, dy - k * y];\n }\n transform.invert = function(x, y) {\n return [(x - dx) / k * sx, (dy - y) / k * sy];\n };\n return transform;\n}\n\nfunction scaleTranslateRotate(k, dx, dy, sx, sy, alpha) {\n if (!alpha) return scaleTranslate(k, dx, dy, sx, sy);\n var cosAlpha = cos(alpha),\n sinAlpha = sin(alpha),\n a = cosAlpha * k,\n b = sinAlpha * k,\n ai = cosAlpha / k,\n bi = sinAlpha / k,\n ci = (sinAlpha * dy - cosAlpha * dx) / k,\n fi = (sinAlpha * dx + cosAlpha * dy) / k;\n function transform(x, y) {\n x *= sx; y *= sy;\n return [a * x - b * y + dx, dy - b * x - a * y];\n }\n transform.invert = function(x, y) {\n return [sx * (ai * x - bi * y + ci), sy * (fi - bi * x - ai * y)];\n };\n return transform;\n}\n\nexport default function projection(project) {\n return projectionMutator(function() { return project; })();\n}\n\nexport function projectionMutator(projectAt) {\n var project,\n k = 150, // scale\n x = 480, y = 250, // translate\n lambda = 0, phi = 0, // center\n deltaLambda = 0, deltaPhi = 0, deltaGamma = 0, rotate, // pre-rotate\n alpha = 0, // post-rotate angle\n sx = 1, // reflectX\n sy = 1, // reflectX\n theta = null, preclip = clipAntimeridian, // pre-clip angle\n x0 = null, y0, x1, y1, postclip = identity, // post-clip extent\n delta2 = 0.5, // precision\n projectResample,\n projectTransform,\n projectRotateTransform,\n cache,\n cacheStream;\n\n function projection(point) {\n return projectRotateTransform(point[0] * radians, point[1] * radians);\n }\n\n function invert(point) {\n point = projectRotateTransform.invert(point[0], point[1]);\n return point && [point[0] * degrees, point[1] * degrees];\n }\n\n projection.stream = function(stream) {\n return cache && cacheStream === stream ? cache : cache = transformRadians(transformRotate(rotate)(preclip(projectResample(postclip(cacheStream = stream)))));\n };\n\n projection.preclip = function(_) {\n return arguments.length ? (preclip = _, theta = undefined, reset()) : preclip;\n };\n\n projection.postclip = function(_) {\n return arguments.length ? (postclip = _, x0 = y0 = x1 = y1 = null, reset()) : postclip;\n };\n\n projection.clipAngle = function(_) {\n return arguments.length ? (preclip = +_ ? clipCircle(theta = _ * radians) : (theta = null, clipAntimeridian), reset()) : theta * degrees;\n };\n\n projection.clipExtent = function(_) {\n return arguments.length ? (postclip = _ == null ? (x0 = y0 = x1 = y1 = null, identity) : clipRectangle(x0 = +_[0][0], y0 = +_[0][1], x1 = +_[1][0], y1 = +_[1][1]), reset()) : x0 == null ? null : [[x0, y0], [x1, y1]];\n };\n\n projection.scale = function(_) {\n return arguments.length ? (k = +_, recenter()) : k;\n };\n\n projection.translate = function(_) {\n return arguments.length ? (x = +_[0], y = +_[1], recenter()) : [x, y];\n };\n\n projection.center = function(_) {\n return arguments.length ? (lambda = _[0] % 360 * radians, phi = _[1] % 360 * radians, recenter()) : [lambda * degrees, phi * degrees];\n };\n\n projection.rotate = function(_) {\n return arguments.length ? (deltaLambda = _[0] % 360 * radians, deltaPhi = _[1] % 360 * radians, deltaGamma = _.length > 2 ? _[2] % 360 * radians : 0, recenter()) : [deltaLambda * degrees, deltaPhi * degrees, deltaGamma * degrees];\n };\n\n projection.angle = function(_) {\n return arguments.length ? (alpha = _ % 360 * radians, recenter()) : alpha * degrees;\n };\n\n projection.reflectX = function(_) {\n return arguments.length ? (sx = _ ? -1 : 1, recenter()) : sx < 0;\n };\n\n projection.reflectY = function(_) {\n return arguments.length ? (sy = _ ? -1 : 1, recenter()) : sy < 0;\n };\n\n projection.precision = function(_) {\n return arguments.length ? (projectResample = resample(projectTransform, delta2 = _ * _), reset()) : sqrt(delta2);\n };\n\n projection.fitExtent = function(extent, object) {\n return fitExtent(projection, extent, object);\n };\n\n projection.fitSize = function(size, object) {\n return fitSize(projection, size, object);\n };\n\n projection.fitWidth = function(width, object) {\n return fitWidth(projection, width, object);\n };\n\n projection.fitHeight = function(height, object) {\n return fitHeight(projection, height, object);\n };\n\n function recenter() {\n var center = scaleTranslateRotate(k, 0, 0, sx, sy, alpha).apply(null, project(lambda, phi)),\n transform = scaleTranslateRotate(k, x - center[0], y - center[1], sx, sy, alpha);\n rotate = rotateRadians(deltaLambda, deltaPhi, deltaGamma);\n projectTransform = compose(project, transform);\n projectRotateTransform = compose(rotate, projectTransform);\n projectResample = resample(projectTransform, delta2);\n return reset();\n }\n\n function reset() {\n cache = cacheStream = null;\n return projection;\n }\n\n return function() {\n project = projectAt.apply(this, arguments);\n projection.invert = project.invert && invert;\n return recenter();\n };\n}\n","import {degrees, pi, radians} from \"../math.js\";\nimport {projectionMutator} from \"./index.js\";\n\nexport function conicProjection(projectAt) {\n var phi0 = 0,\n phi1 = pi / 3,\n m = projectionMutator(projectAt),\n p = m(phi0, phi1);\n\n p.parallels = function(_) {\n return arguments.length ? m(phi0 = _[0] * radians, phi1 = _[1] * radians) : [phi0 * degrees, phi1 * degrees];\n };\n\n return p;\n}\n","import {asin, cos, sin} from \"../math.js\";\n\nexport function cylindricalEqualAreaRaw(phi0) {\n var cosPhi0 = cos(phi0);\n\n function forward(lambda, phi) {\n return [lambda * cosPhi0, sin(phi) / cosPhi0];\n }\n\n forward.invert = function(x, y) {\n return [x / cosPhi0, asin(y * cosPhi0)];\n };\n\n return forward;\n}\n","import {abs, asin, atan2, cos, epsilon, pi, sign, sin, sqrt} from \"../math.js\";\nimport {conicProjection} from \"./conic.js\";\nimport {cylindricalEqualAreaRaw} from \"./cylindricalEqualArea.js\";\n\nexport function conicEqualAreaRaw(y0, y1) {\n var sy0 = sin(y0), n = (sy0 + sin(y1)) / 2;\n\n // Are the parallels symmetrical around the Equator?\n if (abs(n) < epsilon) return cylindricalEqualAreaRaw(y0);\n\n var c = 1 + sy0 * (2 * n - sy0), r0 = sqrt(c) / n;\n\n function project(x, y) {\n var r = sqrt(c - 2 * n * sin(y)) / n;\n return [r * sin(x *= n), r0 - r * cos(x)];\n }\n\n project.invert = function(x, y) {\n var r0y = r0 - y,\n l = atan2(x, abs(r0y)) * sign(r0y);\n if (r0y * n < 0)\n l -= pi * sign(x) * sign(r0y);\n return [l / n, asin((c - (x * x + r0y * r0y) * n * n) / (2 * n))];\n };\n\n return project;\n}\n\nexport default function() {\n return conicProjection(conicEqualAreaRaw)\n .scale(155.424)\n .center([0, 33.6442]);\n}\n","import conicEqualArea from \"./conicEqualArea.js\";\n\nexport default function() {\n return conicEqualArea()\n .parallels([29.5, 45.5])\n .scale(1070)\n .translate([480, 250])\n .rotate([96, 0])\n .center([-0.6, 38.7]);\n}\n","import {atan, exp, halfPi, log, pi, tan, tau} from \"../math.js\";\nimport rotation from \"../rotation.js\";\nimport projection from \"./index.js\";\n\nexport function mercatorRaw(lambda, phi) {\n return [lambda, log(tan((halfPi + phi) / 2))];\n}\n\nmercatorRaw.invert = function(x, y) {\n return [x, 2 * atan(exp(y)) - halfPi];\n};\n\nexport default function() {\n return mercatorProjection(mercatorRaw)\n .scale(961 / tau);\n}\n\nexport function mercatorProjection(project) {\n var m = projection(project),\n center = m.center,\n scale = m.scale,\n translate = m.translate,\n clipExtent = m.clipExtent,\n x0 = null, y0, x1, y1; // clip extent\n\n m.scale = function(_) {\n return arguments.length ? (scale(_), reclip()) : scale();\n };\n\n m.translate = function(_) {\n return arguments.length ? (translate(_), reclip()) : translate();\n };\n\n m.center = function(_) {\n return arguments.length ? (center(_), reclip()) : center();\n };\n\n m.clipExtent = function(_) {\n return arguments.length ? ((_ == null ? x0 = y0 = x1 = y1 = null : (x0 = +_[0][0], y0 = +_[0][1], x1 = +_[1][0], y1 = +_[1][1])), reclip()) : x0 == null ? null : [[x0, y0], [x1, y1]];\n };\n\n function reclip() {\n var k = pi * scale(),\n t = m(rotation(m.rotate()).invert([0, 0]));\n return clipExtent(x0 == null\n ? [[t[0] - k, t[1] - k], [t[0] + k, t[1] + k]] : project === mercatorRaw\n ? [[Math.max(t[0] - k, x0), y0], [Math.min(t[0] + k, x1), y1]]\n : [[x0, Math.max(t[1] - k, y0)], [x1, Math.min(t[1] + k, y1)]]);\n }\n\n return reclip();\n}\n","import projection from \"./index.js\";\n\nexport function equirectangularRaw(lambda, phi) {\n return [lambda, phi];\n}\n\nequirectangularRaw.invert = equirectangularRaw;\n\nexport default function() {\n return projection(equirectangularRaw)\n .scale(152.63);\n}\n","import {abs, atan2, cos, epsilon, pi, sign, sin, sqrt} from \"../math.js\";\nimport {conicProjection} from \"./conic.js\";\nimport {equirectangularRaw} from \"./equirectangular.js\";\n\nexport function conicEquidistantRaw(y0, y1) {\n var cy0 = cos(y0),\n n = y0 === y1 ? sin(y0) : (cy0 - cos(y1)) / (y1 - y0),\n g = cy0 / n + y0;\n\n if (abs(n) < epsilon) return equirectangularRaw;\n\n function project(x, y) {\n var gy = g - y, nx = n * x;\n return [gy * sin(nx), g - gy * cos(nx)];\n }\n\n project.invert = function(x, y) {\n var gy = g - y,\n l = atan2(x, abs(gy)) * sign(gy);\n if (gy * n < 0)\n l -= pi * sign(x) * sign(gy);\n return [l / n, g - sign(n) * sqrt(x * x + gy * gy)];\n };\n\n return project;\n}\n\nexport default function() {\n return conicProjection(conicEquidistantRaw)\n .scale(131.154)\n .center([0, 13.9389]);\n}\n","import projection from \"./index.js\";\nimport {abs, asin, cos, epsilon2, sin, sqrt} from \"../math.js\";\n\nvar A1 = 1.340264,\n A2 = -0.081106,\n A3 = 0.000893,\n A4 = 0.003796,\n M = sqrt(3) / 2,\n iterations = 12;\n\nexport function equalEarthRaw(lambda, phi) {\n var l = asin(M * sin(phi)), l2 = l * l, l6 = l2 * l2 * l2;\n return [\n lambda * cos(l) / (M * (A1 + 3 * A2 * l2 + l6 * (7 * A3 + 9 * A4 * l2))),\n l * (A1 + A2 * l2 + l6 * (A3 + A4 * l2))\n ];\n}\n\nequalEarthRaw.invert = function(x, y) {\n var l = y, l2 = l * l, l6 = l2 * l2 * l2;\n for (var i = 0, delta, fy, fpy; i < iterations; ++i) {\n fy = l * (A1 + A2 * l2 + l6 * (A3 + A4 * l2)) - y;\n fpy = A1 + 3 * A2 * l2 + l6 * (7 * A3 + 9 * A4 * l2);\n l -= delta = fy / fpy, l2 = l * l, l6 = l2 * l2 * l2;\n if (abs(delta) < epsilon2) break;\n }\n return [\n M * x * (A1 + 3 * A2 * l2 + l6 * (7 * A3 + 9 * A4 * l2)) / cos(l),\n asin(sin(l) / M)\n ];\n};\n\nexport default function() {\n return projection(equalEarthRaw)\n .scale(177.158);\n}\n","import projection from \"./index.js\";\nimport {abs, epsilon} from \"../math.js\";\n\nexport function naturalEarth1Raw(lambda, phi) {\n var phi2 = phi * phi, phi4 = phi2 * phi2;\n return [\n lambda * (0.8707 - 0.131979 * phi2 + phi4 * (-0.013791 + phi4 * (0.003971 * phi2 - 0.001529 * phi4))),\n phi * (1.007226 + phi2 * (0.015085 + phi4 * (-0.044475 + 0.028874 * phi2 - 0.005916 * phi4)))\n ];\n}\n\nnaturalEarth1Raw.invert = function(x, y) {\n var phi = y, i = 25, delta;\n do {\n var phi2 = phi * phi, phi4 = phi2 * phi2;\n phi -= delta = (phi * (1.007226 + phi2 * (0.015085 + phi4 * (-0.044475 + 0.028874 * phi2 - 0.005916 * phi4))) - y) /\n (1.007226 + phi2 * (0.015085 * 3 + phi4 * (-0.044475 * 7 + 0.028874 * 9 * phi2 - 0.005916 * 11 * phi4)));\n } while (abs(delta) > epsilon && --i > 0);\n return [\n x / (0.8707 + (phi2 = phi * phi) * (-0.131979 + phi2 * (-0.013791 + phi2 * phi2 * phi2 * (0.003971 - 0.001529 * phi2)))),\n phi\n ];\n};\n\nexport default function() {\n return projection(naturalEarth1Raw)\n .scale(175.295);\n}\n","function defaultSeparation(a, b) {\n return a.parent === b.parent ? 1 : 2;\n}\n\nfunction meanX(children) {\n return children.reduce(meanXReduce, 0) / children.length;\n}\n\nfunction meanXReduce(x, c) {\n return x + c.x;\n}\n\nfunction maxY(children) {\n return 1 + children.reduce(maxYReduce, 0);\n}\n\nfunction maxYReduce(y, c) {\n return Math.max(y, c.y);\n}\n\nfunction leafLeft(node) {\n var children;\n while (children = node.children) node = children[0];\n return node;\n}\n\nfunction leafRight(node) {\n var children;\n while (children = node.children) node = children[children.length - 1];\n return node;\n}\n\nexport default function() {\n var separation = defaultSeparation,\n dx = 1,\n dy = 1,\n nodeSize = false;\n\n function cluster(root) {\n var previousNode,\n x = 0;\n\n // First walk, computing the initial x & y values.\n root.eachAfter(function(node) {\n var children = node.children;\n if (children) {\n node.x = meanX(children);\n node.y = maxY(children);\n } else {\n node.x = previousNode ? x += separation(node, previousNode) : 0;\n node.y = 0;\n previousNode = node;\n }\n });\n\n var left = leafLeft(root),\n right = leafRight(root),\n x0 = left.x - separation(left, right) / 2,\n x1 = right.x + separation(right, left) / 2;\n\n // Second walk, normalizing x & y to the desired size.\n return root.eachAfter(nodeSize ? function(node) {\n node.x = (node.x - root.x) * dx;\n node.y = (root.y - node.y) * dy;\n } : function(node) {\n node.x = (node.x - x0) / (x1 - x0) * dx;\n node.y = (1 - (root.y ? node.y / root.y : 1)) * dy;\n });\n }\n\n cluster.separation = function(x) {\n return arguments.length ? (separation = x, cluster) : separation;\n };\n\n cluster.size = function(x) {\n return arguments.length ? (nodeSize = false, dx = +x[0], dy = +x[1], cluster) : (nodeSize ? null : [dx, dy]);\n };\n\n cluster.nodeSize = function(x) {\n return arguments.length ? (nodeSize = true, dx = +x[0], dy = +x[1], cluster) : (nodeSize ? [dx, dy] : null);\n };\n\n return cluster;\n}\n","function count(node) {\n var sum = 0,\n children = node.children,\n i = children && children.length;\n if (!i) sum = 1;\n else while (--i >= 0) sum += children[i].value;\n node.value = sum;\n}\n\nexport default function() {\n return this.eachAfter(count);\n}\n","export default function(callback, that) {\n let index = -1;\n for (const node of this) {\n callback.call(that, node, ++index, this);\n }\n return this;\n}\n","export default function(callback, that) {\n var node = this, nodes = [node], children, i, index = -1;\n while (node = nodes.pop()) {\n callback.call(that, node, ++index, this);\n if (children = node.children) {\n for (i = children.length - 1; i >= 0; --i) {\n nodes.push(children[i]);\n }\n }\n }\n return this;\n}\n","export default function(callback, that) {\n var node = this, nodes = [node], next = [], children, i, n, index = -1;\n while (node = nodes.pop()) {\n next.push(node);\n if (children = node.children) {\n for (i = 0, n = children.length; i < n; ++i) {\n nodes.push(children[i]);\n }\n }\n }\n while (node = next.pop()) {\n callback.call(that, node, ++index, this);\n }\n return this;\n}\n","export default function(callback, that) {\n let index = -1;\n for (const node of this) {\n if (callback.call(that, node, ++index, this)) {\n return node;\n }\n }\n}\n","export default function(value) {\n return this.eachAfter(function(node) {\n var sum = +value(node.data) || 0,\n children = node.children,\n i = children && children.length;\n while (--i >= 0) sum += children[i].value;\n node.value = sum;\n });\n}\n","export default function(compare) {\n return this.eachBefore(function(node) {\n if (node.children) {\n node.children.sort(compare);\n }\n });\n}\n","export default function(end) {\n var start = this,\n ancestor = leastCommonAncestor(start, end),\n 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 return nodes;\n}\n\nfunction leastCommonAncestor(a, b) {\n if (a === b) return a;\n var aNodes = a.ancestors(),\n bNodes = b.ancestors(),\n c = null;\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","export default function() {\n var node = this, nodes = [node];\n while (node = node.parent) {\n nodes.push(node);\n }\n return nodes;\n}\n","export default function() {\n return Array.from(this);\n}\n","export default function() {\n var leaves = [];\n this.eachBefore(function(node) {\n if (!node.children) {\n leaves.push(node);\n }\n });\n return leaves;\n}\n","export default function() {\n var root = this, 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","export default function*() {\n var node = this, current, next = [node], children, i, n;\n do {\n current = next.reverse(), next = [];\n while (node = current.pop()) {\n yield node;\n if (children = node.children) {\n for (i = 0, n = children.length; i < n; ++i) {\n next.push(children[i]);\n }\n }\n }\n } while (next.length);\n}\n","import node_count from \"./count.js\";\nimport node_each from \"./each.js\";\nimport node_eachBefore from \"./eachBefore.js\";\nimport node_eachAfter from \"./eachAfter.js\";\nimport node_find from \"./find.js\";\nimport node_sum from \"./sum.js\";\nimport node_sort from \"./sort.js\";\nimport node_path from \"./path.js\";\nimport node_ancestors from \"./ancestors.js\";\nimport node_descendants from \"./descendants.js\";\nimport node_leaves from \"./leaves.js\";\nimport node_links from \"./links.js\";\nimport node_iterator from \"./iterator.js\";\n\nexport default function hierarchy(data, children) {\n if (data instanceof Map) {\n data = [undefined, data];\n if (children === undefined) children = mapChildren;\n } else if (children === undefined) {\n children = objectChildren;\n }\n\n var root = new Node(data),\n node,\n nodes = [root],\n child,\n childs,\n i,\n n;\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 Node(childs[i]));\n child.parent = node;\n child.depth = node.depth + 1;\n }\n }\n }\n\n return root.eachBefore(computeHeight);\n}\n\nfunction node_copy() {\n return hierarchy(this).eachBefore(copyData);\n}\n\nfunction objectChildren(d) {\n return d.children;\n}\n\nfunction mapChildren(d) {\n return Array.isArray(d) ? d[1] : null;\n}\n\nfunction copyData(node) {\n if (node.data.value !== undefined) node.value = node.data.value;\n node.data = node.data.data;\n}\n\nexport function computeHeight(node) {\n var height = 0;\n do node.height = height;\n while ((node = node.parent) && (node.height < ++height));\n}\n\nexport function Node(data) {\n this.data = data;\n this.depth =\n this.height = 0;\n this.parent = null;\n}\n\nNode.prototype = hierarchy.prototype = {\n constructor: Node,\n count: node_count,\n each: node_each,\n eachAfter: node_eachAfter,\n eachBefore: node_eachBefore,\n find: node_find,\n sum: node_sum,\n sort: node_sort,\n path: node_path,\n ancestors: node_ancestors,\n descendants: node_descendants,\n leaves: node_leaves,\n links: node_links,\n copy: node_copy,\n [Symbol.iterator]: node_iterator\n};\n","export function optional(f) {\n return f == null ? null : required(f);\n}\n\nexport function required(f) {\n if (typeof f !== \"function\") throw new Error;\n return f;\n}\n","export function constantZero() {\n return 0;\n}\n\nexport default function(x) {\n return function() {\n return x;\n };\n}\n","// https://en.wikipedia.org/wiki/Linear_congruential_generator#Parameters_in_common_use\nconst a = 1664525;\nconst c = 1013904223;\nconst m = 4294967296; // 2^32\n\nexport default function() {\n let s = 1;\n return () => (s = (a * s + c) % m) / m;\n}\n","export default function(x) {\n return typeof x === \"object\" && \"length\" in x\n ? x // Array, TypedArray, NodeList, array-like\n : Array.from(x); // Map, Set, iterable, string, or anything else\n}\n\nexport function shuffle(array, random) {\n let m = array.length,\n t,\n i;\n\n while (m) {\n i = random() * m-- | 0;\n t = array[m];\n array[m] = array[i];\n array[i] = t;\n }\n\n return array;\n}\n","import {shuffle} from \"../array.js\";\nimport lcg from \"../lcg.js\";\n\nexport default function(circles) {\n return packEncloseRandom(circles, lcg());\n}\n\nexport function packEncloseRandom(circles, random) {\n var i = 0, n = (circles = shuffle(Array.from(circles), random)).length, B = [], p, e;\n\n while (i < n) {\n p = circles[i];\n if (e && enclosesWeak(e, p)) ++i;\n else e = encloseBasis(B = extendBasis(B, p)), i = 0;\n }\n\n return e;\n}\n\nfunction extendBasis(B, p) {\n var i, j;\n\n if (enclosesWeakAll(p, B)) return [p];\n\n // If we get here then B must have at least one element.\n for (i = 0; i < B.length; ++i) {\n if (enclosesNot(p, B[i])\n && enclosesWeakAll(encloseBasis2(B[i], p), B)) {\n return [B[i], p];\n }\n }\n\n // If we get here then B must have at least two elements.\n for (i = 0; i < B.length - 1; ++i) {\n for (j = i + 1; j < B.length; ++j) {\n if (enclosesNot(encloseBasis2(B[i], B[j]), p)\n && enclosesNot(encloseBasis2(B[i], p), B[j])\n && enclosesNot(encloseBasis2(B[j], p), B[i])\n && enclosesWeakAll(encloseBasis3(B[i], B[j], p), B)) {\n return [B[i], B[j], p];\n }\n }\n }\n\n // If we get here then something is very wrong.\n throw new Error;\n}\n\nfunction enclosesNot(a, b) {\n var dr = a.r - b.r, dx = b.x - a.x, dy = b.y - a.y;\n return dr < 0 || dr * dr < dx * dx + dy * dy;\n}\n\nfunction enclosesWeak(a, b) {\n var dr = a.r - b.r + Math.max(a.r, b.r, 1) * 1e-9, dx = b.x - a.x, dy = b.y - a.y;\n return dr > 0 && dr * dr > dx * dx + dy * dy;\n}\n\nfunction enclosesWeakAll(a, B) {\n for (var i = 0; i < B.length; ++i) {\n if (!enclosesWeak(a, B[i])) {\n return false;\n }\n }\n return true;\n}\n\nfunction encloseBasis(B) {\n switch (B.length) {\n case 1: return encloseBasis1(B[0]);\n case 2: return encloseBasis2(B[0], B[1]);\n case 3: return encloseBasis3(B[0], B[1], B[2]);\n }\n}\n\nfunction encloseBasis1(a) {\n return {\n x: a.x,\n y: a.y,\n r: a.r\n };\n}\n\nfunction encloseBasis2(a, b) {\n var x1 = a.x, y1 = a.y, r1 = a.r,\n x2 = b.x, y2 = b.y, r2 = b.r,\n x21 = x2 - x1, y21 = y2 - y1, r21 = r2 - r1,\n l = Math.sqrt(x21 * x21 + y21 * y21);\n return {\n x: (x1 + x2 + x21 / l * r21) / 2,\n y: (y1 + y2 + y21 / l * r21) / 2,\n r: (l + r1 + r2) / 2\n };\n}\n\nfunction encloseBasis3(a, b, c) {\n var x1 = a.x, y1 = a.y, r1 = a.r,\n x2 = b.x, y2 = b.y, r2 = b.r,\n x3 = c.x, y3 = c.y, r3 = c.r,\n a2 = x1 - x2,\n a3 = x1 - x3,\n b2 = y1 - y2,\n b3 = y1 - y3,\n c2 = r2 - r1,\n c3 = r3 - r1,\n d1 = x1 * x1 + y1 * y1 - r1 * r1,\n d2 = d1 - x2 * x2 - y2 * y2 + r2 * r2,\n d3 = d1 - x3 * x3 - y3 * y3 + r3 * r3,\n ab = a3 * b2 - a2 * b3,\n xa = (b2 * d3 - b3 * d2) / (ab * 2) - x1,\n xb = (b3 * c2 - b2 * c3) / ab,\n ya = (a3 * d2 - a2 * d3) / (ab * 2) - y1,\n yb = (a2 * c3 - a3 * c2) / ab,\n A = xb * xb + yb * yb - 1,\n B = 2 * (r1 + xa * xb + ya * yb),\n C = xa * xa + ya * ya - r1 * r1,\n r = -(Math.abs(A) > 1e-6 ? (B + Math.sqrt(B * B - 4 * A * C)) / (2 * A) : C / B);\n return {\n x: x1 + xa + xb * r,\n y: y1 + ya + yb * r,\n r: r\n };\n}\n","import array from \"../array.js\";\nimport lcg from \"../lcg.js\";\nimport {packEncloseRandom} from \"./enclose.js\";\n\nfunction place(b, a, c) {\n var dx = b.x - a.x, x, a2,\n dy = b.y - a.y, y, b2,\n d2 = dx * dx + dy * dy;\n if (d2) {\n a2 = a.r + c.r, a2 *= a2;\n b2 = b.r + c.r, b2 *= b2;\n if (a2 > b2) {\n x = (d2 + b2 - a2) / (2 * d2);\n y = Math.sqrt(Math.max(0, b2 / d2 - x * x));\n c.x = b.x - x * dx - y * dy;\n c.y = b.y - x * dy + y * dx;\n } else {\n x = (d2 + a2 - b2) / (2 * d2);\n y = Math.sqrt(Math.max(0, a2 / d2 - x * x));\n c.x = a.x + x * dx - y * dy;\n c.y = a.y + x * dy + y * dx;\n }\n } else {\n c.x = a.x + c.r;\n c.y = a.y;\n }\n}\n\nfunction intersects(a, b) {\n var dr = a.r + b.r - 1e-6, dx = b.x - a.x, dy = b.y - a.y;\n return dr > 0 && dr * dr > dx * dx + dy * dy;\n}\n\nfunction score(node) {\n var a = node._,\n b = node.next._,\n ab = a.r + b.r,\n dx = (a.x * b.r + b.x * a.r) / ab,\n dy = (a.y * b.r + b.y * a.r) / ab;\n return dx * dx + dy * dy;\n}\n\nfunction Node(circle) {\n this._ = circle;\n this.next = null;\n this.previous = null;\n}\n\nexport function packSiblingsRandom(circles, random) {\n if (!(n = (circles = array(circles)).length)) return 0;\n\n var a, b, c, n, aa, ca, i, j, k, sj, sk;\n\n // Place the first circle.\n a = circles[0], a.x = 0, a.y = 0;\n if (!(n > 1)) return a.r;\n\n // Place the second circle.\n b = circles[1], a.x = -b.r, b.x = a.r, b.y = 0;\n if (!(n > 2)) return a.r + b.r;\n\n // Place the third circle.\n place(b, a, c = circles[2]);\n\n // Initialize the front-chain using the first three circles a, b and c.\n a = new Node(a), b = new Node(b), c = new Node(c);\n a.next = c.previous = b;\n b.next = a.previous = c;\n c.next = b.previous = a;\n\n // Attempt to place each remaining circle…\n pack: for (i = 3; i < n; ++i) {\n place(a._, b._, c = circles[i]), c = new Node(c);\n\n // Find the closest intersecting circle on the front-chain, if any.\n // “Closeness” is determined by linear distance along the front-chain.\n // “Ahead” or “behind” is likewise determined by linear distance.\n j = b.next, k = a.previous, sj = b._.r, sk = a._.r;\n do {\n if (sj <= sk) {\n if (intersects(j._, c._)) {\n b = j, a.next = b, b.previous = a, --i;\n continue pack;\n }\n sj += j._.r, j = j.next;\n } else {\n if (intersects(k._, c._)) {\n a = k, a.next = b, b.previous = a, --i;\n continue pack;\n }\n sk += k._.r, k = k.previous;\n }\n } while (j !== k.next);\n\n // Success! Insert the new circle c between a and b.\n c.previous = a, c.next = b, a.next = b.previous = b = c;\n\n // Compute the new closest circle pair to the centroid.\n aa = score(a);\n while ((c = c.next) !== b) {\n if ((ca = score(c)) < aa) {\n a = c, aa = ca;\n }\n }\n b = a.next;\n }\n\n // Compute the enclosing circle of the front chain.\n a = [b._], c = b; while ((c = c.next) !== b) a.push(c._); c = packEncloseRandom(a, random);\n\n // Translate the circles to put the enclosing circle around the origin.\n for (i = 0; i < n; ++i) a = circles[i], a.x -= c.x, a.y -= c.y;\n\n return c.r;\n}\n\nexport default function(circles) {\n packSiblingsRandom(circles, lcg());\n return circles;\n}\n","import {optional} from \"../accessors.js\";\nimport constant, {constantZero} from \"../constant.js\";\nimport lcg from \"../lcg.js\";\nimport {packSiblingsRandom} from \"./siblings.js\";\n\nfunction defaultRadius(d) {\n return Math.sqrt(d.value);\n}\n\nexport default function() {\n var radius = null,\n dx = 1,\n dy = 1,\n padding = constantZero;\n\n function pack(root) {\n const random = lcg();\n root.x = dx / 2, root.y = dy / 2;\n if (radius) {\n root.eachBefore(radiusLeaf(radius))\n .eachAfter(packChildrenRandom(padding, 0.5, random))\n .eachBefore(translateChild(1));\n } else {\n root.eachBefore(radiusLeaf(defaultRadius))\n .eachAfter(packChildrenRandom(constantZero, 1, random))\n .eachAfter(packChildrenRandom(padding, root.r / Math.min(dx, dy), random))\n .eachBefore(translateChild(Math.min(dx, dy) / (2 * root.r)));\n }\n return root;\n }\n\n pack.radius = function(x) {\n return arguments.length ? (radius = optional(x), pack) : radius;\n };\n\n pack.size = function(x) {\n return arguments.length ? (dx = +x[0], dy = +x[1], pack) : [dx, dy];\n };\n\n pack.padding = function(x) {\n return arguments.length ? (padding = typeof x === \"function\" ? x : constant(+x), pack) : padding;\n };\n\n return pack;\n}\n\nfunction radiusLeaf(radius) {\n return function(node) {\n if (!node.children) {\n node.r = Math.max(0, +radius(node) || 0);\n }\n };\n}\n\nfunction packChildrenRandom(padding, k, random) {\n return function(node) {\n if (children = node.children) {\n var children,\n i,\n n = children.length,\n r = padding(node) * k || 0,\n e;\n\n if (r) for (i = 0; i < n; ++i) children[i].r += r;\n e = packSiblingsRandom(children, random);\n if (r) for (i = 0; i < n; ++i) children[i].r -= r;\n node.r = e + r;\n }\n };\n}\n\nfunction translateChild(k) {\n return function(node) {\n var parent = node.parent;\n node.r *= k;\n if (parent) {\n node.x = parent.x + k * node.x;\n node.y = parent.y + k * node.y;\n }\n };\n}\n","export default function(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}\n","export default function(parent, x0, y0, x1, y1) {\n var nodes = parent.children,\n node,\n i = -1,\n n = nodes.length,\n k = parent.value && (x1 - x0) / parent.value;\n\n while (++i < n) {\n node = nodes[i], node.y0 = y0, node.y1 = y1;\n node.x0 = x0, node.x1 = x0 += node.value * k;\n }\n}\n","import {Node} from \"./hierarchy/index.js\";\n\nfunction defaultSeparation(a, b) {\n return a.parent === b.parent ? 1 : 2;\n}\n\n// function radialSeparation(a, b) {\n// return (a.parent === b.parent ? 1 : 2) / a.depth;\n// }\n\n// This function is used to traverse the left contour of a subtree (or\n// subforest). It returns the successor of v on this contour. This successor is\n// either given by the leftmost child of v or by the thread of v. The function\n// returns null if and only if v is on the highest level of its subtree.\nfunction nextLeft(v) {\n var children = v.children;\n return children ? children[0] : v.t;\n}\n\n// This function works analogously to nextLeft.\nfunction nextRight(v) {\n var children = v.children;\n return children ? children[children.length - 1] : v.t;\n}\n\n// Shifts the current subtree rooted at w+. This is done by increasing\n// prelim(w+) and mod(w+) by shift.\nfunction moveSubtree(wm, wp, shift) {\n var change = shift / (wp.i - wm.i);\n wp.c -= change;\n wp.s += shift;\n wm.c += change;\n wp.z += shift;\n wp.m += shift;\n}\n\n// All other shifts, applied to the smaller subtrees between w- and w+, are\n// performed by this function. To prepare the shifts, we have to adjust\n// change(w+), shift(w+), and change(w-).\nfunction executeShifts(v) {\n var shift = 0,\n change = 0,\n children = v.children,\n i = children.length,\n w;\n while (--i >= 0) {\n w = children[i];\n w.z += shift;\n w.m += shift;\n shift += w.s + (change += w.c);\n }\n}\n\n// If vi-’s ancestor is a sibling of v, returns vi-’s ancestor. Otherwise,\n// returns the specified (default) ancestor.\nfunction nextAncestor(vim, v, ancestor) {\n return vim.a.parent === v.parent ? vim.a : ancestor;\n}\n\nfunction TreeNode(node, i) {\n this._ = node;\n this.parent = null;\n this.children = null;\n this.A = null; // default ancestor\n this.a = this; // ancestor\n this.z = 0; // prelim\n this.m = 0; // mod\n this.c = 0; // change\n this.s = 0; // shift\n this.t = null; // thread\n this.i = i; // number\n}\n\nTreeNode.prototype = Object.create(Node.prototype);\n\nfunction treeRoot(root) {\n var tree = new TreeNode(root, 0),\n node,\n nodes = [tree],\n child,\n children,\n i,\n n;\n\n while (node = nodes.pop()) {\n if (children = node._.children) {\n node.children = new Array(n = children.length);\n for (i = n - 1; i >= 0; --i) {\n nodes.push(child = node.children[i] = new TreeNode(children[i], i));\n child.parent = node;\n }\n }\n }\n\n (tree.parent = new TreeNode(null, 0)).children = [tree];\n return tree;\n}\n\n// Node-link tree diagram using the Reingold-Tilford \"tidy\" algorithm\nexport default function() {\n var separation = defaultSeparation,\n dx = 1,\n dy = 1,\n nodeSize = null;\n\n function tree(root) {\n var t = treeRoot(root);\n\n // Compute the layout using Buchheim et al.’s algorithm.\n t.eachAfter(firstWalk), t.parent.m = -t.z;\n t.eachBefore(secondWalk);\n\n // If a fixed node size is specified, scale x and y.\n if (nodeSize) root.eachBefore(sizeNode);\n\n // If a fixed tree size is specified, scale x and y based on the extent.\n // Compute the left-most, right-most, and depth-most nodes for extents.\n else {\n var left = root,\n right = root,\n bottom = root;\n root.eachBefore(function(node) {\n if (node.x < left.x) left = node;\n if (node.x > right.x) right = node;\n if (node.depth > bottom.depth) bottom = node;\n });\n var s = left === right ? 1 : separation(left, right) / 2,\n tx = s - left.x,\n kx = dx / (right.x + s + tx),\n ky = dy / (bottom.depth || 1);\n root.eachBefore(function(node) {\n node.x = (node.x + tx) * kx;\n node.y = node.depth * ky;\n });\n }\n\n return root;\n }\n\n // Computes a preliminary x-coordinate for v. Before that, FIRST WALK is\n // applied recursively to the children of v, as well as the function\n // APPORTION. After spacing out the children by calling EXECUTE SHIFTS, the\n // node v is placed to the midpoint of its outermost children.\n function firstWalk(v) {\n var children = v.children,\n siblings = v.parent.children,\n w = v.i ? siblings[v.i - 1] : null;\n if (children) {\n executeShifts(v);\n var midpoint = (children[0].z + children[children.length - 1].z) / 2;\n if (w) {\n v.z = w.z + separation(v._, w._);\n v.m = v.z - midpoint;\n } else {\n v.z = midpoint;\n }\n } else if (w) {\n v.z = w.z + separation(v._, w._);\n }\n v.parent.A = apportion(v, w, v.parent.A || siblings[0]);\n }\n\n // Computes all real x-coordinates by summing up the modifiers recursively.\n function secondWalk(v) {\n v._.x = v.z + v.parent.m;\n v.m += v.parent.m;\n }\n\n // The core of the algorithm. Here, a new subtree is combined with the\n // previous subtrees. Threads are used to traverse the inside and outside\n // contours of the left and right subtree up to the highest common level. The\n // vertices used for the traversals are vi+, vi-, vo-, and vo+, where the\n // superscript o means outside and i means inside, the subscript - means left\n // subtree and + means right subtree. For summing up the modifiers along the\n // contour, we use respective variables si+, si-, so-, and so+. Whenever two\n // nodes of the inside contours conflict, we compute the left one of the\n // greatest uncommon ancestors using the function ANCESTOR and call MOVE\n // SUBTREE to shift the subtree and prepare the shifts of smaller subtrees.\n // Finally, we add a new thread (if necessary).\n function apportion(v, w, ancestor) {\n if (w) {\n var vip = v,\n vop = v,\n vim = w,\n vom = vip.parent.children[0],\n sip = vip.m,\n sop = vop.m,\n sim = vim.m,\n som = vom.m,\n shift;\n while (vim = nextRight(vim), vip = nextLeft(vip), vim && vip) {\n vom = nextLeft(vom);\n vop = nextRight(vop);\n vop.a = v;\n shift = vim.z + sim - vip.z - sip + separation(vim._, vip._);\n if (shift > 0) {\n moveSubtree(nextAncestor(vim, v, ancestor), v, shift);\n sip += shift;\n sop += shift;\n }\n sim += vim.m;\n sip += vip.m;\n som += vom.m;\n sop += vop.m;\n }\n if (vim && !nextRight(vop)) {\n vop.t = vim;\n vop.m += sim - sop;\n }\n if (vip && !nextLeft(vom)) {\n vom.t = vip;\n vom.m += sip - som;\n ancestor = v;\n }\n }\n return ancestor;\n }\n\n function sizeNode(node) {\n node.x *= dx;\n node.y = node.depth * dy;\n }\n\n tree.separation = function(x) {\n return arguments.length ? (separation = x, tree) : separation;\n };\n\n tree.size = function(x) {\n return arguments.length ? (nodeSize = false, dx = +x[0], dy = +x[1], tree) : (nodeSize ? null : [dx, dy]);\n };\n\n tree.nodeSize = function(x) {\n return arguments.length ? (nodeSize = true, dx = +x[0], dy = +x[1], tree) : (nodeSize ? [dx, dy] : null);\n };\n\n return tree;\n}\n","export default function(parent, x0, y0, x1, y1) {\n var nodes = parent.children,\n node,\n i = -1,\n n = nodes.length,\n k = parent.value && (y1 - y0) / parent.value;\n\n while (++i < n) {\n node = nodes[i], node.x0 = x0, node.x1 = x1;\n node.y0 = y0, node.y1 = y0 += node.value * k;\n }\n}\n","import treemapDice from \"./dice.js\";\nimport treemapSlice from \"./slice.js\";\n\nexport var phi = (1 + Math.sqrt(5)) / 2;\n\nexport function squarifyRatio(ratio, parent, x0, y0, x1, y1) {\n var rows = [],\n nodes = parent.children,\n row,\n nodeValue,\n i0 = 0,\n i1 = 0,\n n = nodes.length,\n dx, dy,\n value = parent.value,\n sumValue,\n minValue,\n maxValue,\n newRatio,\n minRatio,\n alpha,\n beta;\n\n while (i0 < n) {\n dx = x1 - x0, dy = y1 - y0;\n\n // Find the next non-empty node.\n do sumValue = nodes[i1++].value; 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\n // Keep adding nodes while the aspect ratio maintains or improves.\n for (; i1 < n; ++i1) {\n sumValue += nodeValue = nodes[i1].value;\n if (nodeValue < minValue) minValue = nodeValue;\n if (nodeValue > maxValue) maxValue = nodeValue;\n beta = sumValue * sumValue * alpha;\n newRatio = Math.max(maxValue / beta, beta / minValue);\n if (newRatio > minRatio) { sumValue -= nodeValue; break; }\n minRatio = newRatio;\n }\n\n // Position and record the row orientation.\n rows.push(row = {value: sumValue, dice: dx < dy, children: nodes.slice(i0, i1)});\n if (row.dice) treemapDice(row, x0, y0, x1, value ? y0 += dy * sumValue / value : y1);\n else treemapSlice(row, x0, y0, value ? x0 += dx * sumValue / value : x1, y1);\n value -= sumValue, i0 = i1;\n }\n\n return rows;\n}\n\nexport default (function custom(ratio) {\n\n function squarify(parent, x0, y0, x1, y1) {\n squarifyRatio(ratio, parent, x0, y0, x1, y1);\n }\n\n squarify.ratio = function(x) {\n return custom((x = +x) > 1 ? x : 1);\n };\n\n return squarify;\n})(phi);\n","import roundNode from \"./round.js\";\nimport squarify from \"./squarify.js\";\nimport {required} from \"../accessors.js\";\nimport constant, {constantZero} from \"../constant.js\";\n\nexport default function() {\n var tile = squarify,\n round = false,\n dx = 1,\n dy = 1,\n paddingStack = [0],\n paddingInner = constantZero,\n paddingTop = constantZero,\n paddingRight = constantZero,\n paddingBottom = constantZero,\n paddingLeft = constantZero;\n\n function treemap(root) {\n root.x0 =\n root.y0 = 0;\n root.x1 = dx;\n root.y1 = dy;\n root.eachBefore(positionNode);\n paddingStack = [0];\n if (round) root.eachBefore(roundNode);\n return root;\n }\n\n function positionNode(node) {\n var p = paddingStack[node.depth],\n x0 = node.x0 + p,\n y0 = node.y0 + p,\n x1 = node.x1 - p,\n y1 = node.y1 - p;\n if (x1 < x0) x0 = x1 = (x0 + x1) / 2;\n if (y1 < y0) y0 = y1 = (y0 + y1) / 2;\n node.x0 = x0;\n node.y0 = y0;\n node.x1 = x1;\n node.y1 = y1;\n if (node.children) {\n p = paddingStack[node.depth + 1] = paddingInner(node) / 2;\n x0 += paddingLeft(node) - p;\n y0 += paddingTop(node) - p;\n x1 -= paddingRight(node) - p;\n y1 -= paddingBottom(node) - p;\n if (x1 < x0) x0 = x1 = (x0 + x1) / 2;\n if (y1 < y0) y0 = y1 = (y0 + y1) / 2;\n tile(node, x0, y0, x1, y1);\n }\n }\n\n treemap.round = function(x) {\n return arguments.length ? (round = !!x, treemap) : round;\n };\n\n treemap.size = function(x) {\n return arguments.length ? (dx = +x[0], dy = +x[1], treemap) : [dx, dy];\n };\n\n treemap.tile = function(x) {\n return arguments.length ? (tile = required(x), treemap) : tile;\n };\n\n treemap.padding = function(x) {\n return arguments.length ? treemap.paddingInner(x).paddingOuter(x) : treemap.paddingInner();\n };\n\n treemap.paddingInner = function(x) {\n return arguments.length ? (paddingInner = typeof x === \"function\" ? x : constant(+x), treemap) : paddingInner;\n };\n\n treemap.paddingOuter = function(x) {\n return arguments.length ? treemap.paddingTop(x).paddingRight(x).paddingBottom(x).paddingLeft(x) : treemap.paddingTop();\n };\n\n treemap.paddingTop = function(x) {\n return arguments.length ? (paddingTop = typeof x === \"function\" ? x : constant(+x), treemap) : paddingTop;\n };\n\n treemap.paddingRight = function(x) {\n return arguments.length ? (paddingRight = typeof x === \"function\" ? x : constant(+x), treemap) : paddingRight;\n };\n\n treemap.paddingBottom = function(x) {\n return arguments.length ? (paddingBottom = typeof x === \"function\" ? x : constant(+x), treemap) : paddingBottom;\n };\n\n treemap.paddingLeft = function(x) {\n return arguments.length ? (paddingLeft = typeof x === \"function\" ? x : constant(+x), treemap) : paddingLeft;\n };\n\n return treemap;\n}\n","import {Path} from \"d3-path\";\n\nexport function withPath(shape) {\n let digits = 3;\n\n shape.digits = function(_) {\n if (!arguments.length) return digits;\n if (_ == null) {\n digits = null;\n } else {\n const d = Math.floor(_);\n if (!(d >= 0)) throw new RangeError(`invalid digits: ${_}`);\n digits = d;\n }\n return shape;\n };\n\n return () => new Path(digits);\n}\n","import constant from \"./constant.js\";\nimport {abs, acos, asin, atan2, cos, epsilon, halfPi, max, min, pi, sin, sqrt, tau} from \"./math.js\";\nimport {withPath} from \"./path.js\";\n\nfunction arcInnerRadius(d) {\n return d.innerRadius;\n}\n\nfunction arcOuterRadius(d) {\n return d.outerRadius;\n}\n\nfunction arcStartAngle(d) {\n return d.startAngle;\n}\n\nfunction arcEndAngle(d) {\n return d.endAngle;\n}\n\nfunction arcPadAngle(d) {\n return d && d.padAngle; // Note: optional!\n}\n\nfunction intersect(x0, y0, x1, y1, x2, y2, x3, y3) {\n var x10 = x1 - x0, y10 = y1 - y0,\n x32 = x3 - x2, y32 = y3 - y2,\n t = y32 * x10 - x32 * y10;\n if (t * t < epsilon) return;\n t = (x32 * (y0 - y2) - y32 * (x0 - x2)) / t;\n return [x0 + t * x10, y0 + t * y10];\n}\n\n// Compute perpendicular offset line of length rc.\n// http://mathworld.wolfram.com/Circle-LineIntersection.html\nfunction cornerTangents(x0, y0, x1, y1, r1, rc, cw) {\n var x01 = x0 - x1,\n y01 = y0 - y1,\n lo = (cw ? rc : -rc) / sqrt(x01 * x01 + y01 * y01),\n ox = lo * y01,\n oy = -lo * x01,\n x11 = x0 + ox,\n y11 = y0 + oy,\n x10 = x1 + ox,\n y10 = y1 + oy,\n x00 = (x11 + x10) / 2,\n y00 = (y11 + y10) / 2,\n dx = x10 - x11,\n dy = y10 - y11,\n d2 = dx * dx + dy * dy,\n r = r1 - rc,\n D = x11 * y10 - x10 * y11,\n d = (dy < 0 ? -1 : 1) * sqrt(max(0, r * r * d2 - D * D)),\n cx0 = (D * dy - dx * d) / d2,\n cy0 = (-D * dx - dy * d) / d2,\n cx1 = (D * dy + dx * d) / d2,\n cy1 = (-D * dx + dy * d) / d2,\n dx0 = cx0 - x00,\n dy0 = cy0 - y00,\n dx1 = cx1 - x00,\n dy1 = cy1 - y00;\n\n // Pick the closer of the two intersection points.\n // TODO Is there a faster way to determine which intersection to use?\n if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) cx0 = cx1, cy0 = cy1;\n\n return {\n cx: cx0,\n cy: cy0,\n x01: -ox,\n y01: -oy,\n x11: cx0 * (r1 / r - 1),\n y11: cy0 * (r1 / r - 1)\n };\n}\n\nexport default function() {\n var innerRadius = arcInnerRadius,\n outerRadius = arcOuterRadius,\n cornerRadius = constant(0),\n padRadius = null,\n startAngle = arcStartAngle,\n endAngle = arcEndAngle,\n padAngle = arcPadAngle,\n context = null,\n path = withPath(arc);\n\n function arc() {\n var buffer,\n r,\n r0 = +innerRadius.apply(this, arguments),\n r1 = +outerRadius.apply(this, arguments),\n a0 = startAngle.apply(this, arguments) - halfPi,\n a1 = endAngle.apply(this, arguments) - halfPi,\n da = abs(a1 - a0),\n cw = a1 > a0;\n\n if (!context) context = buffer = path();\n\n // Ensure that the outer radius is always larger than the inner radius.\n if (r1 < r0) r = r1, r1 = r0, r0 = r;\n\n // Is it a point?\n if (!(r1 > epsilon)) context.moveTo(0, 0);\n\n // Or is it a circle or annulus?\n else if (da > tau - epsilon) {\n context.moveTo(r1 * cos(a0), r1 * sin(a0));\n context.arc(0, 0, r1, a0, a1, !cw);\n if (r0 > epsilon) {\n context.moveTo(r0 * cos(a1), r0 * sin(a1));\n context.arc(0, 0, r0, a1, a0, cw);\n }\n }\n\n // Or is it a circular or annular sector?\n else {\n var a01 = a0,\n a11 = a1,\n a00 = a0,\n a10 = a1,\n da0 = da,\n da1 = da,\n ap = padAngle.apply(this, arguments) / 2,\n rp = (ap > epsilon) && (padRadius ? +padRadius.apply(this, arguments) : sqrt(r0 * r0 + r1 * r1)),\n rc = min(abs(r1 - r0) / 2, +cornerRadius.apply(this, arguments)),\n rc0 = rc,\n rc1 = rc,\n t0,\n t1;\n\n // Apply padding? Note that since r1 ≥ r0, da1 ≥ da0.\n if (rp > epsilon) {\n var p0 = asin(rp / r0 * sin(ap)),\n p1 = asin(rp / r1 * sin(ap));\n if ((da0 -= p0 * 2) > epsilon) p0 *= (cw ? 1 : -1), a00 += p0, a10 -= p0;\n else da0 = 0, a00 = a10 = (a0 + a1) / 2;\n if ((da1 -= p1 * 2) > epsilon) p1 *= (cw ? 1 : -1), a01 += p1, a11 -= p1;\n else da1 = 0, a01 = a11 = (a0 + a1) / 2;\n }\n\n var x01 = r1 * cos(a01),\n y01 = r1 * sin(a01),\n x10 = r0 * cos(a10),\n y10 = r0 * sin(a10);\n\n // Apply rounded corners?\n if (rc > epsilon) {\n var x11 = r1 * cos(a11),\n y11 = r1 * sin(a11),\n x00 = r0 * cos(a00),\n y00 = r0 * sin(a00),\n oc;\n\n // Restrict the corner radius according to the sector angle. If this\n // intersection fails, it’s probably because the arc is too small, so\n // disable the corner radius entirely.\n if (da < pi) {\n if (oc = intersect(x01, y01, x00, y00, x11, y11, x10, y10)) {\n var ax = x01 - oc[0],\n ay = y01 - oc[1],\n bx = x11 - oc[0],\n by = y11 - oc[1],\n kc = 1 / sin(acos((ax * bx + ay * by) / (sqrt(ax * ax + ay * ay) * sqrt(bx * bx + by * by))) / 2),\n lc = sqrt(oc[0] * oc[0] + oc[1] * oc[1]);\n rc0 = min(rc, (r0 - lc) / (kc - 1));\n rc1 = min(rc, (r1 - lc) / (kc + 1));\n } else {\n rc0 = rc1 = 0;\n }\n }\n }\n\n // Is the sector collapsed to a line?\n if (!(da1 > epsilon)) context.moveTo(x01, y01);\n\n // Does the sector’s outer ring have rounded corners?\n else if (rc1 > epsilon) {\n t0 = cornerTangents(x00, y00, x01, y01, r1, rc1, cw);\n t1 = cornerTangents(x11, y11, x10, y10, r1, rc1, cw);\n\n context.moveTo(t0.cx + t0.x01, t0.cy + t0.y01);\n\n // Have the corners merged?\n if (rc1 < rc) context.arc(t0.cx, t0.cy, rc1, atan2(t0.y01, t0.x01), atan2(t1.y01, t1.x01), !cw);\n\n // Otherwise, draw the two corners and the ring.\n else {\n context.arc(t0.cx, t0.cy, rc1, atan2(t0.y01, t0.x01), atan2(t0.y11, t0.x11), !cw);\n context.arc(0, 0, r1, atan2(t0.cy + t0.y11, t0.cx + t0.x11), atan2(t1.cy + t1.y11, t1.cx + t1.x11), !cw);\n context.arc(t1.cx, t1.cy, rc1, atan2(t1.y11, t1.x11), atan2(t1.y01, t1.x01), !cw);\n }\n }\n\n // Or is the outer ring just a circular arc?\n else context.moveTo(x01, y01), context.arc(0, 0, r1, a01, a11, !cw);\n\n // Is there no inner ring, and it’s a circular sector?\n // Or perhaps it’s an annular sector collapsed due to padding?\n if (!(r0 > epsilon) || !(da0 > epsilon)) context.lineTo(x10, y10);\n\n // Does the sector’s inner ring (or point) have rounded corners?\n else if (rc0 > epsilon) {\n t0 = cornerTangents(x10, y10, x11, y11, r0, -rc0, cw);\n t1 = cornerTangents(x01, y01, x00, y00, r0, -rc0, cw);\n\n context.lineTo(t0.cx + t0.x01, t0.cy + t0.y01);\n\n // Have the corners merged?\n if (rc0 < rc) context.arc(t0.cx, t0.cy, rc0, atan2(t0.y01, t0.x01), atan2(t1.y01, t1.x01), !cw);\n\n // Otherwise, draw the two corners and the ring.\n else {\n context.arc(t0.cx, t0.cy, rc0, atan2(t0.y01, t0.x01), atan2(t0.y11, t0.x11), !cw);\n context.arc(0, 0, r0, atan2(t0.cy + t0.y11, t0.cx + t0.x11), atan2(t1.cy + t1.y11, t1.cx + t1.x11), cw);\n context.arc(t1.cx, t1.cy, rc0, atan2(t1.y11, t1.x11), atan2(t1.y01, t1.x01), !cw);\n }\n }\n\n // Or is the inner ring just a circular arc?\n else context.arc(0, 0, r0, a10, a00, cw);\n }\n\n context.closePath();\n\n if (buffer) return context = null, buffer + \"\" || null;\n }\n\n arc.centroid = function() {\n var r = (+innerRadius.apply(this, arguments) + +outerRadius.apply(this, arguments)) / 2,\n a = (+startAngle.apply(this, arguments) + +endAngle.apply(this, arguments)) / 2 - pi / 2;\n return [cos(a) * r, sin(a) * r];\n };\n\n arc.innerRadius = function(_) {\n return arguments.length ? (innerRadius = typeof _ === \"function\" ? _ : constant(+_), arc) : innerRadius;\n };\n\n arc.outerRadius = function(_) {\n return arguments.length ? (outerRadius = typeof _ === \"function\" ? _ : constant(+_), arc) : outerRadius;\n };\n\n arc.cornerRadius = function(_) {\n return arguments.length ? (cornerRadius = typeof _ === \"function\" ? _ : constant(+_), arc) : cornerRadius;\n };\n\n arc.padRadius = function(_) {\n return arguments.length ? (padRadius = _ == null ? null : typeof _ === \"function\" ? _ : constant(+_), arc) : padRadius;\n };\n\n arc.startAngle = function(_) {\n return arguments.length ? (startAngle = typeof _ === \"function\" ? _ : constant(+_), arc) : startAngle;\n };\n\n arc.endAngle = function(_) {\n return arguments.length ? (endAngle = typeof _ === \"function\" ? _ : constant(+_), arc) : endAngle;\n };\n\n arc.padAngle = function(_) {\n return arguments.length ? (padAngle = typeof _ === \"function\" ? _ : constant(+_), arc) : padAngle;\n };\n\n arc.context = function(_) {\n return arguments.length ? ((context = _ == null ? null : _), arc) : context;\n };\n\n return arc;\n}\n","export function x(p) {\n return p[0];\n}\n\nexport function y(p) {\n return p[1];\n}\n","import array from \"./array.js\";\nimport constant from \"./constant.js\";\nimport curveLinear from \"./curve/linear.js\";\nimport {withPath} from \"./path.js\";\nimport {x as pointX, y as pointY} from \"./point.js\";\n\nexport default function(x, y) {\n var defined = constant(true),\n context = null,\n curve = curveLinear,\n output = null,\n path = withPath(line);\n\n x = typeof x === \"function\" ? x : (x === undefined) ? pointX : constant(x);\n y = typeof y === \"function\" ? y : (y === undefined) ? pointY : constant(y);\n\n function line(data) {\n var i,\n n = (data = array(data)).length,\n d,\n defined0 = false,\n buffer;\n\n if (context == null) output = curve(buffer = path());\n\n for (i = 0; i <= n; ++i) {\n if (!(i < n && defined(d = data[i], i, data)) === defined0) {\n if (defined0 = !defined0) output.lineStart();\n else output.lineEnd();\n }\n if (defined0) output.point(+x(d, i, data), +y(d, i, data));\n }\n\n if (buffer) return output = null, buffer + \"\" || null;\n }\n\n line.x = function(_) {\n return arguments.length ? (x = typeof _ === \"function\" ? _ : constant(+_), line) : x;\n };\n\n line.y = function(_) {\n return arguments.length ? (y = typeof _ === \"function\" ? _ : constant(+_), line) : y;\n };\n\n line.defined = function(_) {\n return arguments.length ? (defined = typeof _ === \"function\" ? _ : constant(!!_), line) : defined;\n };\n\n line.curve = function(_) {\n return arguments.length ? (curve = _, context != null && (output = curve(context)), line) : curve;\n };\n\n line.context = function(_) {\n return arguments.length ? (_ == null ? context = output = null : output = curve(context = _), line) : context;\n };\n\n return line;\n}\n","import array from \"./array.js\";\nimport constant from \"./constant.js\";\nimport curveLinear from \"./curve/linear.js\";\nimport line from \"./line.js\";\nimport {withPath} from \"./path.js\";\nimport {x as pointX, y as pointY} from \"./point.js\";\n\nexport default function(x0, y0, y1) {\n var x1 = null,\n defined = constant(true),\n context = null,\n curve = curveLinear,\n output = null,\n path = withPath(area);\n\n x0 = typeof x0 === \"function\" ? x0 : (x0 === undefined) ? pointX : constant(+x0);\n y0 = typeof y0 === \"function\" ? y0 : (y0 === undefined) ? constant(0) : constant(+y0);\n y1 = typeof y1 === \"function\" ? y1 : (y1 === undefined) ? pointY : constant(+y1);\n\n function area(data) {\n var i,\n j,\n k,\n n = (data = array(data)).length,\n d,\n defined0 = false,\n buffer,\n x0z = new Array(n),\n y0z = new Array(n);\n\n if (context == null) output = curve(buffer = path());\n\n for (i = 0; i <= n; ++i) {\n if (!(i < n && defined(d = data[i], i, data)) === defined0) {\n if (defined0 = !defined0) {\n j = i;\n output.areaStart();\n output.lineStart();\n } else {\n output.lineEnd();\n output.lineStart();\n for (k = i - 1; k >= j; --k) {\n output.point(x0z[k], y0z[k]);\n }\n output.lineEnd();\n output.areaEnd();\n }\n }\n if (defined0) {\n x0z[i] = +x0(d, i, data), y0z[i] = +y0(d, i, data);\n output.point(x1 ? +x1(d, i, data) : x0z[i], y1 ? +y1(d, i, data) : y0z[i]);\n }\n }\n\n if (buffer) return output = null, buffer + \"\" || null;\n }\n\n function arealine() {\n return line().defined(defined).curve(curve).context(context);\n }\n\n area.x = function(_) {\n return arguments.length ? (x0 = typeof _ === \"function\" ? _ : constant(+_), x1 = null, area) : x0;\n };\n\n area.x0 = function(_) {\n return arguments.length ? (x0 = typeof _ === \"function\" ? _ : constant(+_), area) : x0;\n };\n\n area.x1 = function(_) {\n return arguments.length ? (x1 = _ == null ? null : typeof _ === \"function\" ? _ : constant(+_), area) : x1;\n };\n\n area.y = function(_) {\n return arguments.length ? (y0 = typeof _ === \"function\" ? _ : constant(+_), y1 = null, area) : y0;\n };\n\n area.y0 = function(_) {\n return arguments.length ? (y0 = typeof _ === \"function\" ? _ : constant(+_), area) : y0;\n };\n\n area.y1 = function(_) {\n return arguments.length ? (y1 = _ == null ? null : typeof _ === \"function\" ? _ : constant(+_), area) : y1;\n };\n\n area.lineX0 =\n area.lineY0 = function() {\n return arealine().x(x0).y(y0);\n };\n\n area.lineY1 = function() {\n return arealine().x(x0).y(y1);\n };\n\n area.lineX1 = function() {\n return arealine().x(x1).y(y0);\n };\n\n area.defined = function(_) {\n return arguments.length ? (defined = typeof _ === \"function\" ? _ : constant(!!_), area) : defined;\n };\n\n area.curve = function(_) {\n return arguments.length ? (curve = _, context != null && (output = curve(context)), area) : curve;\n };\n\n area.context = function(_) {\n return arguments.length ? (_ == null ? context = output = null : output = curve(context = _), area) : context;\n };\n\n return area;\n}\n","export default function(a, b) {\n return b < a ? -1 : b > a ? 1 : b >= a ? 0 : NaN;\n}\n","export default function(d) {\n return d;\n}\n","import array from \"./array.js\";\nimport constant from \"./constant.js\";\nimport descending from \"./descending.js\";\nimport identity from \"./identity.js\";\nimport {tau} from \"./math.js\";\n\nexport default function() {\n var value = identity,\n sortValues = descending,\n sort = null,\n startAngle = constant(0),\n endAngle = constant(tau),\n padAngle = constant(0);\n\n function pie(data) {\n var i,\n n = (data = array(data)).length,\n j,\n k,\n sum = 0,\n index = new Array(n),\n arcs = new Array(n),\n a0 = +startAngle.apply(this, arguments),\n da = Math.min(tau, Math.max(-tau, endAngle.apply(this, arguments) - a0)),\n a1,\n p = Math.min(Math.abs(da) / n, padAngle.apply(this, arguments)),\n pa = p * (da < 0 ? -1 : 1),\n v;\n\n for (i = 0; i < n; ++i) {\n if ((v = arcs[index[i] = i] = +value(data[i], i, data)) > 0) {\n sum += v;\n }\n }\n\n // Optionally sort the arcs by previously-computed values or by data.\n if (sortValues != null) index.sort(function(i, j) { return sortValues(arcs[i], arcs[j]); });\n else if (sort != null) index.sort(function(i, j) { return sort(data[i], data[j]); });\n\n // Compute the arcs! They are stored in the original data's order.\n for (i = 0, k = sum ? (da - n * pa) / sum : 0; i < n; ++i, a0 = a1) {\n j = index[i], v = arcs[j], a1 = a0 + (v > 0 ? v * k : 0) + pa, arcs[j] = {\n data: data[j],\n index: i,\n value: v,\n startAngle: a0,\n endAngle: a1,\n padAngle: p\n };\n }\n\n return arcs;\n }\n\n pie.value = function(_) {\n return arguments.length ? (value = typeof _ === \"function\" ? _ : constant(+_), pie) : value;\n };\n\n pie.sortValues = function(_) {\n return arguments.length ? (sortValues = _, sort = null, pie) : sortValues;\n };\n\n pie.sort = function(_) {\n return arguments.length ? (sort = _, sortValues = null, pie) : sort;\n };\n\n pie.startAngle = function(_) {\n return arguments.length ? (startAngle = typeof _ === \"function\" ? _ : constant(+_), pie) : startAngle;\n };\n\n pie.endAngle = function(_) {\n return arguments.length ? (endAngle = typeof _ === \"function\" ? _ : constant(+_), pie) : endAngle;\n };\n\n pie.padAngle = function(_) {\n return arguments.length ? (padAngle = typeof _ === \"function\" ? _ : constant(+_), pie) : padAngle;\n };\n\n return pie;\n}\n","import curveLinear from \"./linear.js\";\n\nexport var curveRadialLinear = curveRadial(curveLinear);\n\nfunction Radial(curve) {\n this._curve = curve;\n}\n\nRadial.prototype = {\n areaStart: function() {\n this._curve.areaStart();\n },\n areaEnd: function() {\n this._curve.areaEnd();\n },\n lineStart: function() {\n this._curve.lineStart();\n },\n lineEnd: function() {\n this._curve.lineEnd();\n },\n point: function(a, r) {\n this._curve.point(r * Math.sin(a), r * -Math.cos(a));\n }\n};\n\nexport default function curveRadial(curve) {\n\n function radial(context) {\n return new Radial(curve(context));\n }\n\n radial._curve = curve;\n\n return radial;\n}\n","import curveRadial, {curveRadialLinear} from \"./curve/radial.js\";\nimport line from \"./line.js\";\n\nexport function lineRadial(l) {\n var c = l.curve;\n\n l.angle = l.x, delete l.x;\n l.radius = l.y, delete l.y;\n\n l.curve = function(_) {\n return arguments.length ? c(curveRadial(_)) : c()._curve;\n };\n\n return l;\n}\n\nexport default function() {\n return lineRadial(line().curve(curveRadialLinear));\n}\n","import pointRadial from \"../pointRadial.js\";\n\nclass Bump {\n constructor(context, x) {\n this._context = context;\n this._x = x;\n }\n areaStart() {\n this._line = 0;\n }\n areaEnd() {\n this._line = NaN;\n }\n lineStart() {\n this._point = 0;\n }\n lineEnd() {\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n this._line = 1 - this._line;\n }\n point(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: {\n this._point = 1;\n if (this._line) this._context.lineTo(x, y);\n else this._context.moveTo(x, y);\n break;\n }\n case 1: this._point = 2; // falls through\n default: {\n if (this._x) this._context.bezierCurveTo(this._x0 = (this._x0 + x) / 2, this._y0, this._x0, y, x, y);\n else this._context.bezierCurveTo(this._x0, this._y0 = (this._y0 + y) / 2, x, this._y0, x, y);\n break;\n }\n }\n this._x0 = x, this._y0 = y;\n }\n}\n\nclass BumpRadial {\n constructor(context) {\n this._context = context;\n }\n lineStart() {\n this._point = 0;\n }\n lineEnd() {}\n point(x, y) {\n x = +x, y = +y;\n if (this._point === 0) {\n this._point = 1;\n } else {\n const p0 = pointRadial(this._x0, this._y0);\n const p1 = pointRadial(this._x0, this._y0 = (this._y0 + y) / 2);\n const p2 = pointRadial(x, this._y0);\n const p3 = pointRadial(x, y);\n this._context.moveTo(...p0);\n this._context.bezierCurveTo(...p1, ...p2, ...p3);\n }\n this._x0 = x, this._y0 = y;\n }\n}\n\nexport function bumpX(context) {\n return new Bump(context, true);\n}\n\nexport function bumpY(context) {\n return new Bump(context, false);\n}\n\nexport function bumpRadial(context) {\n return new BumpRadial(context);\n}\n","import {slice} from \"./array.js\";\nimport constant from \"./constant.js\";\nimport {bumpX, bumpY, bumpRadial} from \"./curve/bump.js\";\nimport {withPath} from \"./path.js\";\nimport {x as pointX, y as pointY} from \"./point.js\";\n\nfunction linkSource(d) {\n return d.source;\n}\n\nfunction linkTarget(d) {\n return d.target;\n}\n\nexport function link(curve) {\n let source = linkSource,\n target = linkTarget,\n x = pointX,\n y = pointY,\n context = null,\n output = null,\n path = withPath(link);\n\n function link() {\n let buffer;\n const argv = slice.call(arguments);\n const s = source.apply(this, argv);\n const t = target.apply(this, argv);\n if (context == null) output = curve(buffer = path());\n output.lineStart();\n argv[0] = s, output.point(+x.apply(this, argv), +y.apply(this, argv));\n argv[0] = t, output.point(+x.apply(this, argv), +y.apply(this, argv));\n output.lineEnd();\n if (buffer) return output = null, buffer + \"\" || null;\n }\n\n link.source = function(_) {\n return arguments.length ? (source = _, link) : source;\n };\n\n link.target = function(_) {\n return arguments.length ? (target = _, link) : target;\n };\n\n link.x = function(_) {\n return arguments.length ? (x = typeof _ === \"function\" ? _ : constant(+_), link) : x;\n };\n\n link.y = function(_) {\n return arguments.length ? (y = typeof _ === \"function\" ? _ : constant(+_), link) : y;\n };\n\n link.context = function(_) {\n return arguments.length ? (_ == null ? context = output = null : output = curve(context = _), link) : context;\n };\n\n return link;\n}\n\nexport function linkHorizontal() {\n return link(bumpX);\n}\n\nexport function linkVertical() {\n return link(bumpY);\n}\n\nexport function linkRadial() {\n const l = link(bumpRadial);\n l.angle = l.x, delete l.x;\n l.radius = l.y, delete l.y;\n return l;\n}\n","import { select, type Selection as D3Selection } from 'd3'\nimport { merge } from 'lodash-es'\nimport { getProperty } from '@/tools'\nimport { carbonPrefix } from '@/configuration-non-customizable' // CSS prefix\nimport type { ChartModel } from '@/model/model'\nimport { DOMUtils } from '@/services/essentials/dom-utils'\nimport { RenderTypes } from '@/interfaces/enums'\nimport { Services } from '@/interfaces/services'\n\nexport class Component {\n\tpublic type = ''\n\tpublic renderType = RenderTypes.HTML\n\n\tpublic id = ''\n\n\tprotected parent:\n\t\t| D3Selection\n\t\t| undefined = undefined\n\n\tprotected configs: any = {}\n\n\tprotected model: ChartModel\n\tprotected services: Services\n\n\tconstructor(model: ChartModel, services: Services, configs?: any) {\n\t\tthis.model = model\n\t\tthis.services = services\n\n\t\tif (configs) {\n\t\t\tthis.configs = configs\n\t\t\tif (this.configs.id) {\n\t\t\t\tconst chartprefix = getProperty(this.model.getOptions(), 'style', 'prefix')\n\t\t\t\tthis.id = `${chartprefix}--${this.configs.id}`\n\t\t\t}\n\t\t}\n\n\t\t// Set parent element to shell SVG if no parent exists for component\n\t\tif (!this.parent) {\n\t\t\tthis.setParent(\n\t\t\t\tselect(\n\t\t\t\t\tthis.services.domUtils.getMainContainer() as HTMLDivElement\n\t\t\t\t)\n\t\t\t)\n\t\t}\n\t}\n\n\tinit() {\n\t\t// do nothing.\n\t}\n\n\t// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n\t// @ts-ignore\n\t// eslint-disable-next-line @typescript-eslint/no-unused-vars\n\trender(animate = true): void {\n\t\tconsole.error('Error: Component did not provide the required render function.')\n\t}\n\n\tdestroy() {\n\t\t// do nothing.\n\t}\n\n\t// Used to pass down information to the components\n\tsetModel(newObj: any) {\n\t\tthis.model = newObj\n\t}\n\n\t// Used to pass down information to the components\n\tsetServices(newObj: any) {\n\t\tthis.services = newObj\n\t}\n\n\tsetParent(parent: any) {\n\t\tconst oldParent = this.parent\n\t\tthis.parent = parent\n\n\t\tif (oldParent && oldParent.node() === parent.node()) {\n\t\t\treturn\n\t\t}\n\n\t\tif (this.type) {\n\t\t\tconst chartprefix = getProperty(this.model.getOptions(), 'style', 'prefix')\n\t\t\tthis.parent?.classed(`${carbonPrefix}--${chartprefix}--${this.type}`, true)\n\n\t\t\tif (oldParent) {\n\t\t\t\toldParent.classed(`${carbonPrefix}--${chartprefix}--${this.type}`, false)\n\t\t\t}\n\t\t}\n\t}\n\n\tgetParent() {\n\t\treturn this.parent\n\t}\n\n\tgetComponentContainer(\n\t\tconfigs: {\n\t\t\tariaLabel?: string | null\n\t\t\tisPresentational?: boolean\n\t\t\twithinChartClip?: boolean\n\t\t} = { ariaLabel: null, isPresentational: false, withinChartClip: false }\n\t) {\n\t\tif (this.type) {\n\t\t\tconst chartprefix = getProperty(this.model.getOptions(), 'style', 'prefix')\n\n\t\t\tconst idSelector = this.id ? `#${this.id}` : ''\n\t\t\tconst container = DOMUtils.appendOrSelect(\n\t\t\t\tthis.parent,\n\t\t\t\t`${\n\t\t\t\t\tthis.renderType === RenderTypes.SVG ? 'svg' : 'div'\n\t\t\t\t}${idSelector}.${carbonPrefix}--${chartprefix}--${this.type}`\n\t\t\t)\n\n\t\t\tif (configs.ariaLabel) {\n\t\t\t\tcontainer.attr('aria-label', configs.ariaLabel)\n\t\t\t}\n\n\t\t\tif (configs.isPresentational) {\n\t\t\t\tcontainer.attr('role', 'presentation')\n\t\t\t}\n\n\t\t\tif (configs.withinChartClip) {\n\t\t\t\t// get unique chartClipId int this chart from model\n\t\t\t\tconst chartClipId = this.model.get('chartClipId')\n\n\t\t\t\tif (chartClipId) {\n\t\t\t\t\tconst chartClipSelection = select(`#${chartClipId}`)\n\t\t\t\t\tconst chartClipRectSelection = chartClipSelection.select('rect')\n\n\t\t\t\t\t/*\n\t\t\t\t\t * these checks are needed because of a chrome bug\n\t\t\t\t\t * related to the rendering of the clip path\n\t\t\t\t\t */\n\t\t\t\t\tif (\n\t\t\t\t\t\tchartClipRectSelection.size() !== 0 &&\n\t\t\t\t\t\tparseFloat(chartClipRectSelection.attr('height')) > 0\n\t\t\t\t\t) {\n\t\t\t\t\t\tcontainer.attr('clip-path', `url(#${chartClipId})`)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn container.attr('width', '100%').attr('height', '100%')\n\t\t}\n\n\t\treturn this.parent\n\t}\n\n\t/**\n\t * graphs used in combo charts share a model with global options but can receive their own local options.\n\t * this function retrieves the global options and merges it with any options passed into this\n\t * component's config.options object.\n\t */\n\tgetOptions() {\n\t\tif (this.configs.options) {\n\t\t\tconst options = merge({}, this.model.getOptions(), this.configs.options)\n\t\t\treturn options\n\t\t}\n\t\treturn this.model.getOptions()\n\t}\n}\n","/*! @license DOMPurify 3.1.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.1.6/LICENSE */\n\nconst {\n entries,\n setPrototypeOf,\n isFrozen,\n getPrototypeOf,\n getOwnPropertyDescriptor\n} = Object;\nlet {\n freeze,\n seal,\n create\n} = Object; // eslint-disable-line import/no-mutable-exports\nlet {\n apply,\n construct\n} = typeof Reflect !== 'undefined' && Reflect;\nif (!freeze) {\n freeze = function freeze(x) {\n return x;\n };\n}\nif (!seal) {\n seal = function seal(x) {\n return x;\n };\n}\nif (!apply) {\n apply = function apply(fun, thisValue, args) {\n return fun.apply(thisValue, args);\n };\n}\nif (!construct) {\n construct = function construct(Func, args) {\n return new Func(...args);\n };\n}\nconst arrayForEach = unapply(Array.prototype.forEach);\nconst arrayPop = unapply(Array.prototype.pop);\nconst arrayPush = unapply(Array.prototype.push);\nconst stringToLowerCase = unapply(String.prototype.toLowerCase);\nconst stringToString = unapply(String.prototype.toString);\nconst stringMatch = unapply(String.prototype.match);\nconst stringReplace = unapply(String.prototype.replace);\nconst stringIndexOf = unapply(String.prototype.indexOf);\nconst stringTrim = unapply(String.prototype.trim);\nconst objectHasOwnProperty = unapply(Object.prototype.hasOwnProperty);\nconst regExpTest = unapply(RegExp.prototype.test);\nconst typeErrorCreate = unconstruct(TypeError);\n\n/**\n * Creates a new function that calls the given function with a specified thisArg and arguments.\n *\n * @param {Function} func - The function to be wrapped and called.\n * @returns {Function} A new function that calls the given function with a specified thisArg and arguments.\n */\nfunction unapply(func) {\n return function (thisArg) {\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n return apply(func, thisArg, args);\n };\n}\n\n/**\n * Creates a new function that constructs an instance of the given constructor function with the provided arguments.\n *\n * @param {Function} func - The constructor function to be wrapped and called.\n * @returns {Function} A new function that constructs an instance of the given constructor function with the provided arguments.\n */\nfunction unconstruct(func) {\n return function () {\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n return construct(func, args);\n };\n}\n\n/**\n * Add properties to a lookup table\n *\n * @param {Object} set - The set to which elements will be added.\n * @param {Array} array - The array containing elements to be added to the set.\n * @param {Function} transformCaseFunc - An optional function to transform the case of each element before adding to the set.\n * @returns {Object} The modified set with added elements.\n */\nfunction addToSet(set, array) {\n let transformCaseFunc = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : stringToLowerCase;\n if (setPrototypeOf) {\n // Make 'in' and truthy checks like Boolean(set.constructor)\n // independent of any properties defined on Object.prototype.\n // Prevent prototype setters from intercepting set as a this value.\n setPrototypeOf(set, null);\n }\n let l = array.length;\n while (l--) {\n let element = array[l];\n if (typeof element === 'string') {\n const lcElement = transformCaseFunc(element);\n if (lcElement !== element) {\n // Config presets (e.g. tags.js, attrs.js) are immutable.\n if (!isFrozen(array)) {\n array[l] = lcElement;\n }\n element = lcElement;\n }\n }\n set[element] = true;\n }\n return set;\n}\n\n/**\n * Clean up an array to harden against CSPP\n *\n * @param {Array} array - The array to be cleaned.\n * @returns {Array} The cleaned version of the array\n */\nfunction cleanArray(array) {\n for (let index = 0; index < array.length; index++) {\n const isPropertyExist = objectHasOwnProperty(array, index);\n if (!isPropertyExist) {\n array[index] = null;\n }\n }\n return array;\n}\n\n/**\n * Shallow clone an object\n *\n * @param {Object} object - The object to be cloned.\n * @returns {Object} A new object that copies the original.\n */\nfunction clone(object) {\n const newObject = create(null);\n for (const [property, value] of entries(object)) {\n const isPropertyExist = objectHasOwnProperty(object, property);\n if (isPropertyExist) {\n if (Array.isArray(value)) {\n newObject[property] = cleanArray(value);\n } else if (value && typeof value === 'object' && value.constructor === Object) {\n newObject[property] = clone(value);\n } else {\n newObject[property] = value;\n }\n }\n }\n return newObject;\n}\n\n/**\n * This method automatically checks if the prop is function or getter and behaves accordingly.\n *\n * @param {Object} object - The object to look up the getter function in its prototype chain.\n * @param {String} prop - The property name for which to find the getter function.\n * @returns {Function} The getter function found in the prototype chain or a fallback function.\n */\nfunction lookupGetter(object, prop) {\n while (object !== null) {\n const desc = getOwnPropertyDescriptor(object, prop);\n if (desc) {\n if (desc.get) {\n return unapply(desc.get);\n }\n if (typeof desc.value === 'function') {\n return unapply(desc.value);\n }\n }\n object = getPrototypeOf(object);\n }\n function fallbackValue() {\n return null;\n }\n return fallbackValue;\n}\n\nconst html$1 = freeze(['a', 'abbr', 'acronym', 'address', 'area', 'article', 'aside', 'audio', 'b', 'bdi', 'bdo', 'big', 'blink', 'blockquote', 'body', 'br', 'button', 'canvas', 'caption', 'center', 'cite', 'code', 'col', 'colgroup', 'content', 'data', 'datalist', 'dd', 'decorator', 'del', 'details', 'dfn', 'dialog', 'dir', 'div', 'dl', 'dt', 'element', 'em', 'fieldset', 'figcaption', 'figure', 'font', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'i', 'img', 'input', 'ins', 'kbd', 'label', 'legend', 'li', 'main', 'map', 'mark', 'marquee', 'menu', 'menuitem', 'meter', 'nav', 'nobr', 'ol', 'optgroup', 'option', 'output', 'p', 'picture', 'pre', 'progress', 'q', 'rp', 'rt', 'ruby', 's', 'samp', 'section', 'select', 'shadow', 'small', 'source', 'spacer', 'span', 'strike', 'strong', 'style', 'sub', 'summary', 'sup', 'table', 'tbody', 'td', 'template', 'textarea', 'tfoot', 'th', 'thead', 'time', 'tr', 'track', 'tt', 'u', 'ul', 'var', 'video', 'wbr']);\n\n// SVG\nconst svg$1 = freeze(['svg', 'a', 'altglyph', 'altglyphdef', 'altglyphitem', 'animatecolor', 'animatemotion', 'animatetransform', 'circle', 'clippath', 'defs', 'desc', 'ellipse', 'filter', 'font', 'g', 'glyph', 'glyphref', 'hkern', 'image', 'line', 'lineargradient', 'marker', 'mask', 'metadata', 'mpath', 'path', 'pattern', 'polygon', 'polyline', 'radialgradient', 'rect', 'stop', 'style', 'switch', 'symbol', 'text', 'textpath', 'title', 'tref', 'tspan', 'view', 'vkern']);\nconst svgFilters = freeze(['feBlend', 'feColorMatrix', 'feComponentTransfer', 'feComposite', 'feConvolveMatrix', 'feDiffuseLighting', 'feDisplacementMap', 'feDistantLight', 'feDropShadow', 'feFlood', 'feFuncA', 'feFuncB', 'feFuncG', 'feFuncR', 'feGaussianBlur', 'feImage', 'feMerge', 'feMergeNode', 'feMorphology', 'feOffset', 'fePointLight', 'feSpecularLighting', 'feSpotLight', 'feTile', 'feTurbulence']);\n\n// List of SVG elements that are disallowed by default.\n// We still need to know them so that we can do namespace\n// checks properly in case one wants to add them to\n// allow-list.\nconst svgDisallowed = freeze(['animate', 'color-profile', 'cursor', 'discard', 'font-face', 'font-face-format', 'font-face-name', 'font-face-src', 'font-face-uri', 'foreignobject', 'hatch', 'hatchpath', 'mesh', 'meshgradient', 'meshpatch', 'meshrow', 'missing-glyph', 'script', 'set', 'solidcolor', 'unknown', 'use']);\nconst mathMl$1 = freeze(['math', 'menclose', 'merror', 'mfenced', 'mfrac', 'mglyph', 'mi', 'mlabeledtr', 'mmultiscripts', 'mn', 'mo', 'mover', 'mpadded', 'mphantom', 'mroot', 'mrow', 'ms', 'mspace', 'msqrt', 'mstyle', 'msub', 'msup', 'msubsup', 'mtable', 'mtd', 'mtext', 'mtr', 'munder', 'munderover', 'mprescripts']);\n\n// Similarly to SVG, we want to know all MathML elements,\n// even those that we disallow by default.\nconst mathMlDisallowed = freeze(['maction', 'maligngroup', 'malignmark', 'mlongdiv', 'mscarries', 'mscarry', 'msgroup', 'mstack', 'msline', 'msrow', 'semantics', 'annotation', 'annotation-xml', 'mprescripts', 'none']);\nconst text = freeze(['#text']);\n\nconst html = freeze(['accept', 'action', 'align', 'alt', 'autocapitalize', 'autocomplete', 'autopictureinpicture', 'autoplay', 'background', 'bgcolor', 'border', 'capture', 'cellpadding', 'cellspacing', 'checked', 'cite', 'class', 'clear', 'color', 'cols', 'colspan', 'controls', 'controlslist', 'coords', 'crossorigin', 'datetime', 'decoding', 'default', 'dir', 'disabled', 'disablepictureinpicture', 'disableremoteplayback', 'download', 'draggable', 'enctype', 'enterkeyhint', 'face', 'for', 'headers', 'height', 'hidden', 'high', 'href', 'hreflang', 'id', 'inputmode', 'integrity', 'ismap', 'kind', 'label', 'lang', 'list', 'loading', 'loop', 'low', 'max', 'maxlength', 'media', 'method', 'min', 'minlength', 'multiple', 'muted', 'name', 'nonce', 'noshade', 'novalidate', 'nowrap', 'open', 'optimum', 'pattern', 'placeholder', 'playsinline', 'popover', 'popovertarget', 'popovertargetaction', 'poster', 'preload', 'pubdate', 'radiogroup', 'readonly', 'rel', 'required', 'rev', 'reversed', 'role', 'rows', 'rowspan', 'spellcheck', 'scope', 'selected', 'shape', 'size', 'sizes', 'span', 'srclang', 'start', 'src', 'srcset', 'step', 'style', 'summary', 'tabindex', 'title', 'translate', 'type', 'usemap', 'valign', 'value', 'width', 'wrap', 'xmlns', 'slot']);\nconst svg = freeze(['accent-height', 'accumulate', 'additive', 'alignment-baseline', 'ascent', 'attributename', 'attributetype', 'azimuth', 'basefrequency', 'baseline-shift', 'begin', 'bias', 'by', 'class', 'clip', 'clippathunits', 'clip-path', 'clip-rule', 'color', 'color-interpolation', 'color-interpolation-filters', 'color-profile', 'color-rendering', 'cx', 'cy', 'd', 'dx', 'dy', 'diffuseconstant', 'direction', 'display', 'divisor', 'dur', 'edgemode', 'elevation', 'end', 'fill', 'fill-opacity', 'fill-rule', 'filter', 'filterunits', 'flood-color', 'flood-opacity', 'font-family', 'font-size', 'font-size-adjust', 'font-stretch', 'font-style', 'font-variant', 'font-weight', 'fx', 'fy', 'g1', 'g2', 'glyph-name', 'glyphref', 'gradientunits', 'gradienttransform', 'height', 'href', 'id', 'image-rendering', 'in', 'in2', 'k', 'k1', 'k2', 'k3', 'k4', 'kerning', 'keypoints', 'keysplines', 'keytimes', 'lang', 'lengthadjust', 'letter-spacing', 'kernelmatrix', 'kernelunitlength', 'lighting-color', 'local', 'marker-end', 'marker-mid', 'marker-start', 'markerheight', 'markerunits', 'markerwidth', 'maskcontentunits', 'maskunits', 'max', 'mask', 'media', 'method', 'mode', 'min', 'name', 'numoctaves', 'offset', 'operator', 'opacity', 'order', 'orient', 'orientation', 'origin', 'overflow', 'paint-order', 'path', 'pathlength', 'patterncontentunits', 'patterntransform', 'patternunits', 'points', 'preservealpha', 'preserveaspectratio', 'primitiveunits', 'r', 'rx', 'ry', 'radius', 'refx', 'refy', 'repeatcount', 'repeatdur', 'restart', 'result', 'rotate', 'scale', 'seed', 'shape-rendering', 'specularconstant', 'specularexponent', 'spreadmethod', 'startoffset', 'stddeviation', 'stitchtiles', 'stop-color', 'stop-opacity', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke', 'stroke-width', 'style', 'surfacescale', 'systemlanguage', 'tabindex', 'targetx', 'targety', 'transform', 'transform-origin', 'text-anchor', 'text-decoration', 'text-rendering', 'textlength', 'type', 'u1', 'u2', 'unicode', 'values', 'viewbox', 'visibility', 'version', 'vert-adv-y', 'vert-origin-x', 'vert-origin-y', 'width', 'word-spacing', 'wrap', 'writing-mode', 'xchannelselector', 'ychannelselector', 'x', 'x1', 'x2', 'xmlns', 'y', 'y1', 'y2', 'z', 'zoomandpan']);\nconst mathMl = freeze(['accent', 'accentunder', 'align', 'bevelled', 'close', 'columnsalign', 'columnlines', 'columnspan', 'denomalign', 'depth', 'dir', 'display', 'displaystyle', 'encoding', 'fence', 'frame', 'height', 'href', 'id', 'largeop', 'length', 'linethickness', 'lspace', 'lquote', 'mathbackground', 'mathcolor', 'mathsize', 'mathvariant', 'maxsize', 'minsize', 'movablelimits', 'notation', 'numalign', 'open', 'rowalign', 'rowlines', 'rowspacing', 'rowspan', 'rspace', 'rquote', 'scriptlevel', 'scriptminsize', 'scriptsizemultiplier', 'selection', 'separator', 'separators', 'stretchy', 'subscriptshift', 'supscriptshift', 'symmetric', 'voffset', 'width', 'xmlns']);\nconst xml = freeze(['xlink:href', 'xml:id', 'xlink:title', 'xml:space', 'xmlns:xlink']);\n\n// eslint-disable-next-line unicorn/better-regex\nconst MUSTACHE_EXPR = seal(/\\{\\{[\\w\\W]*|[\\w\\W]*\\}\\}/gm); // Specify template detection regex for SAFE_FOR_TEMPLATES mode\nconst ERB_EXPR = seal(/<%[\\w\\W]*|[\\w\\W]*%>/gm);\nconst TMPLIT_EXPR = seal(/\\${[\\w\\W]*}/gm);\nconst DATA_ATTR = seal(/^data-[\\-\\w.\\u00B7-\\uFFFF]/); // eslint-disable-line no-useless-escape\nconst ARIA_ATTR = seal(/^aria-[\\-\\w]+$/); // eslint-disable-line no-useless-escape\nconst IS_ALLOWED_URI = seal(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\\-]+(?:[^a-z+.\\-:]|$))/i // eslint-disable-line no-useless-escape\n);\nconst IS_SCRIPT_OR_DATA = seal(/^(?:\\w+script|data):/i);\nconst ATTR_WHITESPACE = seal(/[\\u0000-\\u0020\\u00A0\\u1680\\u180E\\u2000-\\u2029\\u205F\\u3000]/g // eslint-disable-line no-control-regex\n);\nconst DOCTYPE_NAME = seal(/^html$/i);\nconst CUSTOM_ELEMENT = seal(/^[a-z][.\\w]*(-[.\\w]+)+$/i);\n\nvar EXPRESSIONS = /*#__PURE__*/Object.freeze({\n __proto__: null,\n MUSTACHE_EXPR: MUSTACHE_EXPR,\n ERB_EXPR: ERB_EXPR,\n TMPLIT_EXPR: TMPLIT_EXPR,\n DATA_ATTR: DATA_ATTR,\n ARIA_ATTR: ARIA_ATTR,\n IS_ALLOWED_URI: IS_ALLOWED_URI,\n IS_SCRIPT_OR_DATA: IS_SCRIPT_OR_DATA,\n ATTR_WHITESPACE: ATTR_WHITESPACE,\n DOCTYPE_NAME: DOCTYPE_NAME,\n CUSTOM_ELEMENT: CUSTOM_ELEMENT\n});\n\n// https://developer.mozilla.org/en-US/docs/Web/API/Node/nodeType\nconst NODE_TYPE = {\n element: 1,\n attribute: 2,\n text: 3,\n cdataSection: 4,\n entityReference: 5,\n // Deprecated\n entityNode: 6,\n // Deprecated\n progressingInstruction: 7,\n comment: 8,\n document: 9,\n documentType: 10,\n documentFragment: 11,\n notation: 12 // Deprecated\n};\nconst getGlobal = function getGlobal() {\n return typeof window === 'undefined' ? null : window;\n};\n\n/**\n * Creates a no-op policy for internal use only.\n * Don't export this function outside this module!\n * @param {TrustedTypePolicyFactory} trustedTypes The policy factory.\n * @param {HTMLScriptElement} purifyHostElement The Script element used to load DOMPurify (to determine policy name suffix).\n * @return {TrustedTypePolicy} The policy created (or null, if Trusted Types\n * are not supported or creating the policy failed).\n */\nconst _createTrustedTypesPolicy = function _createTrustedTypesPolicy(trustedTypes, purifyHostElement) {\n if (typeof trustedTypes !== 'object' || typeof trustedTypes.createPolicy !== 'function') {\n return null;\n }\n\n // Allow the callers to control the unique policy name\n // by adding a data-tt-policy-suffix to the script element with the DOMPurify.\n // Policy creation with duplicate names throws in Trusted Types.\n let suffix = null;\n const ATTR_NAME = 'data-tt-policy-suffix';\n if (purifyHostElement && purifyHostElement.hasAttribute(ATTR_NAME)) {\n suffix = purifyHostElement.getAttribute(ATTR_NAME);\n }\n const policyName = 'dompurify' + (suffix ? '#' + suffix : '');\n try {\n return trustedTypes.createPolicy(policyName, {\n createHTML(html) {\n return html;\n },\n createScriptURL(scriptUrl) {\n return scriptUrl;\n }\n });\n } catch (_) {\n // Policy creation failed (most likely another DOMPurify script has\n // already run). Skip creating the policy, as this will only cause errors\n // if TT are enforced.\n console.warn('TrustedTypes policy ' + policyName + ' could not be created.');\n return null;\n }\n};\nfunction createDOMPurify() {\n let window = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getGlobal();\n const DOMPurify = root => createDOMPurify(root);\n\n /**\n * Version label, exposed for easier checks\n * if DOMPurify is up to date or not\n */\n DOMPurify.version = '3.1.6';\n\n /**\n * Array of elements that DOMPurify removed during sanitation.\n * Empty if nothing was removed.\n */\n DOMPurify.removed = [];\n if (!window || !window.document || window.document.nodeType !== NODE_TYPE.document) {\n // Not running in a browser, provide a factory function\n // so that you can pass your own Window\n DOMPurify.isSupported = false;\n return DOMPurify;\n }\n let {\n document\n } = window;\n const originalDocument = document;\n const currentScript = originalDocument.currentScript;\n const {\n DocumentFragment,\n HTMLTemplateElement,\n Node,\n Element,\n NodeFilter,\n NamedNodeMap = window.NamedNodeMap || window.MozNamedAttrMap,\n HTMLFormElement,\n DOMParser,\n trustedTypes\n } = window;\n const ElementPrototype = Element.prototype;\n const cloneNode = lookupGetter(ElementPrototype, 'cloneNode');\n const remove = lookupGetter(ElementPrototype, 'remove');\n const getNextSibling = lookupGetter(ElementPrototype, 'nextSibling');\n const getChildNodes = lookupGetter(ElementPrototype, 'childNodes');\n const getParentNode = lookupGetter(ElementPrototype, 'parentNode');\n\n // As per issue #47, the web-components registry is inherited by a\n // new document created via createHTMLDocument. As per the spec\n // (http://w3c.github.io/webcomponents/spec/custom/#creating-and-passing-registries)\n // a new empty registry is used when creating a template contents owner\n // document, so we use that as our parent document to ensure nothing\n // is inherited.\n if (typeof HTMLTemplateElement === 'function') {\n const template = document.createElement('template');\n if (template.content && template.content.ownerDocument) {\n document = template.content.ownerDocument;\n }\n }\n let trustedTypesPolicy;\n let emptyHTML = '';\n const {\n implementation,\n createNodeIterator,\n createDocumentFragment,\n getElementsByTagName\n } = document;\n const {\n importNode\n } = originalDocument;\n let hooks = {};\n\n /**\n * Expose whether this browser supports running the full DOMPurify.\n */\n DOMPurify.isSupported = typeof entries === 'function' && typeof getParentNode === 'function' && implementation && implementation.createHTMLDocument !== undefined;\n const {\n MUSTACHE_EXPR,\n ERB_EXPR,\n TMPLIT_EXPR,\n DATA_ATTR,\n ARIA_ATTR,\n IS_SCRIPT_OR_DATA,\n ATTR_WHITESPACE,\n CUSTOM_ELEMENT\n } = EXPRESSIONS;\n let {\n IS_ALLOWED_URI: IS_ALLOWED_URI$1\n } = EXPRESSIONS;\n\n /**\n * We consider the elements and attributes below to be safe. Ideally\n * don't add any new ones but feel free to remove unwanted ones.\n */\n\n /* allowed element names */\n let ALLOWED_TAGS = null;\n const DEFAULT_ALLOWED_TAGS = addToSet({}, [...html$1, ...svg$1, ...svgFilters, ...mathMl$1, ...text]);\n\n /* Allowed attribute names */\n let ALLOWED_ATTR = null;\n const DEFAULT_ALLOWED_ATTR = addToSet({}, [...html, ...svg, ...mathMl, ...xml]);\n\n /*\n * Configure how DOMPUrify should handle custom elements and their attributes as well as customized built-in elements.\n * @property {RegExp|Function|null} tagNameCheck one of [null, regexPattern, predicate]. Default: `null` (disallow any custom elements)\n * @property {RegExp|Function|null} attributeNameCheck one of [null, regexPattern, predicate]. Default: `null` (disallow any attributes not on the allow list)\n * @property {boolean} allowCustomizedBuiltInElements allow custom elements derived from built-ins if they pass CUSTOM_ELEMENT_HANDLING.tagNameCheck. Default: `false`.\n */\n let CUSTOM_ELEMENT_HANDLING = Object.seal(create(null, {\n tagNameCheck: {\n writable: true,\n configurable: false,\n enumerable: true,\n value: null\n },\n attributeNameCheck: {\n writable: true,\n configurable: false,\n enumerable: true,\n value: null\n },\n allowCustomizedBuiltInElements: {\n writable: true,\n configurable: false,\n enumerable: true,\n value: false\n }\n }));\n\n /* Explicitly forbidden tags (overrides ALLOWED_TAGS/ADD_TAGS) */\n let FORBID_TAGS = null;\n\n /* Explicitly forbidden attributes (overrides ALLOWED_ATTR/ADD_ATTR) */\n let FORBID_ATTR = null;\n\n /* Decide if ARIA attributes are okay */\n let ALLOW_ARIA_ATTR = true;\n\n /* Decide if custom data attributes are okay */\n let ALLOW_DATA_ATTR = true;\n\n /* Decide if unknown protocols are okay */\n let ALLOW_UNKNOWN_PROTOCOLS = false;\n\n /* Decide if self-closing tags in attributes are allowed.\n * Usually removed due to a mXSS issue in jQuery 3.0 */\n let ALLOW_SELF_CLOSE_IN_ATTR = true;\n\n /* Output should be safe for common template engines.\n * This means, DOMPurify removes data attributes, mustaches and ERB\n */\n let SAFE_FOR_TEMPLATES = false;\n\n /* Output should be safe even for XML used within HTML and alike.\n * This means, DOMPurify removes comments when containing risky content.\n */\n let SAFE_FOR_XML = true;\n\n /* Decide if document with ... should be returned */\n let WHOLE_DOCUMENT = false;\n\n /* Track whether config is already set on this instance of DOMPurify. */\n let SET_CONFIG = false;\n\n /* Decide if all elements (e.g. style, script) must be children of\n * document.body. By default, browsers might move them to document.head */\n let FORCE_BODY = false;\n\n /* Decide if a DOM `HTMLBodyElement` should be returned, instead of a html\n * string (or a TrustedHTML object if Trusted Types are supported).\n * If `WHOLE_DOCUMENT` is enabled a `HTMLHtmlElement` will be returned instead\n */\n let RETURN_DOM = false;\n\n /* Decide if a DOM `DocumentFragment` should be returned, instead of a html\n * string (or a TrustedHTML object if Trusted Types are supported) */\n let RETURN_DOM_FRAGMENT = false;\n\n /* Try to return a Trusted Type object instead of a string, return a string in\n * case Trusted Types are not supported */\n let RETURN_TRUSTED_TYPE = false;\n\n /* Output should be free from DOM clobbering attacks?\n * This sanitizes markups named with colliding, clobberable built-in DOM APIs.\n */\n let SANITIZE_DOM = true;\n\n /* Achieve full DOM Clobbering protection by isolating the namespace of named\n * properties and JS variables, mitigating attacks that abuse the HTML/DOM spec rules.\n *\n * HTML/DOM spec rules that enable DOM Clobbering:\n * - Named Access on Window (§7.3.3)\n * - DOM Tree Accessors (§3.1.5)\n * - Form Element Parent-Child Relations (§4.10.3)\n * - Iframe srcdoc / Nested WindowProxies (§4.8.5)\n * - HTMLCollection (§4.2.10.2)\n *\n * Namespace isolation is implemented by prefixing `id` and `name` attributes\n * with a constant string, i.e., `user-content-`\n */\n let SANITIZE_NAMED_PROPS = false;\n const SANITIZE_NAMED_PROPS_PREFIX = 'user-content-';\n\n /* Keep element content when removing element? */\n let KEEP_CONTENT = true;\n\n /* If a `Node` is passed to sanitize(), then performs sanitization in-place instead\n * of importing it into a new Document and returning a sanitized copy */\n let IN_PLACE = false;\n\n /* Allow usage of profiles like html, svg and mathMl */\n let USE_PROFILES = {};\n\n /* Tags to ignore content of when KEEP_CONTENT is true */\n let FORBID_CONTENTS = null;\n const DEFAULT_FORBID_CONTENTS = addToSet({}, ['annotation-xml', 'audio', 'colgroup', 'desc', 'foreignobject', 'head', 'iframe', 'math', 'mi', 'mn', 'mo', 'ms', 'mtext', 'noembed', 'noframes', 'noscript', 'plaintext', 'script', 'style', 'svg', 'template', 'thead', 'title', 'video', 'xmp']);\n\n /* Tags that are safe for data: URIs */\n let DATA_URI_TAGS = null;\n const DEFAULT_DATA_URI_TAGS = addToSet({}, ['audio', 'video', 'img', 'source', 'image', 'track']);\n\n /* Attributes safe for values like \"javascript:\" */\n let URI_SAFE_ATTRIBUTES = null;\n const DEFAULT_URI_SAFE_ATTRIBUTES = addToSet({}, ['alt', 'class', 'for', 'id', 'label', 'name', 'pattern', 'placeholder', 'role', 'summary', 'title', 'value', 'style', 'xmlns']);\n const MATHML_NAMESPACE = 'http://www.w3.org/1998/Math/MathML';\n const SVG_NAMESPACE = 'http://www.w3.org/2000/svg';\n const HTML_NAMESPACE = 'http://www.w3.org/1999/xhtml';\n /* Document namespace */\n let NAMESPACE = HTML_NAMESPACE;\n let IS_EMPTY_INPUT = false;\n\n /* Allowed XHTML+XML namespaces */\n let ALLOWED_NAMESPACES = null;\n const DEFAULT_ALLOWED_NAMESPACES = addToSet({}, [MATHML_NAMESPACE, SVG_NAMESPACE, HTML_NAMESPACE], stringToString);\n\n /* Parsing of strict XHTML documents */\n let PARSER_MEDIA_TYPE = null;\n const SUPPORTED_PARSER_MEDIA_TYPES = ['application/xhtml+xml', 'text/html'];\n const DEFAULT_PARSER_MEDIA_TYPE = 'text/html';\n let transformCaseFunc = null;\n\n /* Keep a reference to config to pass to hooks */\n let CONFIG = null;\n\n /* Ideally, do not touch anything below this line */\n /* ______________________________________________ */\n\n const formElement = document.createElement('form');\n const isRegexOrFunction = function isRegexOrFunction(testValue) {\n return testValue instanceof RegExp || testValue instanceof Function;\n };\n\n /**\n * _parseConfig\n *\n * @param {Object} cfg optional config literal\n */\n // eslint-disable-next-line complexity\n const _parseConfig = function _parseConfig() {\n let cfg = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n if (CONFIG && CONFIG === cfg) {\n return;\n }\n\n /* Shield configuration object from tampering */\n if (!cfg || typeof cfg !== 'object') {\n cfg = {};\n }\n\n /* Shield configuration object from prototype pollution */\n cfg = clone(cfg);\n PARSER_MEDIA_TYPE =\n // eslint-disable-next-line unicorn/prefer-includes\n SUPPORTED_PARSER_MEDIA_TYPES.indexOf(cfg.PARSER_MEDIA_TYPE) === -1 ? DEFAULT_PARSER_MEDIA_TYPE : cfg.PARSER_MEDIA_TYPE;\n\n // HTML tags and attributes are not case-sensitive, converting to lowercase. Keeping XHTML as is.\n transformCaseFunc = PARSER_MEDIA_TYPE === 'application/xhtml+xml' ? stringToString : stringToLowerCase;\n\n /* Set configuration parameters */\n ALLOWED_TAGS = objectHasOwnProperty(cfg, 'ALLOWED_TAGS') ? addToSet({}, cfg.ALLOWED_TAGS, transformCaseFunc) : DEFAULT_ALLOWED_TAGS;\n ALLOWED_ATTR = objectHasOwnProperty(cfg, 'ALLOWED_ATTR') ? addToSet({}, cfg.ALLOWED_ATTR, transformCaseFunc) : DEFAULT_ALLOWED_ATTR;\n ALLOWED_NAMESPACES = objectHasOwnProperty(cfg, 'ALLOWED_NAMESPACES') ? addToSet({}, cfg.ALLOWED_NAMESPACES, stringToString) : DEFAULT_ALLOWED_NAMESPACES;\n URI_SAFE_ATTRIBUTES = objectHasOwnProperty(cfg, 'ADD_URI_SAFE_ATTR') ? addToSet(clone(DEFAULT_URI_SAFE_ATTRIBUTES),\n // eslint-disable-line indent\n cfg.ADD_URI_SAFE_ATTR,\n // eslint-disable-line indent\n transformCaseFunc // eslint-disable-line indent\n ) // eslint-disable-line indent\n : DEFAULT_URI_SAFE_ATTRIBUTES;\n DATA_URI_TAGS = objectHasOwnProperty(cfg, 'ADD_DATA_URI_TAGS') ? addToSet(clone(DEFAULT_DATA_URI_TAGS),\n // eslint-disable-line indent\n cfg.ADD_DATA_URI_TAGS,\n // eslint-disable-line indent\n transformCaseFunc // eslint-disable-line indent\n ) // eslint-disable-line indent\n : DEFAULT_DATA_URI_TAGS;\n FORBID_CONTENTS = objectHasOwnProperty(cfg, 'FORBID_CONTENTS') ? addToSet({}, cfg.FORBID_CONTENTS, transformCaseFunc) : DEFAULT_FORBID_CONTENTS;\n FORBID_TAGS = objectHasOwnProperty(cfg, 'FORBID_TAGS') ? addToSet({}, cfg.FORBID_TAGS, transformCaseFunc) : {};\n FORBID_ATTR = objectHasOwnProperty(cfg, 'FORBID_ATTR') ? addToSet({}, cfg.FORBID_ATTR, transformCaseFunc) : {};\n USE_PROFILES = objectHasOwnProperty(cfg, 'USE_PROFILES') ? cfg.USE_PROFILES : false;\n ALLOW_ARIA_ATTR = cfg.ALLOW_ARIA_ATTR !== false; // Default true\n ALLOW_DATA_ATTR = cfg.ALLOW_DATA_ATTR !== false; // Default true\n ALLOW_UNKNOWN_PROTOCOLS = cfg.ALLOW_UNKNOWN_PROTOCOLS || false; // Default false\n ALLOW_SELF_CLOSE_IN_ATTR = cfg.ALLOW_SELF_CLOSE_IN_ATTR !== false; // Default true\n SAFE_FOR_TEMPLATES = cfg.SAFE_FOR_TEMPLATES || false; // Default false\n SAFE_FOR_XML = cfg.SAFE_FOR_XML !== false; // Default true\n WHOLE_DOCUMENT = cfg.WHOLE_DOCUMENT || false; // Default false\n RETURN_DOM = cfg.RETURN_DOM || false; // Default false\n RETURN_DOM_FRAGMENT = cfg.RETURN_DOM_FRAGMENT || false; // Default false\n RETURN_TRUSTED_TYPE = cfg.RETURN_TRUSTED_TYPE || false; // Default false\n FORCE_BODY = cfg.FORCE_BODY || false; // Default false\n SANITIZE_DOM = cfg.SANITIZE_DOM !== false; // Default true\n SANITIZE_NAMED_PROPS = cfg.SANITIZE_NAMED_PROPS || false; // Default false\n KEEP_CONTENT = cfg.KEEP_CONTENT !== false; // Default true\n IN_PLACE = cfg.IN_PLACE || false; // Default false\n IS_ALLOWED_URI$1 = cfg.ALLOWED_URI_REGEXP || IS_ALLOWED_URI;\n NAMESPACE = cfg.NAMESPACE || HTML_NAMESPACE;\n CUSTOM_ELEMENT_HANDLING = cfg.CUSTOM_ELEMENT_HANDLING || {};\n if (cfg.CUSTOM_ELEMENT_HANDLING && isRegexOrFunction(cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck)) {\n CUSTOM_ELEMENT_HANDLING.tagNameCheck = cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck;\n }\n if (cfg.CUSTOM_ELEMENT_HANDLING && isRegexOrFunction(cfg.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)) {\n CUSTOM_ELEMENT_HANDLING.attributeNameCheck = cfg.CUSTOM_ELEMENT_HANDLING.attributeNameCheck;\n }\n if (cfg.CUSTOM_ELEMENT_HANDLING && typeof cfg.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements === 'boolean') {\n CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements = cfg.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements;\n }\n if (SAFE_FOR_TEMPLATES) {\n ALLOW_DATA_ATTR = false;\n }\n if (RETURN_DOM_FRAGMENT) {\n RETURN_DOM = true;\n }\n\n /* Parse profile info */\n if (USE_PROFILES) {\n ALLOWED_TAGS = addToSet({}, text);\n ALLOWED_ATTR = [];\n if (USE_PROFILES.html === true) {\n addToSet(ALLOWED_TAGS, html$1);\n addToSet(ALLOWED_ATTR, html);\n }\n if (USE_PROFILES.svg === true) {\n addToSet(ALLOWED_TAGS, svg$1);\n addToSet(ALLOWED_ATTR, svg);\n addToSet(ALLOWED_ATTR, xml);\n }\n if (USE_PROFILES.svgFilters === true) {\n addToSet(ALLOWED_TAGS, svgFilters);\n addToSet(ALLOWED_ATTR, svg);\n addToSet(ALLOWED_ATTR, xml);\n }\n if (USE_PROFILES.mathMl === true) {\n addToSet(ALLOWED_TAGS, mathMl$1);\n addToSet(ALLOWED_ATTR, mathMl);\n addToSet(ALLOWED_ATTR, xml);\n }\n }\n\n /* Merge configuration parameters */\n if (cfg.ADD_TAGS) {\n if (ALLOWED_TAGS === DEFAULT_ALLOWED_TAGS) {\n ALLOWED_TAGS = clone(ALLOWED_TAGS);\n }\n addToSet(ALLOWED_TAGS, cfg.ADD_TAGS, transformCaseFunc);\n }\n if (cfg.ADD_ATTR) {\n if (ALLOWED_ATTR === DEFAULT_ALLOWED_ATTR) {\n ALLOWED_ATTR = clone(ALLOWED_ATTR);\n }\n addToSet(ALLOWED_ATTR, cfg.ADD_ATTR, transformCaseFunc);\n }\n if (cfg.ADD_URI_SAFE_ATTR) {\n addToSet(URI_SAFE_ATTRIBUTES, cfg.ADD_URI_SAFE_ATTR, transformCaseFunc);\n }\n if (cfg.FORBID_CONTENTS) {\n if (FORBID_CONTENTS === DEFAULT_FORBID_CONTENTS) {\n FORBID_CONTENTS = clone(FORBID_CONTENTS);\n }\n addToSet(FORBID_CONTENTS, cfg.FORBID_CONTENTS, transformCaseFunc);\n }\n\n /* Add #text in case KEEP_CONTENT is set to true */\n if (KEEP_CONTENT) {\n ALLOWED_TAGS['#text'] = true;\n }\n\n /* Add html, head and body to ALLOWED_TAGS in case WHOLE_DOCUMENT is true */\n if (WHOLE_DOCUMENT) {\n addToSet(ALLOWED_TAGS, ['html', 'head', 'body']);\n }\n\n /* Add tbody to ALLOWED_TAGS in case tables are permitted, see #286, #365 */\n if (ALLOWED_TAGS.table) {\n addToSet(ALLOWED_TAGS, ['tbody']);\n delete FORBID_TAGS.tbody;\n }\n if (cfg.TRUSTED_TYPES_POLICY) {\n if (typeof cfg.TRUSTED_TYPES_POLICY.createHTML !== 'function') {\n throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a \"createHTML\" hook.');\n }\n if (typeof cfg.TRUSTED_TYPES_POLICY.createScriptURL !== 'function') {\n throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a \"createScriptURL\" hook.');\n }\n\n // Overwrite existing TrustedTypes policy.\n trustedTypesPolicy = cfg.TRUSTED_TYPES_POLICY;\n\n // Sign local variables required by `sanitize`.\n emptyHTML = trustedTypesPolicy.createHTML('');\n } else {\n // Uninitialized policy, attempt to initialize the internal dompurify policy.\n if (trustedTypesPolicy === undefined) {\n trustedTypesPolicy = _createTrustedTypesPolicy(trustedTypes, currentScript);\n }\n\n // If creating the internal policy succeeded sign internal variables.\n if (trustedTypesPolicy !== null && typeof emptyHTML === 'string') {\n emptyHTML = trustedTypesPolicy.createHTML('');\n }\n }\n\n // Prevent further manipulation of configuration.\n // Not available in IE8, Safari 5, etc.\n if (freeze) {\n freeze(cfg);\n }\n CONFIG = cfg;\n };\n const MATHML_TEXT_INTEGRATION_POINTS = addToSet({}, ['mi', 'mo', 'mn', 'ms', 'mtext']);\n const HTML_INTEGRATION_POINTS = addToSet({}, ['foreignobject', 'annotation-xml']);\n\n // Certain elements are allowed in both SVG and HTML\n // namespace. We need to specify them explicitly\n // so that they don't get erroneously deleted from\n // HTML namespace.\n const COMMON_SVG_AND_HTML_ELEMENTS = addToSet({}, ['title', 'style', 'font', 'a', 'script']);\n\n /* Keep track of all possible SVG and MathML tags\n * so that we can perform the namespace checks\n * correctly. */\n const ALL_SVG_TAGS = addToSet({}, [...svg$1, ...svgFilters, ...svgDisallowed]);\n const ALL_MATHML_TAGS = addToSet({}, [...mathMl$1, ...mathMlDisallowed]);\n\n /**\n * @param {Element} element a DOM element whose namespace is being checked\n * @returns {boolean} Return false if the element has a\n * namespace that a spec-compliant parser would never\n * return. Return true otherwise.\n */\n const _checkValidNamespace = function _checkValidNamespace(element) {\n let parent = getParentNode(element);\n\n // In JSDOM, if we're inside shadow DOM, then parentNode\n // can be null. We just simulate parent in this case.\n if (!parent || !parent.tagName) {\n parent = {\n namespaceURI: NAMESPACE,\n tagName: 'template'\n };\n }\n const tagName = stringToLowerCase(element.tagName);\n const parentTagName = stringToLowerCase(parent.tagName);\n if (!ALLOWED_NAMESPACES[element.namespaceURI]) {\n return false;\n }\n if (element.namespaceURI === SVG_NAMESPACE) {\n // The only way to switch from HTML namespace to SVG\n // is via . If it happens via any other tag, then\n // it should be killed.\n if (parent.namespaceURI === HTML_NAMESPACE) {\n return tagName === 'svg';\n }\n\n // The only way to switch from MathML to SVG is via`\n // svg if parent is either or MathML\n // text integration points.\n if (parent.namespaceURI === MATHML_NAMESPACE) {\n return tagName === 'svg' && (parentTagName === 'annotation-xml' || MATHML_TEXT_INTEGRATION_POINTS[parentTagName]);\n }\n\n // We only allow elements that are defined in SVG\n // spec. All others are disallowed in SVG namespace.\n return Boolean(ALL_SVG_TAGS[tagName]);\n }\n if (element.namespaceURI === MATHML_NAMESPACE) {\n // The only way to switch from HTML namespace to MathML\n // is via . If it happens via any other tag, then\n // it should be killed.\n if (parent.namespaceURI === HTML_NAMESPACE) {\n return tagName === 'math';\n }\n\n // The only way to switch from SVG to MathML is via\n // and HTML integration points\n if (parent.namespaceURI === SVG_NAMESPACE) {\n return tagName === 'math' && HTML_INTEGRATION_POINTS[parentTagName];\n }\n\n // We only allow elements that are defined in MathML\n // spec. All others are disallowed in MathML namespace.\n return Boolean(ALL_MATHML_TAGS[tagName]);\n }\n if (element.namespaceURI === HTML_NAMESPACE) {\n // The only way to switch from SVG to HTML is via\n // HTML integration points, and from MathML to HTML\n // is via MathML text integration points\n if (parent.namespaceURI === SVG_NAMESPACE && !HTML_INTEGRATION_POINTS[parentTagName]) {\n return false;\n }\n if (parent.namespaceURI === MATHML_NAMESPACE && !MATHML_TEXT_INTEGRATION_POINTS[parentTagName]) {\n return false;\n }\n\n // We disallow tags that are specific for MathML\n // or SVG and should never appear in HTML namespace\n return !ALL_MATHML_TAGS[tagName] && (COMMON_SVG_AND_HTML_ELEMENTS[tagName] || !ALL_SVG_TAGS[tagName]);\n }\n\n // For XHTML and XML documents that support custom namespaces\n if (PARSER_MEDIA_TYPE === 'application/xhtml+xml' && ALLOWED_NAMESPACES[element.namespaceURI]) {\n return true;\n }\n\n // The code should never reach this place (this means\n // that the element somehow got namespace that is not\n // HTML, SVG, MathML or allowed via ALLOWED_NAMESPACES).\n // Return false just in case.\n return false;\n };\n\n /**\n * _forceRemove\n *\n * @param {Node} node a DOM node\n */\n const _forceRemove = function _forceRemove(node) {\n arrayPush(DOMPurify.removed, {\n element: node\n });\n try {\n // eslint-disable-next-line unicorn/prefer-dom-node-remove\n getParentNode(node).removeChild(node);\n } catch (_) {\n remove(node);\n }\n };\n\n /**\n * _removeAttribute\n *\n * @param {String} name an Attribute name\n * @param {Node} node a DOM node\n */\n const _removeAttribute = function _removeAttribute(name, node) {\n try {\n arrayPush(DOMPurify.removed, {\n attribute: node.getAttributeNode(name),\n from: node\n });\n } catch (_) {\n arrayPush(DOMPurify.removed, {\n attribute: null,\n from: node\n });\n }\n node.removeAttribute(name);\n\n // We void attribute values for unremovable \"is\"\" attributes\n if (name === 'is' && !ALLOWED_ATTR[name]) {\n if (RETURN_DOM || RETURN_DOM_FRAGMENT) {\n try {\n _forceRemove(node);\n } catch (_) {}\n } else {\n try {\n node.setAttribute(name, '');\n } catch (_) {}\n }\n }\n };\n\n /**\n * _initDocument\n *\n * @param {String} dirty a string of dirty markup\n * @return {Document} a DOM, filled with the dirty markup\n */\n const _initDocument = function _initDocument(dirty) {\n /* Create a HTML document */\n let doc = null;\n let leadingWhitespace = null;\n if (FORCE_BODY) {\n dirty = ' ' + dirty;\n } else {\n /* If FORCE_BODY isn't used, leading whitespace needs to be preserved manually */\n const matches = stringMatch(dirty, /^[\\r\\n\\t ]+/);\n leadingWhitespace = matches && matches[0];\n }\n if (PARSER_MEDIA_TYPE === 'application/xhtml+xml' && NAMESPACE === HTML_NAMESPACE) {\n // Root of XHTML doc must contain xmlns declaration (see https://www.w3.org/TR/xhtml1/normative.html#strict)\n dirty = '' + dirty + '';\n }\n const dirtyPayload = trustedTypesPolicy ? trustedTypesPolicy.createHTML(dirty) : dirty;\n /*\n * Use the DOMParser API by default, fallback later if needs be\n * DOMParser not work for svg when has multiple root element.\n */\n if (NAMESPACE === HTML_NAMESPACE) {\n try {\n doc = new DOMParser().parseFromString(dirtyPayload, PARSER_MEDIA_TYPE);\n } catch (_) {}\n }\n\n /* Use createHTMLDocument in case DOMParser is not available */\n if (!doc || !doc.documentElement) {\n doc = implementation.createDocument(NAMESPACE, 'template', null);\n try {\n doc.documentElement.innerHTML = IS_EMPTY_INPUT ? emptyHTML : dirtyPayload;\n } catch (_) {\n // Syntax error if dirtyPayload is invalid xml\n }\n }\n const body = doc.body || doc.documentElement;\n if (dirty && leadingWhitespace) {\n body.insertBefore(document.createTextNode(leadingWhitespace), body.childNodes[0] || null);\n }\n\n /* Work on whole document or just its body */\n if (NAMESPACE === HTML_NAMESPACE) {\n return getElementsByTagName.call(doc, WHOLE_DOCUMENT ? 'html' : 'body')[0];\n }\n return WHOLE_DOCUMENT ? doc.documentElement : body;\n };\n\n /**\n * Creates a NodeIterator object that you can use to traverse filtered lists of nodes or elements in a document.\n *\n * @param {Node} root The root element or node to start traversing on.\n * @return {NodeIterator} The created NodeIterator\n */\n const _createNodeIterator = function _createNodeIterator(root) {\n return createNodeIterator.call(root.ownerDocument || root, root,\n // eslint-disable-next-line no-bitwise\n NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_TEXT | NodeFilter.SHOW_PROCESSING_INSTRUCTION | NodeFilter.SHOW_CDATA_SECTION, null);\n };\n\n /**\n * _isClobbered\n *\n * @param {Node} elm element to check for clobbering attacks\n * @return {Boolean} true if clobbered, false if safe\n */\n const _isClobbered = function _isClobbered(elm) {\n return elm instanceof HTMLFormElement && (typeof elm.nodeName !== 'string' || typeof elm.textContent !== 'string' || typeof elm.removeChild !== 'function' || !(elm.attributes instanceof NamedNodeMap) || typeof elm.removeAttribute !== 'function' || typeof elm.setAttribute !== 'function' || typeof elm.namespaceURI !== 'string' || typeof elm.insertBefore !== 'function' || typeof elm.hasChildNodes !== 'function');\n };\n\n /**\n * Checks whether the given object is a DOM node.\n *\n * @param {Node} object object to check whether it's a DOM node\n * @return {Boolean} true is object is a DOM node\n */\n const _isNode = function _isNode(object) {\n return typeof Node === 'function' && object instanceof Node;\n };\n\n /**\n * _executeHook\n * Execute user configurable hooks\n *\n * @param {String} entryPoint Name of the hook's entry point\n * @param {Node} currentNode node to work on with the hook\n * @param {Object} data additional hook parameters\n */\n const _executeHook = function _executeHook(entryPoint, currentNode, data) {\n if (!hooks[entryPoint]) {\n return;\n }\n arrayForEach(hooks[entryPoint], hook => {\n hook.call(DOMPurify, currentNode, data, CONFIG);\n });\n };\n\n /**\n * _sanitizeElements\n *\n * @protect nodeName\n * @protect textContent\n * @protect removeChild\n *\n * @param {Node} currentNode to check for permission to exist\n * @return {Boolean} true if node was killed, false if left alive\n */\n const _sanitizeElements = function _sanitizeElements(currentNode) {\n let content = null;\n\n /* Execute a hook if present */\n _executeHook('beforeSanitizeElements', currentNode, null);\n\n /* Check if element is clobbered or can clobber */\n if (_isClobbered(currentNode)) {\n _forceRemove(currentNode);\n return true;\n }\n\n /* Now let's check the element's type and name */\n const tagName = transformCaseFunc(currentNode.nodeName);\n\n /* Execute a hook if present */\n _executeHook('uponSanitizeElement', currentNode, {\n tagName,\n allowedTags: ALLOWED_TAGS\n });\n\n /* Detect mXSS attempts abusing namespace confusion */\n if (currentNode.hasChildNodes() && !_isNode(currentNode.firstElementChild) && regExpTest(/<[/\\w]/g, currentNode.innerHTML) && regExpTest(/<[/\\w]/g, currentNode.textContent)) {\n _forceRemove(currentNode);\n return true;\n }\n\n /* Remove any occurrence of processing instructions */\n if (currentNode.nodeType === NODE_TYPE.progressingInstruction) {\n _forceRemove(currentNode);\n return true;\n }\n\n /* Remove any kind of possibly harmful comments */\n if (SAFE_FOR_XML && currentNode.nodeType === NODE_TYPE.comment && regExpTest(/<[/\\w]/g, currentNode.data)) {\n _forceRemove(currentNode);\n return true;\n }\n\n /* Remove element if anything forbids its presence */\n if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) {\n /* Check if we have a custom element to handle */\n if (!FORBID_TAGS[tagName] && _isBasicCustomElement(tagName)) {\n if (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, tagName)) {\n return false;\n }\n if (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(tagName)) {\n return false;\n }\n }\n\n /* Keep content except for bad-listed elements */\n if (KEEP_CONTENT && !FORBID_CONTENTS[tagName]) {\n const parentNode = getParentNode(currentNode) || currentNode.parentNode;\n const childNodes = getChildNodes(currentNode) || currentNode.childNodes;\n if (childNodes && parentNode) {\n const childCount = childNodes.length;\n for (let i = childCount - 1; i >= 0; --i) {\n const childClone = cloneNode(childNodes[i], true);\n childClone.__removalCount = (currentNode.__removalCount || 0) + 1;\n parentNode.insertBefore(childClone, getNextSibling(currentNode));\n }\n }\n }\n _forceRemove(currentNode);\n return true;\n }\n\n /* Check whether element has a valid namespace */\n if (currentNode instanceof Element && !_checkValidNamespace(currentNode)) {\n _forceRemove(currentNode);\n return true;\n }\n\n /* Make sure that older browsers don't get fallback-tag mXSS */\n if ((tagName === 'noscript' || tagName === 'noembed' || tagName === 'noframes') && regExpTest(/<\\/no(script|embed|frames)/i, currentNode.innerHTML)) {\n _forceRemove(currentNode);\n return true;\n }\n\n /* Sanitize element content to be template-safe */\n if (SAFE_FOR_TEMPLATES && currentNode.nodeType === NODE_TYPE.text) {\n /* Get the element's text content */\n content = currentNode.textContent;\n arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], expr => {\n content = stringReplace(content, expr, ' ');\n });\n if (currentNode.textContent !== content) {\n arrayPush(DOMPurify.removed, {\n element: currentNode.cloneNode()\n });\n currentNode.textContent = content;\n }\n }\n\n /* Execute a hook if present */\n _executeHook('afterSanitizeElements', currentNode, null);\n return false;\n };\n\n /**\n * _isValidAttribute\n *\n * @param {string} lcTag Lowercase tag name of containing element.\n * @param {string} lcName Lowercase attribute name.\n * @param {string} value Attribute value.\n * @return {Boolean} Returns true if `value` is valid, otherwise false.\n */\n // eslint-disable-next-line complexity\n const _isValidAttribute = function _isValidAttribute(lcTag, lcName, value) {\n /* Make sure attribute cannot clobber */\n if (SANITIZE_DOM && (lcName === 'id' || lcName === 'name') && (value in document || value in formElement)) {\n return false;\n }\n\n /* Allow valid data-* attributes: At least one character after \"-\"\n (https://html.spec.whatwg.org/multipage/dom.html#embedding-custom-non-visible-data-with-the-data-*-attributes)\n XML-compatible (https://html.spec.whatwg.org/multipage/infrastructure.html#xml-compatible and http://www.w3.org/TR/xml/#d0e804)\n We don't need to check the value; it's always URI safe. */\n if (ALLOW_DATA_ATTR && !FORBID_ATTR[lcName] && regExpTest(DATA_ATTR, lcName)) ; else if (ALLOW_ARIA_ATTR && regExpTest(ARIA_ATTR, lcName)) ; else if (!ALLOWED_ATTR[lcName] || FORBID_ATTR[lcName]) {\n if (\n // First condition does a very basic check if a) it's basically a valid custom element tagname AND\n // b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck\n // and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck\n _isBasicCustomElement(lcTag) && (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, lcTag) || CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(lcTag)) && (CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.attributeNameCheck, lcName) || CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.attributeNameCheck(lcName)) ||\n // Alternative, second condition checks if it's an `is`-attribute, AND\n // the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck\n lcName === 'is' && CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements && (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, value) || CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(value))) ; else {\n return false;\n }\n /* Check value is safe. First, is attr inert? If so, is safe */\n } else if (URI_SAFE_ATTRIBUTES[lcName]) ; else if (regExpTest(IS_ALLOWED_URI$1, stringReplace(value, ATTR_WHITESPACE, ''))) ; else if ((lcName === 'src' || lcName === 'xlink:href' || lcName === 'href') && lcTag !== 'script' && stringIndexOf(value, 'data:') === 0 && DATA_URI_TAGS[lcTag]) ; else if (ALLOW_UNKNOWN_PROTOCOLS && !regExpTest(IS_SCRIPT_OR_DATA, stringReplace(value, ATTR_WHITESPACE, ''))) ; else if (value) {\n return false;\n } else ;\n return true;\n };\n\n /**\n * _isBasicCustomElement\n * checks if at least one dash is included in tagName, and it's not the first char\n * for more sophisticated checking see https://github.com/sindresorhus/validate-element-name\n *\n * @param {string} tagName name of the tag of the node to sanitize\n * @returns {boolean} Returns true if the tag name meets the basic criteria for a custom element, otherwise false.\n */\n const _isBasicCustomElement = function _isBasicCustomElement(tagName) {\n return tagName !== 'annotation-xml' && stringMatch(tagName, CUSTOM_ELEMENT);\n };\n\n /**\n * _sanitizeAttributes\n *\n * @protect attributes\n * @protect nodeName\n * @protect removeAttribute\n * @protect setAttribute\n *\n * @param {Node} currentNode to sanitize\n */\n const _sanitizeAttributes = function _sanitizeAttributes(currentNode) {\n /* Execute a hook if present */\n _executeHook('beforeSanitizeAttributes', currentNode, null);\n const {\n attributes\n } = currentNode;\n\n /* Check if we have attributes; if not we might have a text node */\n if (!attributes) {\n return;\n }\n const hookEvent = {\n attrName: '',\n attrValue: '',\n keepAttr: true,\n allowedAttributes: ALLOWED_ATTR\n };\n let l = attributes.length;\n\n /* Go backwards over all attributes; safely remove bad ones */\n while (l--) {\n const attr = attributes[l];\n const {\n name,\n namespaceURI,\n value: attrValue\n } = attr;\n const lcName = transformCaseFunc(name);\n let value = name === 'value' ? attrValue : stringTrim(attrValue);\n\n /* Execute a hook if present */\n hookEvent.attrName = lcName;\n hookEvent.attrValue = value;\n hookEvent.keepAttr = true;\n hookEvent.forceKeepAttr = undefined; // Allows developers to see this is a property they can set\n _executeHook('uponSanitizeAttribute', currentNode, hookEvent);\n value = hookEvent.attrValue;\n\n /* Work around a security issue with comments inside attributes */\n if (SAFE_FOR_XML && regExpTest(/((--!?|])>)|<\\/(style|title)/i, value)) {\n _removeAttribute(name, currentNode);\n continue;\n }\n\n /* Did the hooks approve of the attribute? */\n if (hookEvent.forceKeepAttr) {\n continue;\n }\n\n /* Remove attribute */\n _removeAttribute(name, currentNode);\n\n /* Did the hooks approve of the attribute? */\n if (!hookEvent.keepAttr) {\n continue;\n }\n\n /* Work around a security issue in jQuery 3.0 */\n if (!ALLOW_SELF_CLOSE_IN_ATTR && regExpTest(/\\/>/i, value)) {\n _removeAttribute(name, currentNode);\n continue;\n }\n\n /* Sanitize attribute content to be template-safe */\n if (SAFE_FOR_TEMPLATES) {\n arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], expr => {\n value = stringReplace(value, expr, ' ');\n });\n }\n\n /* Is `value` valid for this attribute? */\n const lcTag = transformCaseFunc(currentNode.nodeName);\n if (!_isValidAttribute(lcTag, lcName, value)) {\n continue;\n }\n\n /* Full DOM Clobbering protection via namespace isolation,\n * Prefix id and name attributes with `user-content-`\n */\n if (SANITIZE_NAMED_PROPS && (lcName === 'id' || lcName === 'name')) {\n // Remove the attribute with this value\n _removeAttribute(name, currentNode);\n\n // Prefix the value and later re-create the attribute with the sanitized value\n value = SANITIZE_NAMED_PROPS_PREFIX + value;\n }\n\n /* Handle attributes that require Trusted Types */\n if (trustedTypesPolicy && typeof trustedTypes === 'object' && typeof trustedTypes.getAttributeType === 'function') {\n if (namespaceURI) ; else {\n switch (trustedTypes.getAttributeType(lcTag, lcName)) {\n case 'TrustedHTML':\n {\n value = trustedTypesPolicy.createHTML(value);\n break;\n }\n case 'TrustedScriptURL':\n {\n value = trustedTypesPolicy.createScriptURL(value);\n break;\n }\n }\n }\n }\n\n /* Handle invalid data-* attribute set by try-catching it */\n try {\n if (namespaceURI) {\n currentNode.setAttributeNS(namespaceURI, name, value);\n } else {\n /* Fallback to setAttribute() for browser-unrecognized namespaces e.g. \"x-schema\". */\n currentNode.setAttribute(name, value);\n }\n if (_isClobbered(currentNode)) {\n _forceRemove(currentNode);\n } else {\n arrayPop(DOMPurify.removed);\n }\n } catch (_) {}\n }\n\n /* Execute a hook if present */\n _executeHook('afterSanitizeAttributes', currentNode, null);\n };\n\n /**\n * _sanitizeShadowDOM\n *\n * @param {DocumentFragment} fragment to iterate over recursively\n */\n const _sanitizeShadowDOM = function _sanitizeShadowDOM(fragment) {\n let shadowNode = null;\n const shadowIterator = _createNodeIterator(fragment);\n\n /* Execute a hook if present */\n _executeHook('beforeSanitizeShadowDOM', fragment, null);\n while (shadowNode = shadowIterator.nextNode()) {\n /* Execute a hook if present */\n _executeHook('uponSanitizeShadowNode', shadowNode, null);\n\n /* Sanitize tags and elements */\n if (_sanitizeElements(shadowNode)) {\n continue;\n }\n\n /* Deep shadow DOM detected */\n if (shadowNode.content instanceof DocumentFragment) {\n _sanitizeShadowDOM(shadowNode.content);\n }\n\n /* Check attributes, sanitize if necessary */\n _sanitizeAttributes(shadowNode);\n }\n\n /* Execute a hook if present */\n _executeHook('afterSanitizeShadowDOM', fragment, null);\n };\n\n /**\n * Sanitize\n * Public method providing core sanitation functionality\n *\n * @param {String|Node} dirty string or DOM node\n * @param {Object} cfg object\n */\n // eslint-disable-next-line complexity\n DOMPurify.sanitize = function (dirty) {\n let cfg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n let body = null;\n let importedNode = null;\n let currentNode = null;\n let returnNode = null;\n /* Make sure we have a string to sanitize.\n DO NOT return early, as this will return the wrong type if\n the user has requested a DOM object rather than a string */\n IS_EMPTY_INPUT = !dirty;\n if (IS_EMPTY_INPUT) {\n dirty = '';\n }\n\n /* Stringify, in case dirty is an object */\n if (typeof dirty !== 'string' && !_isNode(dirty)) {\n if (typeof dirty.toString === 'function') {\n dirty = dirty.toString();\n if (typeof dirty !== 'string') {\n throw typeErrorCreate('dirty is not a string, aborting');\n }\n } else {\n throw typeErrorCreate('toString is not a function');\n }\n }\n\n /* Return dirty HTML if DOMPurify cannot run */\n if (!DOMPurify.isSupported) {\n return dirty;\n }\n\n /* Assign config vars */\n if (!SET_CONFIG) {\n _parseConfig(cfg);\n }\n\n /* Clean up removed elements */\n DOMPurify.removed = [];\n\n /* Check if dirty is correctly typed for IN_PLACE */\n if (typeof dirty === 'string') {\n IN_PLACE = false;\n }\n if (IN_PLACE) {\n /* Do some early pre-sanitization to avoid unsafe root nodes */\n if (dirty.nodeName) {\n const tagName = transformCaseFunc(dirty.nodeName);\n if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) {\n throw typeErrorCreate('root node is forbidden and cannot be sanitized in-place');\n }\n }\n } else if (dirty instanceof Node) {\n /* If dirty is a DOM element, append to an empty document to avoid\n elements being stripped by the parser */\n body = _initDocument('');\n importedNode = body.ownerDocument.importNode(dirty, true);\n if (importedNode.nodeType === NODE_TYPE.element && importedNode.nodeName === 'BODY') {\n /* Node is already a body, use as is */\n body = importedNode;\n } else if (importedNode.nodeName === 'HTML') {\n body = importedNode;\n } else {\n // eslint-disable-next-line unicorn/prefer-dom-node-append\n body.appendChild(importedNode);\n }\n } else {\n /* Exit directly if we have nothing to do */\n if (!RETURN_DOM && !SAFE_FOR_TEMPLATES && !WHOLE_DOCUMENT &&\n // eslint-disable-next-line unicorn/prefer-includes\n dirty.indexOf('<') === -1) {\n return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML(dirty) : dirty;\n }\n\n /* Initialize the document to work on */\n body = _initDocument(dirty);\n\n /* Check we have a DOM node from the data */\n if (!body) {\n return RETURN_DOM ? null : RETURN_TRUSTED_TYPE ? emptyHTML : '';\n }\n }\n\n /* Remove first element node (ours) if FORCE_BODY is set */\n if (body && FORCE_BODY) {\n _forceRemove(body.firstChild);\n }\n\n /* Get node iterator */\n const nodeIterator = _createNodeIterator(IN_PLACE ? dirty : body);\n\n /* Now start iterating over the created document */\n while (currentNode = nodeIterator.nextNode()) {\n /* Sanitize tags and elements */\n if (_sanitizeElements(currentNode)) {\n continue;\n }\n\n /* Shadow DOM detected, sanitize it */\n if (currentNode.content instanceof DocumentFragment) {\n _sanitizeShadowDOM(currentNode.content);\n }\n\n /* Check attributes, sanitize if necessary */\n _sanitizeAttributes(currentNode);\n }\n\n /* If we sanitized `dirty` in-place, return it. */\n if (IN_PLACE) {\n return dirty;\n }\n\n /* Return sanitized string or DOM */\n if (RETURN_DOM) {\n if (RETURN_DOM_FRAGMENT) {\n returnNode = createDocumentFragment.call(body.ownerDocument);\n while (body.firstChild) {\n // eslint-disable-next-line unicorn/prefer-dom-node-append\n returnNode.appendChild(body.firstChild);\n }\n } else {\n returnNode = body;\n }\n if (ALLOWED_ATTR.shadowroot || ALLOWED_ATTR.shadowrootmode) {\n /*\n AdoptNode() is not used because internal state is not reset\n (e.g. the past names map of a HTMLFormElement), this is safe\n in theory but we would rather not risk another attack vector.\n The state that is cloned by importNode() is explicitly defined\n by the specs.\n */\n returnNode = importNode.call(originalDocument, returnNode, true);\n }\n return returnNode;\n }\n let serializedHTML = WHOLE_DOCUMENT ? body.outerHTML : body.innerHTML;\n\n /* Serialize doctype if allowed */\n if (WHOLE_DOCUMENT && ALLOWED_TAGS['!doctype'] && body.ownerDocument && body.ownerDocument.doctype && body.ownerDocument.doctype.name && regExpTest(DOCTYPE_NAME, body.ownerDocument.doctype.name)) {\n serializedHTML = '\\n' + serializedHTML;\n }\n\n /* Sanitize final string template-safe */\n if (SAFE_FOR_TEMPLATES) {\n arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], expr => {\n serializedHTML = stringReplace(serializedHTML, expr, ' ');\n });\n }\n return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML(serializedHTML) : serializedHTML;\n };\n\n /**\n * Public method to set the configuration once\n * setConfig\n *\n * @param {Object} cfg configuration object\n */\n DOMPurify.setConfig = function () {\n let cfg = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n _parseConfig(cfg);\n SET_CONFIG = true;\n };\n\n /**\n * Public method to remove the configuration\n * clearConfig\n *\n */\n DOMPurify.clearConfig = function () {\n CONFIG = null;\n SET_CONFIG = false;\n };\n\n /**\n * Public method to check if an attribute value is valid.\n * Uses last set config, if any. Otherwise, uses config defaults.\n * isValidAttribute\n *\n * @param {String} tag Tag name of containing element.\n * @param {String} attr Attribute name.\n * @param {String} value Attribute value.\n * @return {Boolean} Returns true if `value` is valid. Otherwise, returns false.\n */\n DOMPurify.isValidAttribute = function (tag, attr, value) {\n /* Initialize shared config vars if necessary. */\n if (!CONFIG) {\n _parseConfig({});\n }\n const lcTag = transformCaseFunc(tag);\n const lcName = transformCaseFunc(attr);\n return _isValidAttribute(lcTag, lcName, value);\n };\n\n /**\n * AddHook\n * Public method to add DOMPurify hooks\n *\n * @param {String} entryPoint entry point for the hook to add\n * @param {Function} hookFunction function to execute\n */\n DOMPurify.addHook = function (entryPoint, hookFunction) {\n if (typeof hookFunction !== 'function') {\n return;\n }\n hooks[entryPoint] = hooks[entryPoint] || [];\n arrayPush(hooks[entryPoint], hookFunction);\n };\n\n /**\n * RemoveHook\n * Public method to remove a DOMPurify hook at a given entryPoint\n * (pops it from the stack of hooks if more are present)\n *\n * @param {String} entryPoint entry point for the hook to remove\n * @return {Function} removed(popped) hook\n */\n DOMPurify.removeHook = function (entryPoint) {\n if (hooks[entryPoint]) {\n return arrayPop(hooks[entryPoint]);\n }\n };\n\n /**\n * RemoveHooks\n * Public method to remove all DOMPurify hooks at a given entryPoint\n *\n * @param {String} entryPoint entry point for the hooks to remove\n */\n DOMPurify.removeHooks = function (entryPoint) {\n if (hooks[entryPoint]) {\n hooks[entryPoint] = [];\n }\n };\n\n /**\n * RemoveAllHooks\n * Public method to remove all DOMPurify hooks\n */\n DOMPurify.removeAllHooks = function () {\n hooks = {};\n };\n return DOMPurify;\n}\nvar purify = createDOMPurify();\n\nexport { purify as default };\n//# sourceMappingURL=purify.es.mjs.map\n","import DOMPurify from 'dompurify'\n\nexport const sanitizeHtml = (html: string) => {\n\treturn DOMPurify.sanitize(html, {\n\t\tUSE_PROFILES: {\n\t\t\thtml: true,\n\t\t\tsvg: true,\n\t\t\tsvgFilters: true\n\t\t}\n\t})\n}\n\n// This is a more restrictive version of sanitizeHtml that focuses on SVGs\nexport const sanitizeSVG = (svgContent: string) => {\n\treturn DOMPurify.sanitize(svgContent, {\n\t\tNAMESPACE: 'http://www.w3.org/2000/svg',\n\t\tUSE_PROFILES: {\n\t\t\thtml: true,\n\t\t\tsvg: true,\n\t\t\tsvgFilters: true\n\t\t}\n\t})\n}\n\n// This is a more restrictive version of sanitizeHtml that only allows text\nexport const sanitizeText = (html: string) => {\n\treturn DOMPurify.sanitize(html, { ALLOWED_TAGS: [] })\n}\n","import { select } from 'd3'\nimport { getProperty } from '@/tools'\nimport { Component } from '@/components/component'\nimport { Events, RenderTypes, ToolbarControlTypes } from '@/interfaces/enums'\nimport { sanitizeSVG, sanitizeText } from '@/utils/sanitizeHtml'\n\nexport class Toolbar extends Component {\n\tstatic buttonID = 0\n\ttype = 'toolbar'\n\trenderType = RenderTypes.HTML\n\n\t// overflow menu button to control background color\n\toverflowButton: any\n\n\t// div options list element\n\toverflowMenu: any\n\n\tinit() {\n\t\tconst bodyOnClickHandler = () => this.updateOverflowMenu(false)\n\n\t\t// Grab the tooltip element\n\t\tthis.services.events.addEventListener(Events.Toolbar.SHOW_OVERFLOW_MENU, () => {\n\t\t\tthis.renderOverflowMenu()\n\n\t\t\t// hide overflow menu if user clicks on somewhere in web page\n\t\t\tdocument.body.addEventListener('click', bodyOnClickHandler)\n\t\t})\n\n\t\t// listen to hide overflow menu event to hide the overflow menu\n\t\tthis.services.events.addEventListener(Events.Toolbar.HIDE_OVERFLOW_MENU, () => {\n\t\t\t// // hide overflow menu if user clicks on somewhere in web page\n\t\t\tdocument.body.removeEventListener('click', bodyOnClickHandler)\n\t\t})\n\t}\n\n\t// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n\t// @ts-ignore\n\t// eslint-disable-next-line @typescript-eslint/no-unused-vars\n\trender(animate = true) {\n\t\tconst container = this.getComponentContainer({\n\t\t\tariaLabel: 'toolbar'\n\t\t}).attr('role', 'group')\n\n\t\tconst isDataLoading = getProperty(this.getOptions(), 'data', 'loading')\n\n\t\tif (isDataLoading) {\n\t\t\tcontainer.html('')\n\t\t\t// Set overflow menu to null if data is loading\n\t\t\t// This will render in a new overflow menu when data is done loading\n\t\t\tthis.overflowMenu = null\n\t\t} else {\n\t\t\tif (!this.overflowMenu) {\n\t\t\t\tthis.overflowMenu = container\n\t\t\t\t\t.append('div')\n\t\t\t\t\t.attr(\n\t\t\t\t\t\t'class',\n\t\t\t\t\t\t'cds--overflow-menu-options cds--overflow-menu--flip cds--overflow-menu-options cds--overflow-menu--flip'\n\t\t\t\t\t)\n\t\t\t\t\t.attr('tabindex', -1)\n\t\t\t\t\t.html(``)\n\t\t\t}\n\n\t\t\t// get the toolbar buttons\n\t\t\tconst { buttonList, overflowMenuItemList } = this.getControlConfigs()\n\n\t\t\t// overflow button is required only if overflow menu item list is valid\n\t\t\tif (overflowMenuItemList) {\n\t\t\t\tbuttonList.push(this.getOverflowButtonConfig())\n\t\t\t}\n\n\t\t\tconst toolbarControls = container\n\t\t\t\t.selectAll('div.toolbar-control')\n\t\t\t\t.data(buttonList, (button: any) => button.id)\n\n\t\t\ttoolbarControls.exit().remove()\n\n\t\t\tconst enteringToolbarControls = toolbarControls\n\t\t\t\t.enter()\n\t\t\t\t.append('div')\n\t\t\t\t.attr('class', 'toolbar-control cds--overflow-menu cds--overflow-menu')\n\n\t\t\tconst self = this\n\t\t\tenteringToolbarControls\n\t\t\t\t.merge(toolbarControls as any)\n\t\t\t\t.classed('disabled', (d: any) => d.shouldBeDisabled())\n\t\t\t\t.attr('role', 'button')\n\t\t\t\t.attr('aria-disabled', (d: any) => d.shouldBeDisabled())\n\t\t\t\t.attr('aria-label', (d: any) => d.title)\n\t\t\t\t.html((d: any) => {\n\t\t\t\t\treturn `\n\t\t\t\n\t\t\t\t\n\t\t\t `\n\t\t\t\t})\n\t\t\t\t.each(function (d: any, index: number) {\n\t\t\t\t\tselect(this)\n\t\t\t\t\t\t.select('svg')\n\t\t\t\t\t\t.style('pointer-events', 'none')\n\t\t\t\t\t\t.style('will-change', 'transform')\n\t\t\t\t\t\t.style('width', d.iconSVG.width !== undefined ? d.iconSVG.width : '20px')\n\t\t\t\t\t\t.style('height', d.iconSVG.height !== undefined ? d.iconSVG.height : '20px')\n\n\t\t\t\t\tselect(this)\n\t\t\t\t\t\t.select('button')\n\t\t\t\t\t\t.on('mouseover focus', function (event: MouseEvent) {\n\t\t\t\t\t\t\tconst hoveredElement = select(this)\n\t\t\t\t\t\t\thoveredElement.classed('hovered', true)\n\t\t\t\t\t\t\tself.services.events.dispatchEvent(Events.Toolbar.SHOW_TOOLTIP, {\n\t\t\t\t\t\t\t\tevent,\n\t\t\t\t\t\t\t\thoveredElement,\n\t\t\t\t\t\t\t\tcontent: d.title,\n\t\t\t\t\t\t\t\tnoWrap: true,\n\t\t\t\t\t\t\t\tplacements: ['top', 'bottom']\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t})\n\t\t\t\t\t\t.on('mouseout blur', function () {\n\t\t\t\t\t\t\tself.services.events.dispatchEvent(Events.Toolbar.HIDE_TOOLTIP)\n\t\t\t\t\t\t})\n\t\t\t\t\t\t.on('click', (event: CustomEvent) => {\n\t\t\t\t\t\t\tif (!d.shouldBeDisabled()) {\n\t\t\t\t\t\t\t\tself.triggerFunctionAndEvent(d, event, this)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t})\n\t\t\t\t\t\t.on('keydown', (event: any) => {\n\t\t\t\t\t\t\tif ((event.key && event.key === 'Enter') || event.key === ' ') {\n\t\t\t\t\t\t\t\tevent.preventDefault()\n\t\t\t\t\t\t\t\tself.triggerFunctionAndEvent(d, event, this)\n\t\t\t\t\t\t\t} else if (event.key && event.key === 'ArrowLeft') {\n\t\t\t\t\t\t\t\tself.focusOnPreviousEnabledToolbarItem(index)\n\t\t\t\t\t\t\t} else if (event.key && event.key === 'ArrowRight') {\n\t\t\t\t\t\t\t\tself.focusOnNextEnabledToolbarItem(index)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t})\n\t\t\t\t})\n\n\t\t\tthis.overflowButton = this.getComponentContainer().select(\n\t\t\t\t`button.cds--overflow-menu__trigger#${this.services.domUtils.generateElementIDString(\n\t\t\t\t\t'control-toolbar-overflow-menu'\n\t\t\t\t)}`\n\t\t\t)\n\t\t}\n\t}\n\n\trenderOverflowMenu() {\n\t\tconst { overflowMenuItemList } = this.getControlConfigs()\n\n\t\tconst overflowMenuControls = this.overflowMenu\n\t\t\t.select('ul')\n\t\t\t.selectAll('li.cds--overflow-menu-options__option')\n\t\t\t.data(overflowMenuItemList, (button: any) => getProperty(button, 'id'))\n\n\t\toverflowMenuControls.exit().remove()\n\n\t\tconst enteringOverflowMenuControls = overflowMenuControls\n\t\t\t.enter()\n\t\t\t.append('li')\n\t\t\t.attr('id', (d: any) => this.services.domUtils.generateElementIDString(`control-${d.id}`))\n\t\t\t.attr('class', 'cds--overflow-menu-options__option cds--overflow-menu-options__option')\n\t\t\t.attr('role', 'menuitem')\n\t\t\t.attr('tabindex', 1)\n\n\t\tenteringOverflowMenuControls\n\t\t\t.append('button')\n\t\t\t.attr('class', 'cds--overflow-menu-options__btn cds--overflow-menu-options__btn')\n\n\t\tenteringOverflowMenuControls\n\t\t\t.merge(overflowMenuControls)\n\t\t\t.classed('cds--overflow-menu-options__option--disabled', (d: any) => d.shouldBeDisabled())\n\t\t\t.classed('cds--overflow-menu-options__option--disabled', (d: any) => d.shouldBeDisabled())\n\t\t\t.attr('aria-disabled', (d: any) => d.shouldBeDisabled())\n\t\t\t.selectAll('button')\n\t\t\t.text((d: any) => d.title)\n\t}\n\n\tisOverflowMenuOpen() {\n\t\treturn this.overflowMenu.classed('is-open')\n\t}\n\n\t// show/hide overflow menu\n\tupdateOverflowMenu(show: boolean) {\n\t\tif (!this.overflowMenu) {\n\t\t\treturn\n\t\t}\n\t\tthis.overflowMenu.classed('is-open', show)\n\n\t\t// update overflow button background\n\t\tif (this.overflowButton) {\n\t\t\tthis.overflowButton.attr('aria-expanded', show)\n\t\t\tselect(this.overflowButton.node().parentNode)\n\t\t\t\t.classed('cds--overflow-menu--open', show)\n\t\t\t\t.classed('cds--overflow-menu--open', show)\n\t\t}\n\n\t\tif (show) {\n\t\t\tthis.services.events.dispatchEvent(Events.Toolbar.SHOW_OVERFLOW_MENU)\n\t\t} else {\n\t\t\tthis.services.events.dispatchEvent(Events.Toolbar.HIDE_OVERFLOW_MENU)\n\t\t}\n\t}\n\n\t// Toolbar controllers\n\tfocusOnPreviousEnabledToolbarItem(currentItemIndex: number) {\n\t\tconst buttonList = this.getToolbarButtonItems()\n\t\tlet previousItemIndex = buttonList.length\n\n\t\tfor (let i = currentItemIndex - 1; i >= 0; i--) {\n\t\t\tconst previousButtonItem = buttonList[i]\n\t\t\tif (!previousButtonItem.shouldBeDisabled()) {\n\t\t\t\tpreviousItemIndex = i\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\n\t\t// only if previous enabled menu item found\n\t\tif (previousItemIndex < buttonList.length) {\n\t\t\tconst previousItemNode = select(\n\t\t\t\t`button#${this.services.domUtils.generateElementIDString(\n\t\t\t\t\t`control-${buttonList[previousItemIndex].id}`\n\t\t\t\t)}`\n\t\t\t).node()\n\t\t\tif ('focus' in previousItemNode) {\n\t\t\t\tpreviousItemNode.focus()\n\t\t\t}\n\t\t}\n\t}\n\n\tfocusOnNextEnabledToolbarItem(currentItemIndex: number) {\n\t\tconst buttonList = this.getToolbarButtonItems()\n\t\tlet nextItemIndex = -1\n\n\t\tfor (let i = currentItemIndex + 1; i < buttonList.length; i++) {\n\t\t\tconst nextOverflowMenuItem = buttonList[i]\n\t\t\tif (!nextOverflowMenuItem.shouldBeDisabled()) {\n\t\t\t\tnextItemIndex = i\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\n\t\t// only if next enabled menu item found\n\t\tif (nextItemIndex > -1) {\n\t\t\tconst nextItemNode = select(\n\t\t\t\t`button#${this.services.domUtils.generateElementIDString(\n\t\t\t\t\t`control-${buttonList[nextItemIndex].id}`\n\t\t\t\t)}`\n\t\t\t).node()\n\n\t\t\tif ('focus' in nextItemNode) {\n\t\t\t\tnextItemNode.focus()\n\t\t\t}\n\t\t}\n\t}\n\n\tfocusOnPreviousEnabledMenuItem(currentItemIndex: number) {\n\t\tconst overflowMenuItems = this.getOverflowMenuItems()\n\t\tlet previousItemIndex = overflowMenuItems.length\n\n\t\tfor (let i = currentItemIndex - 1; i >= 0; i--) {\n\t\t\tconst previousOverflowMenuItem = overflowMenuItems[i]\n\t\t\tif (!previousOverflowMenuItem.shouldBeDisabled()) {\n\t\t\t\tpreviousItemIndex = i\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\n\t\t// only if previous enabled menu item found\n\t\tif (previousItemIndex < overflowMenuItems.length) {\n\t\t\tconst previousItemNode = select(\n\t\t\t\t`#${this.services.domUtils.generateElementIDString(\n\t\t\t\t\t`control-${overflowMenuItems[previousItemIndex].id}`\n\t\t\t\t)} button`\n\t\t\t).node()\n\t\t\tif ('focus' in previousItemNode) {\n\t\t\t\tpreviousItemNode.focus()\n\t\t\t}\n\t\t}\n\t}\n\n\tfocusOnNextEnabledMenuItem(currentItemIndex: number) {\n\t\tconst overflowMenuItems = this.getOverflowMenuItems()\n\t\tlet nextItemIndex = -1\n\n\t\tfor (let i = currentItemIndex + 1; i < overflowMenuItems.length; i++) {\n\t\t\tconst nextOverflowMenuItem = overflowMenuItems[i]\n\t\t\tif (!nextOverflowMenuItem.shouldBeDisabled()) {\n\t\t\t\tnextItemIndex = i\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\n\t\t// only if next enabled menu item found\n\t\tif (nextItemIndex > -1) {\n\t\t\tconst nextItemNode = select(\n\t\t\t\t`#${this.services.domUtils.generateElementIDString(\n\t\t\t\t\t`control-${overflowMenuItems[nextItemIndex].id}`\n\t\t\t\t)} button`\n\t\t\t).node()\n\n\t\t\tif ('focus' in nextItemNode) {\n\t\t\t\tnextItemNode.focus()\n\t\t\t}\n\t\t}\n\t}\n\n\ttoggleOverflowMenu(event: any) {\n\t\tif (this.isOverflowMenuOpen()) {\n\t\t\t// hide overflow menu\n\t\t\tthis.updateOverflowMenu(false)\n\t\t} else {\n\t\t\t// show overflow menu\n\t\t\tthis.updateOverflowMenu(true)\n\n\t\t\t// setup overflow menu item event listener\n\t\t\tconst self = this\n\t\t\tconst overflowMenuItems = this.getOverflowMenuItems()\n\t\t\toverflowMenuItems.forEach((menuItem: any, index) => {\n\t\t\t\tconst element = select(\n\t\t\t\t\t`#${this.services.domUtils.generateElementIDString(`control-${menuItem.id}`)}`\n\t\t\t\t)\n\t\t\t\tif (element !== null) {\n\t\t\t\t\telement.on('click', () => {\n\t\t\t\t\t\tself.triggerFunctionAndEvent(menuItem, event, element.node())\n\n\t\t\t\t\t\t// hide overflow menu\n\t\t\t\t\t\tself.updateOverflowMenu(false)\n\t\t\t\t\t})\n\n\t\t\t\t\telement.on('keydown', (keyEvent: KeyboardEvent) => {\n\t\t\t\t\t\tif (keyEvent && keyEvent.key === 'Enter') {\n\t\t\t\t\t\t\tself.triggerFunctionAndEvent(menuItem, event, element.node())\n\t\t\t\t\t\t} else if (keyEvent && keyEvent.key === 'ArrowUp') {\n\t\t\t\t\t\t\t// focus on previous menu item\n\t\t\t\t\t\t\tself.focusOnPreviousEnabledMenuItem(index)\n\t\t\t\t\t\t} else if (keyEvent && keyEvent.key === 'ArrowDown') {\n\t\t\t\t\t\t\t// focus on next menu item\n\t\t\t\t\t\t\tself.focusOnNextEnabledMenuItem(index)\n\t\t\t\t\t\t} else if (keyEvent && keyEvent.key === 'Escape') {\n\t\t\t\t\t\t\tself.updateOverflowMenu(false)\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Not hide overflow menu by keyboard arrow up/down event\n\t\t\t\t\t\t// Prevent page from scrolling up/down\n\t\t\t\t\t\tkeyEvent.preventDefault()\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t})\n\n\t\t\t// default to focus on the first enabled menu item\n\t\t\tself.focusOnNextEnabledMenuItem(-1)\n\t\t}\n\n\t\t// propogation should not be stopped for keyboard events\n\t\tif (event) {\n\t\t\tevent.stopImmediatePropagation()\n\t\t}\n\t}\n\n\t// Calls passed function && dispatches event\n\ttriggerFunctionAndEvent(control: any, event: CustomEvent, element?: any) {\n\t\t// Check if trigger is disabled\n\t\tif (typeof control.shouldBeDisabled === 'function' && control.shouldBeDisabled()) {\n\t\t\treturn\n\t\t}\n\n\t\t// Call custom function only if it exists\n\t\tif (typeof control.clickFunction === 'function') {\n\t\t\tcontrol.clickFunction(event)\n\t\t}\n\n\t\t// Dispatch selection event\n\t\tthis.services.events.dispatchEvent(Events.Toolbar.BUTTON_CLICK, {\n\t\t\tcontrol,\n\t\t\tevent,\n\t\t\telement\n\t\t})\n\t}\n\n\tgetControlConfigs() {\n\t\tconst numberOfIcons = getProperty(this.getOptions(), 'toolbar', 'numberOfIcons') - 1\n\t\tconst controls = getProperty(this.getOptions(), 'toolbar', 'controls')\n\t\tconst overflowSpecificControls: any[] = []\n\t\tconst buttonList: any[] = []\n\t\tconst overflowList: any[] = []\n\n\t\tcontrols.forEach((control: any) => {\n\t\t\tlet controlConfig = null\n\t\t\t// check if button is custom or default control\n\t\t\tif (control.type === ToolbarControlTypes.CUSTOM) {\n\t\t\t\t// add generic id if missing\n\t\t\t\tif (getProperty(control, 'id') === null) {\n\t\t\t\t\t// add id directly to the data passed so that id isn't reassigned on rerender\n\t\t\t\t\tcontrol.id = `toolbar-button-${Toolbar.buttonID++}`\n\t\t\t\t}\n\t\t\t\t// define function if missing\n\t\t\t\tif (getProperty(control, 'shouldBeDisabled') === null) {\n\t\t\t\t\tcontrol.shouldBeDisabled = () => false\n\t\t\t\t}\n\n\t\t\t\tcontrolConfig = control\n\t\t\t} else {\n\t\t\t\tconst isFullScreenMode = this.services.domUtils.isFullScreenMode()\n\t\t\t\t// toggle fullscreen configs by current display modes\n\t\t\t\tif (control.type === ToolbarControlTypes.MAKE_FULLSCREEN && isFullScreenMode) {\n\t\t\t\t\tcontrol.type = ToolbarControlTypes.EXIT_FULLSCREEN\n\t\t\t\t} else if (control.type === ToolbarControlTypes.EXIT_FULLSCREEN && !isFullScreenMode) {\n\t\t\t\t\tcontrol.type = ToolbarControlTypes.MAKE_FULLSCREEN\n\t\t\t\t}\n\t\t\t\tcontrolConfig = this.getControlConfigByType(control.type)\n\t\t\t}\n\n\t\t\t// add to list if config is valid\n\t\t\tif (controlConfig) {\n\t\t\t\tcontrolConfig.text = control.text ? control.text : control.type\n\n\t\t\t\tif (controlConfig.id.indexOf('toolbar-export') !== -1) {\n\t\t\t\t\toverflowSpecificControls.push(controlConfig)\n\t\t\t\t} else if (buttonList.length < numberOfIcons) {\n\t\t\t\t\t// check if icon exists else assign to the overflow list\n\t\t\t\t\tif (getProperty(controlConfig, 'iconSVG', 'content') === null) {\n\t\t\t\t\t\toverflowList.push(controlConfig)\n\t\t\t\t\t} else {\n\t\t\t\t\t\tbuttonList.push(controlConfig)\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\toverflowList.push(controlConfig)\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\n\t\t// Ensures the `export` controls are always at the bottom\n\t\toverflowList.push(...overflowSpecificControls)\n\n\t\tif (!overflowList.length) {\n\t\t\treturn {\n\t\t\t\tbuttonList\n\t\t\t}\n\t\t}\n\n\t\treturn {\n\t\t\tbuttonList,\n\t\t\toverflowMenuItemList: overflowList\n\t\t}\n\t}\n\n\tgetToolbarButtonItems() {\n\t\tconst { buttonList, overflowMenuItemList } = this.getControlConfigs()\n\t\tif (overflowMenuItemList) {\n\t\t\tbuttonList.push(this.getOverflowButtonConfig())\n\t\t}\n\t\tif (buttonList) {\n\t\t\treturn buttonList\n\t\t}\n\n\t\treturn []\n\t}\n\n\tgetOverflowMenuItems() {\n\t\tconst { overflowMenuItemList } = this.getControlConfigs()\n\t\tif (overflowMenuItemList) {\n\t\t\treturn overflowMenuItemList\n\t\t} else {\n\t\t\treturn []\n\t\t}\n\t}\n\n\t// special button config for overflow button\n\tgetOverflowButtonConfig() {\n\t\tconst { moreOptions } = getProperty(\n\t\t\tthis.model.getOptions(),\n\t\t\t'locale',\n\t\t\t'translations',\n\t\t\t'toolbar'\n\t\t)\n\t\treturn {\n\t\t\tid: 'toolbar-overflow-menu',\n\t\t\ttitle: moreOptions,\n\t\t\tshouldBeDisabled: () => false,\n\t\t\ticonSVG: {\n\t\t\t\tcontent: ` \n\t\t\t\t \n\t\t\t\t `\n\t\t\t},\n\t\t\tclickFunction: (event: any) => this.toggleOverflowMenu(event)\n\t\t}\n\t}\n\n\tgetControlConfigByType(controlType: ToolbarControlTypes) {\n\t\tconst isZoomBarEnabled =\n\t\t\tthis.services.zoom &&\n\t\t\tthis.services.zoom.isZoomBarEnabled() &&\n\t\t\t!this.services.zoom.isEmptyState()\n\n\t\tconst displayData = this.model.getDisplayData()\n\t\tconst options = this.model.getOptions()\n\t\tconst {\n\t\t\texportAsCSV,\n\t\t\texportAsJPG,\n\t\t\texportAsPNG,\n\t\t\tzoomIn,\n\t\t\tzoomOut,\n\t\t\tresetZoom,\n\t\t\tmakeFullScreen,\n\t\t\texitFullScreen,\n\t\t\tshowAsTable\n\t\t} = getProperty(options, 'locale', 'translations', 'toolbar')\n\n\t\tlet controlConfig: any\n\t\tswitch (controlType) {\n\t\t\tcase ToolbarControlTypes.ZOOM_IN:\n\t\t\t\tif (isZoomBarEnabled) {\n\t\t\t\t\tcontrolConfig = {\n\t\t\t\t\t\tid: 'toolbar-zoomIn',\n\t\t\t\t\t\ttitle: zoomIn,\n\t\t\t\t\t\tshouldBeDisabled: () => this.services.zoom.isMinZoomDomain(),\n\t\t\t\t\t\ticonSVG: {\n\t\t\t\t\t\t\tcontent: this.getControlIconByType(controlType)\n\t\t\t\t\t\t},\n\t\t\t\t\t\tclickFunction: () => this.services.zoom.zoomIn()\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak\n\t\t\tcase ToolbarControlTypes.ZOOM_OUT:\n\t\t\t\tif (isZoomBarEnabled) {\n\t\t\t\t\tcontrolConfig = {\n\t\t\t\t\t\tid: 'toolbar-zoomOut',\n\t\t\t\t\t\ttitle: zoomOut,\n\t\t\t\t\t\tshouldBeDisabled: () => this.services.zoom.isMaxZoomDomain(),\n\t\t\t\t\t\ticonSVG: {\n\t\t\t\t\t\t\tcontent: this.getControlIconByType(controlType)\n\t\t\t\t\t\t},\n\t\t\t\t\t\tclickFunction: () => this.services.zoom.zoomOut()\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak\n\t\t\tcase ToolbarControlTypes.RESET_ZOOM:\n\t\t\t\tif (isZoomBarEnabled) {\n\t\t\t\t\tcontrolConfig = {\n\t\t\t\t\t\tid: 'toolbar-resetZoom',\n\t\t\t\t\t\ttitle: resetZoom,\n\t\t\t\t\t\tshouldBeDisabled: () => this.services.zoom.isMaxZoomDomain(),\n\t\t\t\t\t\ticonSVG: {\n\t\t\t\t\t\t\tcontent: this.getControlIconByType(controlType)\n\t\t\t\t\t\t},\n\t\t\t\t\t\tclickFunction: () => this.services.zoom.resetZoomDomain()\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak\n\t\t\tcase ToolbarControlTypes.MAKE_FULLSCREEN:\n\t\t\t\tcontrolConfig = {\n\t\t\t\t\tid: 'toolbar-makefullscreen',\n\t\t\t\t\ticonSVG: {\n\t\t\t\t\t\tcontent: this.getControlIconByType(controlType),\n\t\t\t\t\t\twidth: '15px',\n\t\t\t\t\t\theight: '15px'\n\t\t\t\t\t},\n\t\t\t\t\ttitle: makeFullScreen,\n\t\t\t\t\tshouldBeDisabled: () => false,\n\t\t\t\t\tclickFunction: () => {\n\t\t\t\t\t\tthis.services.domUtils.toggleFullscreen()\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak\n\t\t\tcase ToolbarControlTypes.EXIT_FULLSCREEN:\n\t\t\t\tcontrolConfig = {\n\t\t\t\t\tid: 'toolbar-exitfullscreen',\n\t\t\t\t\ticonSVG: {\n\t\t\t\t\t\tcontent: this.getControlIconByType(controlType),\n\t\t\t\t\t\twidth: '15px',\n\t\t\t\t\t\theight: '15px'\n\t\t\t\t\t},\n\t\t\t\t\ttitle: exitFullScreen,\n\t\t\t\t\tshouldBeDisabled: () => false,\n\t\t\t\t\tclickFunction: () => {\n\t\t\t\t\t\tthis.services.domUtils.toggleFullscreen()\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak\n\t\t\tcase ToolbarControlTypes.SHOW_AS_DATATABLE:\n\t\t\t\tcontrolConfig = {\n\t\t\t\t\tid: 'toolbar-showasdatatable',\n\t\t\t\t\ticonSVG: {\n\t\t\t\t\t\tcontent: this.getControlIconByType(controlType)\n\t\t\t\t\t},\n\t\t\t\t\ttitle: showAsTable,\n\t\t\t\t\tshouldBeDisabled: () => displayData.length === 0,\n\t\t\t\t\tclickFunction: () => this.services.events.dispatchEvent(Events.Modal.SHOW)\n\t\t\t\t}\n\t\t\t\tbreak\n\t\t\tcase ToolbarControlTypes.EXPORT_CSV:\n\t\t\t\tcontrolConfig = {\n\t\t\t\t\tid: 'toolbar-export-CSV',\n\t\t\t\t\ttitle: exportAsCSV,\n\t\t\t\t\tshouldBeDisabled: () => false,\n\t\t\t\t\ticonSVG: {\n\t\t\t\t\t\tcontent: this.getControlIconByType(controlType)\n\t\t\t\t\t},\n\t\t\t\t\tclickFunction: () => this.model.exportToCSV()\n\t\t\t\t}\n\t\t\t\tbreak\n\t\t\tcase ToolbarControlTypes.EXPORT_PNG:\n\t\t\t\tcontrolConfig = {\n\t\t\t\t\tid: 'toolbar-export-PNG',\n\t\t\t\t\ttitle: exportAsPNG,\n\t\t\t\t\tshouldBeDisabled: () => false,\n\t\t\t\t\ticonSVG: {\n\t\t\t\t\t\tcontent: this.getControlIconByType(controlType)\n\t\t\t\t\t},\n\t\t\t\t\tclickFunction: () => this.services.domUtils.exportToPNG()\n\t\t\t\t}\n\t\t\t\tbreak\n\t\t\tcase ToolbarControlTypes.EXPORT_JPG:\n\t\t\t\tcontrolConfig = {\n\t\t\t\t\tid: 'toolbar-export-JPG',\n\t\t\t\t\ttitle: exportAsJPG,\n\t\t\t\t\tshouldBeDisabled: () => false,\n\t\t\t\t\ticonSVG: {\n\t\t\t\t\t\tcontent: this.getControlIconByType(controlType)\n\t\t\t\t\t},\n\t\t\t\t\tclickFunction: () => this.services.domUtils.exportToJPG()\n\t\t\t\t}\n\t\t\t\tbreak\n\t\t\t// add more toolbar control configuration here\n\n\t\t\tdefault:\n\t\t\t\tthrow Error('Not supported toolbar control type: ' + controlType)\n\t\t}\n\t\treturn controlConfig\n\t}\n\n\tgetControlIconByType(controlType: ToolbarControlTypes) {\n\t\tswitch (controlType) {\n\t\t\tcase ToolbarControlTypes.ZOOM_IN:\n\t\t\t\treturn ` \n\t\t\t\t\t\t`\n\t\t\tcase ToolbarControlTypes.ZOOM_OUT:\n\t\t\t\treturn `\n\t\t\t\t\t\t`\n\t\t\tcase ToolbarControlTypes.RESET_ZOOM:\n\t\t\t\treturn ``\n\t\t\tcase ToolbarControlTypes.MAKE_FULLSCREEN:\n\t\t\t\treturn ` `\n\t\t\tcase ToolbarControlTypes.EXIT_FULLSCREEN:\n\t\t\t\treturn ` `\n\t\t\tcase ToolbarControlTypes.SHOW_AS_DATATABLE:\n\t\t\t\treturn ``\n\t\t\tcase ToolbarControlTypes.EXPORT_CSV:\n\t\t\t\treturn ``\n\t\t\tcase ToolbarControlTypes.EXPORT_JPG:\n\t\t\t\treturn ``\n\t\t\tcase ToolbarControlTypes.EXPORT_PNG:\n\t\t\t\treturn `` // add more icons here\n\t\t\t// svg icon must be with 32x32 viewBox\n\n\t\t\tdefault:\n\t\t\t\tthrow Error('Not supported toolbar control type: ' + controlType)\n\t\t}\n\t}\n}\n","import { select } from 'd3'\nimport { getProperty } from '@/tools'\nimport { carbonPrefix } from '@/configuration-non-customizable' // CSS prefix\nimport { Component } from '@/components/component'\nimport { LayoutDirection, LayoutGrowth, RenderTypes, LayoutAlignItems } from '@/interfaces/enums'\nimport { LayoutConfigs } from '@/interfaces/layout'\nimport { LayoutComponentChild } from '@/interfaces/components'\nimport { DOMUtils } from '@/services/essentials/dom-utils'\nimport type { ChartModel } from '@/model/model'\n\nexport class LayoutComponent extends Component {\n\t// Give every layout component a distinct ID\n\t// so they don't interfere when querying elements\n\tstatic instanceID = Math.floor(Math.random() * 99999999999)\n\n\ttype = 'layout'\n\n\tchildren: LayoutComponentChild[]\n\n\tprivate _instanceID: number\n\n\tconstructor(\n\t\tmodel: ChartModel,\n\t\tservices: any,\n\t\tchildren: LayoutComponentChild[],\n\t\tconfigs?: LayoutConfigs\n\t) {\n\t\tsuper(model, services, configs)\n\n\t\tthis.configs = configs\n\t\tthis.children = children\n\n\t\tthis._instanceID = LayoutComponent.instanceID++\n\n\t\tthis.init()\n\t}\n\n\tinit() {\n\t\tthis.children.forEach((child: any) => {\n\t\t\tchild.components.forEach((component: Component) => {\n\t\t\t\tcomponent.init()\n\t\t\t})\n\t\t})\n\t}\n\n\tgetPreferedAndFixedSizeSum(): number {\n\t\tconst svg = this.parent\n\t\tlet sum = 0\n\n\t\tsvg\n\t\t\t.selectAll(`div.layout-child-${this._instanceID}`)\n\t\t\t.filter((d: any) => {\n\t\t\t\tconst growth = getProperty(d, 'growth')\n\n\t\t\t\treturn growth === LayoutGrowth.PREFERRED || growth === LayoutGrowth.FIXED\n\t\t\t})\n\t\t\t.each(function (d: any) {\n\t\t\t\tsum += d.size\n\t\t\t})\n\n\t\treturn sum\n\t}\n\n\tgetNumOfStretchChildren(): number {\n\t\tconst svg = this.parent\n\n\t\treturn svg\n\t\t\t.selectAll(`div.layout-child-${this._instanceID}`)\n\t\t\t.filter((d: any) => getProperty(d, 'growth') === LayoutGrowth.STRETCH)\n\t\t\t.size()\n\t}\n\n\trender(animate = true) {\n\t\tconst options = this.model.getOptions()\n\n\t\t// Get parent element to render inside of\n\t\tconst parent = this.parent\n\n\t\tconst { width, height } = DOMUtils.getHTMLElementSize(parent.node() as any)\n\n\t\tconst horizontal =\n\t\t\tthis.configs.direction === LayoutDirection.ROW ||\n\t\t\tthis.configs.direction === LayoutDirection.ROW_REVERSE\n\n\t\tconst chartprefix = getProperty(this.model.getOptions(), 'style', 'prefix')\n\n\t\t// Add new boxes to the DOM for each layout child\n\t\tconst updatedBoxes = parent\n\t\t\t.classed(\n\t\t\t\t`${carbonPrefix}--${chartprefix}--layout-row`,\n\t\t\t\tthis.configs.direction === LayoutDirection.ROW\n\t\t\t)\n\t\t\t.classed(\n\t\t\t\t`${carbonPrefix}--${chartprefix}--layout-row-reverse`,\n\t\t\t\tthis.configs.direction === LayoutDirection.ROW_REVERSE\n\t\t\t)\n\t\t\t.classed(\n\t\t\t\t`${carbonPrefix}--${chartprefix}--layout-column`,\n\t\t\t\tthis.configs.direction === LayoutDirection.COLUMN\n\t\t\t)\n\t\t\t.classed(\n\t\t\t\t`${carbonPrefix}--${chartprefix}--layout-column-reverse`,\n\t\t\t\tthis.configs.direction === LayoutDirection.COLUMN_REVERSE\n\t\t\t)\n\t\t\t.classed(\n\t\t\t\t`${carbonPrefix}--${chartprefix}--layout-alignitems-center`,\n\t\t\t\tthis.configs.alignItems === LayoutAlignItems.CENTER\n\t\t\t)\n\t\t\t.selectAll(`div.layout-child-${this._instanceID}`)\n\t\t\t.data(this.children, (d: any) => d.id)\n\n\t\tconst enteringBoxes = updatedBoxes.enter().append('div')\n\n\t\tenteringBoxes\n\t\t\t.merge(parent.selectAll(`div.layout-child-${this._instanceID}`))\n\t\t\t.attr('class', (d: any) => `layout-child layout-child-${this._instanceID} ${d.id}`)\n\t\t\t.each(function (d: any) {\n\t\t\t\t// Set parent component for each child\n\t\t\t\td.components.forEach((itemComponent: any) => {\n\t\t\t\t\tconst selection = select(this)\n\n\t\t\t\t\tconst renderType = getProperty(d, 'renderType')\n\t\t\t\t\tconst isRenderingSVG = renderType === RenderTypes.SVG\n\t\t\t\t\titemComponent.setParent(\n\t\t\t\t\t\tisRenderingSVG\n\t\t\t\t\t\t\t? DOMUtils.appendOrSelect(selection, 'svg.layout-svg-wrapper')\n\t\t\t\t\t\t\t\t\t.attr('width', '100%')\n\t\t\t\t\t\t\t\t\t.attr('height', '100%')\n\t\t\t\t\t\t\t: selection\n\t\t\t\t\t)\n\n\t\t\t\t\t// if parent is missing aria-label, set it to the title of the parent\n\t\t\t\t\tif (isRenderingSVG && !selection.select('svg.layout-svg-wrapper').attr('aria-label')) {\n\t\t\t\t\t\tselection.select('svg.layout-svg-wrapper').attr('aria-label', options?.accessibility?.svgAriaLabel || options?.title)\n\t\t\t\t\t}\n\n\t\t\t\t\t// Render preffered & fixed items\n\t\t\t\t\tconst growth = getProperty(d, 'growth')\n\t\t\t\t\tif (growth === LayoutGrowth.PREFERRED || growth === LayoutGrowth.FIXED) {\n\t\t\t\t\t\titemComponent.render(animate)\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t})\n\n\t\tparent\n\t\t\t.selectAll(`div.layout-child-${this._instanceID}`)\n\t\t\t.style('height', null)\n\t\t\t.style('width', null)\n\t\t\t.each(function (d: any) {\n\t\t\t\t// Calculate preffered children sizes after internal rendering\n\t\t\t\tconst growth = getProperty(d, 'growth')\n\n\t\t\t\tconst renderType = getProperty(d, 'renderType')\n\t\t\t\tconst matchingElementDimensions =\n\t\t\t\t\trenderType === RenderTypes.SVG\n\t\t\t\t\t\t? DOMUtils.getSVGElementSize(select(this).select('svg.layout-svg-wrapper'), {\n\t\t\t\t\t\t\t\tuseBBox: true\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t: DOMUtils.getHTMLElementSize(this as any)\n\n\t\t\t\tif (growth === LayoutGrowth.PREFERRED) {\n\t\t\t\t\tconst matchingElementWidth = horizontal\n\t\t\t\t\t\t? matchingElementDimensions.width\n\t\t\t\t\t\t: matchingElementDimensions.height\n\t\t\t\t\tconst elementWidth = horizontal ? width : height\n\n\t\t\t\t\td.size = (matchingElementWidth / elementWidth) * 100\n\t\t\t\t}\n\t\t\t})\n\n\t\tupdatedBoxes.exit().remove()\n\n\t\t// Run through stretch x-items\n\t\tthis.children\n\t\t\t.filter(child => {\n\t\t\t\tconst growth = getProperty(child, 'growth')\n\t\t\t\treturn growth === LayoutGrowth.STRETCH\n\t\t\t})\n\t\t\t.forEach((child: any) => {\n\t\t\t\tchild.size = (100 - +this.getPreferedAndFixedSizeSum()) / +this.getNumOfStretchChildren()\n\t\t\t})\n\n\t\t// Update all boxes with new sizing\n\t\tconst allUpdatedBoxes = parent\n\t\t\t.selectAll(`div.layout-child-${this._instanceID}`)\n\t\t\t.data(this.children, (d: any) => d.id)\n\n\t\tif (horizontal) {\n\t\t\tallUpdatedBoxes\n\t\t\t\t.style('width', (d: any) => `${(d.size / 100) * width}px`)\n\t\t\t\t.style('height', '100%')\n\t\t} else {\n\t\t\tallUpdatedBoxes\n\t\t\t\t.style('height', (d: any) => `${(d.size / 100) * height}px`)\n\t\t\t\t.style('width', '100%')\n\t\t}\n\n\t\tallUpdatedBoxes.each(function (d: any) {\n\t\t\td.components.forEach((itemComponent: any) => {\n\t\t\t\tconst growth = getProperty(d, 'growth')\n\t\t\t\tif (growth === LayoutGrowth.STRETCH) {\n\t\t\t\t\titemComponent.render(animate)\n\t\t\t\t}\n\t\t\t})\n\t\t})\n\t}\n\n\t// Pass on model to children as well\n\tsetModel(newObj: ChartModel) {\n\t\tsuper.setModel(newObj)\n\n\t\tthis.children.forEach((child: any) => {\n\t\t\tchild.components.forEach((component: Component) => component.setModel(newObj))\n\t\t})\n\t}\n\n\t// Pass on essentials to children as well\n\tsetServices(newObj: any) {\n\t\tsuper.setServices(newObj)\n\n\t\tthis.children.forEach((child: any) => {\n\t\t\tchild.components.forEach((component: Component) => component.setServices(newObj))\n\t\t})\n\t}\n\n\tdestroy() {\n\t\tthis.children.forEach((child: any) => {\n\t\t\tchild.components.forEach((component: Component) => component.destroy())\n\t\t})\n\t}\n}\n","import { spacers as spacerConfigs } from '@/configuration'\nimport { Component } from '@/components/component'\n\nexport class Spacer extends Component {\n\ttype = 'spacer'\n\n\t// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n\t// @ts-ignore\n\t// eslint-disable-next-line @typescript-eslint/no-unused-vars\n\trender(animate = false) {\n\t\tthis.getComponentContainer({\n\t\t\tisPresentational: true\n\t\t})\n\t\t\t.style('width', `${this.configs.size || spacerConfigs.default.size}px`)\n\t\t\t.style('height', `${this.configs.size || spacerConfigs.default.size}px`)\n\t\t\t.attr('opacity', 0)\n\t}\n}\n","/**\n * Copyright IBM Corp. 2016, 2018\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n/**\n * Settings.\n * @exports CarbonComponents.settings\n * @type Object\n * @property {boolean} [disableAutoInit]\n * Disables automatic instantiation of components.\n * By default (`CarbonComponents.disableAutoInit` is `false`),\n * carbon-components attempts to instantiate components automatically\n * by searching for elements with `data-component-name` (e.g. `data-loading`) attribute\n * or upon DOM events (e.g. clicking) on such elements.\n * See each components' static `.init()` methods for details.\n * @property {string} [prefix=bx]\n * Brand prefix. Should be in sync with `$prefix` Sass variable in carbon-components/src/globals/scss/_vars.scss.\n * // @todo given that the default value is so long, is it appropriate to put in the JSDoc?\n * @property {string} [selectorTabbable]\n * A selector selecting tabbable/focusable nodes.\n * By default selectorTabbable references links, areas, inputs, buttons, selects, textareas,\n * iframes, objects, embeds, or elements explicitly using tabindex or contenteditable attributes\n * as long as the element is not `disabled` or the `tabindex=\"-1\"`.\n * @property {string} [selectorFocusable]\n * CSS selector that selects major nodes that are click focusable\n * This property is identical to selectorTabbable with the exception of\n * the `:not([tabindex='-1'])` pseudo class\n */\nvar settings = {\n prefix: 'bx',\n selectorTabbable: \"\\n a[href], area[href], input:not([disabled]):not([tabindex='-1']),\\n button:not([disabled]):not([tabindex='-1']),select:not([disabled]):not([tabindex='-1']),\\n textarea:not([disabled]):not([tabindex='-1']),\\n iframe, object, embed, *[tabindex]:not([tabindex='-1']), *[contenteditable=true]\\n \",\n selectorFocusable: \"\\n a[href], area[href], input:not([disabled]),\\n button:not([disabled]),select:not([disabled]),\\n textarea:not([disabled]),\\n iframe, object, embed, *[tabindex], *[contenteditable=true]\\n \"\n};\nvar settings_1 = settings;\nexport { settings_1 as default };","function _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\n\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n Object.defineProperty(Constructor, \"prototype\", {\n writable: false\n });\n return Constructor;\n}\n\nfunction _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\n\nfunction _toConsumableArray(arr) {\n return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();\n}\n\nfunction _nonIterableSpread() {\n throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\n\nfunction _unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return _arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(o);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);\n}\n\nfunction _iterableToArray(iter) {\n if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter);\n}\n\nfunction _arrayWithoutHoles(arr) {\n if (Array.isArray(arr)) return _arrayLikeToArray(arr);\n}\n\nfunction _arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n\n for (var i = 0, arr2 = new Array(len); i < len; i++) {\n arr2[i] = arr[i];\n }\n\n return arr2;\n}\n/**\n * Copyright IBM Corp. 2016, 2018\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n/**\n * @param {Array} a An array.\n * @returns {Array} The flattened version of the given array.\n */\n\n\nfunction flatten(a) {\n return a.reduce(function (result, item) {\n if (Array.isArray(item)) {\n result.push.apply(result, _toConsumableArray(flatten(item)));\n } else {\n result.push(item);\n }\n\n return result;\n }, []);\n}\n/**\n * An interface for defining mix-in classes. Used with {@link mixin}.\n * @function mixinfn\n * @param {Class} ToMix The class to mix.\n * @returns {Class} The class mixed-in with the given ToMix class.\n */\n\n/**\n * @function mixin\n * @param {...mixinfn} mixinfns The functions generating mix-ins.\n * @returns {Class} The class generated with the given mix-ins.\n */\n\n\nexport default function mixin() {\n for (var _len = arguments.length, mixinfns = new Array(_len), _key = 0; _key < _len; _key++) {\n mixinfns[_key] = arguments[_key];\n }\n\n return flatten(mixinfns).reduce(function (Class, mixinfn) {\n return mixinfn(Class);\n }, /*#__PURE__*/function () {\n function _class() {\n _classCallCheck(this, _class);\n }\n\n return _createClass(_class);\n }());\n}","function _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) {\n return typeof obj;\n } : function (obj) {\n return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n }, _typeof(obj);\n}\n\nfunction _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\n\nfunction _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\n\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n Object.defineProperty(Constructor, \"prototype\", {\n writable: false\n });\n return Constructor;\n}\n\nfunction _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n writable: true,\n configurable: true\n }\n });\n Object.defineProperty(subClass, \"prototype\", {\n writable: false\n });\n if (superClass) _setPrototypeOf(subClass, superClass);\n}\n\nfunction _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}\n\nfunction _createSuper(Derived) {\n var hasNativeReflectConstruct = _isNativeReflectConstruct();\n\n return function _createSuperInternal() {\n var Super = _getPrototypeOf(Derived),\n result;\n\n if (hasNativeReflectConstruct) {\n var NewTarget = _getPrototypeOf(this).constructor;\n\n result = Reflect.construct(Super, arguments, NewTarget);\n } else {\n result = Super.apply(this, arguments);\n }\n\n return _possibleConstructorReturn(this, result);\n };\n}\n\nfunction _possibleConstructorReturn(self, call) {\n if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) {\n return call;\n } else if (call !== void 0) {\n throw new TypeError(\"Derived constructors may only return object or undefined\");\n }\n\n return _assertThisInitialized(self);\n}\n\nfunction _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return self;\n}\n\nfunction _isNativeReflectConstruct() {\n if (typeof Reflect === \"undefined\" || !Reflect.construct) return false;\n if (Reflect.construct.sham) return false;\n if (typeof Proxy === \"function\") return true;\n\n try {\n Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));\n return true;\n } catch (e) {\n return false;\n }\n}\n\nfunction _getPrototypeOf(o) {\n _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {\n return o.__proto__ || Object.getPrototypeOf(o);\n };\n return _getPrototypeOf(o);\n}\n/**\n * Copyright IBM Corp. 2016, 2018\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\nexport default function (ToMix) {\n var CreateComponent = /*#__PURE__*/function (_ToMix) {\n _inherits(CreateComponent, _ToMix);\n\n var _super = _createSuper(CreateComponent);\n /**\n * The component instances managed by this component.\n * Releasing this component also releases the components in `this.children`.\n * @type {Component[]}\n */\n\n /**\n * Mix-in class to manage lifecycle of component.\n * The constructor sets up this component's effective options,\n * and registers this component's instance associated to an element.\n * @implements Handle\n * @param {HTMLElement} element The element working as this component.\n * @param {object} [options] The component options.\n */\n\n\n function CreateComponent(element) {\n var _this;\n\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n _classCallCheck(this, CreateComponent);\n\n _this = _super.call(this, element, options);\n _this.children = [];\n\n if (!element || element.nodeType !== Node.ELEMENT_NODE) {\n throw new TypeError('DOM element should be given to initialize this widget.');\n }\n /**\n * The element the component is of.\n * @type {Element}\n */\n\n\n _this.element = element;\n /**\n * The component options.\n * @type {object}\n */\n\n _this.options = Object.assign(Object.create(_this.constructor.options), options);\n\n _this.constructor.components.set(_this.element, _assertThisInitialized(_this));\n\n return _this;\n }\n /**\n * Instantiates this component of the given element.\n * @param {HTMLElement} element The element.\n */\n\n\n _createClass(CreateComponent, [{\n key: \"release\",\n value:\n /**\n * Releases this component's instance from the associated element.\n */\n function release() {\n for (var child = this.children.pop(); child; child = this.children.pop()) {\n child.release();\n }\n\n this.constructor.components.delete(this.element);\n return null;\n }\n }], [{\n key: \"create\",\n value: function create(element, options) {\n return this.components.get(element) || new this(element, options);\n }\n }]);\n\n return CreateComponent;\n }(ToMix);\n\n return CreateComponent;\n}","function _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) {\n return typeof obj;\n } : function (obj) {\n return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n }, _typeof(obj);\n}\n\nfunction _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\n\nfunction _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\n\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n Object.defineProperty(Constructor, \"prototype\", {\n writable: false\n });\n return Constructor;\n}\n\nfunction _get() {\n if (typeof Reflect !== \"undefined\" && Reflect.get) {\n _get = Reflect.get;\n } else {\n _get = function _get(target, property, receiver) {\n var base = _superPropBase(target, property);\n\n if (!base) return;\n var desc = Object.getOwnPropertyDescriptor(base, property);\n\n if (desc.get) {\n return desc.get.call(arguments.length < 3 ? target : receiver);\n }\n\n return desc.value;\n };\n }\n\n return _get.apply(this, arguments);\n}\n\nfunction _superPropBase(object, property) {\n while (!Object.prototype.hasOwnProperty.call(object, property)) {\n object = _getPrototypeOf(object);\n if (object === null) break;\n }\n\n return object;\n}\n\nfunction _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n writable: true,\n configurable: true\n }\n });\n Object.defineProperty(subClass, \"prototype\", {\n writable: false\n });\n if (superClass) _setPrototypeOf(subClass, superClass);\n}\n\nfunction _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}\n\nfunction _createSuper(Derived) {\n var hasNativeReflectConstruct = _isNativeReflectConstruct();\n\n return function _createSuperInternal() {\n var Super = _getPrototypeOf(Derived),\n result;\n\n if (hasNativeReflectConstruct) {\n var NewTarget = _getPrototypeOf(this).constructor;\n\n result = Reflect.construct(Super, arguments, NewTarget);\n } else {\n result = Super.apply(this, arguments);\n }\n\n return _possibleConstructorReturn(this, result);\n };\n}\n\nfunction _possibleConstructorReturn(self, call) {\n if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) {\n return call;\n } else if (call !== void 0) {\n throw new TypeError(\"Derived constructors may only return object or undefined\");\n }\n\n return _assertThisInitialized(self);\n}\n\nfunction _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return self;\n}\n\nfunction _isNativeReflectConstruct() {\n if (typeof Reflect === \"undefined\" || !Reflect.construct) return false;\n if (Reflect.construct.sham) return false;\n if (typeof Proxy === \"function\") return true;\n\n try {\n Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));\n return true;\n } catch (e) {\n return false;\n }\n}\n\nfunction _getPrototypeOf(o) {\n _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {\n return o.__proto__ || Object.getPrototypeOf(o);\n };\n return _getPrototypeOf(o);\n}\n/**\n * Copyright IBM Corp. 2016, 2018\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\nexport default function (ToMix) {\n /**\n * Mix-in class to manage handles in component.\n * Managed handles are automatically released when the component with this class mixed in is released.\n * @class Handles\n * @implements Handle\n */\n var Handles = /*#__PURE__*/function (_ToMix) {\n _inherits(Handles, _ToMix);\n\n var _super = _createSuper(Handles);\n\n function Handles() {\n var _this;\n\n _classCallCheck(this, Handles);\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n _this = _super.call.apply(_super, [this].concat(args));\n _this.handles = new Set();\n return _this;\n }\n\n _createClass(Handles, [{\n key: \"manage\",\n value:\n /**\n * Manages the given handle.\n * @param {Handle} handle The handle to manage.\n * @returns {Handle} The given handle.\n */\n function manage(handle) {\n this.handles.add(handle);\n return handle;\n }\n /**\n * Stop managing the given handle.\n * @param {Handle} handle The handle to stop managing.\n * @returns {Handle} The given handle.\n */\n\n }, {\n key: \"unmanage\",\n value: function unmanage(handle) {\n this.handles.delete(handle);\n return handle;\n }\n }, {\n key: \"release\",\n value: function release() {\n var _this2 = this;\n\n this.handles.forEach(function (handle) {\n handle.release();\n\n _this2.handles.delete(handle);\n });\n return _get(_getPrototypeOf(Handles.prototype), \"release\", this).call(this);\n }\n }]);\n\n return Handles;\n }(ToMix);\n\n return Handles;\n}","/**\n * Copyright IBM Corp. 2016, 2018\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\nexport default function on(element) {\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n element.addEventListener.apply(element, args);\n return {\n release: function release() {\n element.removeEventListener.apply(element, args);\n return null;\n }\n };\n}","function _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) {\n return typeof obj;\n } : function (obj) {\n return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n }, _typeof(obj);\n}\n\nfunction _toConsumableArray(arr) {\n return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();\n}\n\nfunction _nonIterableSpread() {\n throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\n\nfunction _unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return _arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(o);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);\n}\n\nfunction _iterableToArray(iter) {\n if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter);\n}\n\nfunction _arrayWithoutHoles(arr) {\n if (Array.isArray(arr)) return _arrayLikeToArray(arr);\n}\n\nfunction _arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n\n for (var i = 0, arr2 = new Array(len); i < len; i++) {\n arr2[i] = arr[i];\n }\n\n return arr2;\n}\n\nfunction _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\n\nfunction _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\n\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n Object.defineProperty(Constructor, \"prototype\", {\n writable: false\n });\n return Constructor;\n}\n\nfunction _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n writable: true,\n configurable: true\n }\n });\n Object.defineProperty(subClass, \"prototype\", {\n writable: false\n });\n if (superClass) _setPrototypeOf(subClass, superClass);\n}\n\nfunction _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}\n\nfunction _createSuper(Derived) {\n var hasNativeReflectConstruct = _isNativeReflectConstruct();\n\n return function _createSuperInternal() {\n var Super = _getPrototypeOf(Derived),\n result;\n\n if (hasNativeReflectConstruct) {\n var NewTarget = _getPrototypeOf(this).constructor;\n\n result = Reflect.construct(Super, arguments, NewTarget);\n } else {\n result = Super.apply(this, arguments);\n }\n\n return _possibleConstructorReturn(this, result);\n };\n}\n\nfunction _possibleConstructorReturn(self, call) {\n if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) {\n return call;\n } else if (call !== void 0) {\n throw new TypeError(\"Derived constructors may only return object or undefined\");\n }\n\n return _assertThisInitialized(self);\n}\n\nfunction _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return self;\n}\n\nfunction _isNativeReflectConstruct() {\n if (typeof Reflect === \"undefined\" || !Reflect.construct) return false;\n if (Reflect.construct.sham) return false;\n if (typeof Proxy === \"function\") return true;\n\n try {\n Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));\n return true;\n } catch (e) {\n return false;\n }\n}\n\nfunction _getPrototypeOf(o) {\n _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {\n return o.__proto__ || Object.getPrototypeOf(o);\n };\n return _getPrototypeOf(o);\n}\n/**\n * Copyright IBM Corp. 2016, 2018\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\nexport default function (ToMix) {\n /**\n * Mix-in class to manage events associated with states.\n * @class EventedState\n */\n var EventedState = /*#__PURE__*/function (_ToMix) {\n _inherits(EventedState, _ToMix);\n\n var _super = _createSuper(EventedState);\n\n function EventedState() {\n _classCallCheck(this, EventedState);\n\n return _super.apply(this, arguments);\n }\n\n _createClass(EventedState, [{\n key: \"_changeState\",\n value:\n /* eslint-disable jsdoc/check-param-names */\n\n /**\n * The internal implementation for {@link EventedState#changeState `.changeState()`}, performing actual change in state.\n * @param {string} [state] The new state. Can be an omitted, which means toggling.\n * @param {object} [detail]\n * The object that should be put to event details that is fired before/after changing state.\n * Can have a `group` property, which specifies what state to be changed.\n * @param {EventedState~changeStateCallback} callback The callback called once changing state is finished or is canceled.\n * @private\n */\n function _changeState() {\n throw new Error('_changeState() should be overridden to perform actual change in state.');\n }\n /**\n * Changes the state of this component.\n * @param {string} [state] The new state. Can be an omitted, which means toggling.\n * @param {object} [detail]\n * The object that should be put to event details that is fired before/after changing state.\n * Can have a `group` property, which specifies what state to be changed.\n * @param {EventedState~changeStateCallback} [callback] The callback called once changing state is finished or is canceled.\n */\n\n }, {\n key: \"changeState\",\n value: function changeState() {\n var _this = this;\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n var state = typeof args[0] === 'string' ? args.shift() : undefined;\n var detail = Object(args[0]) === args[0] && typeof args[0] !== 'function' ? args.shift() : undefined;\n var callback = typeof args[0] === 'function' ? args.shift() : undefined;\n\n if (typeof this.shouldStateBeChanged === 'function' && !this.shouldStateBeChanged(state, detail)) {\n if (callback) {\n callback(null, true);\n }\n\n return;\n }\n\n var data = {\n group: detail && detail.group,\n state: state\n };\n var eventNameSuffix = [data.group, state].filter(Boolean).join('-').split('-') // Group or state may contain hyphen\n .map(function (item) {\n return item[0].toUpperCase() + item.substr(1);\n }).join('');\n var eventStart = new CustomEvent(this.options[\"eventBefore\".concat(eventNameSuffix)], {\n bubbles: true,\n cancelable: true,\n detail: detail\n });\n var fireOnNode = detail && detail.delegatorNode || this.element;\n var canceled = !fireOnNode.dispatchEvent(eventStart);\n\n if (canceled) {\n if (callback) {\n var error = new Error(\"Changing state (\".concat(JSON.stringify(data), \") has been canceled.\"));\n error.canceled = true;\n callback(error);\n }\n } else {\n var changeStateArgs = [state, detail].filter(Boolean);\n\n this._changeState.apply(this, _toConsumableArray(changeStateArgs).concat([function () {\n fireOnNode.dispatchEvent(new CustomEvent(_this.options[\"eventAfter\".concat(eventNameSuffix)], {\n bubbles: true,\n cancelable: true,\n detail: detail\n }));\n\n if (callback) {\n callback();\n }\n }]));\n }\n }\n /* eslint-enable jsdoc/check-param-names */\n\n /**\n * Tests if change in state should happen or not.\n * Classes inheriting {@link EventedState `EventedState`} should override this function.\n * @function EventedState#shouldStateBeChanged\n * @param {string} [state] The new state. Can be an omitted, which means toggling.\n * @param {object} [detail]\n * The object that should be put to event details that is fired before/after changing state.\n * Can have a `group` property, which specifies what state to be changed.\n * @returns {boolean}\n * `false` if change in state shouldn't happen, e.g. when the given new state is the same as the current one.\n */\n\n }]);\n\n return EventedState;\n }(ToMix);\n /**\n * The callback called once changing state is finished or is canceled.\n * @callback EventedState~changeStateCallback\n * @param {Error} error\n * An error object with `true` in its `canceled` property if changing state is canceled.\n * Cancellation happens if the handler of a custom event, that is fired before changing state happens,\n * calls `.preventDefault()` against the event.\n * @param {boolean} keptState\n * `true` if the call to {@link EventedState#changeState `.changeState()`} didn't cause actual change in state.\n */\n\n\n return EventedState;\n}","/**\n * Copyright IBM Corp. 2016, 2018\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n/**\n * @param {Event} event The event.\n * @param {string} selector The selector.\n * @returns {Element}\n * The closest ancestor of the event target (or the event target itself) which matches the selectors given in parameter.\n */\nexport default function eventMatches(event, selector) {\n // in IE does not have `Element#msMatchesSelector()` (that should be copied to `Element#matches()` by a polyfill).\n // Also a weird behavior is seen in IE where DOM tree seems broken when `event.target` is on .\n // Therefore this function simply returns `undefined` when `event.target` is on .\n var target = event.target,\n currentTarget = event.currentTarget;\n\n if (typeof target.matches === 'function') {\n if (target.matches(selector)) {\n // If event target itself matches the given selector, return it\n return target;\n }\n\n if (target.matches(\"\".concat(selector, \" *\"))) {\n var closest = target.closest(selector);\n\n if ((currentTarget.nodeType === Node.DOCUMENT_NODE ? currentTarget.documentElement : currentTarget).contains(closest)) {\n return closest;\n }\n }\n }\n\n return undefined;\n}","/**\n * Copyright IBM Corp. 2016, 2018\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\nexport default function getLaunchingDetails(evt) {\n if (!evt || typeof evt === 'function') {\n return {\n launchingElement: null,\n launchingEvent: null\n };\n }\n\n var launchingElement = evt.delegateTarget || evt.currentTarget || evt;\n var launchingEvent = evt.currentTarget && evt;\n\n if (launchingElement && !launchingElement.nodeType) {\n throw new TypeError('DOM Node should be given for launching element.');\n }\n\n if (launchingEvent && !launchingEvent.type) {\n throw new TypeError('DOM event should be given for launching event.');\n }\n\n return {\n launchingElement: launchingElement,\n launchingEvent: launchingEvent\n };\n}","function _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) {\n return typeof obj;\n } : function (obj) {\n return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n }, _typeof(obj);\n}\n\nfunction _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\n\nfunction _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\n\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n Object.defineProperty(Constructor, \"prototype\", {\n writable: false\n });\n return Constructor;\n}\n\nfunction _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n writable: true,\n configurable: true\n }\n });\n Object.defineProperty(subClass, \"prototype\", {\n writable: false\n });\n if (superClass) _setPrototypeOf(subClass, superClass);\n}\n\nfunction _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}\n\nfunction _createSuper(Derived) {\n var hasNativeReflectConstruct = _isNativeReflectConstruct();\n\n return function _createSuperInternal() {\n var Super = _getPrototypeOf(Derived),\n result;\n\n if (hasNativeReflectConstruct) {\n var NewTarget = _getPrototypeOf(this).constructor;\n\n result = Reflect.construct(Super, arguments, NewTarget);\n } else {\n result = Super.apply(this, arguments);\n }\n\n return _possibleConstructorReturn(this, result);\n };\n}\n\nfunction _possibleConstructorReturn(self, call) {\n if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) {\n return call;\n } else if (call !== void 0) {\n throw new TypeError(\"Derived constructors may only return object or undefined\");\n }\n\n return _assertThisInitialized(self);\n}\n\nfunction _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return self;\n}\n\nfunction _isNativeReflectConstruct() {\n if (typeof Reflect === \"undefined\" || !Reflect.construct) return false;\n if (Reflect.construct.sham) return false;\n if (typeof Proxy === \"function\") return true;\n\n try {\n Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));\n return true;\n } catch (e) {\n return false;\n }\n}\n\nfunction _getPrototypeOf(o) {\n _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {\n return o.__proto__ || Object.getPrototypeOf(o);\n };\n return _getPrototypeOf(o);\n}\n/**\n * Copyright IBM Corp. 2016, 2018\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\nimport eventedState from './evented-state';\nimport getLaunchingDetails from '../misc/get-launching-details';\n\nfunction eventedShowHideState(ToMix) {\n /**\n * Mix-in class to launch a floating menu.\n * @class EventedShowHideState\n */\n var EventedShowHideState = /*#__PURE__*/function (_ToMix) {\n _inherits(EventedShowHideState, _ToMix);\n\n var _super = _createSuper(EventedShowHideState);\n\n function EventedShowHideState() {\n _classCallCheck(this, EventedShowHideState);\n\n return _super.apply(this, arguments);\n }\n\n _createClass(EventedShowHideState, [{\n key: \"show\",\n value:\n /**\n */\n\n /**\n * Switch to 'shown' state.\n * @param [evtOrElem] The launching event or element.\n * @param {EventedState~changeStateCallback} [callback] The callback.\n */\n function show(evtOrElem, callback) {\n if (!evtOrElem || typeof evtOrElem === 'function') {\n callback = evtOrElem; // eslint-disable-line no-param-reassign\n }\n\n this.changeState('shown', getLaunchingDetails(evtOrElem), callback);\n }\n /**\n * Switch to 'hidden' state.\n * @param [evtOrElem] The launching event or element.\n * @param {EventedState~changeStateCallback} [callback] The callback.\n */\n\n }, {\n key: \"hide\",\n value: function hide(evtOrElem, callback) {\n if (!evtOrElem || typeof evtOrElem === 'function') {\n callback = evtOrElem; // eslint-disable-line no-param-reassign\n }\n\n this.changeState('hidden', getLaunchingDetails(evtOrElem), callback);\n }\n }]);\n\n return EventedShowHideState;\n }(ToMix);\n\n return EventedShowHideState;\n}\n\nvar exports = [eventedState, eventedShowHideState];\nexport default exports;","/**\n * Copyright 2014-2015, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n'use strict';\n\n/**\n * Similar to invariant but only logs a warning if the condition is not met.\n * This can be used to log issues in development environments in critical\n * paths. Removing the logging code for production environments will keep the\n * same logic and follow the same code paths.\n */\n\nvar warning = function() {};\n\nif (process.env.NODE_ENV !== 'production') {\n warning = function(condition, format, args) {\n var len = arguments.length;\n args = new Array(len > 2 ? len - 2 : 0);\n for (var key = 2; key < len; key++) {\n args[key - 2] = arguments[key];\n }\n if (format === undefined) {\n throw new Error(\n '`warning(condition, format, ...args)` requires a warning ' +\n 'message argument'\n );\n }\n\n if (format.length < 10 || (/^[s\\W]*$/).test(format)) {\n throw new Error(\n 'The warning format should be able to uniquely identify this ' +\n 'warning. Please, use a more descriptive format than: ' + format\n );\n }\n\n if (!condition) {\n var argIndex = 0;\n var message = 'Warning: ' +\n format.replace(/%s/g, function() {\n return args[argIndex++];\n });\n if (typeof console !== 'undefined') {\n console.error(message);\n }\n try {\n // This error was thrown as a convenience so that you can use this stack\n // to find the callsite that caused this warning to fire.\n throw new Error(message);\n } catch(x) {}\n }\n };\n}\n\nmodule.exports = warning;\n","function _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) {\n return typeof obj;\n } : function (obj) {\n return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n }, _typeof(obj);\n}\n\nfunction _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\n\nfunction _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\n\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n Object.defineProperty(Constructor, \"prototype\", {\n writable: false\n });\n return Constructor;\n}\n\nfunction _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n writable: true,\n configurable: true\n }\n });\n Object.defineProperty(subClass, \"prototype\", {\n writable: false\n });\n if (superClass) _setPrototypeOf(subClass, superClass);\n}\n\nfunction _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}\n\nfunction _createSuper(Derived) {\n var hasNativeReflectConstruct = _isNativeReflectConstruct();\n\n return function _createSuperInternal() {\n var Super = _getPrototypeOf(Derived),\n result;\n\n if (hasNativeReflectConstruct) {\n var NewTarget = _getPrototypeOf(this).constructor;\n\n result = Reflect.construct(Super, arguments, NewTarget);\n } else {\n result = Super.apply(this, arguments);\n }\n\n return _possibleConstructorReturn(this, result);\n };\n}\n\nfunction _possibleConstructorReturn(self, call) {\n if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) {\n return call;\n } else if (call !== void 0) {\n throw new TypeError(\"Derived constructors may only return object or undefined\");\n }\n\n return _assertThisInitialized(self);\n}\n\nfunction _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return self;\n}\n\nfunction _isNativeReflectConstruct() {\n if (typeof Reflect === \"undefined\" || !Reflect.construct) return false;\n if (Reflect.construct.sham) return false;\n if (typeof Proxy === \"function\") return true;\n\n try {\n Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));\n return true;\n } catch (e) {\n return false;\n }\n}\n\nfunction _getPrototypeOf(o) {\n _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {\n return o.__proto__ || Object.getPrototypeOf(o);\n };\n return _getPrototypeOf(o);\n}\n/**\n * Copyright IBM Corp. 2016, 2018\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\nimport eventMatches from '../misc/event-matches';\nimport on from '../misc/on';\nexport default function (ToMix) {\n /**\n * Mix-in class to instantiate components events on launcher button.\n * @class InitComponentByLauncher\n */\n var InitComponentByLauncher = /*#__PURE__*/function (_ToMix) {\n _inherits(InitComponentByLauncher, _ToMix);\n\n var _super = _createSuper(InitComponentByLauncher);\n\n function InitComponentByLauncher() {\n _classCallCheck(this, InitComponentByLauncher);\n\n return _super.apply(this, arguments);\n }\n\n _createClass(InitComponentByLauncher, null, [{\n key: \"init\",\n value:\n /**\n * `true` suggests that this component is lazily initialized upon an action/event, etc.\n * @type {boolean}\n */\n\n /**\n * Instantiates this component in the given element.\n * If the given element indicates that it's an component of this class, instantiates it.\n * Otherwise, instantiates this component by clicking on launcher buttons\n * (buttons with attribute that `options.attribInitTarget` points to) of this component in the given node.\n * @param {Node} target The DOM node to instantiate this component in. Should be a document or an element.\n * @param {object} [options] The component options.\n * @param {string} [options.selectorInit] The CSS selector to find this component.\n * @param {string} [options.attribInitTarget] The attribute name in the launcher buttons to find target component.\n * @returns {Handle} The handle to remove the event listener to handle clicking.\n */\n function init() {\n var _this = this;\n\n var target = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : document;\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var effectiveOptions = Object.assign(Object.create(this.options), options);\n\n if (!target || target.nodeType !== Node.ELEMENT_NODE && target.nodeType !== Node.DOCUMENT_NODE) {\n throw new TypeError('DOM document or DOM element should be given to search for and initialize this widget.');\n }\n\n if (target.nodeType === Node.ELEMENT_NODE && target.matches(effectiveOptions.selectorInit)) {\n this.create(target, options);\n } else {\n var handles = effectiveOptions.initEventNames.map(function (name) {\n return on(target, name, function (event) {\n var launcher = eventMatches(event, \"[\".concat(effectiveOptions.attribInitTarget, \"]\"));\n\n if (launcher) {\n event.delegateTarget = launcher; // eslint-disable-line no-param-reassign\n\n // eslint-disable-line no-param-reassign\n var elements = launcher.ownerDocument.querySelectorAll(launcher.getAttribute(effectiveOptions.attribInitTarget));\n\n if (elements.length > 1) {\n throw new Error('Target widget must be unique.');\n }\n\n if (elements.length === 1) {\n if (launcher.tagName === 'A') {\n event.preventDefault();\n }\n\n var component = _this.create(elements[0], options);\n\n if (typeof component.createdByLauncher === 'function') {\n component.createdByLauncher(event);\n }\n }\n }\n });\n });\n return {\n release: function release() {\n for (var handle = handles.pop(); handle; handle = handles.pop()) {\n handle.release();\n }\n }\n };\n }\n\n return '';\n }\n }]);\n\n InitComponentByLauncher.forLazyInit = true;\n return InitComponentByLauncher;\n }(ToMix);\n\n return InitComponentByLauncher;\n}","function _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) {\n return typeof obj;\n } : function (obj) {\n return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n }, _typeof(obj);\n}\n\nfunction _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\n\nfunction _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\n\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n Object.defineProperty(Constructor, \"prototype\", {\n writable: false\n });\n return Constructor;\n}\n\nfunction _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n writable: true,\n configurable: true\n }\n });\n Object.defineProperty(subClass, \"prototype\", {\n writable: false\n });\n if (superClass) _setPrototypeOf(subClass, superClass);\n}\n\nfunction _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}\n\nfunction _createSuper(Derived) {\n var hasNativeReflectConstruct = _isNativeReflectConstruct();\n\n return function _createSuperInternal() {\n var Super = _getPrototypeOf(Derived),\n result;\n\n if (hasNativeReflectConstruct) {\n var NewTarget = _getPrototypeOf(this).constructor;\n\n result = Reflect.construct(Super, arguments, NewTarget);\n } else {\n result = Super.apply(this, arguments);\n }\n\n return _possibleConstructorReturn(this, result);\n };\n}\n\nfunction _possibleConstructorReturn(self, call) {\n if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) {\n return call;\n } else if (call !== void 0) {\n throw new TypeError(\"Derived constructors may only return object or undefined\");\n }\n\n return _assertThisInitialized(self);\n}\n\nfunction _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return self;\n}\n\nfunction _isNativeReflectConstruct() {\n if (typeof Reflect === \"undefined\" || !Reflect.construct) return false;\n if (Reflect.construct.sham) return false;\n if (typeof Proxy === \"function\") return true;\n\n try {\n Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));\n return true;\n } catch (e) {\n return false;\n }\n}\n\nfunction _getPrototypeOf(o) {\n _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {\n return o.__proto__ || Object.getPrototypeOf(o);\n };\n return _getPrototypeOf(o);\n}\n/**\n * Copyright IBM Corp. 2016, 2018\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\nimport warning from 'warning';\nimport settings from '../../globals/js/settings';\nimport mixin from '../../globals/js/misc/mixin';\nimport createComponent from '../../globals/js/mixins/create-component';\nimport initComponentByLauncher from '../../globals/js/mixins/init-component-by-launcher';\nimport eventedShowHideState from '../../globals/js/mixins/evented-show-hide-state';\nimport handles from '../../globals/js/mixins/handles';\nimport eventMatches from '../../globals/js/misc/event-matches';\nimport on from '../../globals/js/misc/on';\n\nvar Modal = /*#__PURE__*/function (_mixin) {\n _inherits(Modal, _mixin);\n\n var _super = _createSuper(Modal);\n /**\n * Modal dialog.\n * @extends CreateComponent\n * @extends InitComponentByLauncher\n * @extends EventedShowHideState\n * @extends Handles\n * @param {HTMLElement} element The element working as a modal dialog.\n * @param {object} [options] The component options.\n * @param {string} [options.classVisible] The CSS class for the visible state.\n * @param {string} [options.classBody] The CSS class for `` with open modal.\n * @param {string} [options.eventBeforeShown]\n * The name of the custom event fired before this modal is shown.\n * Cancellation of this event stops showing the modal.\n * @param {string} [options.eventAfterShown]\n * The name of the custom event telling that modal is sure shown\n * without being canceled by the event handler named by `eventBeforeShown` option (`modal-beingshown`).\n * @param {string} [options.eventBeforeHidden]\n * The name of the custom event fired before this modal is hidden.\n * Cancellation of this event stops hiding the modal.\n * @param {string} [options.eventAfterHidden]\n * The name of the custom event telling that modal is sure hidden\n * without being canceled by the event handler named by `eventBeforeHidden` option (`modal-beinghidden`).\n */\n\n\n /**\n * Modal dialog.\n * @extends CreateComponent\n * @extends InitComponentByLauncher\n * @extends EventedShowHideState\n * @extends Handles\n * @param {HTMLElement} element The element working as a modal dialog.\n * @param {object} [options] The component options.\n * @param {string} [options.classVisible] The CSS class for the visible state.\n * @param {string} [options.classBody] The CSS class for `` with open modal.\n * @param {string} [options.eventBeforeShown]\n * The name of the custom event fired before this modal is shown.\n * Cancellation of this event stops showing the modal.\n * @param {string} [options.eventAfterShown]\n * The name of the custom event telling that modal is sure shown\n * without being canceled by the event handler named by `eventBeforeShown` option (`modal-beingshown`).\n * @param {string} [options.eventBeforeHidden]\n * The name of the custom event fired before this modal is hidden.\n * Cancellation of this event stops hiding the modal.\n * @param {string} [options.eventAfterHidden]\n * The name of the custom event telling that modal is sure hidden\n * without being canceled by the event handler named by `eventBeforeHidden` option (`modal-beinghidden`).\n */\n function Modal(element, options) {\n var _this;\n\n _classCallCheck(this, Modal);\n\n _this = _super.call(this, element, options);\n _this._handleFocusinListener = void 0;\n _this._handleKeydownListener = void 0;\n\n _this._handleFocusin = function (evt) {\n var focusWrapNode = _this.element.querySelector(_this.options.selectorModalContainer) || _this.element;\n\n if (_this.element.classList.contains(_this.options.classVisible) && !focusWrapNode.contains(evt.target) && _this.options.selectorsFloatingMenus.every(function (selector) {\n return !eventMatches(evt, selector);\n })) {\n _this.element.querySelector(settings.selectorTabbable).focus();\n }\n };\n\n _this._hookCloseActions();\n\n return _this;\n }\n /**\n * The handle for `focusin` event listener.\n * Used for \"focus-wrap\" feature.\n * @type {Handle}\n * @private\n */\n\n\n /**\n * The handle for `focusin` event listener.\n * Used for \"focus-wrap\" feature.\n * @type {Handle}\n * @private\n */\n _createClass(Modal, [{\n key: \"createdByLauncher\",\n value:\n /**\n * A method that runs when `.init()` is called from `initComponentByLauncher`.\n * @param {Event} evt The event fired on the launcher button.\n */\n function createdByLauncher(evt) {\n this.show(evt);\n }\n /**\n * Determines whether or not to emit events and callback function when `.changeState()` is called from `eventedState`.\n * @param {string} state The new state.\n * @returns {boolean} `true` if the given `state` is different from current state.\n */\n\n }, {\n key: \"shouldStateBeChanged\",\n value: function shouldStateBeChanged(state) {\n if (state === 'shown') {\n return !this.element.classList.contains(this.options.classVisible);\n }\n\n return this.element.classList.contains(this.options.classVisible);\n }\n /**\n * Changes the shown/hidden state.\n * @private\n * @param {string} state The new state.\n * @param {object} detail The detail data to be included in the event that will be fired.\n * @param {Function} callback Callback called when change in state completes.\n */\n\n }, {\n key: \"_changeState\",\n value: function _changeState(state, detail, callback) {\n var _this2 = this;\n\n var handleTransitionEnd;\n\n var transitionEnd = function transitionEnd() {\n if (handleTransitionEnd) {\n handleTransitionEnd = _this2.unmanage(handleTransitionEnd).release();\n }\n\n if (state === 'shown' && _this2.element.offsetWidth > 0 && _this2.element.offsetHeight > 0) {\n _this2.previouslyFocusedNode = _this2.element.ownerDocument.activeElement;\n\n var focusableItem = _this2.element.querySelector(_this2.options.selectorPrimaryFocus) || _this2.element.querySelector(settings.selectorTabbable);\n\n focusableItem.focus();\n\n if (process.env.NODE_ENV !== \"production\") {\n process.env.NODE_ENV !== \"production\" ? warning(focusableItem, \"Modals need to contain a focusable element by either using \" + \"`\".concat(_this2.options.selectorPrimaryFocus, \"` or settings.selectorTabbable.\")) : void 0;\n }\n }\n\n callback();\n };\n\n if (this._handleFocusinListener) {\n this._handleFocusinListener = this.unmanage(this._handleFocusinListener).release();\n }\n\n if (state === 'shown') {\n var hasFocusin = ('onfocusin' in this.element.ownerDocument.defaultView);\n var focusinEventName = hasFocusin ? 'focusin' : 'focus';\n this._handleFocusinListener = this.manage(on(this.element.ownerDocument, focusinEventName, this._handleFocusin, !hasFocusin));\n }\n\n if (state === 'hidden') {\n this.element.classList.toggle(this.options.classVisible, false);\n this.element.ownerDocument.body.classList.toggle(this.options.classBody, false);\n\n if (this.options.selectorFocusOnClose || this.previouslyFocusedNode) {\n (this.element.ownerDocument.querySelector(this.options.selectorFocusOnClose) || this.previouslyFocusedNode).focus();\n }\n } else if (state === 'shown') {\n this.element.classList.toggle(this.options.classVisible, true);\n this.element.ownerDocument.body.classList.toggle(this.options.classBody, true);\n }\n\n handleTransitionEnd = this.manage(on(this.element, 'transitionend', transitionEnd));\n }\n }, {\n key: \"_hookCloseActions\",\n value: function _hookCloseActions() {\n var _this3 = this;\n\n this.manage(on(this.element, 'click', function (evt) {\n var closeButton = eventMatches(evt, _this3.options.selectorModalClose);\n\n if (closeButton) {\n evt.delegateTarget = closeButton; // eslint-disable-line no-param-reassign\n }\n\n if (closeButton || evt.target === _this3.element) {\n _this3.hide(evt);\n }\n }));\n\n if (this._handleKeydownListener) {\n this._handleKeydownListener = this.unmanage(this._handleKeydownListener).release();\n }\n\n this._handleKeydownListener = this.manage(on(this.element.ownerDocument.body, 'keydown', function (evt) {\n // Avoid running `evt.stopPropagation()` only when modal is shown\n if (evt.which === 27 && _this3.shouldStateBeChanged('hidden')) {\n evt.stopPropagation();\n\n _this3.hide(evt);\n }\n }));\n }\n /**\n * Handles `focusin` (or `focus` depending on browser support of `focusin`) event to do wrap-focus behavior.\n * @param {Event} evt The event.\n * @private\n */\n\n }], [{\n key: \"options\",\n get:\n /**\n * The component options.\n * If `options` is specified in the constructor, {@linkcode Modal.create .create()}, or {@linkcode Modal.init .init()},\n * properties in this object are overridden for the instance being create and how {@linkcode Modal.init .init()} works.\n * @member Modal.options\n * @type {object}\n * @property {string} selectorInit The CSS class to find modal dialogs.\n * @property {string} [selectorModalClose] The selector to find elements that close the modal.\n * @property {string} [selectorPrimaryFocus] The CSS selector to determine the element to put focus when modal gets open.\n * @property {string} [selectorFocusOnClose] The CSS selector to determine the element to put focus when modal closes.\n * If undefined, focus returns to the previously focused element prior to the modal opening.\n * @property {string} [selectorModalContainer] The CSS selector for the content container of the modal for focus wrap feature.\n * @property {string} attribInitTarget The attribute name in the launcher buttons to find target modal dialogs.\n * @property {string[]} [selectorsFloatingMenu]\n * The CSS selectors of floating menus.\n * Used for detecting if focus-wrap behavior should be disabled temporarily.\n * @property {string} [classVisible] The CSS class for the visible state.\n * @property {string} [classBody] The CSS class for `` with open modal.\n * @property {string} [classNoScroll] The CSS class for hiding scroll bar in body element while modal is shown.\n * @property {string} [eventBeforeShown]\n * The name of the custom event fired before this modal is shown.\n * Cancellation of this event stops showing the modal.\n * @property {string} [eventAfterShown]\n * The name of the custom event telling that modal is sure shown\n * without being canceled by the event handler named by `eventBeforeShown` option (`modal-beingshown`).\n * @property {string} [eventBeforeHidden]\n * The name of the custom event fired before this modal is hidden.\n * Cancellation of this event stops hiding the modal.\n * @property {string} [eventAfterHidden]\n * The name of the custom event telling that modal is sure hidden\n * without being canceled by the event handler named by `eventBeforeHidden` option (`modal-beinghidden`).\n */\n function get() {\n var prefix = settings.prefix;\n return {\n selectorInit: '[data-modal]',\n selectorModalClose: '[data-modal-close]',\n selectorPrimaryFocus: '[data-modal-primary-focus]',\n selectorsFloatingMenus: [\".\".concat(prefix, \"--overflow-menu-options\"), \".\".concat(prefix, \"--tooltip\"), '.flatpickr-calendar'],\n selectorModalContainer: \".\".concat(prefix, \"--modal-container\"),\n classVisible: 'is-visible',\n classBody: \"\".concat(prefix, \"--body--with-modal-open\"),\n attribInitTarget: 'data-modal-target',\n initEventNames: ['click'],\n eventBeforeShown: 'modal-beingshown',\n eventAfterShown: 'modal-shown',\n eventBeforeHidden: 'modal-beinghidden',\n eventAfterHidden: 'modal-hidden'\n };\n }\n }]);\n\n Modal.components = new WeakMap();\n return Modal;\n}(mixin(createComponent, initComponentByLauncher, eventedShowHideState, handles));\n\nexport default Modal;","import { select, type Selection } from 'd3'\nimport { get } from 'lodash-es'\nimport { Modal as CarbonModalComponent } from 'carbon-components'\nimport { getProperty } from '@/tools'\nimport { carbonPrefix } from '@/configuration-non-customizable' // CSS prefix\nimport { Component } from '@/components/component'\nimport { DOMUtils } from '@/services/essentials/dom-utils'\nimport type { ChartModel } from '@/model/model'\nimport type { ChartOptions } from '@/interfaces/charts'\nimport { Events } from '@/interfaces/enums'\nimport { sanitizeText } from '@/utils/sanitizeHtml'\n\nexport class Modal extends Component {\n\ttype = 'modal'\n\n\t// flag for checking whether tooltip event listener is added or not\n\tisEventListenerAdded = false\n\tmodal: any\n\n\tconstructor(model: ChartModel, services: any, configs?: any) {\n\t\tsuper(model, services, configs)\n\n\t\tthis.init()\n\t}\n\n\thandleShowModal = () => {\n\t\tconst id = this.services.domUtils.getChartID()\n\t\tthis.modal\n\t\t\t.attr('data-modal', true)\n\t\t\t.attr('class', 'cds--modal')\n\t\t\t.attr('role', 'dialog')\n\t\t\t.attr('aria-modal', true)\n\t\t\t.attr('aria-labelledby', `${id}__modal-title`)\n\t\t\t.attr('aria-describedby', `${id}__modal-description`)\n\t\t\t.attr('tabindex', -1)\n\n\t\tthis.modal.html(this.getModalHTML())\n\t\tthis.modal\n\t\t\t.select('div.cds--modal-footer button.cds--btn')\n\t\t\t.on('click', () => this.model.exportToCSV())\n\n\t\tconst modalInstance = CarbonModalComponent.create(this.modal.node())\n\t\tmodalInstance.show()\n\n\t\t//catches when modal gets closed\n\t\tdocument.addEventListener('modal-hidden', this.handleHideModal)\n\t}\n\n\thandleHideModal = () => {\n\t\tthis.modal\n\t\t\t.attr('role', null)\n\t\t\t.attr('aria-modal', null)\n\t\t\t.attr('aria-labelledby', null)\n\t\t\t.attr('aria-describedby', null)\n\t\t\t.attr('tabindex', null)\n\n\t\t//removes event listener when modal is closed\n\t\tdocument.removeEventListener('modal-hidden', this.handleHideModal)\n\t}\n\n\taddEventListeners() {\n\t\t// listen to show-modal Custom Events to render the modal\n\t\tthis.services.events.addEventListener(Events.Modal.SHOW, this.handleShowModal)\n\t}\n\n\tremoveEventListeners() {\n\t\t// remove show-modal Custom Events\n\t\tthis.services.events.removeEventListener(Events.Modal.SHOW, this.handleShowModal)\n\t}\n\n\tgetModalHTML() {\n\t\tconst id = this.services.domUtils.getChartID()\n\n\t\tconst options = this.model.getOptions()\n\n\t\tconst { title, downloadAsCSV } = getProperty(options, 'locale', 'translations', 'tabularRep')\n\n\t\tconst chartprefix = getProperty(options, 'style', 'prefix')\n\n\t\tconst tableArray = this.model.getTabularDataArray()\n\n\t\treturn `\n\t\t\n\t\t\t\n\n\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t${get(tableArray, 0)\n\t\t\t\t\t\t\t\t.map(\n\t\t\t\t\t\t\t\t\t(heading: any) => `\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t `\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t.join('')}\n\t\t\t\t\t\t \n\t\t\t\t\t \n\n\t\t\t\t\t${tableArray\n\t\t\t\t\t\t.slice(1)\n\t\t\t\t\t\t.map(\n\t\t\t\t\t\t\t(row: any) => `\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t${row.map((column: any) => `${sanitizeText(column)} `).join('')}\n\t\t\t\t\t\t\t `\n\t\t\t\t\t\t)\n\t\t\t\t\t\t.join('')}\n\t\t\t\t\t \n\t\t\t\t
\n\t\t\t
\n\n\t\t\t\n\t\t
`\n\t}\n\n\t// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n\t// @ts-ignore\n\t// eslint-disable-next-line @typescript-eslint/no-unused-vars\n\trender(animate = false) {\n\t\tconst options = this.model.getOptions() as ChartOptions\n\t\tif (!this.isEventListenerAdded) {\n\t\t\t// Grab the tooltip element\n\t\t\tconst holder = select(this.services.domUtils.getHolder()) as Selection<\n\t\t\t\tHTMLDivElement,\n\t\t\t\tany,\n\t\t\t\tElement,\n\t\t\t\tany\n\t\t\t>\n\t\t\tconst chartprefix = getProperty(options, 'style', 'prefix') as string\n\t\t\tthis.modal = DOMUtils.appendOrSelect(holder, `div.${carbonPrefix}--${chartprefix}--modal`)\n\n\t\t\tthis.addEventListeners()\n\t\t\tthis.isEventListenerAdded = true\n\t\t}\n\t}\n\n\tdestroy() {\n\t\t// remove tooltip eventListener\n\t\tthis.removeEventListeners()\n\t\tthis.isEventListenerAdded = false\n\t}\n}\n","import type { Selection } from 'd3'\nimport { getProperty } from '@/tools'\nimport { Component } from '@/components/component'\nimport { DOMUtils } from '@/services/essentials/dom-utils'\nimport { Events, RenderTypes } from '@/interfaces/enums'\nimport { sanitizeText } from '@/utils/sanitizeHtml'\n\nexport class Title extends Component {\n\ttype = 'title'\n\trenderType = RenderTypes.HTML\n\n\t// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n\t// @ts-ignore\n\t// eslint-disable-next-line @typescript-eslint/no-unused-vars\n\trender(animate = false) {\n\t\tconst svg = this.getComponentContainer()\n\t\tconst title = getProperty(this.getOptions(), 'title')\n\n\t\tconst text = svg.selectAll('p.title').data([title]) as Selection<\n\t\t\tHTMLParagraphElement,\n\t\t\tany,\n\t\t\tElement,\n\t\t\tany\n\t\t>\n\n\t\ttext\n\t\t\t.enter()\n\t\t\t.append('p')\n\t\t\t.classed('title', true)\n\t\t\t.attr('role', 'heading')\n\t\t\t.attr('aria-level', 2)\n\t\t\t.merge(text as any)\n\t\t\t.html((d: any) => sanitizeText(d))\n\n\t\t// check if title needs truncation (and tooltip support)\n\t\tif (text.node() && text.node().offsetWidth < text.node().scrollWidth) {\n\t\t\t// add events for displaying the tooltip with the title\n\t\t\tconst self = this\n\t\t\ttext\n\t\t\t\t.on('mouseover', function (event: MouseEvent) {\n\t\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.SHOW, {\n\t\t\t\t\t\tevent,\n\t\t\t\t\t\thoveredElement: text,\n\t\t\t\t\t\tcontent: text.text()\n\t\t\t\t\t})\n\t\t\t\t})\n\t\t\t\t.on('mousemove', function (event: MouseEvent) {\n\t\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.MOVE, {\n\t\t\t\t\t\tevent\n\t\t\t\t\t})\n\t\t\t\t})\n\t\t\t\t.on('mouseout', function () {\n\t\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.HIDE)\n\t\t\t\t})\n\t\t}\n\n\t\ttext.exit().remove()\n\t}\n\n\t/**\n\t * Truncates title creating ellipses and attaching tooltip for exposing full title.\n\t */\n\ttruncateTitle(title: any, maxWidth: number) {\n\t\t// sanity check to prevent stack overflow on binary search\n\t\tif (maxWidth <= 0) {\n\t\t\treturn\n\t\t}\n\n\t\tconst untruncatedTitle = title.text()\n\t\t// check if the title is too big for the containing svg\n\t\tif (title.node().getComputedTextLength() > maxWidth) {\n\t\t\t// append the ellipses to their own tspan to calculate the text length\n\t\t\ttitle.append('tspan').text('...')\n\n\t\t\t// get the bounding width including the elipses '...'\n\t\t\tconst tspanLength = DOMUtils.appendOrSelect(title, 'tspan').node().getComputedTextLength()\n\n\t\t\t// with elipses\n\t\t\tconst titleString = title.text()\n\n\t\t\t// get the index for creating the max length substring that fit within the svg\n\t\t\t// use one less than the index to avoid crowding (the elipsis)\n\t\t\tconst substringIndex = this.getSubstringIndex(\n\t\t\t\ttitle.node(),\n\t\t\t\t0,\n\t\t\t\ttitleString.length - 1,\n\t\t\t\tmaxWidth - tspanLength\n\t\t\t)\n\n\t\t\t// use the substring as the title\n\t\t\ttitle\n\t\t\t\t.html(titleString.substring(0, substringIndex - 1))\n\t\t\t\t.append('tspan')\n\t\t\t\t.text('...')\n\n\t\t\t// add events for displaying the tooltip with the title\n\t\t\tconst self = this\n\t\t\ttitle\n\t\t\t\t.on('mouseover', function (event: MouseEvent) {\n\t\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.SHOW, {\n\t\t\t\t\t\tevent,\n\t\t\t\t\t\thoveredElement: title,\n\t\t\t\t\t\tcontent: untruncatedTitle\n\t\t\t\t\t})\n\t\t\t\t})\n\t\t\t\t.on('mousemove', function (event: MouseEvent) {\n\t\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.MOVE, {\n\t\t\t\t\t\tevent\n\t\t\t\t\t})\n\t\t\t\t})\n\t\t\t\t.on('mouseout', function () {\n\t\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.HIDE)\n\t\t\t\t})\n\t\t}\n\t}\n\n\t// computes the maximum space a title can take\n\tprotected getMaxTitleWidth() {\n\t\treturn DOMUtils.getSVGElementSize(this.parent.node() as any, {\n\t\t\tuseAttrs: true\n\t\t}).width\n\t}\n\n\t/**\n\t * Returns the index for a maximum length substring that is less than the width parameter.\n\t * @param title the title node used for getting the text lengths of substrings\n\t * @param start the start index for the binary search\n\t * @param end the end index for the binary search\n\t * @param width the width of the svg container that holds the title\n\t */\n\tprotected getSubstringIndex(title: any, start: number, end: number, width: number): number {\n\t\tconst mid = Math.floor((end + start) / 2)\n\t\tif (title.getSubStringLength(0, mid) > width) {\n\t\t\treturn this.getSubstringIndex(title, start, mid, width)\n\t\t} else if (title.getSubStringLength(0, mid) < width) {\n\t\t\tif (title.getSubStringLength(0, mid + 1) > width) {\n\t\t\t\treturn mid\n\t\t\t}\n\t\t\treturn this.getSubstringIndex(title, mid, end, width)\n\t\t} else {\n\t\t\treturn mid\n\t\t}\n\t}\n}\n","import { select } from 'd3'\nimport { getProperty, truncateLabel } from '@/tools'\nimport { legend as legendConfigs } from '@/configuration'\nimport { Component } from '@/components/component'\nimport {\n\tAlignments,\n\tColorClassNameTypes,\n\tLegendItemType,\n\tRenderTypes,\n\tEvents,\n\tTruncationTypes\n} from '@/interfaces/enums'\nimport { Roles } from '@/interfaces/a11y'\nimport { sanitizeText } from '@/utils/sanitizeHtml'\n\nexport class Legend extends Component {\n\ttype = 'legend'\n\trenderType = RenderTypes.HTML\n\n\t// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n\t// @ts-ignore\n\t// eslint-disable-next-line @typescript-eslint/no-unused-vars\n\trender(animate = false) {\n\t\tconst options = this.getOptions()\n\t\tconst legendOptions = getProperty(options, 'legend')\n\t\tconst alignment = getProperty(legendOptions, 'alignment')\n\n\t\tconst legendOrientation = getProperty(options, 'legend', 'orientation')\n\n\t\tlet dataGroups = this.model.getDataGroups()\n\n\t\t// Check if there are disabled legend items\n\t\tconst { DISABLED } = legendConfigs.items.status\n\t\tconst hasDeactivatedItems = dataGroups.some((dataGroup: any) => dataGroup.status === DISABLED)\n\t\tconst userProvidedOrder = getProperty(legendOptions, 'order')\n\n\t\tconst svg = this.getComponentContainer()\n\t\t\t.classed('center-aligned', alignment === Alignments.CENTER)\n\t\t\t.classed('right-aligned', alignment === Alignments.RIGHT)\n\t\t\t.classed(legendOrientation, true)\n\t\t\t.classed('has-deactivated-items', hasDeactivatedItems)\n\t\t\t.attr('role', Roles.GROUP)\n\t\t\t.attr('aria-label', 'Data groups')\n\t\t\t.attr('data-name', 'legend-items')\n\n\t\tif (userProvidedOrder) {\n\t\t\tdataGroups = this.sortDataGroups(dataGroups, userProvidedOrder)\n\t\t}\n\n\t\tconst legendItems = svg\n\t\t\t.selectAll('div.legend-item')\n\t\t\t.data(dataGroups, (dataGroup: any) => dataGroup.name)\n\n\t\tconst addedLegendItems = legendItems.enter().append('div').attr('class', 'legend-item')\n\n\t\taddedLegendItems.merge(svg.selectAll('div.legend-item')).classed('active', function (d: any) {\n\t\t\treturn d.status === legendConfigs.items.status.ACTIVE\n\t\t})\n\n\t\tconst legendClickable = getProperty(this.getOptions(), 'legend', 'clickable')\n\t\tsvg.classed('clickable', legendClickable && dataGroups.length > 1)\n\n\t\tconst checkboxRadius = legendConfigs.checkbox.radius\n\n\t\tconst addedCheckboxes = addedLegendItems.append('div').classed('checkbox', true)\n\n\t\tconst allCheckboxes = addedCheckboxes\n\t\t\t.merge(legendItems.select('div.checkbox'))\n\t\t\t.attr('role', Roles.CHECKBOX)\n\t\t\t.attr('tabindex', legendClickable ? 0 : -1)\n\t\t\t.attr('aria-labelledby', (_: any, i: number) =>\n\t\t\t\tthis.services.domUtils.generateElementIDString(`legend-datagroup-${i}-title`)\n\t\t\t)\n\t\t\t.attr('aria-checked', ({ status }) => status === legendConfigs.items.status.ACTIVE)\n\t\t\t.attr('width', checkboxRadius * 2)\n\t\t\t.attr('height', checkboxRadius * 2)\n\t\t\t.attr('class', (d: any) =>\n\t\t\t\tthis.model.getColorClassName({\n\t\t\t\t\tclassNameTypes: [ColorClassNameTypes.BACKGROUND],\n\t\t\t\t\tdataGroupName: d.name,\n\t\t\t\t\toriginalClassName: 'checkbox'\n\t\t\t\t})\n\t\t\t)\n\t\t\t.style('background', (d: any) =>\n\t\t\t\td.status === legendConfigs.items.status.ACTIVE\n\t\t\t\t\t? this.model.getFillColor(d.name) || this.model.getStrokeColor(d.name)\n\t\t\t\t\t: null\n\t\t\t)\n\t\t\t.classed('active', function (d: any) {\n\t\t\t\treturn d.status === legendConfigs.items.status.ACTIVE\n\t\t\t})\n\n\t\taddedCheckboxes\n\t\t\t.append('svg')\n\t\t\t.attr('focusable', false)\n\t\t\t.attr('preserveAspectRatio', 'xMidYMid meet')\n\t\t\t.attr('xmlns', 'http://www.w3.org/2000/svg')\n\t\t\t.attr('width', '11')\n\t\t\t.attr('height', '11')\n\t\t\t.attr('viewBox', '0 0 31 28')\n\t\t\t.attr('aria-hidden', true)\n\t\t\t.style('will-change', 'transform')\n\t\t\t.append('path')\n\t\t\t.attr('d', 'M13 21.2l-7.1-7.1-1.4 1.4 7.1 7.1L13 24 27.1 9.9l-1.4-1.5z')\n\n\t\taddedLegendItems.append('p').merge(legendItems.select('p'))\n\n\t\tconst additionalItemsOption = getProperty(options, 'legend', 'additionalItems')\n\n\t\t// add additional legend items\n\t\tif (additionalItemsOption && dataGroups.length) {\n\t\t\tconst self = this\n\n\t\t\tconst additionalItems = svg.selectAll('div.additional-item').data(additionalItemsOption)\n\n\t\t\tadditionalItems.exit().remove()\n\n\t\t\tconst addedAdditionalItems = additionalItems\n\t\t\t\t.enter()\n\t\t\t\t.append('div')\n\t\t\t\t.merge(additionalItems as any)\n\t\t\t\t.classed('legend-item', true)\n\t\t\t\t.classed('additional', true)\n\t\t\t\t.attr('aria-labelledby', (_: any, i: number) =>\n\t\t\t\t\tthis.services.domUtils.generateElementIDString(\n\t\t\t\t\t\t`legend-datagroup-${allCheckboxes.size() + i}-title`\n\t\t\t\t\t)\n\t\t\t\t)\n\n\t\t\t// remove nested child elements that no longer needed\n\t\t\taddedAdditionalItems.selectAll('*').remove()\n\n\t\t\t// get index of item with same type to assign distinct classname\n\t\t\tlet previousType: any\n\t\t\tlet indexOfItem = 1\n\n\t\t\t// add different type of legend items\n\t\t\taddedAdditionalItems\n\t\t\t\t.append('svg')\n\t\t\t\t.classed('icon', true)\n\t\t\t\t.each(function (d: any) {\n\t\t\t\t\tconst additionalItem = select(this)\n\n\t\t\t\t\tif (!previousType || previousType != d.type) {\n\t\t\t\t\t\tpreviousType = d.type\n\t\t\t\t\t\tindexOfItem = 1\n\t\t\t\t\t} else {\n\t\t\t\t\t\tindexOfItem++\n\t\t\t\t\t}\n\n\t\t\t\t\tself.addAdditionalItem(additionalItem, d, indexOfItem)\n\t\t\t\t})\n\n\t\t\taddedAdditionalItems.append('p').merge(addedAdditionalItems.select('p'))\n\n\t\t\tthis.truncateLegendText()\n\t\t}\n\n\t\t// Remove old elements as needed.\n\t\tlegendItems.exit().on('mouseover', null).on('click', null).on('mouseout', null).remove()\n\n\t\tif (legendClickable && addedLegendItems.size() > 1) {\n\t\t\tthis.addEventListeners()\n\t\t}\n\t}\n\n\tsortDataGroups(dataGroups: any, legendOrder: any) {\n\t\t// Sort data in user defined order\n\t\tdataGroups.sort(\n\t\t\t(dataA: { name: string }, dataB: { name: string }) =>\n\t\t\t\tlegendOrder.indexOf(dataA.name) - legendOrder.indexOf(dataB.name)\n\t\t)\n\n\t\t// If user only defined partial ordering, ordered items are placed before unordered ones\n\t\tif (legendOrder.length < dataGroups.length) {\n\t\t\tconst definedOrderIndex = dataGroups.length - legendOrder.length\n\t\t\tconst definedOrder = dataGroups.slice(definedOrderIndex)\n\n\t\t\treturn definedOrder.concat(dataGroups.slice(0, definedOrderIndex))\n\t\t}\n\t\treturn dataGroups\n\t}\n\n\taddAdditionalItem(additionalItem: any, itemConfig: any, indexOfItem: any) {\n\t\tconst { width, height } = legendConfigs.area\n\n\t\tif (itemConfig.type === LegendItemType.RADIUS) {\n\t\t\t// Circular icon\n\t\t\tadditionalItem.style('width', `${height}px`).style('height', `${height}px`)\n\t\t} else {\n\t\t\tadditionalItem.style('width', `${width}px`).style('height', `${height}px`)\n\t\t}\n\n\t\tif (itemConfig.type === LegendItemType.RADIUS) {\n\t\t\tconst { iconData, fill, stroke } = legendConfigs.radius\n\n\t\t\tconst circleEnter = additionalItem\n\t\t\t\t.attr('fill', 'none')\n\t\t\t\t.selectAll('circle')\n\t\t\t\t.data(iconData)\n\t\t\t\t.enter()\n\n\t\t\tcircleEnter\n\t\t\t\t.append('circle')\n\t\t\t\t.classed('radius', true)\n\t\t\t\t.attr('role', Roles.IMG)\n\t\t\t\t.attr('aria-label', 'radius')\n\t\t\t\t.attr('cx', (d: any) => d.cx)\n\t\t\t\t.attr('cy', (d: any) => d.cy)\n\t\t\t\t.attr('r', (d: any) => d.r)\n\t\t\t\t.style('fill', itemConfig.fill ? itemConfig.fill : fill)\n\t\t\t\t.style('stroke', itemConfig.stroke ? itemConfig.stroke : stroke)\n\t\t} else if (itemConfig.type === LegendItemType.LINE) {\n\t\t\tconst lineConfig = legendConfigs.line\n\n\t\t\tif (additionalItem.select('line.line').empty()) {\n\t\t\t\tadditionalItem\n\t\t\t\t\t.append('line')\n\t\t\t\t\t.classed(`line-${indexOfItem}`, true)\n\t\t\t\t\t.attr('role', Roles.IMG)\n\t\t\t\t\t.attr('aria-label', 'line')\n\t\t\t\t\t.attr('x1', 0)\n\t\t\t\t\t.attr('y1', lineConfig.yPosition)\n\t\t\t\t\t.attr('x2', width)\n\t\t\t\t\t.attr('y2', lineConfig.yPosition)\n\t\t\t\t\t.style('stroke', itemConfig.stroke ? itemConfig.stroke : lineConfig.stroke)\n\t\t\t\t\t.style('stroke-width', lineConfig.strokeWidth)\n\t\t\t}\n\t\t} else if (itemConfig.type === LegendItemType.AREA) {\n\t\t\tif (additionalItem.select('rect.area').empty()) {\n\t\t\t\tadditionalItem\n\t\t\t\t\t.append('rect')\n\t\t\t\t\t.classed(`area-${indexOfItem}`, true)\n\t\t\t\t\t.attr('role', Roles.IMG)\n\t\t\t\t\t.attr('aria-label', 'area')\n\t\t\t\t\t.attr('width', width)\n\t\t\t\t\t.attr('height', height)\n\t\t\t\t\t.style(\n\t\t\t\t\t\t'fill',\n\t\t\t\t\t\tindexOfItem > 3 && !itemConfig.fill ? legendConfigs.area.fill : itemConfig.fill\n\t\t\t\t\t)\n\t\t\t\t\t.style('stroke', itemConfig.stroke)\n\t\t\t}\n\t\t} else if (itemConfig.type === LegendItemType.SIZE) {\n\t\t\tconst { iconData, fill, stroke } = legendConfigs.size\n\n\t\t\tconst sizeEnter = additionalItem\n\t\t\t\t.attr('fill', 'none')\n\t\t\t\t.attr('role', Roles.IMG)\n\t\t\t\t.attr('aria-label', 'size')\n\t\t\t\t.selectAll('rect')\n\t\t\t\t.data(iconData)\n\t\t\t\t.enter()\n\n\t\t\tsizeEnter\n\t\t\t\t.append('rect')\n\t\t\t\t.classed('size', true)\n\t\t\t\t.attr('width', (d: any) => d.width)\n\t\t\t\t.attr('height', (d: any) => d.height)\n\t\t\t\t.attr('y', () => 0)\n\t\t\t\t.style('fill', itemConfig.fill ? itemConfig.fill : fill)\n\t\t\t\t.style('stroke', itemConfig.stroke ? itemConfig.stroke : stroke)\n\t\t\t\t.style('stroke-width', 1)\n\t\t} else if (itemConfig.type === LegendItemType.QUARTILE) {\n\t\t\tconst { iconData } = legendConfigs.quartile\n\n\t\t\tconst quartileEnter = additionalItem\n\t\t\t\t.selectAll('rect')\n\t\t\t\t.attr('role', Roles.IMG)\n\t\t\t\t.attr('aria-label', 'quartile')\n\t\t\t\t.data(iconData)\n\t\t\t\t.enter()\n\n\t\t\tquartileEnter\n\t\t\t\t.append('rect')\n\t\t\t\t.attr('class', (_: any, i: number) => `quartile-${i === 0 ? 'wrapper' : 'line'}`)\n\t\t\t\t.attr('x', (d: any) => d.x)\n\t\t\t\t.attr('y', (d: any) => d.y)\n\t\t\t\t.attr('width', (d: any) => d.width)\n\t\t\t\t.attr('height', (d: any) => d.height)\n\t\t} else if (itemConfig.type === LegendItemType.ZOOM) {\n\t\t\tconst { iconData, color } = getProperty(legendConfigs, 'zoom')\n\n\t\t\tconst zoomEnter = additionalItem\n\t\t\t\t.attr('role', Roles.IMG)\n\t\t\t\t.attr('aria-label', 'zoom')\n\t\t\t\t.selectAll('g.icon')\n\t\t\t\t.data(iconData)\n\t\t\t\t.enter()\n\n\t\t\t// add '+' for the magnifying icon\n\t\t\tzoomEnter\n\t\t\t\t.append('g')\n\t\t\t\t.attr('x', (d: any) => d.x)\n\t\t\t\t.attr('y', (d: any) => d.y)\n\t\t\t\t.attr('width', (d: any) => d.width)\n\t\t\t\t.attr('height', (d: any) => d.height)\n\t\t\t\t.append('polygon')\n\t\t\t\t.attr(\n\t\t\t\t\t'points',\n\t\t\t\t\t'7.7 4.82 5.78 4.82 5.78 2.89 4.82 2.89 4.82 4.82 2.89 4.82 2.89 5.78 4.82 5.78 4.82 7.7 5.78 7.7 5.78 5.78 7.7 5.78 7.7 4.82'\n\t\t\t\t)\n\t\t\t\t.attr('fill', () => (itemConfig.color ? itemConfig.color : color))\n\n\t\t\t// add the magnifying zoom icon handle/circle\n\t\t\tzoomEnter\n\t\t\t\t.append('path')\n\t\t\t\t.attr(\n\t\t\t\t\t'd',\n\t\t\t\t\t'M9.36,8.67A5.22,5.22,0,0,0,10.59,5.3,5.3,5.3,0,1,0,5.3,10.59,5.22,5.22,0,0,0,8.67,9.36L12.32,13l.68-.68Zm-4.06,1A4.34,4.34,0,1,1,9.63,5.3,4.33,4.33,0,0,1,5.3,9.63Z'\n\t\t\t\t)\n\t\t\t\t.attr('fill', () => (itemConfig.color ? itemConfig.color : color))\n\t\t}\n\t}\n\n\ttruncateLegendText() {\n\t\tconst svg = this.getComponentContainer()\n\n\t\tconst truncationOptions = getProperty(this.getOptions(), 'legend', 'truncation')\n\t\t// Truncation\n\t\t// get user provided custom values for truncation\n\t\tconst truncationType = getProperty(truncationOptions, 'type')\n\t\tconst truncationThreshold = getProperty(truncationOptions, 'threshold')\n\t\tconst truncationNumCharacter = getProperty(truncationOptions, 'numCharacter')\n\n\t\tconst addedLegendItemsText = svg.selectAll('div.legend-item p')\n\n\t\t// Add an ID for the checkbox to use through `aria-labelledby`\n\t\taddedLegendItemsText.attr('id', function () {\n\t\t\tconst elementToReference: any =\n\t\t\t\t(this as any).parentNode.querySelector('div.checkbox') || (this as any).parentNode\n\n\t\t\treturn elementToReference.getAttribute('aria-labelledby')\n\t\t})\n\n\t\t// truncate the legend label if it's too long\n\t\tif (truncationType !== TruncationTypes.NONE) {\n\t\t\taddedLegendItemsText.html(function (d: any) {\n\t\t\t\tconst _sanitizedLabel = sanitizeText(d.name)\n\t\t\t\tif (\n\t\t\t\t\t_sanitizedLabel.length > truncationThreshold &&\n\t\t\t\t\t_sanitizedLabel.length !== truncationNumCharacter\n\t\t\t\t) {\n\t\t\t\t\treturn truncateLabel(_sanitizedLabel, truncationType, truncationNumCharacter)\n\t\t\t\t} else {\n\t\t\t\t\treturn _sanitizedLabel\n\t\t\t\t}\n\t\t\t})\n\t\t} else {\n\t\t\taddedLegendItemsText.html((d: any) => sanitizeText(d.name))\n\t\t}\n\t}\n\n\taddEventListeners() {\n\t\tconst self = this\n\t\tconst svg = this.getComponentContainer()\n\t\tconst options = this.getOptions()\n\t\tconst legendOptions = getProperty(options, 'legend')\n\t\tconst truncation = getProperty(legendOptions, 'truncation')\n\n\t\tsvg\n\t\t\t.selectAll('div.legend-item')\n\t\t\t.on('mouseover', function (event: MouseEvent) {\n\t\t\t\tself.services.events.dispatchEvent(Events.Legend.ITEM_HOVER, {\n\t\t\t\t\thoveredElement: select(this)\n\t\t\t\t})\n\n\t\t\t\tconst hoveredItem = select(this)\n\t\t\t\thoveredItem.select('div.checkbox').classed('hovered', true)\n\n\t\t\t\t// Show tooltip if character length is greater than threshold & there is no truncation\n\t\t\t\tconst hoveredItemData = hoveredItem.datum() as any\n\t\t\t\tif (\n\t\t\t\t\thoveredItemData.name.length > truncation.threshold &&\n\t\t\t\t\ttruncation.numCharacter < hoveredItemData.name.length &&\n\t\t\t\t\ttruncation.type !== TruncationTypes.NONE\n\t\t\t\t) {\n\t\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.SHOW, {\n\t\t\t\t\t\tevent,\n\t\t\t\t\t\thoveredElement: hoveredItem,\n\t\t\t\t\t\tcontent: hoveredItemData.name\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t})\n\t\t\t.on('mousemove', function (event: MouseEvent) {\n\t\t\t\t// Emit tooltip move event only if tooltip is shown\n\t\t\t\tconst hoveredItemData = select(this).datum() as any\n\t\t\t\tif (\n\t\t\t\t\thoveredItemData.name.length > truncation.threshold &&\n\t\t\t\t\ttruncation.type !== TruncationTypes.NONE\n\t\t\t\t) {\n\t\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.MOVE, {\n\t\t\t\t\t\tevent\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t})\n\t\t\t.on('click', function () {\n\t\t\t\tself.services.events.dispatchEvent(Events.Legend.ITEM_CLICK, {\n\t\t\t\t\tclickedElement: select(this)\n\t\t\t\t})\n\n\t\t\t\tconst clickedItem = select(this)\n\t\t\t\tconst clickedItemData = clickedItem.datum() as any\n\n\t\t\t\tself.model.toggleDataLabel(clickedItemData.name)\n\t\t\t})\n\t\t\t.on('mouseout', function () {\n\t\t\t\tconst hoveredItem = select(this)\n\t\t\t\thoveredItem.select('div.checkbox').classed('hovered', false)\n\n\t\t\t\t// Emit tooltip hide event only if tooltip is shown\n\t\t\t\tconst hoveredItemData = hoveredItem.datum() as any\n\t\t\t\tif (\n\t\t\t\t\thoveredItemData.name.length > truncation.threshold &&\n\t\t\t\t\ttruncation.type !== TruncationTypes.NONE\n\t\t\t\t) {\n\t\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.HIDE)\n\t\t\t\t}\n\n\t\t\t\tself.services.events.dispatchEvent(Events.Legend.ITEM_MOUSEOUT, {\n\t\t\t\t\thoveredElement: hoveredItem\n\t\t\t\t})\n\t\t\t})\n\n\t\tsvg.selectAll('div.legend-item div.checkbox').on('keyup', function (event: KeyboardEvent) {\n\t\t\tif (event.key && event.key === 'Tab') {\n\t\t\t\t// Higlight group\n\t\t\t\tself.services.events.dispatchEvent(Events.Legend.ITEM_HOVER, {\n\t\t\t\t\thoveredElement: select(this)\n\t\t\t\t})\n\t\t\t}\n\t\t})\n\n\t\tsvg\n\t\t\t.selectAll('div.legend-item div.checkbox')\n\t\t\t.on('keydown', function (event: KeyboardEvent, d: any) {\n\t\t\t\tif (event.key && event.key === ' ') {\n\t\t\t\t\tevent.preventDefault()\n\t\t\t\t\tself.model.toggleDataLabel(d.name)\n\t\t\t\t} else if (event.key && event.key === 'Tab') {\n\t\t\t\t\t// Unhiglight group\n\t\t\t\t\tself.services.events.dispatchEvent(Events.Legend.ITEM_MOUSEOUT, {\n\t\t\t\t\t\thoveredElement: select(this)\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t})\n\n\t\tsvg.selectAll('g.additional-item').on('mouseover', function (event: MouseEvent) {\n\t\t\tconst hoveredItem = select(this)\n\n\t\t\tconst hoveredItemData = hoveredItem.datum() as any\n\t\t\tif (hoveredItemData.name.length > truncation.threshold) {\n\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.SHOW, {\n\t\t\t\t\tevent,\n\t\t\t\t\thoveredElement: hoveredItem,\n\t\t\t\t\tcontent: hoveredItemData.name\n\t\t\t\t})\n\t\t\t}\n\t\t})\n\t}\n}\n","import { Component } from '@/components/component'\nimport { DOMUtils } from '@/services/essentials/dom-utils'\nimport type { ChartModel } from '@/model/model'\nimport { RenderTypes } from '@/interfaces/enums'\nimport type { Selection } from 'd3'\n\n// This class is used to create the clipPath to clip the chart components\n// It's necessary for zoom in/out behavior\nexport class ChartClip extends Component {\n\ttype = 'chart-clip'\n\trenderType = RenderTypes.SVG\n\n\t// Give every chart-clip a distinct ID\n\t// so they don't interfere each other in a page with multiple charts\n\tchartClipId = 'chart-clip-id-' + Math.floor(Math.random() * 99999999999)\n\n\tchartClipPath: any\n\n\tconstructor(model: ChartModel, services: any, configs?: any) {\n\t\tsuper(model, services, configs)\n\t\tthis.init()\n\t}\n\n\tinit() {\n\t\t// set unique chartClipId in this chart to model\n\t\tthis.model.set({ chartClipId: this.chartClipId }, { skipUpdate: true })\n\t}\n\n\t// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n\t// @ts-ignore\n\t// eslint-disable-next-line @typescript-eslint/no-unused-vars\n\trender(animate = true) {\n\t\t// Create the clipPath\n\t\tthis.createClipPath()\n\t}\n\n\tcreateClipPath() {\n\t\tconst svg = this.parent\n\t\tconst { cartesianScales } = this.services\n\t\tif (!cartesianScales) throw new Error('Service cartesianScales was undefined')\n\t\tconst mainXScale = cartesianScales.getMainXScale()\n\t\tconst mainYScale = cartesianScales.getMainYScale()\n\n\t\tconst [xScaleStart, xScaleEnd]: number[] = mainXScale.range()\n\t\tconst [yScaleEnd, yScaleStart]: number[] = mainYScale.range()\n\n\t\t// Get height\n\t\tif (!svg) {\n\t\t\tthrow new Error('svg is undefined')\n\t\t}\n\n\t\tthis.chartClipPath = DOMUtils.appendOrSelect(\n\t\t\tsvg as Selection,\n\t\t\t`clipPath.${this.type}`\n\t\t).attr('id', this.chartClipId)\n\t\tconst clipRect = DOMUtils.appendOrSelect(this.chartClipPath, `rect.${this.type}`) as Selection<\n\t\t\tany,\n\t\t\tany,\n\t\t\tHTMLElement,\n\t\t\tany\n\t\t>\n\n\t\tif (xScaleEnd - xScaleStart > 0) {\n\t\t\tclipRect\n\t\t\t\t.attr('x', xScaleStart)\n\t\t\t\t.attr('y', yScaleStart)\n\t\t\t\t.attr('width', xScaleEnd - xScaleStart)\n\t\t\t\t.attr('height', yScaleEnd - yScaleStart)\n\t\t}\n\n\t\tthis.chartClipPath.merge(clipRect).lower()\n\t}\n}\n","// Internal Imports\nimport { ChartClip } from '@/components/axes/chart-clip'\nimport { DOMUtils } from '@/services/essentials/dom-utils'\n\n// This class is used to create the clipPath to clip the chart components\n// It's necessary for zoom in/out behavior\nexport class CanvasChartClip extends ChartClip {\n\ttype = 'canvas-chart-clip'\n\n\t// Give every chart-clip a distinct ID\n\t// so they don't interfere each other in a page with multiple charts\n\tchartClipId = 'canvas-chart-clip-id-' + Math.floor(Math.random() * 99999999999)\n\n\tcreateClipPath() {\n\t\tconst svg = this.parent\n\t\tconst { width, height } = DOMUtils.getSVGElementSize(this.parent as any, {\n\t\t\tuseAttrs: true\n\t\t})\n\n\t\tthis.chartClipPath = DOMUtils.appendOrSelect(svg, `clipPath.${this.type}`).attr(\n\t\t\t'id',\n\t\t\tthis.chartClipId\n\t\t)\n\t\tconst clipRect = DOMUtils.appendOrSelect(this.chartClipPath, `rect.${this.type}`)\n\n\t\tclipRect.attr('x', 0).attr('y', 0).attr('width', width).attr('height', height)\n\n\t\tthis.chartClipPath.merge(clipRect).lower()\n\t}\n}\n","/**\n * Utilites to manipulate the position of elements relative to other elements\n */\nvar _a;\nexport var PLACEMENTS;\n(function (PLACEMENTS) {\n PLACEMENTS[\"LEFT\"] = \"left\";\n PLACEMENTS[\"RIGHT\"] = \"right\";\n PLACEMENTS[\"TOP\"] = \"top\";\n PLACEMENTS[\"BOTTOM\"] = \"bottom\";\n})(PLACEMENTS || (PLACEMENTS = {}));\nexport var defaultPositions = (_a = {},\n _a[PLACEMENTS.LEFT] = function (referenceOffset, target, referenceRect) { return ({\n top: referenceOffset.top - Math.round(target.offsetHeight / 2) + Math.round(referenceRect.height / 2),\n left: Math.round(referenceOffset.left - target.offsetWidth)\n }); },\n _a[PLACEMENTS.RIGHT] = function (referenceOffset, target, referenceRect) { return ({\n top: referenceOffset.top - Math.round(target.offsetHeight / 2) + Math.round(referenceRect.height / 2),\n left: Math.round(referenceOffset.left + referenceRect.width)\n }); },\n _a[PLACEMENTS.TOP] = function (referenceOffset, target, referenceRect) { return ({\n top: Math.round(referenceOffset.top - target.offsetHeight),\n left: referenceOffset.left - Math.round(target.offsetWidth / 2) + Math.round(referenceRect.width / 2)\n }); },\n _a[PLACEMENTS.BOTTOM] = function (referenceOffset, target, referenceRect) { return ({\n top: Math.round(referenceOffset.top + referenceRect.height),\n left: referenceOffset.left - Math.round(target.offsetWidth / 2) + Math.round(referenceRect.width / 2)\n }); },\n _a);\nvar windowRef = typeof window !== \"undefined\" ? window : {\n innerHeight: 0,\n scrollY: 0,\n innerWidth: 0,\n scrollX: 0\n};\nvar Position = /** @class */ (function () {\n function Position(positions) {\n if (positions === void 0) { positions = {}; }\n this.positions = defaultPositions;\n this.positions = Object.assign({}, defaultPositions, positions);\n }\n Position.prototype.getRelativeOffset = function (target) {\n // start with the initial element offsets\n var offsets = {\n left: target.offsetLeft,\n top: target.offsetTop\n };\n // get each static (i.e. not absolute or relative) offsetParent and sum the left/right offsets\n while (target.offsetParent && getComputedStyle(target.offsetParent).position === \"static\") {\n offsets.left += target.offsetLeft;\n offsets.top += target.offsetTop;\n target = target.offsetParent;\n }\n return offsets;\n };\n Position.prototype.getAbsoluteOffset = function (target) {\n var currentNode = target;\n var margins = {\n top: 0,\n left: 0\n };\n // searches for containing elements with additional margins\n while (currentNode.offsetParent) {\n var computed = getComputedStyle(currentNode.offsetParent);\n // find static elements with additional margins\n // since they tend to throw off our positioning\n // (usually this is just the body)\n if (computed.position === \"static\" &&\n computed.marginLeft &&\n computed.marginTop) {\n if (parseInt(computed.marginTop, 10)) {\n margins.top += parseInt(computed.marginTop, 10);\n }\n if (parseInt(computed.marginLeft, 10)) {\n margins.left += parseInt(computed.marginLeft, 10);\n }\n }\n currentNode = currentNode.offsetParent;\n }\n var targetRect = target.getBoundingClientRect();\n var relativeRect = document.body.getBoundingClientRect();\n return {\n top: targetRect.top - relativeRect.top + margins.top,\n left: targetRect.left - relativeRect.left + margins.left\n };\n };\n // finds the position relative to the `reference` element\n Position.prototype.findRelative = function (reference, target, placement) {\n var referenceOffset = this.getRelativeOffset(reference);\n var referenceRect = reference.getBoundingClientRect();\n return this.calculatePosition(referenceOffset, referenceRect, target, placement);\n };\n Position.prototype.findAbsolute = function (reference, target, placement) {\n var referenceOffset = this.getAbsoluteOffset(reference);\n var referenceRect = reference.getBoundingClientRect();\n return this.calculatePosition(referenceOffset, referenceRect, target, placement);\n };\n Position.prototype.findPosition = function (reference, target, placement, offsetFunction) {\n if (offsetFunction === void 0) { offsetFunction = this.getAbsoluteOffset.bind(this); }\n var referenceOffset = offsetFunction(reference);\n var referenceRect = reference.getBoundingClientRect();\n return this.calculatePosition(referenceOffset, referenceRect, target, placement);\n };\n Position.prototype.findPositionAt = function (offset, target, placement) {\n return this.calculatePosition(offset, { top: 0, left: 0, height: 0, width: 0 }, target, placement);\n };\n /**\n * Get the dimensions of an element from an AbsolutePosition and a reference element\n */\n Position.prototype.getPlacementBox = function (target, position) {\n var targetBottom = target.offsetHeight + position.top;\n var targetRight = target.offsetWidth + position.left;\n return {\n top: position.top,\n bottom: targetBottom,\n left: position.left,\n right: targetRight\n };\n };\n Position.prototype.addOffset = function (position, top, left) {\n if (top === void 0) { top = 0; }\n if (left === void 0) { left = 0; }\n return Object.assign({}, position, {\n top: position.top + top,\n left: position.left + left\n });\n };\n Position.prototype.setElement = function (element, position) {\n element.style.top = position.top + \"px\";\n element.style.left = position.left + \"px\";\n };\n Position.prototype.findBestPlacement = function (reference, target, placements, containerFunction, positionFunction) {\n var _this = this;\n if (containerFunction === void 0) { containerFunction = this.defaultContainerFunction.bind(this); }\n if (positionFunction === void 0) { positionFunction = this.findPosition.bind(this); }\n /**\n * map over the array of placements and weight them based on the percentage of visible area\n * where visible area is defined as the area not obscured by the window borders\n */\n var weightedPlacements = placements.map(function (placement) {\n var pos = positionFunction(reference, target, placement);\n var box = _this.getPlacementBox(target, pos);\n var hiddenHeight = 0;\n var hiddenWidth = 0;\n var container = containerFunction();\n // the element is exceeding from top or bottom of its container\n if (box.top < container.top) {\n hiddenHeight = container.top - box.top;\n }\n else if (box.bottom > container.height) {\n hiddenHeight = box.bottom - container.height;\n }\n // the element is exceeding from left or right of its container\n if (box.left < container.left) {\n hiddenWidth = container.left - box.left;\n }\n else if (box.right > container.width) {\n hiddenWidth = box.right - container.width;\n }\n // if one of the hidden dimensions is 0 but the other is > 0\n // we want to have a positive area, so setting the null one to 1\n if (hiddenHeight && !hiddenWidth) {\n hiddenWidth = 1;\n }\n else if (hiddenWidth && !hiddenHeight) {\n hiddenHeight = 1;\n }\n var area = target.offsetHeight * target.offsetWidth;\n var hiddenArea = hiddenHeight * hiddenWidth;\n // if visibleArea is 0 it means the element is fully outside container bounds\n // and visiblePercent will then be 0\n var visibleArea = area - hiddenArea;\n var visiblePercent = visibleArea / area;\n return {\n placement: placement,\n weight: visiblePercent\n };\n });\n // sort the placements from best to worst\n weightedPlacements.sort(function (a, b) { return b.weight - a.weight; });\n // pick the best!\n return weightedPlacements[0].placement;\n };\n Position.prototype.findBestPlacementAt = function (offset, target, placements, containerFunction) {\n var _this = this;\n if (containerFunction === void 0) { containerFunction = this.defaultContainerFunction.bind(this); }\n var positionAt = function (_, target, placement) {\n return _this.findPositionAt(offset, target, placement);\n };\n return this.findBestPlacement(null, target, placements, containerFunction, positionAt);\n };\n Position.prototype.defaultContainerFunction = function () {\n return {\n // we go with window here, because that's going to be the simple/common case\n top: 0,\n left: 0,\n height: windowRef.innerHeight,\n width: windowRef.innerWidth\n };\n };\n Position.prototype.calculatePosition = function (referenceOffset, referenceRect, target, placement) {\n if (this.positions[placement]) {\n return this.positions[placement](referenceOffset, target, referenceRect);\n }\n console.error(\"No function found for placement, defaulting to 0,0\");\n return { left: 0, top: 0 };\n };\n return Position;\n}());\nexport { Position };\nexport var position = new Position();\nexport default Position;\n//# sourceMappingURL=../src/index.js.map","import { select, pointer } from 'd3'\nimport { Position, PLACEMENTS } from '@carbon/utils-position' // position service\nimport { getProperty, truncateLabel } from '@/tools'\nimport { zoomBar as zoomBarConfigs, tooltips as tooltipConfigs } from '@/configuration'\nimport { carbonPrefix } from '@/configuration-non-customizable' // CSS prefix\nimport { Component } from '@/components/component'\nimport { DOMUtils } from '@/services/essentials/dom-utils'\nimport type { ChartModel } from '@/model/model'\nimport { Events, RenderTypes, TruncationTypes } from '@/interfaces/enums'\nimport { sanitizeHtml } from '@/utils/sanitizeHtml'\n\nexport class Tooltip extends Component {\n\ttype = 'tooltip'\n\trenderType = RenderTypes.HTML\n\n\t// flag for checking whether tooltip event listener is added or not\n\tisEventListenerAdded = false\n\tlastTriggeredEventType = ''\n\ttooltip: any\n\tpositionService = new Position()\n\n\tconstructor(model: ChartModel, services: any, configs?: any) {\n\t\tsuper(model, services, configs)\n\n\t\tthis.init()\n\t}\n\n\thandleShowTooltip = (e: any) => {\n\t\tconst data = e.detail.data || e.detail.items\n\t\tconst datum = select(e.detail.event.target).datum()\n\n\t\tlet defaultHTML: any\n\t\tconst formattedItems = this.formatItems(this.getItems(e))\n\n\t\tif (e.detail.content) {\n\t\t\tdefaultHTML = ``\n\t\t} else {\n\t\t\tdefaultHTML = sanitizeHtml(this.getTooltipHTML(formattedItems))\n\t\t}\n\n\t\tconst tooltipTextContainer = DOMUtils.appendOrSelect(this.tooltip, 'div.content-box')\n\n\t\t// if there is a provided tooltip HTML function call it\n\t\tif (getProperty(this.getOptions(), 'tooltip', 'customHTML')) {\n\t\t\tif (e.detail.content) {\n\t\t\t\tconst labelHTML = ``\n\t\t\t\ttooltipTextContainer.html(labelHTML)\n\t\t\t} else {\n\t\t\t\ttooltipTextContainer.html(\n\t\t\t\t\t``\n\t\t\t\t)\n\t\t\t}\n\t\t} else {\n\t\t\t// Use default tooltip\n\t\t\ttooltipTextContainer.html(defaultHTML)\n\t\t}\n\n\t\t// Apply custom background colors\n\t\ttooltipTextContainer.selectAll('.datapoint-tooltip').each(function (_: any, i: number) {\n\t\t\tconst item = formattedItems[i]\n\n\t\t\tif (formattedItems[i] && formattedItems[i].color) {\n\t\t\t\tselect(this)\n\t\t\t\t\t.select('.tooltip-color')\n\t\t\t\t\t.attr('class', 'tooltip-color')\n\t\t\t\t\t.style('background-color', item.color)\n\t\t\t}\n\t\t})\n\n\t\t// Position the tooltip\n\t\tthis.positionTooltip(e)\n\n\t\t// Fade in\n\t\tthis.tooltip.classed('hidden', false).attr('aria-hidden', false)\n\n\t\t// Store the latest triggered custom event type\n\t\tthis.lastTriggeredEventType = e.type\n\t}\n\n\thandleHideTooltip = () => {\n\t\tthis.tooltip.classed('hidden', true).attr('aria-hidden', true)\n\t}\n\n\taddTooltipEventListener() {\n\t\t// listen to move-tooltip Custom Events to move the tooltip\n\t\tthis.services.events.addEventListener(Events.Tooltip.MOVE, (e: CustomEvent) => {\n\t\t\tif (\n\t\t\t\tthis.lastTriggeredEventType !== Events.Toolbar.SHOW_TOOLTIP &&\n\t\t\t\tthis.tooltip.classed('hidden') === false\n\t\t\t) {\n\t\t\t\tthis.positionTooltip(e)\n\t\t\t}\n\t\t})\n\n\t\t// listen to show-tooltip Custom Events to render the tooltip\n\t\tthis.services.events.addEventListener(Events.Tooltip.SHOW, this.handleShowTooltip)\n\n\t\t// listen to hide-tooltip Custom Events to hide the tooltip\n\t\tthis.services.events.addEventListener(Events.Tooltip.HIDE, this.handleHideTooltip)\n\n\t\t// listen to chart-mouseout event to hide the tooltip\n\t\tthis.services.events.addEventListener(Events.Chart.MOUSEOUT, this.handleHideTooltip)\n\n\t\t// listen to toolbar events\n\t\tthis.services.events.addEventListener(Events.Toolbar.SHOW_TOOLTIP, this.handleShowTooltip)\n\t\tthis.services.events.addEventListener(Events.Toolbar.HIDE_TOOLTIP, this.handleHideTooltip)\n\t}\n\n\tremoveTooltipEventListener() {\n\t\t// remove move-tooltip Custom Events\n\t\tthis.services.events.removeEventListener(Events.Tooltip.MOVE, null)\n\n\t\t// remove show-tooltip Custom Events\n\t\tthis.services.events.removeEventListener(Events.Tooltip.SHOW, this.handleShowTooltip)\n\n\t\t// remove hide-tooltip Custom Events\n\t\tthis.services.events.removeEventListener(Events.Tooltip.HIDE, this.handleHideTooltip)\n\n\t\t// remove the listener on chart-mouseout\n\t\tthis.services.events.removeEventListener(Events.Chart.MOUSEOUT, this.handleHideTooltip)\n\n\t\t// remove the listener of the toolbar\n\t\tthis.services.events.removeEventListener(Events.Toolbar.SHOW_TOOLTIP, this.handleShowTooltip)\n\t\tthis.services.events.removeEventListener(Events.Toolbar.HIDE_TOOLTIP, this.handleHideTooltip)\n\t}\n\n\tgetItems(e: CustomEvent) {\n\t\tif (e.detail.items) {\n\t\t\treturn e.detail.items\n\t\t}\n\n\t\treturn []\n\t}\n\n\tformatItems(items: any) {\n\t\tconst options = this.getOptions()\n\n\t\t// get user provided custom values for truncation\n\t\tconst truncationType = getProperty(options, 'tooltip', 'truncation', 'type')\n\n\t\tconst truncationThreshold = getProperty(options, 'tooltip', 'truncation', 'threshold')\n\n\t\tconst truncationNumCharacter = getProperty(options, 'tooltip', 'truncation', 'numCharacter')\n\n\t\t// truncate the label if it's too long\n\t\t// only applies to discrete type\n\t\tif (truncationType !== TruncationTypes.NONE) {\n\t\t\treturn items.map((item: any) => {\n\t\t\t\t// get width of the label icon if it exists\n\t\t\t\tconst labelIconSize = item.labelIcon ? 12 : 0\n\n\t\t\t\titem.value = item.value ? this.valueFormatter(item.value, item.label) : item.value\n\t\t\t\tif (item.label && item.label.length + labelIconSize > truncationThreshold) {\n\t\t\t\t\titem.label = truncateLabel(item.label, truncationType, truncationNumCharacter)\n\t\t\t\t}\n\n\t\t\t\tif (item.value && item.value.length > truncationThreshold) {\n\t\t\t\t\titem.value = truncateLabel(item.value, truncationType, truncationNumCharacter)\n\t\t\t\t}\n\n\t\t\t\treturn item\n\t\t\t})\n\t\t} else {\n\t\t\treturn items.map((item: any) => {\n\t\t\t\titem.value = item.value ? this.valueFormatter(item.value, item.label) : item.value\n\t\t\t\treturn item\n\t\t\t})\n\t\t}\n\t}\n\n\tgetTooltipHTML(formattedItems: any) {\n\t\treturn (\n\t\t\t``\n\t\t)\n\t}\n\n\tisDate(value: any): value is Date {\n\t\treturn value instanceof Date\n\t}\n\n\tvalueFormatter(value: number | Date, label: string) {\n\t\tconst options = this.getOptions()\n\t\tconst valueFormatter = getProperty(options, 'tooltip', 'valueFormatter')\n\t\tconst {\n\t\t\tcode: localeCode,\n\t\t\tnumber: numberFormatter,\n\t\t\tdate: dateFormatter\n\t\t} = getProperty(options, 'locale')\n\n\t\tif (valueFormatter) {\n\t\t\treturn valueFormatter(value, label)\n\t\t}\n\n\t\tif (this.isDate(value)) {\n\t\t\treturn dateFormatter(value, localeCode, { month: 'short', day: 'numeric', year: 'numeric' })\n\t\t}\n\n\t\ttry {\n\t\t\t// it's a correct ISO format Date string\n\t\t\tif (typeof value === 'string' && /\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}.\\d{3}Z/.test(value)) {\n\t\t\t\tconst newDate = new Date(value)\n\t\t\t\treturn dateFormatter(newDate, localeCode, {\n\t\t\t\t\tmonth: 'short',\n\t\t\t\t\tday: 'numeric',\n\t\t\t\t\tyear: 'numeric'\n\t\t\t\t})\n\t\t\t}\n\t\t} catch (e) {\n\t\t\t// not a valid ISO format string\n\t\t}\n\n\t\treturn numberFormatter(value, localeCode)\n\t}\n\n\t// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n\t// @ts-ignore\n\t// eslint-disable-next-line @typescript-eslint/no-unused-vars\n\trender(animate = false) {\n\t\tconst options = this.getOptions()\n\t\tconst isTooltipEnabled = getProperty(options, 'tooltip', 'enabled')\n\t\tif (isTooltipEnabled) {\n\t\t\t// Grab the tooltip element\n\t\t\tconst holder = select(this.services.domUtils.getHolder())\n\t\t\tconst chartprefix = getProperty(options, 'style', 'prefix')\n\t\t\tthis.tooltip = DOMUtils.appendOrSelect(holder, `div.${carbonPrefix}--${chartprefix}--tooltip`)\n\n\t\t\tthis.tooltip.style('max-width', null).attr('role', 'tooltip')\n\n\t\t\tif (!this.isEventListenerAdded) {\n\t\t\t\tthis.addTooltipEventListener()\n\t\t\t\tthis.isEventListenerAdded = true\n\t\t\t}\n\t\t\tthis.tooltip.classed('hidden', true)\n\t\t} else if (!isTooltipEnabled && this.isEventListenerAdded) {\n\t\t\t// remove tooltip eventListener\n\t\t\tthis.removeTooltipEventListener()\n\t\t\tthis.isEventListenerAdded = false\n\t\t}\n\t}\n\n\taddOffsetByPlacement(position: any, placement: string, offset: number) {\n\t\tconst newOffset = Object.assign({}, position)\n\t\tif (placement == PLACEMENTS.LEFT) {\n\t\t\tnewOffset.left -= offset\n\t\t} else if (placement == PLACEMENTS.RIGHT) {\n\t\t\tnewOffset.left += offset\n\t\t} else if (placement == PLACEMENTS.TOP) {\n\t\t\tnewOffset.top -= offset\n\t\t} else if (placement == PLACEMENTS.BOTTOM) {\n\t\t\tnewOffset.top += offset\n\t\t}\n\t\treturn newOffset\n\t}\n\n\tpositionTooltip(e: CustomEvent) {\n\t\tconst holder = this.services.domUtils.getHolder()\n\t\tconst holderWidth = holder.offsetWidth\n\t\tconst holderHeight = holder.offsetHeight\n\t\tconst target = this.tooltip.node()\n\t\tconst options = this.getOptions()\n\t\tconst isTopZoomBarEnabled = getProperty(options, 'zoomBar', 'top', 'enabled')\n\t\tconst noWrap = !!getProperty(e, 'detail', 'noWrap')\n\t\tconst hasCustomPlacements = Array.isArray(getProperty(e, 'detail', 'placements'))\n\t\tconst placements = hasCustomPlacements\n\t\t\t? getProperty(e, 'detail', 'placements')\n\t\t\t: [PLACEMENTS.RIGHT, PLACEMENTS.LEFT, PLACEMENTS.TOP, PLACEMENTS.BOTTOM]\n\n\t\tlet bestPlacementOption: any\n\t\tlet { horizontalOffset } = tooltipConfigs\n\t\tconst { defaultOffset } = tooltipConfigs\n\n\t\tthis.tooltip.select('div.title-tooltip').classed('title-tooltip-nowrap', noWrap)\n\n\t\t// set tooltip based on reference element with candidate placements\n\t\tif (hasCustomPlacements) {\n\t\t\tconst hoveredElement = getProperty(e, 'detail', 'event', 'target')\n\t\t\t// calculate the best placement from array \"placements\"\n\t\t\tconst hoveredPos = this.services.domUtils.getElementOffset(hoveredElement, true)\n\t\t\tbestPlacementOption = this.positionService.findBestPlacementAt(\n\t\t\t\thoveredPos,\n\t\t\t\ttarget,\n\t\t\t\tplacements,\n\t\t\t\t() => ({\n\t\t\t\t\ttop: 0,\n\t\t\t\t\tleft: 0,\n\t\t\t\t\twidth: holderWidth,\n\t\t\t\t\theight: holderHeight\n\t\t\t\t})\n\t\t\t)\n\t\t\tlet bestPos = this.positionService.findPosition(\n\t\t\t\thoveredElement,\n\t\t\t\ttarget,\n\t\t\t\tbestPlacementOption,\n\t\t\t\t() => this.services.domUtils.getElementOffset(hoveredElement)\n\t\t\t)\n\t\t\tbestPos = this.addOffsetByPlacement(bestPos, bestPlacementOption, defaultOffset)\n\t\t\tthis.positionService.setElement(target, bestPos)\n\t\t\treturn\n\t\t}\n\n\t\t// set tooltip based on mouse positions\n\t\tlet mouseRelativePos = getProperty(e, 'detail', 'mousePosition')\n\t\tif (!mouseRelativePos) {\n\t\t\tmouseRelativePos = pointer(getProperty(e, 'detail', 'event'), holder)\n\t\t} else {\n\t\t\tconst zoombarType = getProperty(options, 'zoomBar', 'top', 'type') as\n\t\t\t\t| 'graph_view'\n\t\t\t\t| 'slider_view'\n\t\t\tconst zoombarHeight = zoomBarConfigs.height[zoombarType]\n\n\t\t\t// if the mouse position is from event (ruler)\n\t\t\t// we need add zoom bar height\n\t\t\tif (isTopZoomBarEnabled) {\n\t\t\t\tmouseRelativePos[1] += zoombarHeight + zoomBarConfigs.spacerHeight\n\n\t\t\t\t// TODO - we need to add toolbar height when toolbar is available\n\t\t\t}\n\t\t}\n\n\t\tif (mouseRelativePos[0] / holderWidth > 0.9) {\n\t\t\tbestPlacementOption = PLACEMENTS.LEFT\n\t\t} else if (mouseRelativePos[0] / holderWidth < 0.1) {\n\t\t\tbestPlacementOption = PLACEMENTS.RIGHT\n\t\t} else {\n\t\t\t// Find out whether tooltip should be shown on the left or right side\n\t\t\tbestPlacementOption = this.positionService.findBestPlacementAt(\n\t\t\t\t{\n\t\t\t\t\tleft: mouseRelativePos[0],\n\t\t\t\t\ttop: mouseRelativePos[1]\n\t\t\t\t},\n\t\t\t\ttarget,\n\t\t\t\tplacements,\n\t\t\t\t() => ({\n\t\t\t\t\ttop: undefined, // properties were never set to optional (probably should)\n\t\t\t\t\tleft: undefined, // ditto\n\t\t\t\t\twidth: holderWidth,\n\t\t\t\t\theight: holderHeight\n\t\t\t\t})\n\t\t\t)\n\t\t}\n\n\t\tif (bestPlacementOption === PLACEMENTS.LEFT) {\n\t\t\thorizontalOffset *= -1\n\t\t}\n\n\t\t// Get coordinates to where tooltip should be positioned\n\t\tconst pos = this.positionService.findPositionAt(\n\t\t\t{\n\t\t\t\tleft: mouseRelativePos[0] + horizontalOffset,\n\t\t\t\ttop: mouseRelativePos[1]\n\t\t\t},\n\t\t\ttarget,\n\t\t\tbestPlacementOption\n\t\t)\n\n\t\tthis.positionService.setElement(target, pos)\n\t}\n}\n","import { brushX, pointer, scaleTime } from 'd3'\nimport { Component } from '@/components/component'\nimport { RenderTypes, ScaleTypes } from '@/interfaces/enums'\nimport { DOMUtils } from '@/services/essentials/dom-utils'\nimport { Selection } from 'd3'\n\n// This class is used for handle brush events in chart\nexport class ChartBrush extends Component {\n\tstatic DASH_LENGTH = 4\n\n\ttype = 'grid-brush'\n\trenderType = RenderTypes.SVG\n\n\tselectionSelector = 'rect.selection' // needs to match the class name in d3.brush\n\n\tfrontSelectionSelector = 'rect.frontSelection' // needs to match the class name in _grid-brush.scss\n\n\t// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n\t// @ts-ignore\n\t// eslint-disable-next-line @typescript-eslint/no-unused-vars\n\trender(animate = true) {\n\t\tconst svg = this.parent\n\n\t\t// use this area to display selection above all graphs\n\t\tconst frontSelectionArea = this.getComponentContainer({\n\t\t\tisPresentational: true\n\t\t})\n\t\tif (!svg) throw new Error('SVG was not defined')\n\t\tconst backdrop = DOMUtils.appendOrSelect(\n\t\t\tsvg as Selection,\n\t\t\t'svg.chart-grid-backdrop'\n\t\t)\n\t\t// use this area to handle d3 brush events\n\t\tconst brushArea = DOMUtils.appendOrSelect(backdrop, `g.${this.type}`)\n\n\t\t// set an id for rect.selection to be referred\n\t\tconst d3Selection = DOMUtils.appendOrSelect(brushArea, this.selectionSelector)\n\n\t\tconst { width, height } = DOMUtils.getSVGElementSize(backdrop, {\n\t\t\tuseAttrs: true\n\t\t})\n\n\t\tconst { cartesianScales } = this.services\n\t\tconst mainXScaleType = cartesianScales.getMainXScaleType()\n\t\tconst mainXScale = cartesianScales.getMainXScale()\n\t\tconst [xScaleStart] = mainXScale.range()\n\t\tfrontSelectionArea.attr('transform', `translate(${xScaleStart},0)`)\n\t\tconst frontSelection = DOMUtils.appendOrSelect(frontSelectionArea, this.frontSelectionSelector)\n\n\t\tif (mainXScale && mainXScaleType === ScaleTypes.TIME) {\n\t\t\t// get current zoomDomain\n\t\t\tlet zoomDomain = this.model.get('zoomDomain')\n\t\t\tif (zoomDomain === undefined) {\n\t\t\t\t// default to full range with extended domain\n\t\t\t\tzoomDomain = this.services.zoom.getDefaultZoomBarDomain()\n\t\t\t\tif (zoomDomain) {\n\t\t\t\t\tthis.model.set({ zoomDomain: zoomDomain }, { animate: false })\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst updateSelectionDash = (selection: any) => {\n\t\t\t\t// set end drag point to dash\n\t\t\t\tconst selectionWidth = selection[1] - selection[0]\n\t\t\t\tlet dashArray = '0,' + selectionWidth.toString() // top (invisible)\n\n\t\t\t\t// right\n\t\t\t\tconst dashCount = Math.floor(height / ChartBrush.DASH_LENGTH)\n\t\t\t\tconst totalRightDash = dashCount * ChartBrush.DASH_LENGTH\n\t\t\t\tfor (let i = 0; i < dashCount; i++) {\n\t\t\t\t\tdashArray += ',' + ChartBrush.DASH_LENGTH // for each full length dash\n\t\t\t\t}\n\t\t\t\tdashArray += ',' + (height - totalRightDash) // for rest of the right height\n\t\t\t\t// if dash count is even, one more \",0\" is needed to make total right dash pattern even\n\t\t\t\tif (dashCount % 2 === 1) {\n\t\t\t\t\tdashArray += ',0'\n\t\t\t\t}\n\t\t\t\tdashArray += ',' + selectionWidth.toString() // bottom (invisible)\n\t\t\t\tdashArray += ',' + height.toString() // left\n\t\t\t\tfrontSelection.attr('stroke-dasharray', dashArray)\n\t\t\t}\n\n\t\t\tconst brushEventHandler = (event: any) => {\n\t\t\t\t// selection range: [0, width]\n\t\t\t\tconst selection = event.selection\n\t\t\t\tif (selection === null || selection[0] === selection[1]) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\n\t\t\t\t// copy the d3 selection attrs to front selection element\n\t\t\t\tfrontSelection\n\t\t\t\t\t.attr('x', parseFloat(d3Selection.attr('x')) + parseFloat(backdrop.attr('x')))\n\t\t\t\t\t.attr('y', d3Selection.attr('y'))\n\t\t\t\t\t.attr('width', d3Selection.attr('width'))\n\t\t\t\t\t.attr('height', d3Selection.attr('height'))\n\t\t\t\t\t.style('cursor', 'pointer')\n\t\t\t\t\t.style('display', null)\n\n\t\t\t\tupdateSelectionDash(selection)\n\t\t\t}\n\n\t\t\t// assume max range is [0, width]\n\t\t\tconst updateZoomDomain = (startPoint: any, endPoint: any) => {\n\t\t\t\t// create xScale based on current zoomDomain\n\t\t\t\tconst xScale = scaleTime().range([0, width]).domain(zoomDomain)\n\n\t\t\t\tlet newDomain = [xScale.invert(startPoint), xScale.invert(endPoint)]\n\t\t\t\t// if selected start time and end time are the same\n\t\t\t\t// reset to default full range\n\t\t\t\tif (newDomain[0].valueOf() === newDomain[1].valueOf()) {\n\t\t\t\t\t// same as d3 behavior and zoom bar behavior: set to default full range\n\t\t\t\t\tnewDomain = this.services.zoom.getDefaultZoomBarDomain()\n\t\t\t\t}\n\n\t\t\t\t// only if zoomDomain needs update\n\t\t\t\tif (\n\t\t\t\t\tzoomDomain[0].valueOf() !== newDomain[0].valueOf() ||\n\t\t\t\t\tzoomDomain[1].valueOf() !== newDomain[1].valueOf()\n\t\t\t\t) {\n\t\t\t\t\tthis.services.zoom.handleDomainChange(newDomain)\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tlet brush: any\n\n\t\t\tconst brushed = (event: any) => {\n\t\t\t\t// max selection range: [0, width]\n\t\t\t\tconst selection = event.selection\n\n\t\t\t\tif (selection !== null) {\n\t\t\t\t\t// updateZoomDomain assumes max range is [0, width]\n\t\t\t\t\tupdateZoomDomain(selection[0], selection[1])\n\n\t\t\t\t\t// clear brush selection\n\t\t\t\t\tbrushArea.call(brush.move, null)\n\t\t\t\t\t// hide frontSelection\n\t\t\t\t\tfrontSelection.style('display', 'none')\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (height != 0 && width != 0) {\n\t\t\t\t// leave some space to display selection strokes beside axes\n\t\t\t\tbrush = brushX()\n\t\t\t\t\t.extent([\n\t\t\t\t\t\t[0, 0],\n\t\t\t\t\t\t[width - 1, height]\n\t\t\t\t\t])\n\t\t\t\t\t.on('start brush end', brushEventHandler)\n\t\t\t\t\t.on('end.brushed', brushed)\n\n\t\t\t\tbrushArea.call(brush)\n\t\t\t}\n\n\t\t\tconst zoomRatio: number = this.services.zoom.getZoomRatio()\n\t\t\tbackdrop.on('click', function (event: MouseEvent) {\n\t\t\t\tif (event.shiftKey) {\n\t\t\t\t\tconst holder = this.services.domUtils.getHolder()\n\n\t\t\t\t\t// clickedX range: [0, width]\n\t\t\t\t\tconst clickedX = pointer(brushArea.node(), holder)[0]\n\n\t\t\t\t\tlet leftPoint = clickedX - (width * zoomRatio) / 2\n\t\t\t\t\tif (leftPoint < 0) {\n\t\t\t\t\t\tleftPoint = 0\n\t\t\t\t\t}\n\t\t\t\t\tlet rightPoint = clickedX + (width * zoomRatio) / 2\n\t\t\t\t\tif (rightPoint > width) {\n\t\t\t\t\t\trightPoint = width\n\t\t\t\t\t}\n\t\t\t\t\t// updateZoomDomain assumes max range is [0, width]\n\t\t\t\t\tupdateZoomDomain(leftPoint, rightPoint)\n\t\t\t\t}\n\t\t\t})\n\t\t}\n\t}\n}\n","import { cloneDeep, isEmpty, merge } from 'lodash-es'\nimport { area, brushX, extent, line } from 'd3'\nimport { getProperty } from '@/tools'\nimport { zoomBar as zoomBarConfigs } from '@/configuration'\nimport { Component } from '@/components/component'\nimport type { ChartModelCartesian } from '@/model/cartesian-charts'\nimport { AxisPositions, Events, RenderTypes, ScaleTypes, ZoomBarTypes } from '@/interfaces/enums'\nimport { DOMUtils } from '@/services/essentials/dom-utils'\n\nexport class ZoomBar extends Component {\n\ttype = 'zoom-bar'\n\trenderType = RenderTypes.SVG\n\n\t// The minimum selection x range to trigger handler update\n\t// Smaller number may introduce a handler flash during initialization\n\t// Bigger number may not trigger handler update while selection area on chart is very small\n\tMIN_SELECTION_DIFF = 9e-10\n\n\t// needs to match the style in _zoom-bar.scss\n\tbrushSelector = 'g.zoom-bar-brush'\n\n\t// The max allowed selection range, will be updated soon in render()\n\tmaxSelectionRange: [0, 0]\n\n\t// Give every zoomBarClip a distinct ID\n\t// so they don't interfere the other zoom bars in a page\n\tclipId = 'zoomBarClip-' + Math.floor(Math.random() * 99999999999)\n\n\tbrush = brushX()\n\txScale: any\n\tyScale: any\n\n\thighlightStrokeWidth = 1\n\n\tprotected model: ChartModelCartesian\n\n\tinit() {\n\t\tthis.services.events.addEventListener(Events.ZoomBar.UPDATE, this.render.bind(this))\n\t\t// check if pre-defined zoom bar data exists\n\t\tconst definedZoomBarData = getProperty(this.getOptions(), 'zoomBar', AxisPositions.TOP, 'data')\n\n\t\t// load up the zoomBarData into this model\n\t\tthis.model.setZoomBarData(definedZoomBarData)\n\t}\n\n\t// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n\t// @ts-ignore\n\t// eslint-disable-next-line @typescript-eslint/no-unused-vars\n\trender(animate = true) {\n\t\tconst svg = this.getComponentContainer({\n\t\t\tariaLabel: 'zoom bar'\n\t\t})\n\n\t\tconst isTopZoomBarLoading = this.services.zoom.isZoomBarLoading(AxisPositions.TOP)\n\t\tconst isTopZoomBarLocked = this.services.zoom.isZoomBarLocked(AxisPositions.TOP)\n\n\t\tconst zoombarType = getProperty(this.getOptions(), 'zoomBar', AxisPositions.TOP, 'type') as\n\t\t\t| 'graph_view'\n\t\t\t| 'slider_view'\n\n\t\t// As zoom current only available on top only highlights corresponding to bottom axis will be shown\n\t\tconst highlight = getProperty(this.getOptions(), 'axes', AxisPositions.BOTTOM, 'highlights')\n\n\t\tconst zoombarHeight = zoomBarConfigs.height[zoombarType]\n\n\t\tconst { width } = DOMUtils.getSVGElementSize(this.parent as any, {\n\t\t\tuseAttrs: true\n\t\t})\n\t\t// initialization is not completed yet\n\t\tif (width === 0) {\n\t\t\treturn\n\t\t}\n\t\t// get axes margins\n\t\tlet axesLeftMargin = 0\n\t\tconst axesMargins = this.model.get('axesMargins')\n\t\tif (axesMargins && axesMargins.left) {\n\t\t\taxesLeftMargin = axesMargins.left\n\t\t}\n\n\t\tconst container = DOMUtils.appendOrSelect(svg, 'svg.zoom-container')\n\t\t\t.attr('width', '100%')\n\t\t\t.attr('height', zoombarHeight)\n\t\t\t.attr('opacity', 1)\n\n\t\tDOMUtils.appendOrSelect(svg, 'rect.zoom-spacer')\n\t\t\t.attr('x', 0)\n\t\t\t.attr('y', zoombarHeight)\n\t\t\t.attr('width', '100%')\n\t\t\t.attr('height', zoomBarConfigs.spacerHeight)\n\t\t\t.attr('opacity', 1)\n\t\t\t.attr('fill', 'none')\n\n\t\tif (zoombarType === ZoomBarTypes.GRAPH_VIEW) {\n\t\t\t// Draw zoombar background rectangle\n\t\t\tDOMUtils.appendOrSelect(container, 'rect.zoom-bg')\n\t\t\t\t.attr('x', axesLeftMargin)\n\t\t\t\t.attr('y', 0)\n\t\t\t\t.attr('width', width - axesLeftMargin)\n\t\t\t\t.attr('height', '100%')\n\t\t\t\t.classed('zoom-bg-skeleton', isTopZoomBarLoading)\n\t\t\t\t.style(\n\t\t\t\t\t'stroke',\n\t\t\t\t\tisTopZoomBarLoading\n\t\t\t\t\t\t? `url(#${this.services.domUtils.generateElementIDString(`shimmer-lines`)})`\n\t\t\t\t\t\t: null\n\t\t\t\t)\n\t\t} else if (zoombarType === ZoomBarTypes.SLIDER_VIEW) {\n\t\t\t// Draw zoombar background line\n\t\t\tDOMUtils.appendOrSelect(container, 'rect.zoom-slider-bg')\n\t\t\t\t.attr('x', axesLeftMargin)\n\t\t\t\t.attr('y', zoombarHeight / 2 - 1)\n\t\t\t\t.attr('width', width - axesLeftMargin)\n\t\t\t\t.attr('height', 2)\n\t\t\t\t.classed('zoom-slider-bg-skeleton', isTopZoomBarLoading)\n\t\t\t\t.style(\n\t\t\t\t\t'stroke',\n\t\t\t\t\tisTopZoomBarLoading\n\t\t\t\t\t\t? `url(#${this.services.domUtils.generateElementIDString(`shimmer-lines`)})`\n\t\t\t\t\t\t: null\n\t\t\t\t)\n\t\t}\n\n\t\tif (isTopZoomBarLoading) {\n\t\t\tthis.renderSkeleton(container, axesLeftMargin, width)\n\t\t\treturn\n\t\t}\n\n\t\tconst { cartesianScales } = this.services\n\t\tconst mainXScale = cartesianScales.getMainXScale()\n\t\tconst mainYScale = cartesianScales.getMainYScale()\n\t\tconst mainXScaleType = cartesianScales.getMainXScaleType()\n\n\t\tif (mainXScale && mainXScaleType === ScaleTypes.TIME) {\n\t\t\tlet zoomBarData = this.services.zoom.getZoomBarData()\n\n\t\t\t// if there's no zoom bar data we can't do anything (true, undefined, null...)\n\t\t\t// if zoom domain is based on a single data element\n\t\t\t// doesn't make sense to allow zooming in\n\t\t\tif (isEmpty(zoomBarData) || zoomBarData.length === 1) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.xScale = mainXScale.copy()\n\t\t\tthis.yScale = mainYScale.copy()\n\n\t\t\tconst defaultDomain = this.services.zoom.getDefaultZoomBarDomain(zoomBarData)\n\n\t\t\t// add value 0 to the extended domain for zoom bar area graph\n\t\t\tzoomBarData = this.compensateDataForDefaultDomain(zoomBarData, defaultDomain)\n\n\t\t\t// get old initialZoomDomain from model\n\t\t\tconst oldInitialZoomDomain = this.model.get('initialZoomDomain')\n\t\t\t// get new initialZoomDomain from option\n\t\t\tconst newInitialZoomDomain = getProperty(\n\t\t\t\tthis.getOptions(),\n\t\t\t\t'zoomBar',\n\t\t\t\tAxisPositions.TOP,\n\t\t\t\t'initialZoomDomain'\n\t\t\t)\n\t\t\t// change string date to Date object if necessary\n\t\t\tif (newInitialZoomDomain && newInitialZoomDomain[0] && newInitialZoomDomain[1]) {\n\t\t\t\tnewInitialZoomDomain[0] = new Date(newInitialZoomDomain[0])\n\t\t\t\tnewInitialZoomDomain[1] = new Date(newInitialZoomDomain[1])\n\t\t\t}\n\t\t\t// update initialZoomDomain and set zoomDomain in model only if the option is changed\n\t\t\t// not the same object, and both start date and end date are not equal\n\t\t\tif (\n\t\t\t\tnewInitialZoomDomain &&\n\t\t\t\t!(\n\t\t\t\t\toldInitialZoomDomain &&\n\t\t\t\t\toldInitialZoomDomain[0].valueOf() === newInitialZoomDomain[0].valueOf() &&\n\t\t\t\t\toldInitialZoomDomain[1].valueOf() === newInitialZoomDomain[1].valueOf()\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\tthis.model.set(\n\t\t\t\t\t{\n\t\t\t\t\t\t// use a new object instead of newInitialZoomDomain\n\t\t\t\t\t\tinitialZoomDomain: merge([], newInitialZoomDomain),\n\t\t\t\t\t\tzoomDomain: newInitialZoomDomain ? merge([], newInitialZoomDomain) : defaultDomain\n\t\t\t\t\t},\n\t\t\t\t\t{ skipUpdate: true }\n\t\t\t\t)\n\t\t\t} else if (newInitialZoomDomain === null && oldInitialZoomDomain !== null) {\n\t\t\t\t// if newInitialZoomDomain is set to null (when oldInitialZoomDomain is not null)\n\t\t\t\t// save initialZoomDomain and reset zoom domain to default domain\n\t\t\t\tthis.model.set(\n\t\t\t\t\t{\n\t\t\t\t\t\tinitialZoomDomain: null,\n\t\t\t\t\t\tzoomDomain: merge([], defaultDomain)\n\t\t\t\t\t},\n\t\t\t\t\t{ skipUpdate: true }\n\t\t\t\t)\n\t\t\t}\n\n\t\t\tthis.xScale.range([axesLeftMargin, width]).domain(defaultDomain)\n\n\t\t\t// keep max selection range\n\t\t\tthis.maxSelectionRange = this.xScale.range()\n\n\t\t\tthis.yScale.range([0, zoombarHeight - 6]).domain(extent(zoomBarData, (d: any) => d.value))\n\n\t\t\tconst zoomDomain = this.model.get('zoomDomain')\n\n\t\t\tif (zoombarType === ZoomBarTypes.GRAPH_VIEW) {\n\t\t\t\tthis.renderZoomBarArea(container, 'path.zoom-graph-area-unselected', zoomBarData, null)\n\t\t\t\tthis.updateClipPath(svg, this.clipId, 0, 0, 0, 0)\n\t\t\t\tthis.renderZoomBarArea(container, 'path.zoom-graph-area', zoomBarData, this.clipId)\n\t\t\t\t// Draw the zoom bar base line\n\t\t\t\tthis.renderZoomBarBaseline(container as any, axesLeftMargin, width)\n\n\t\t\t\tif (highlight) {\n\t\t\t\t\tconst startHighlight = highlight.highlightStartMapsTo\n\t\t\t\t\tconst endHighlight = highlight.highlightEndMapsTo\n\t\t\t\t\tconst color = highlight.color\n\t\t\t\t\tconst labelMapTo = highlight.labelMapsTo\n\n\t\t\t\t\thighlight.data.forEach((element: any, index: number) => {\n\t\t\t\t\t\tDOMUtils.appendOrSelect(container, `rect.highlight-${index}`)\n\t\t\t\t\t\t\t.attr('height', zoombarHeight - 2 * this.highlightStrokeWidth)\n\t\t\t\t\t\t\t.attr('y', this.highlightStrokeWidth)\n\t\t\t\t\t\t\t.attr('x', this.xScale(element[startHighlight]))\n\t\t\t\t\t\t\t.attr(\n\t\t\t\t\t\t\t\t'width',\n\t\t\t\t\t\t\t\tthis.xScale(element[endHighlight]) - this.xScale(element[startHighlight])\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t.style(\n\t\t\t\t\t\t\t\t'fill',\n\t\t\t\t\t\t\t\tcolor && color.scale[element[labelMapTo]] ? color.scale[element[labelMapTo]] : null\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t.style('fill-opacity', 0.1)\n\t\t\t\t\t\t\t.style(\n\t\t\t\t\t\t\t\t'stroke',\n\t\t\t\t\t\t\t\tcolor && color.scale[element[labelMapTo]] ? color.scale[element[labelMapTo]] : null\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t.style('stroke-dasharray', '2, 2')\n\t\t\t\t\t\t\t.attr('stroke-width', 1 + 'px')\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Attach brushing event listeners\n\t\t\tthis.addBrushEventListener(zoomDomain, axesLeftMargin, width)\n\n\t\t\t// Draw the brushing area\n\t\t\tconst brushArea = DOMUtils.appendOrSelect(svg, this.brushSelector).call(this.brush)\n\n\t\t\tif (zoomDomain === undefined) {\n\t\t\t\t// do nothing, initialization not completed yet\n\t\t\t\t// don't update brushHandle to avoid flash\n\t\t\t} else if (zoomDomain[0].valueOf() === zoomDomain[1].valueOf()) {\n\t\t\t\tbrushArea.call(this.brush.move, this.xScale.range()) // default to full range\n\t\t\t\tthis.updateBrushHandle(this.getComponentContainer(), this.xScale.range())\n\t\t\t} else {\n\t\t\t\tconst selected = zoomDomain.map((domain: any) => this.xScale(domain))\n\t\t\t\tif (selected[1] - selected[0] < this.MIN_SELECTION_DIFF) {\n\t\t\t\t\t// initialization not completed yet\n\t\t\t\t\t// don't update brushHandle to avoid flash\n\t\t\t\t} else {\n\t\t\t\t\tbrushArea.call(this.brush.move, selected) // set brush to correct position\n\t\t\t\t\tthis.updateBrushHandle(this.getComponentContainer(), selected)\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (isTopZoomBarLocked) {\n\t\t\t\tthis.brush.filter(() => {\n\t\t\t\t\treturn false\n\t\t\t\t})\n\t\t\t\t// reset all cursor to auto\n\t\t\t\tbrushArea.selectAll('rect').attr('cursor', 'auto')\n\t\t\t}\n\t\t}\n\t}\n\n\taddBrushEventListener(zoomDomain: any, axesLeftMargin: any, width: any) {\n\t\tconst brushEventListener = (event: any) => {\n\t\t\tconst selection = event.selection\n\t\t\t// follow d3 behavior: when selection is null, reset default full range\n\t\t\t// select behavior is completed, but nothing selected\n\t\t\tif (selection === null) {\n\t\t\t\tthis.handleBrushedEvent(event, zoomDomain, this.xScale, this.xScale.range())\n\t\t\t} else if (selection[0] === selection[1]) {\n\t\t\t\t// select behavior is not completed yet, do nothing\n\t\t\t} else {\n\t\t\t\tthis.handleBrushedEvent(event, zoomDomain, this.xScale, selection)\n\t\t\t}\n\t\t}\n\n\t\tconst zoombarType = getProperty(this.getOptions(), 'zoomBar', AxisPositions.TOP, 'type') as\n\t\t\t| 'graph_view'\n\t\t\t| 'slider_view'\n\t\tconst zoombarHeight = zoomBarConfigs.height[zoombarType]\n\n\t\t// Initialize the d3 brush\n\t\tthis.brush\n\t\t\t.extent([\n\t\t\t\t[axesLeftMargin, 0],\n\t\t\t\t[width, zoombarHeight]\n\t\t\t])\n\t\t\t.on('start brush end', null) // remove old listener first\n\t\t\t.on('start brush end', brushEventListener)\n\t}\n\n\t// brush event listener\n\thandleBrushedEvent(event: any, zoomDomain: any, scale: any, selection: any) {\n\t\tconst newDomain = [scale.invert(selection[0]), scale.invert(selection[1])]\n\n\t\t// update brush handle position\n\t\tthis.updateBrushHandle(this.getComponentContainer(), selection)\n\n\t\t// be aware that the value of d3.event changes during an event!\n\t\t// update zoomDomain only if the event comes from mouse/touch event\n\t\tif (\n\t\t\tevent.sourceEvent != null &&\n\t\t\t(event.sourceEvent.type === 'mousemove' ||\n\t\t\t\tevent.sourceEvent.type === 'mouseup' ||\n\t\t\t\tevent.sourceEvent.type === 'mousedown' ||\n\t\t\t\tevent.sourceEvent.type === 'touchstart' ||\n\t\t\t\tevent.sourceEvent.type === 'touchmove' ||\n\t\t\t\tevent.sourceEvent.type === 'touchend')\n\t\t) {\n\t\t\t// only if zoomDomain is never set or needs update\n\t\t\tif (\n\t\t\t\tzoomDomain === undefined ||\n\t\t\t\tzoomDomain[0] !== newDomain[0] ||\n\t\t\t\tzoomDomain[1] !== newDomain[1]\n\t\t\t) {\n\t\t\t\t// don't dispatch event for all event types\n\t\t\t\t// let the following code to dispatch necessary events\n\t\t\t\tthis.services.zoom.handleDomainChange(newDomain, {\n\t\t\t\t\tdispatchEvent: false\n\t\t\t\t})\n\t\t\t}\n\n\t\t\t// dispatch selection events\n\t\t\tlet zoomBarEventType\n\t\t\tif (event.type === 'start') {\n\t\t\t\tzoomBarEventType = Events.ZoomBar.SELECTION_START\n\t\t\t} else if (event.type === 'brush') {\n\t\t\t\tzoomBarEventType = Events.ZoomBar.SELECTION_IN_PROGRESS\n\t\t\t} else if (event.type === 'end') {\n\t\t\t\tzoomBarEventType = Events.ZoomBar.SELECTION_END\n\t\t\t\t// only dispatch zoom domain change event for triggering api call when event type equals to end\n\t\t\t\tthis.services.events.dispatchEvent(Events.ZoomDomain.CHANGE, {\n\t\t\t\t\tnewDomain\n\t\t\t\t})\n\t\t\t}\n\t\t\tthis.services.events.dispatchEvent(zoomBarEventType, {\n\t\t\t\tselection,\n\t\t\t\tnewDomain\n\t\t\t})\n\t\t}\n\t}\n\n\tupdateBrushHandle(svg: any, selection: any) {\n\t\tconst self = this\n\t\tconst handleWidth = zoomBarConfigs.handleWidth\n\n\t\tconst zoombarType = getProperty(this.getOptions(), 'zoomBar', AxisPositions.TOP, 'type') as\n\t\t\t| 'graph_view'\n\t\t\t| 'slider_view'\n\t\tconst handleHeight = zoomBarConfigs.height[zoombarType]\n\t\tconst handleXDiff = -handleWidth / 2\n\n\t\tconst handleBarWidth = zoomBarConfigs.handleBarWidth\n\t\tconst handleBarHeight =\n\t\t\tzoombarType === ZoomBarTypes.GRAPH_VIEW ? zoomBarConfigs.handleBarHeight : 6\n\t\tconst handleBarXDiff = -handleBarWidth / 2\n\t\tconst handleYBarDiff = (handleHeight - handleBarHeight) / 2\n\n\t\t// handle\n\t\tsvg\n\t\t\t.select(this.brushSelector)\n\t\t\t.selectAll('rect.handle')\n\t\t\t.data([{ type: 'w' }, { type: 'e' }])\n\t\t\t.attr('x', function (d: any) {\n\t\t\t\tif (d.type === 'w') {\n\t\t\t\t\t// handle should not exceed zoom bar range\n\t\t\t\t\treturn Math.max(selection[0] + handleXDiff, self.maxSelectionRange[0])\n\t\t\t\t} else if (d.type === 'e') {\n\t\t\t\t\t// handle should not exceed zoom bar range\n\t\t\t\t\treturn Math.min(selection[1] + handleXDiff, self.maxSelectionRange[1] - handleWidth)\n\t\t\t\t}\n\t\t\t})\n\t\t\t.attr('y', 0)\n\t\t\t.attr('width', handleWidth)\n\t\t\t.attr('height', handleHeight)\n\t\t\t.attr('cursor', 'ew-resize')\n\t\t\t.style('display', null) // always display\n\n\t\t// handle-bar\n\t\tconst handleBars = svg\n\t\t\t.select(this.brushSelector)\n\t\t\t.selectAll('rect.handle-bar')\n\t\t\t.data([{ type: 'w' }, { type: 'e' }])\n\t\t// create rect if not exists\n\t\thandleBars\n\t\t\t.enter()\n\t\t\t.append('rect')\n\t\t\t.attr('class', function (d: any) {\n\t\t\t\treturn 'handle-bar handle-bar--' + d.type\n\t\t\t})\n\t\t// update positions\n\t\thandleBars\n\t\t\t.attr('x', function (d: any) {\n\t\t\t\tif (d.type === 'w') {\n\t\t\t\t\treturn Math.max(\n\t\t\t\t\t\tselection[0] + handleBarXDiff,\n\t\t\t\t\t\tself.maxSelectionRange[0] - handleXDiff + handleBarXDiff\n\t\t\t\t\t)\n\t\t\t\t} else if (d.type === 'e') {\n\t\t\t\t\treturn Math.min(\n\t\t\t\t\t\tselection[1] + handleBarXDiff,\n\t\t\t\t\t\tself.maxSelectionRange[1] + handleXDiff + handleBarXDiff\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t})\n\t\t\t.attr('y', handleYBarDiff)\n\t\t\t.attr('width', handleBarWidth)\n\t\t\t.attr('height', handleBarHeight)\n\t\t\t.attr('cursor', 'ew-resize')\n\n\t\t// Update slider selected area\n\t\tif (zoombarType === ZoomBarTypes.SLIDER_VIEW) {\n\t\t\tthis.updateSliderSelectedArea(selection)\n\t\t}\n\n\t\tthis.updateClipPath(\n\t\t\tsvg,\n\t\t\tthis.clipId,\n\t\t\tselection[0],\n\t\t\t0,\n\t\t\tselection[1] - selection[0],\n\t\t\thandleHeight\n\t\t)\n\t}\n\n\tupdateSliderSelectedArea(selection: any) {\n\t\tconst zoombarType = getProperty(this.getOptions(), 'zoomBar', AxisPositions.TOP, 'type') as\n\t\t\t| 'graph_view'\n\t\t\t| 'slider_view'\n\t\tconst zoombarHeight = zoomBarConfigs.height[zoombarType]\n\n\t\tconst svg = this.getComponentContainer()\n\t\tconst container = svg.select('svg.zoom-container')\n\n\t\t// Draw zoombar background line\n\t\tDOMUtils.appendOrSelect(container as any, 'rect.zoom-slider-selected-area')\n\t\t\t.attr('x', selection[0])\n\t\t\t.attr('y', zoombarHeight / 2 - 1)\n\t\t\t.attr('width', selection[1] - selection[0])\n\t\t\t.attr('height', 2)\n\t}\n\n\trenderZoomBarArea(container: any, querySelector: any, data: any, clipId: any) {\n\t\tconst { cartesianScales } = this.services\n\t\tconst mainXAxisPosition = cartesianScales.getMainXAxisPosition()\n\t\tconst mainYAxisPosition = cartesianScales.getMainYAxisPosition()\n\t\tconst mainXScaleType = cartesianScales.getMainXScaleType()\n\t\tconst mainYScaleType = cartesianScales.getMainYScaleType()\n\n\t\tconst accessorFunction = (scale: any, scaleType: any, axisPosition: any) => {\n\t\t\treturn (d: any) => {\n\t\t\t\treturn cartesianScales.getValueFromScale(scale, scaleType, axisPosition, d)\n\t\t\t}\n\t\t}\n\n\t\tconst xAccessor = accessorFunction(this.xScale, mainXScaleType, mainXAxisPosition)\n\t\tconst yAccessor = accessorFunction(this.yScale, mainYScaleType, mainYAxisPosition)\n\n\t\tconst zoombarType = getProperty(this.getOptions(), 'zoomBar', AxisPositions.TOP, 'type') as\n\t\t\t| 'graph_view'\n\t\t\t| 'slider_view'\n\t\tconst zoombarHeight = zoomBarConfigs.height[zoombarType]\n\t\tconst areaGenerator = area()\n\t\t\t.x((d: any) => xAccessor(d))\n\t\t\t.y0(zoombarHeight)\n\t\t\t.y1((d: any) => zoombarHeight - yAccessor(d))\n\n\t\tconst areaGraph = DOMUtils.appendOrSelect(container, querySelector)\n\t\t\t.datum(data)\n\t\t\t.attr('d', areaGenerator)\n\n\t\tif (clipId) {\n\t\t\tareaGraph.attr('clip-path', `url(#${clipId})`)\n\t\t}\n\t}\n\n\tupdateClipPath(\n\t\tsvg: any,\n\t\tclipId: string,\n\t\tx: number | string,\n\t\ty: number | string,\n\t\twidth: number | string,\n\t\theight: number | string\n\t) {\n\t\tconst zoomBarClipPath = DOMUtils.appendOrSelect(svg, `clipPath`).attr('id', clipId)\n\t\tDOMUtils.appendOrSelect(zoomBarClipPath, 'rect')\n\t\t\t.attr('x', x)\n\t\t\t.attr('y', y)\n\t\t\t.attr('width', width)\n\t\t\t.attr('height', height)\n\t}\n\n\t// assume the domains in data are already sorted\n\tcompensateDataForDefaultDomain(data: any, defaultDomain: any) {\n\t\tif (!data || data.length < 2) {\n\t\t\treturn\n\t\t}\n\t\tconst zoomBarData = cloneDeep(data)\n\n\t\tconst domainIdentifier = this.services.cartesianScales.getDomainIdentifier()\n\t\tconst rangeIdentifier = this.services.cartesianScales.getRangeIdentifier()\n\n\t\t// if min domain is extended\n\t\tif (Number(defaultDomain[0]) < Number(zoomBarData[0][domainIdentifier])) {\n\t\t\tconst newDatum: any = {}\n\t\t\tnewDatum[domainIdentifier] = defaultDomain[0]\n\t\t\tnewDatum[rangeIdentifier] = 0\n\t\t\tzoomBarData.unshift(newDatum)\n\t\t}\n\t\t// if max domain is extended\n\t\tif (Number(defaultDomain[1]) > Number(zoomBarData[zoomBarData.length - 1][domainIdentifier])) {\n\t\t\tconst newDatum: any = {}\n\t\t\tnewDatum[domainIdentifier] = defaultDomain[1]\n\t\t\tnewDatum[rangeIdentifier] = 0\n\t\t\tzoomBarData.push(newDatum)\n\t\t}\n\t\treturn zoomBarData\n\t}\n\n\trenderZoomBarBaseline(\n\t\tcontainer: HTMLElement,\n\t\tstartX: number,\n\t\tendX: number,\n\t\tskeletonClass = false\n\t) {\n\t\tconst zoombarType = getProperty(\n\t\t\tthis.model.getOptions(),\n\t\t\t'zoomBar',\n\t\t\tAxisPositions.TOP,\n\t\t\t'type'\n\t\t) as 'graph_view' | 'slider_view'\n\t\tconst zoombarHeight = zoomBarConfigs.height[zoombarType]\n\t\tconst baselineGenerator = line()([\n\t\t\t[startX, zoombarHeight],\n\t\t\t[endX, zoombarHeight]\n\t\t])\n\t\tDOMUtils.appendOrSelect(container as any, 'path.zoom-bg-baseline')\n\t\t\t.attr('d', baselineGenerator)\n\t\t\t.classed('zoom-bg-baseline-skeleton', skeletonClass)\n\t\t\t.style(\n\t\t\t\t'stroke',\n\t\t\t\tskeletonClass\n\t\t\t\t\t? `url(#${this.services.domUtils.generateElementIDString(`shimmer-lines`)})`\n\t\t\t\t\t: null\n\t\t\t)\n\t}\n\n\trenderSkeleton(container: any, startX: number, endX: number) {\n\t\t// need to clear current zoom bar area\n\t\tthis.renderZoomBarArea(container, 'path.zoom-graph-area-unselected', [], null)\n\t\tthis.renderZoomBarArea(container, 'path.zoom-graph-area', [], this.clipId)\n\t\t// remove brush listener\n\t\tthis.brush.on('start brush end', null)\n\t\t// clear d3 brush\n\t\tDOMUtils.appendOrSelect(this.getComponentContainer(), this.brushSelector).html(null)\n\n\t\t// re-render baseline because no axis labels in skeleton so the baseline length needs to change\n\t\tconst zoombarType = getProperty(this.getOptions(), 'zoomBar', AxisPositions.TOP, 'type')\n\t\tif (zoombarType === ZoomBarTypes.GRAPH_VIEW) {\n\t\t\tthis.renderZoomBarBaseline(container, startX, endX, true)\n\t\t}\n\t}\n\n\tdestroy() {\n\t\tthis.brush.on('start brush end', null) // remove event listener\n\t\tthis.services.events.removeEventListener(Events.ZoomBar.UPDATE, this.render.bind(this))\n\t}\n}\n","import { select, pointer, type ScaleBand } from 'd3'\nimport { Position, PLACEMENTS } from '@carbon/utils-position' // position services\nimport { flipDomainAndRangeBasedOnOrientation, getProperty } from '@/tools'\nimport { carbonPrefix } from '@/configuration-non-customizable' // CSS prefix\nimport { Component } from '@/components/component'\nimport { DOMUtils } from '@/services/essentials/dom-utils'\nimport type { ChartModel } from '@/model/model'\nimport { AxisPositions, Events, RenderTypes, ScaleTypes } from '@/interfaces/enums'\nimport { formatTick, computeTimeIntervalName } from '@/services/time-series'\nimport { sanitizeText } from '@/utils/sanitizeHtml'\n\nexport class Threshold extends Component {\n\ttype = 'threshold'\n\trenderType = RenderTypes.SVG\n\n\tlabel: any\n\n\tpositionService = new Position()\n\n\tconstructor(model: ChartModel, services: any) {\n\t\tsuper(model, services)\n\t}\n\n\trender(animate = false) {\n\t\tconst axesOptions = getProperty(this.getOptions(), 'axes')\n\n\t\tconst thresholdData: any[] = []\n\n\t\tObject.keys(axesOptions).forEach(axisPosition => {\n\t\t\tif (Object.values(AxisPositions).includes(axisPosition as any)) {\n\t\t\t\tconst axisOptions = axesOptions[axisPosition]\n\n\t\t\t\tif (axisOptions.thresholds && axisOptions.thresholds.length > 0) {\n\t\t\t\t\tthresholdData.push({\n\t\t\t\t\t\taxisPosition,\n\t\t\t\t\t\tthresholds: axisOptions.thresholds,\n\t\t\t\t\t\tcorrespondingDatasets: axisOptions?.correspondingDatasets,\n\t\t\t\t\t\tmapsTo: axisOptions?.mapsTo\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\n\t\t// Grab container SVG\n\t\tconst svg = this.getComponentContainer({\n\t\t\tariaLabel: 'threshold lines',\n\t\t\twithinChartClip: true\n\t\t})\n\n\t\t// Update data on all axis threshold groups\n\t\tconst thresholdAxisGroups = svg\n\t\t\t.selectAll('g.axis-thresholds')\n\t\t\t.data(thresholdData, (d: any) => d.axisPosition)\n\n\t\t// Remove axis threshold groups that are no longer needed\n\t\tthresholdAxisGroups.exit().attr('opacity', 0).remove()\n\n\t\t// Add the axis threshold groups that need to be introduced\n\t\tconst thresholdAxisGroupsEnter = thresholdAxisGroups.enter().append('g')\n\n\t\tconst thresholdAxisGroupsMerge = thresholdAxisGroupsEnter.merge(thresholdAxisGroups as any)\n\t\tthresholdAxisGroupsMerge.attr('class', (d: any) => `axis-thresholds ${d.axisPosition}`)\n\n\t\tconst thresholdGroups = thresholdAxisGroupsMerge.selectAll('g.threshold-group').data((d: any) =>\n\t\t\td.thresholds.map((threshold: any) => {\n\t\t\t\t// Merge relevant keys into the threshold object\n\t\t\t\tthreshold.axisPosition = d.axisPosition\n\t\t\t\tthreshold.datum = this.constructDatumObj(d, threshold)\n\t\t\t\treturn threshold\n\t\t\t})\n\t\t)\n\n\t\t// Remove threshold groups that are no longer needed\n\t\tthresholdGroups.exit().attr('opacity', 0).remove()\n\n\t\t// Add the threshold groups that need to be introduced\n\t\tconst thresholdGroupsEnter = thresholdGroups.enter().append('g')\n\n\t\tthresholdGroupsEnter.append('line').attr('class', 'threshold-line')\n\t\tthresholdGroupsEnter.append('rect').attr('class', 'threshold-hoverable-area')\n\n\t\tconst thresholdGroupsMerge = thresholdGroupsEnter.merge(thresholdGroups as any)\n\t\tthresholdGroupsMerge.attr('class', 'threshold-group')\n\n\t\tconst self = this\n\t\tthresholdAxisGroupsMerge.each(function ({ axisPosition }: { axisPosition: AxisPositions }) {\n\t\t\tconst scale = self.services.cartesianScales.getScaleByPosition(\n\t\t\t\taxisPosition\n\t\t\t) as unknown as ScaleBand\n\t\t\tconst scaleType = self.services.cartesianScales.getScaleTypeByPosition(axisPosition)\n\n\t\t\tlet xScale = null\n\t\t\tlet yScale = null\n\n\t\t\t// Depending on type of axis position, assign scale and main perpendicular axis\n\t\t\tif (axisPosition === AxisPositions.LEFT || axisPosition === AxisPositions.RIGHT) {\n\t\t\t\tyScale = scale\n\t\t\t\txScale = self.services.cartesianScales.getMainXScale()\n\t\t\t} else {\n\t\t\t\txScale = scale\n\t\t\t\tyScale = self.services.cartesianScales.getMainYScale()\n\t\t\t}\n\n\t\t\tconst isScaleTypeLabels = scaleType === ScaleTypes.LABELS\n\t\t\tconst [xScaleStart, xScaleEnd] = xScale.range()\n\t\t\tconst [yScaleEnd, yScaleStart] = yScale.range()\n\n\t\t\tconst { cartesianScales } = self.services\n\t\t\tconst orientation = cartesianScales.getOrientation()\n\t\t\tconst getDomainValue = (d: any) => cartesianScales.getDomainValue(d) as number\n\t\t\tconst getRangeValue = (d: any) => cartesianScales.getRangeValue(d) as number\n\t\t\tconst [getXValue, getYValue] = flipDomainAndRangeBasedOnOrientation(\n\t\t\t\tgetDomainValue,\n\t\t\t\tgetRangeValue,\n\t\t\t\torientation\n\t\t\t)\n\n\t\t\tconst group = select(this)\n\t\t\tif (axisPosition === AxisPositions.TOP || axisPosition === AxisPositions.BOTTOM) {\n\t\t\t\tgroup\n\t\t\t\t\t.selectAll('line.threshold-line')\n\t\t\t\t\t.transition()\n\t\t\t\t\t.call((t: any) =>\n\t\t\t\t\t\tself.services.transitions.setupTransition({\n\t\t\t\t\t\t\ttransition: t,\n\t\t\t\t\t\t\tname: 'threshold-line-update',\n\t\t\t\t\t\t\tanimate\n\t\t\t\t\t\t})\n\t\t\t\t\t)\n\t\t\t\t\t.attr('y1', yScaleStart)\n\t\t\t\t\t.attr('y2', yScaleEnd)\n\t\t\t\t\t.attr(\n\t\t\t\t\t\t'x1',\n\t\t\t\t\t\t({ datum }: { datum: any }) =>\n\t\t\t\t\t\t\tgetXValue(datum) + (isScaleTypeLabels ? scale.step() / 2 : 0)\n\t\t\t\t\t)\n\t\t\t\t\t.attr(\n\t\t\t\t\t\t'x2',\n\t\t\t\t\t\t({ datum }: { datum: any }) =>\n\t\t\t\t\t\t\tgetXValue(datum) + (isScaleTypeLabels ? scale.step() / 2 : 0)\n\t\t\t\t\t)\n\t\t\t\t\t.style('stroke', ({ fillColor }: { fillColor: string }) => fillColor)\n\n\t\t\t\t// Set hoverable area width and rotate it\n\t\t\t\tgroup\n\t\t\t\t\t.selectAll('rect.threshold-hoverable-area')\n\t\t\t\t\t.attr('x', 0)\n\t\t\t\t\t.attr('y', ({ datum }: { datum: any }) => -getXValue(datum))\n\t\t\t\t\t.attr('width', Math.abs(yScaleEnd - yScaleStart))\n\t\t\t\t\t.classed('rotate', true)\n\t\t\t} else {\n\t\t\t\tgroup\n\t\t\t\t\t.selectAll('line.threshold-line')\n\t\t\t\t\t.transition()\n\t\t\t\t\t.call((t: any) =>\n\t\t\t\t\t\tself.services.transitions.setupTransition({\n\t\t\t\t\t\t\ttransition: t,\n\t\t\t\t\t\t\tname: 'threshold-line-update',\n\t\t\t\t\t\t\tanimate\n\t\t\t\t\t\t})\n\t\t\t\t\t)\n\t\t\t\t\t.attr('x1', xScaleStart)\n\t\t\t\t\t.attr('x2', xScaleEnd)\n\t\t\t\t\t.attr(\n\t\t\t\t\t\t'y1',\n\t\t\t\t\t\t({ datum }: { datum: any }) =>\n\t\t\t\t\t\t\tgetYValue(datum) + (isScaleTypeLabels ? scale.step() / 2 : 0)\n\t\t\t\t\t)\n\t\t\t\t\t.attr(\n\t\t\t\t\t\t'y2',\n\t\t\t\t\t\t({ datum }: { datum: any }) =>\n\t\t\t\t\t\t\tgetYValue(datum) + (isScaleTypeLabels ? scale.step() / 2 : 0)\n\t\t\t\t\t)\n\t\t\t\t\t.style('stroke', ({ fillColor }: { fillColor: string }) => fillColor)\n\n\t\t\t\t// Set hoverable area width\n\t\t\t\tgroup\n\t\t\t\t\t.selectAll('rect.threshold-hoverable-area')\n\t\t\t\t\t.attr('x', xScaleStart)\n\t\t\t\t\t.attr('y', ({ datum }: { datum: any }) => getYValue(datum))\n\t\t\t\t\t.attr('width', Math.abs(xScaleEnd - xScaleStart))\n\t\t\t\t\t.classed('rotate', false)\n\t\t\t}\n\t\t})\n\n\t\t// Add event listener for showing the threshold tooltip\n\t\tthis.services.events.addEventListener(Events.Threshold.SHOW, (e: any) => {\n\t\t\tthis.setThresholdLabelPosition(e.detail)\n\n\t\t\tthis.label.classed('hidden', false)\n\t\t})\n\n\t\t// Add event listener for hiding the threshold tooltip\n\t\tthis.services.events.addEventListener(Events.Threshold.HIDE, () => {\n\t\t\tthis.label.classed('hidden', true)\n\t\t})\n\n\t\tthis.appendThresholdLabel()\n\n\t\tthis.addEventListeners()\n\t}\n\n\tgetFormattedValue(datum: any) {\n\t\tconst { value, axisPosition } = datum\n\t\tconst options = this.getOptions()\n\t\tconst scaleType = this.services.cartesianScales.getScaleTypeByPosition(axisPosition)\n\t\tconst { code: localeCode, number: numberFormatter } = getProperty(options, 'locale')\n\t\t// If scale is time, format the threshold date as the ticks format\n\t\tif (scaleType === ScaleTypes.TIME) {\n\t\t\tconst isVertical = [AxisPositions.LEFT, AxisPositions.RIGHT].includes(axisPosition)\n\t\t\tconst mainXScale = this.services.cartesianScales.getMainXScale()\n\t\t\tconst mainYScale = this.services.cartesianScales.getMainYScale()\n\t\t\tconst scale = isVertical ? mainYScale : mainXScale\n\n\t\t\tconst timeScaleOptions = getProperty(options, 'timeScale')\n\t\t\tconst timeInterval = computeTimeIntervalName(\n\t\t\t\tscale.ticks(),\n\t\t\t\tgetProperty(timeScaleOptions, 'timeInterval')\n\t\t\t)\n\n\t\t\treturn formatTick(value, 0, scale.ticks(), timeInterval, timeScaleOptions, options.locale)\n\t\t}\n\n\t\treturn numberFormatter(value, localeCode)\n\t}\n\n\tappendThresholdLabel() {\n\t\tconst holder = select(this.services.domUtils.getHolder())\n\n\t\tconst chartprefix = getProperty(this.getOptions(), 'style', 'prefix')\n\n\t\tthis.label = DOMUtils.appendOrSelect(\n\t\t\tholder,\n\t\t\t`div.${carbonPrefix}--${chartprefix}--threshold--label`\n\t\t).classed('hidden', true)\n\t}\n\n\tsetThresholdLabelPosition({ event, datum }: { event: CustomEvent; datum: any }) {\n\t\tconst holder = this.services.domUtils.getHolder()\n\t\tconst mouseRelativePos = pointer(event, holder)\n\n\t\t// Format the threshold value using valueFormatter if defined in user-provided options\n\t\tconst formattedValue = datum.valueFormatter\n\t\t\t? datum.valueFormatter(datum.value)\n\t\t\t: this.getFormattedValue(datum)\n\n\t\tthis.label\n\t\t\t.html(sanitizeText(`${datum.label || 'Threshold'}: ${formattedValue}`))\n\t\t\t.style('background-color', datum.fillColor)\n\n\t\tconst target = this.label.node()\n\t\t// Find out whether threshold label should be shown on the left or right side\n\t\tconst bestPlacementOption = this.positionService.findBestPlacementAt(\n\t\t\t{\n\t\t\t\tleft: mouseRelativePos[0],\n\t\t\t\ttop: mouseRelativePos[1]\n\t\t\t},\n\t\t\ttarget,\n\t\t\t[PLACEMENTS.RIGHT, PLACEMENTS.LEFT, PLACEMENTS.TOP, PLACEMENTS.BOTTOM],\n\t\t\t() => ({\n\t\t\t\ttop: undefined, // other package lists this as non-optional\n\t\t\t\tleft: undefined, // ditto\n\t\t\t\twidth: holder.offsetWidth,\n\t\t\t\theight: holder.offsetHeight\n\t\t\t})\n\t\t)\n\n\t\t// Get coordinates to where label should be positioned\n\t\tconst pos = this.positionService.findPositionAt(\n\t\t\t{\n\t\t\t\tleft: mouseRelativePos[0],\n\t\t\t\ttop: mouseRelativePos[1]\n\t\t\t},\n\t\t\ttarget,\n\t\t\tbestPlacementOption\n\t\t)\n\n\t\tthis.positionService.setElement(target, pos)\n\t}\n\n\t// Constructs object to pass in scale functions\n\tconstructDatumObj(d: any, element: any) {\n\t\tconst datum: any = {}\n\n\t\t// We only need to specify group only if correpsonding dataset is defined\n\t\tif (d.correspondingDatasets) {\n\t\t\tdatum['group'] = getProperty(d, 'correspondingDatasets', 0)\n\t\t}\n\n\t\t// Add attribute with the mapsTo value as key\n\t\tdatum[d['mapsTo']] = element.value\n\n\t\treturn datum\n\t}\n\n\taddEventListeners() {\n\t\tconst self = this\n\n\t\t// Grab container SVG\n\t\tconst svg = this.getComponentContainer({ withinChartClip: true })\n\n\t\t// Add events to the threshold hoverable area\n\t\tsvg\n\t\t\t.selectAll('rect.threshold-hoverable-area')\n\t\t\t.on('mouseover mousemove', function (event: MouseEvent) {\n\t\t\t\tselect((this as any).parentNode)\n\t\t\t\t\t.select('line.threshold-line')\n\t\t\t\t\t.classed('active', true)\n\n\t\t\t\tself.services.events.dispatchEvent(Events.Threshold.SHOW, {\n\t\t\t\t\tevent,\n\t\t\t\t\thoveredElement: select(this),\n\t\t\t\t\tdatum: select(this).datum()\n\t\t\t\t})\n\t\t\t})\n\t\t\t.on('mouseout', function (event: MouseEvent) {\n\t\t\t\tselect((this as any).parentNode)\n\t\t\t\t\t.select('line.threshold-line')\n\t\t\t\t\t.classed('active', false)\n\n\t\t\t\tself.services.events.dispatchEvent(Events.Threshold.HIDE, {\n\t\t\t\t\tevent,\n\t\t\t\t\thoveredElement: select(this),\n\t\t\t\t\tdatum: select(this).datum()\n\t\t\t\t})\n\t\t\t})\n\t}\n}\n","import { select } from 'd3'\nimport { Position } from '@carbon/utils-position' // position service\nimport { flipDomainAndRangeBasedOnOrientation, getProperty } from '@/tools'\nimport { Component } from '@/components/component'\nimport type { ChartModel } from '@/model/model'\nimport { AxisPositions, type CartesianOrientations, RenderTypes } from '@/interfaces/enums'\n\nexport class Highlight extends Component {\n\ttype = 'highlight'\n\trenderType = RenderTypes.SVG\n\n\tlabel: any\n\n\tpositionService = new Position()\n\thighlightStrokeWidth = 1\n\n\tconstructor(model: ChartModel, services: any) {\n\t\tsuper(model, services)\n\t}\n\n\trender(animate = false) {\n\t\tconst axesOptions = getProperty(this.getOptions(), 'axes')\n\t\tconst highlightData: any[] = []\n\n\t\tObject.keys(axesOptions).forEach((axisPosition: any) => {\n\t\t\tif (Object.values(AxisPositions).includes(axisPosition as any)) {\n\t\t\t\tconst axisOptions = axesOptions[axisPosition]\n\t\t\t\tif (axisOptions.highlights && axisOptions.highlights.data.length > 0) {\n\t\t\t\t\thighlightData.push({\n\t\t\t\t\t\taxisPosition,\n\t\t\t\t\t\thighlightStartMapsTo: axisOptions.highlights.highlightStartMapsTo,\n\t\t\t\t\t\thighlightEndMapsTo: axisOptions.highlights.highlightEndMapsTo,\n\t\t\t\t\t\tlabelMapsTo: axisOptions.highlights.labelMapsTo,\n\t\t\t\t\t\thighlight: axisOptions.highlights.data,\n\t\t\t\t\t\tcolor: axisOptions.highlights.color\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\n\t\t// Grab container SVG\n\t\tconst svg = this.getComponentContainer({ \n\t\t\tariaLabel: 'highlight areas',\n\t\t\twithinChartClip: true })\n\n\t\t// Update data on all axis highlight groups\n\t\tconst highlightAxisGroups = svg\n\t\t\t.selectAll('g.axis-highlight')\n\t\t\t.data(highlightData, (d: any) => d.axisPosition)\n\n\t\t// Remove axis highlight groups that are no longer needed\n\t\thighlightAxisGroups.exit().attr('opacity', 0).remove()\n\n\t\t// Add the axis highlight groups that need to be introduced\n\t\tconst highlightAxisGroupsEnter = highlightAxisGroups.enter().append('g')\n\n\t\tconst highlightAxisGroupsMerge = highlightAxisGroupsEnter.merge(highlightAxisGroups as any)\n\t\thighlightAxisGroupsMerge.attr('class', (d: any) => `axis-highlight ${d.axisPosition}`)\n\n\t\tconst highlightGroups = highlightAxisGroupsMerge.selectAll('g.highlight-group').data((d: any) =>\n\t\t\td.highlight.map((highlight: any) => {\n\t\t\t\thighlight.axisPosition = d.axisPosition\n\t\t\t\thighlight.highlightStartMapsTo = d.highlightStartMapsTo\n\t\t\t\thighlight.labelMapsTo = d.labelMapsTo\n\t\t\t\thighlight.color = d.color\n\t\t\t\thighlight.highlightEndMapsTo = d.highlightEndMapsTo\n\t\t\t\treturn highlight\n\t\t\t})\n\t\t)\n\n\t\t// Remove highlight groups that are no longer needed\n\t\thighlightGroups.exit().attr('opacity', 0).remove()\n\n\t\t// Add the highlight groups that need to be introduced\n\t\tconst highlightGroupsEnter = highlightGroups.enter().append('g')\n\n\t\thighlightGroupsEnter.append('rect').attr('class', 'highlight-bar')\n\t\thighlightGroupsEnter.append('line').attr('class', 'highlight-line')\n\n\t\tconst highlightGroupsMerge = highlightGroupsEnter.merge(highlightGroups as any)\n\t\thighlightGroupsMerge.attr('class', 'highlight-group')\n\n\t\tconst self = this\n\t\thighlightAxisGroupsMerge.each(function ({ axisPosition }) {\n\t\t\tconst mainXScale = self.services.cartesianScales.getMainXScale()\n\t\t\tconst mainYScale = self.services.cartesianScales.getMainYScale()\n\t\t\tconst [xScaleStart, xScaleEnd] = mainXScale.range()\n\t\t\tconst [yScaleEnd, yScaleStart] = mainYScale.range()\n\n\t\t\tconst { cartesianScales } = self.services\n\t\t\tconst orientation = cartesianScales.getOrientation() as CartesianOrientations\n\t\t\tconst getDomainValue = (d: any) => cartesianScales.getDomainValue(d) as number\n\t\t\tconst getRangeValue = (d: any) => cartesianScales.getRangeValue(d) as number\n\t\t\tconst [getXValue, getYValue] = flipDomainAndRangeBasedOnOrientation(\n\t\t\t\tgetDomainValue,\n\t\t\t\tgetRangeValue,\n\t\t\t\torientation\n\t\t\t)\n\n\t\t\tconst group = select(this)\n\t\t\tif (axisPosition === AxisPositions.TOP || axisPosition === AxisPositions.BOTTOM) {\n\t\t\t\tgroup\n\t\t\t\t\t.selectAll('rect.highlight-bar')\n\t\t\t\t\t.transition()\n\t\t\t\t\t.call((t: any) =>\n\t\t\t\t\t\tself.services.transitions.setupTransition({\n\t\t\t\t\t\t\ttransition: t,\n\t\t\t\t\t\t\tname: 'highlight-bar-update',\n\t\t\t\t\t\t\tanimate\n\t\t\t\t\t\t})\n\t\t\t\t\t)\n\t\t\t\t\t// Stroke width added to stop overflow of highlight\n\t\t\t\t\t.attr('y', Math.max(yScaleStart + self.highlightStrokeWidth, 0))\n\t\t\t\t\t// Stroke width subtracted to stop overflow of highlight\n\t\t\t\t\t.attr('height', Math.max(yScaleEnd - 2 * self.highlightStrokeWidth, 0))\n\t\t\t\t\t.attr('x', ({ highlightStartMapsTo, ...d }) => getXValue(d[highlightStartMapsTo]))\n\t\t\t\t\t.attr('width', ({ highlightStartMapsTo, highlightEndMapsTo, ...d }) =>\n\t\t\t\t\t\tMath.max(getXValue(d[highlightEndMapsTo]) - getXValue(d[highlightStartMapsTo]), 0)\n\t\t\t\t\t)\n\t\t\t\t\t.style('stroke', ({ color, labelMapsTo, ...data }) => {\n\t\t\t\t\t\treturn color && color.scale[data[labelMapsTo]] ? color.scale[data[labelMapsTo]] : null\n\t\t\t\t\t})\n\t\t\t\t\t.style('stroke-dasharray', '2, 2')\n\t\t\t\t\t.attr('stroke-width', self.highlightStrokeWidth + 'px')\n\t\t\t\t\t.style('fill-opacity', 0.1)\n\t\t\t\t\t.style('fill', ({ color, labelMapsTo, ...data }) => {\n\t\t\t\t\t\treturn color && color.scale[data[labelMapsTo]] ? color.scale[data[labelMapsTo]] : null\n\t\t\t\t\t})\n\t\t\t} else {\n\t\t\t\tgroup\n\t\t\t\t\t.selectAll('rect.highlight-bar')\n\t\t\t\t\t.transition()\n\t\t\t\t\t.call((t: any) =>\n\t\t\t\t\t\tself.services.transitions.setupTransition({\n\t\t\t\t\t\t\ttransition: t,\n\t\t\t\t\t\t\tname: 'highlight-bar-update',\n\t\t\t\t\t\t\tanimate\n\t\t\t\t\t\t})\n\t\t\t\t\t)\n\t\t\t\t\t.attr('x', xScaleStart)\n\t\t\t\t\t.attr('width', Math.max(xScaleEnd - xScaleStart, 0))\n\t\t\t\t\t.attr('y', ({ highlightEndMapsTo, ...d }) => getYValue(d[highlightEndMapsTo]))\n\t\t\t\t\t.attr('height', ({ highlightStartMapsTo, highlightEndMapsTo, ...d }) =>\n\t\t\t\t\t\tMath.max(getYValue(d[highlightStartMapsTo]) - getYValue(d[highlightEndMapsTo]), 0)\n\t\t\t\t\t)\n\t\t\t\t\t.style('stroke', ({ color, labelMapsTo, ...data }) => {\n\t\t\t\t\t\treturn color && color.scale[data[labelMapsTo]] ? color.scale[data[labelMapsTo]] : null\n\t\t\t\t\t})\n\t\t\t\t\t.style('stroke-dasharray', '2, 2')\n\t\t\t\t\t.attr('stroke-width', self.highlightStrokeWidth + 'px')\n\t\t\t\t\t.style('fill-opacity', 0.1)\n\t\t\t\t\t.style('fill', ({ color, labelMapsTo, ...data }) => {\n\t\t\t\t\t\treturn color && color.scale[data[labelMapsTo]] ? color.scale[data[labelMapsTo]] : null\n\t\t\t\t\t})\n\t\t\t}\n\t\t})\n\t}\n}\n","import { get } from 'lodash-es'\nimport { getProperty } from '@/tools'\nimport { Tooltip } from './tooltip'\nimport { ColorClassNameTypes } from '@/interfaces/enums'\n\nexport class AxisChartsTooltip extends Tooltip {\n\tgetItems(e: CustomEvent) {\n\t\tif (e.detail.items) {\n\t\t\treturn e.detail.items\n\t\t}\n\n\t\tconst { data } = e.detail\n\t\tif (!data || !data.length || !data[0]) {\n\t\t\treturn []\n\t\t}\n\n\t\tconst options = this.getOptions()\n\t\tconst { cartesianScales } = this.services\n\t\tconst domainIdentifier = cartesianScales.getDomainIdentifier()\n\t\tconst dualAxes = cartesianScales.isDualAxes()\n\n\t\t// Generate default tooltip\n\t\tconst { groupMapsTo } = options.data\n\t\tconst domainLabel = cartesianScales.getDomainLabel()\n\t\tlet rangeLabel = cartesianScales.getRangeLabel()\n\n\t\tconst domainValue = data[0][domainIdentifier]\n\t\tlet items: any[]\n\t\tif (data.length === 1) {\n\t\t\tconst datum = data[0]\n\t\t\tconst rangeIdentifier = cartesianScales.getRangeIdentifier(datum)\n\n\t\t\tif (dualAxes) {\n\t\t\t\tconst position = cartesianScales.getRangeAxisPosition({\n\t\t\t\t\tdatum,\n\t\t\t\t\tgroups: [datum[groupMapsTo]]\n\t\t\t\t})\n\t\t\t\trangeLabel = cartesianScales.getScaleLabel(position)\n\t\t\t}\n\t\t\tconst value = datum[rangeIdentifier]\n\n\t\t\titems = [\n\t\t\t\t{\n\t\t\t\t\tlabel: domainLabel,\n\t\t\t\t\tvalue: domainValue\n\t\t\t\t},\n\t\t\t\t...(Array.isArray(value) && value.length === 2\n\t\t\t\t\t? [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tlabel: 'Start',\n\t\t\t\t\t\t\t\tvalue: value[0]\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tlabel: 'End',\n\t\t\t\t\t\t\t\tvalue: value[1]\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t]\n\t\t\t\t\t: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tlabel: rangeLabel,\n\t\t\t\t\t\t\t\tvalue: datum[rangeIdentifier]\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t])\n\t\t\t]\n\n\t\t\tif (e.detail.additionalItems) {\n\t\t\t\te.detail.additionalItems.forEach((additionalItem: any) =>\n\t\t\t\t\titems.push({\n\t\t\t\t\t\tlabel: additionalItem.label,\n\t\t\t\t\t\tvalue: additionalItem.value\n\t\t\t\t\t})\n\t\t\t\t)\n\t\t\t}\n\n\t\t\titems.push({\n\t\t\t\tlabel: get(options, 'locale.translations.group') || get(options, 'tooltip.groupLabel'),\n\t\t\t\tvalue: datum[groupMapsTo],\n\t\t\t\tcolor: this.model.getFillColor(datum[groupMapsTo]),\n\t\t\t\tclass: this.model.getColorClassName({\n\t\t\t\t\tclassNameTypes: [ColorClassNameTypes.TOOLTIP],\n\t\t\t\t\tdataGroupName: datum[groupMapsTo]\n\t\t\t\t})\n\t\t\t})\n\t\t} else if (data.length > 1) {\n\t\t\titems = [\n\t\t\t\t{\n\t\t\t\t\tlabel: domainLabel,\n\t\t\t\t\tvalue: domainValue\n\t\t\t\t}\n\t\t\t]\n\n\t\t\titems = items.concat(\n\t\t\t\tdata\n\t\t\t\t\t.map((datum: any) => {\n\t\t\t\t\t\t// Format value if is array\n\t\t\t\t\t\tconst value = datum[cartesianScales.getRangeIdentifier(datum)]\n\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tlabel: datum[groupMapsTo],\n\t\t\t\t\t\t\tvalue:\n\t\t\t\t\t\t\t\tArray.isArray(value) && value.length === 2 ? `${value[0]} - ${value[1]}` : value,\n\t\t\t\t\t\t\tcolor: this.model.getFillColor(datum[groupMapsTo]),\n\t\t\t\t\t\t\tclass: this.model.getColorClassName({\n\t\t\t\t\t\t\t\tclassNameTypes: [ColorClassNameTypes.TOOLTIP],\n\t\t\t\t\t\t\t\tdataGroupName: datum[groupMapsTo]\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t\t.sort((a: any, b: any) => b.value - a.value)\n\t\t\t)\n\n\t\t\tif (!dualAxes && getProperty(options, 'tooltip', 'showTotal') === true) {\n\t\t\t\t// use the primary/only range id\n\t\t\t\tconst rangeIdentifier = cartesianScales.getRangeIdentifier()\n\t\t\t\titems.push({\n\t\t\t\t\tlabel:\n\t\t\t\t\t\tget(options, 'locale.translations.total') ||\n\t\t\t\t\t\tget(options, 'tooltip.totalLabel') ||\n\t\t\t\t\t\t'Total',\n\t\t\t\t\tvalue: data.reduce(\n\t\t\t\t\t\t(accumulator: number, datum: any) => accumulator + datum[rangeIdentifier],\n\t\t\t\t\t\t0\n\t\t\t\t\t),\n\t\t\t\t\tbold: true\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\n\t\treturn items\n\t}\n}\n","export default function max(values, valueof) {\n let max;\n if (valueof === undefined) {\n for (const value of values) {\n if (value != null\n && (max < value || (max === undefined && value >= value))) {\n max = value;\n }\n }\n } else {\n let index = -1;\n for (let value of values) {\n if ((value = valueof(value, ++index, values)) != null\n && (max < value || (max === undefined && value >= value))) {\n max = value;\n }\n }\n }\n return max;\n}\n","export default function min(values, valueof) {\n let min;\n if (valueof === undefined) {\n for (const value of values) {\n if (value != null\n && (min > value || (min === undefined && value >= value))) {\n min = value;\n }\n }\n } else {\n let index = -1;\n for (let value of values) {\n if ((value = valueof(value, ++index, values)) != null\n && (min > value || (min === undefined && value >= value))) {\n min = value;\n }\n }\n }\n return min;\n}\n","export default function sum(values, valueof) {\n let sum = 0;\n if (valueof === undefined) {\n for (let value of values) {\n if (value = +value) {\n sum += value;\n }\n }\n } else {\n let index = -1;\n for (let value of values) {\n if (value = +valueof(value, ++index, values)) {\n sum += value;\n }\n }\n }\n return sum;\n}\n","import {min} from \"d3-array\";\n\nfunction targetDepth(d) {\n return d.target.depth;\n}\n\nexport function left(node) {\n return node.depth;\n}\n\nexport function right(node, n) {\n return n - 1 - node.height;\n}\n\nexport function justify(node, n) {\n return node.sourceLinks.length ? node.depth : n - 1;\n}\n\nexport function center(node) {\n return node.targetLinks.length ? node.depth\n : node.sourceLinks.length ? min(node.sourceLinks, targetDepth) - 1\n : 0;\n}\n","export default function constant(x) {\n return function() {\n return x;\n };\n}\n","import {max, min, sum} from \"d3-array\";\nimport {justify} from \"./align.js\";\nimport constant from \"./constant.js\";\n\nfunction ascendingSourceBreadth(a, b) {\n return ascendingBreadth(a.source, b.source) || a.index - b.index;\n}\n\nfunction ascendingTargetBreadth(a, b) {\n return ascendingBreadth(a.target, b.target) || a.index - b.index;\n}\n\nfunction ascendingBreadth(a, b) {\n return a.y0 - b.y0;\n}\n\nfunction value(d) {\n return d.value;\n}\n\nfunction defaultId(d) {\n return d.index;\n}\n\nfunction defaultNodes(graph) {\n return graph.nodes;\n}\n\nfunction defaultLinks(graph) {\n return graph.links;\n}\n\nfunction find(nodeById, id) {\n const node = nodeById.get(id);\n if (!node) throw new Error(\"missing: \" + id);\n return node;\n}\n\nfunction computeLinkBreadths({nodes}) {\n for (const node of nodes) {\n let y0 = node.y0;\n let y1 = y0;\n for (const link of node.sourceLinks) {\n link.y0 = y0 + link.width / 2;\n y0 += link.width;\n }\n for (const link of node.targetLinks) {\n link.y1 = y1 + link.width / 2;\n y1 += link.width;\n }\n }\n}\n\nexport default function Sankey() {\n let x0 = 0, y0 = 0, x1 = 1, y1 = 1; // extent\n let dx = 24; // nodeWidth\n let dy = 8, py; // nodePadding\n let id = defaultId;\n let align = justify;\n let sort;\n let linkSort;\n let nodes = defaultNodes;\n let links = defaultLinks;\n let iterations = 6;\n\n function sankey() {\n const graph = {nodes: nodes.apply(null, arguments), links: links.apply(null, arguments)};\n computeNodeLinks(graph);\n computeNodeValues(graph);\n computeNodeDepths(graph);\n computeNodeHeights(graph);\n computeNodeBreadths(graph);\n computeLinkBreadths(graph);\n return graph;\n }\n\n sankey.update = function(graph) {\n computeLinkBreadths(graph);\n return graph;\n };\n\n sankey.nodeId = function(_) {\n return arguments.length ? (id = typeof _ === \"function\" ? _ : constant(_), sankey) : id;\n };\n\n sankey.nodeAlign = function(_) {\n return arguments.length ? (align = typeof _ === \"function\" ? _ : constant(_), sankey) : align;\n };\n\n sankey.nodeSort = function(_) {\n return arguments.length ? (sort = _, sankey) : sort;\n };\n\n sankey.nodeWidth = function(_) {\n return arguments.length ? (dx = +_, sankey) : dx;\n };\n\n sankey.nodePadding = function(_) {\n return arguments.length ? (dy = py = +_, sankey) : dy;\n };\n\n sankey.nodes = function(_) {\n return arguments.length ? (nodes = typeof _ === \"function\" ? _ : constant(_), sankey) : nodes;\n };\n\n sankey.links = function(_) {\n return arguments.length ? (links = typeof _ === \"function\" ? _ : constant(_), sankey) : links;\n };\n\n sankey.linkSort = function(_) {\n return arguments.length ? (linkSort = _, sankey) : linkSort;\n };\n\n sankey.size = function(_) {\n return arguments.length ? (x0 = y0 = 0, x1 = +_[0], y1 = +_[1], sankey) : [x1 - x0, y1 - y0];\n };\n\n sankey.extent = function(_) {\n return arguments.length ? (x0 = +_[0][0], x1 = +_[1][0], y0 = +_[0][1], y1 = +_[1][1], sankey) : [[x0, y0], [x1, y1]];\n };\n\n sankey.iterations = function(_) {\n return arguments.length ? (iterations = +_, sankey) : iterations;\n };\n\n function computeNodeLinks({nodes, links}) {\n for (const [i, node] of nodes.entries()) {\n node.index = i;\n node.sourceLinks = [];\n node.targetLinks = [];\n }\n const nodeById = new Map(nodes.map((d, i) => [id(d, i, nodes), d]));\n for (const [i, link] of links.entries()) {\n link.index = i;\n let {source, target} = link;\n if (typeof source !== \"object\") source = link.source = find(nodeById, source);\n if (typeof target !== \"object\") target = link.target = find(nodeById, target);\n source.sourceLinks.push(link);\n target.targetLinks.push(link);\n }\n if (linkSort != null) {\n for (const {sourceLinks, targetLinks} of nodes) {\n sourceLinks.sort(linkSort);\n targetLinks.sort(linkSort);\n }\n }\n }\n\n function computeNodeValues({nodes}) {\n for (const node of nodes) {\n node.value = node.fixedValue === undefined\n ? Math.max(sum(node.sourceLinks, value), sum(node.targetLinks, value))\n : node.fixedValue;\n }\n }\n\n function computeNodeDepths({nodes}) {\n const n = nodes.length;\n let current = new Set(nodes);\n let next = new Set;\n let x = 0;\n while (current.size) {\n for (const node of current) {\n node.depth = x;\n for (const {target} of node.sourceLinks) {\n next.add(target);\n }\n }\n if (++x > n) throw new Error(\"circular link\");\n current = next;\n next = new Set;\n }\n }\n\n function computeNodeHeights({nodes}) {\n const n = nodes.length;\n let current = new Set(nodes);\n let next = new Set;\n let x = 0;\n while (current.size) {\n for (const node of current) {\n node.height = x;\n for (const {source} of node.targetLinks) {\n next.add(source);\n }\n }\n if (++x > n) throw new Error(\"circular link\");\n current = next;\n next = new Set;\n }\n }\n\n function computeNodeLayers({nodes}) {\n const x = max(nodes, d => d.depth) + 1;\n const kx = (x1 - x0 - dx) / (x - 1);\n const columns = new Array(x);\n for (const node of nodes) {\n const i = Math.max(0, Math.min(x - 1, Math.floor(align.call(null, node, x))));\n node.layer = i;\n node.x0 = x0 + i * kx;\n node.x1 = node.x0 + dx;\n if (columns[i]) columns[i].push(node);\n else columns[i] = [node];\n }\n if (sort) for (const column of columns) {\n column.sort(sort);\n }\n return columns;\n }\n\n function initializeNodeBreadths(columns) {\n const ky = min(columns, c => (y1 - y0 - (c.length - 1) * py) / sum(c, value));\n for (const nodes of columns) {\n let y = y0;\n for (const node of nodes) {\n node.y0 = y;\n node.y1 = y + node.value * ky;\n y = node.y1 + py;\n for (const link of node.sourceLinks) {\n link.width = link.value * ky;\n }\n }\n y = (y1 - y + py) / (nodes.length + 1);\n for (let i = 0; i < nodes.length; ++i) {\n const node = nodes[i];\n node.y0 += y * (i + 1);\n node.y1 += y * (i + 1);\n }\n reorderLinks(nodes);\n }\n }\n\n function computeNodeBreadths(graph) {\n const columns = computeNodeLayers(graph);\n py = Math.min(dy, (y1 - y0) / (max(columns, c => c.length) - 1));\n initializeNodeBreadths(columns);\n for (let i = 0; i < iterations; ++i) {\n const alpha = Math.pow(0.99, i);\n const beta = Math.max(1 - alpha, (i + 1) / iterations);\n relaxRightToLeft(columns, alpha, beta);\n relaxLeftToRight(columns, alpha, beta);\n }\n }\n\n // Reposition each node based on its incoming (target) links.\n function relaxLeftToRight(columns, alpha, beta) {\n for (let i = 1, n = columns.length; i < n; ++i) {\n const column = columns[i];\n for (const target of column) {\n let y = 0;\n let w = 0;\n for (const {source, value} of target.targetLinks) {\n let v = value * (target.layer - source.layer);\n y += targetTop(source, target) * v;\n w += v;\n }\n if (!(w > 0)) continue;\n let dy = (y / w - target.y0) * alpha;\n target.y0 += dy;\n target.y1 += dy;\n reorderNodeLinks(target);\n }\n if (sort === undefined) column.sort(ascendingBreadth);\n resolveCollisions(column, beta);\n }\n }\n\n // Reposition each node based on its outgoing (source) links.\n function relaxRightToLeft(columns, alpha, beta) {\n for (let n = columns.length, i = n - 2; i >= 0; --i) {\n const column = columns[i];\n for (const source of column) {\n let y = 0;\n let w = 0;\n for (const {target, value} of source.sourceLinks) {\n let v = value * (target.layer - source.layer);\n y += sourceTop(source, target) * v;\n w += v;\n }\n if (!(w > 0)) continue;\n let dy = (y / w - source.y0) * alpha;\n source.y0 += dy;\n source.y1 += dy;\n reorderNodeLinks(source);\n }\n if (sort === undefined) column.sort(ascendingBreadth);\n resolveCollisions(column, beta);\n }\n }\n\n function resolveCollisions(nodes, alpha) {\n const i = nodes.length >> 1;\n const subject = nodes[i];\n resolveCollisionsBottomToTop(nodes, subject.y0 - py, i - 1, alpha);\n resolveCollisionsTopToBottom(nodes, subject.y1 + py, i + 1, alpha);\n resolveCollisionsBottomToTop(nodes, y1, nodes.length - 1, alpha);\n resolveCollisionsTopToBottom(nodes, y0, 0, alpha);\n }\n\n // Push any overlapping nodes down.\n function resolveCollisionsTopToBottom(nodes, y, i, alpha) {\n for (; i < nodes.length; ++i) {\n const node = nodes[i];\n const dy = (y - node.y0) * alpha;\n if (dy > 1e-6) node.y0 += dy, node.y1 += dy;\n y = node.y1 + py;\n }\n }\n\n // Push any overlapping nodes up.\n function resolveCollisionsBottomToTop(nodes, y, i, alpha) {\n for (; i >= 0; --i) {\n const node = nodes[i];\n const dy = (node.y1 - y) * alpha;\n if (dy > 1e-6) node.y0 -= dy, node.y1 -= dy;\n y = node.y0 - py;\n }\n }\n\n function reorderNodeLinks({sourceLinks, targetLinks}) {\n if (linkSort === undefined) {\n for (const {source: {sourceLinks}} of targetLinks) {\n sourceLinks.sort(ascendingTargetBreadth);\n }\n for (const {target: {targetLinks}} of sourceLinks) {\n targetLinks.sort(ascendingSourceBreadth);\n }\n }\n }\n\n function reorderLinks(nodes) {\n if (linkSort === undefined) {\n for (const {sourceLinks, targetLinks} of nodes) {\n sourceLinks.sort(ascendingTargetBreadth);\n targetLinks.sort(ascendingSourceBreadth);\n }\n }\n }\n\n // Returns the target.y0 that would produce an ideal link from source to target.\n function targetTop(source, target) {\n let y = source.y0 - (source.sourceLinks.length - 1) * py / 2;\n for (const {target: node, width} of source.sourceLinks) {\n if (node === target) break;\n y += width + py;\n }\n for (const {source: node, width} of target.targetLinks) {\n if (node === source) break;\n y -= width;\n }\n return y;\n }\n\n // Returns the source.y0 that would produce an ideal link from source to target.\n function sourceTop(source, target) {\n let y = target.y0 - (target.targetLinks.length - 1) * py / 2;\n for (const {source: node, width} of target.targetLinks) {\n if (node === source) break;\n y += width + py;\n }\n for (const {target: node, width} of source.sourceLinks) {\n if (node === target) break;\n y -= width;\n }\n return y;\n }\n\n return sankey;\n}\n","var pi = Math.PI,\n tau = 2 * pi,\n epsilon = 1e-6,\n tauEpsilon = tau - epsilon;\n\nfunction Path() {\n this._x0 = this._y0 = // start of current subpath\n this._x1 = this._y1 = null; // end of current subpath\n this._ = \"\";\n}\n\nfunction path() {\n return new Path;\n}\n\nPath.prototype = path.prototype = {\n constructor: Path,\n moveTo: function(x, y) {\n this._ += \"M\" + (this._x0 = this._x1 = +x) + \",\" + (this._y0 = this._y1 = +y);\n },\n closePath: function() {\n if (this._x1 !== null) {\n this._x1 = this._x0, this._y1 = this._y0;\n this._ += \"Z\";\n }\n },\n lineTo: function(x, y) {\n this._ += \"L\" + (this._x1 = +x) + \",\" + (this._y1 = +y);\n },\n quadraticCurveTo: function(x1, y1, x, y) {\n this._ += \"Q\" + (+x1) + \",\" + (+y1) + \",\" + (this._x1 = +x) + \",\" + (this._y1 = +y);\n },\n bezierCurveTo: function(x1, y1, x2, y2, x, y) {\n this._ += \"C\" + (+x1) + \",\" + (+y1) + \",\" + (+x2) + \",\" + (+y2) + \",\" + (this._x1 = +x) + \",\" + (this._y1 = +y);\n },\n arcTo: function(x1, y1, x2, y2, r) {\n x1 = +x1, y1 = +y1, x2 = +x2, y2 = +y2, r = +r;\n var x0 = this._x1,\n y0 = this._y1,\n x21 = x2 - x1,\n y21 = y2 - y1,\n x01 = x0 - x1,\n y01 = y0 - y1,\n l01_2 = x01 * x01 + y01 * y01;\n\n // Is the radius negative? Error.\n if (r < 0) throw new Error(\"negative radius: \" + r);\n\n // Is this path empty? Move to (x1,y1).\n if (this._x1 === null) {\n this._ += \"M\" + (this._x1 = x1) + \",\" + (this._y1 = y1);\n }\n\n // Or, is (x1,y1) coincident with (x0,y0)? Do nothing.\n else if (!(l01_2 > epsilon));\n\n // Or, are (x0,y0), (x1,y1) and (x2,y2) collinear?\n // Equivalently, is (x1,y1) coincident with (x2,y2)?\n // Or, is the radius zero? Line to (x1,y1).\n else if (!(Math.abs(y01 * x21 - y21 * x01) > epsilon) || !r) {\n this._ += \"L\" + (this._x1 = x1) + \",\" + (this._y1 = y1);\n }\n\n // Otherwise, draw an arc!\n else {\n var x20 = x2 - x0,\n y20 = y2 - y0,\n l21_2 = x21 * x21 + y21 * y21,\n l20_2 = x20 * x20 + y20 * y20,\n l21 = Math.sqrt(l21_2),\n l01 = Math.sqrt(l01_2),\n l = r * Math.tan((pi - Math.acos((l21_2 + l01_2 - l20_2) / (2 * l21 * l01))) / 2),\n t01 = l / l01,\n t21 = l / l21;\n\n // If the start tangent is not coincident with (x0,y0), line to.\n if (Math.abs(t01 - 1) > epsilon) {\n this._ += \"L\" + (x1 + t01 * x01) + \",\" + (y1 + t01 * y01);\n }\n\n this._ += \"A\" + r + \",\" + r + \",0,0,\" + (+(y01 * x20 > x01 * y20)) + \",\" + (this._x1 = x1 + t21 * x21) + \",\" + (this._y1 = y1 + t21 * y21);\n }\n },\n arc: function(x, y, r, a0, a1, ccw) {\n x = +x, y = +y, r = +r, ccw = !!ccw;\n var dx = r * Math.cos(a0),\n dy = r * Math.sin(a0),\n x0 = x + dx,\n y0 = y + dy,\n cw = 1 ^ ccw,\n da = ccw ? a0 - a1 : a1 - a0;\n\n // Is the radius negative? Error.\n if (r < 0) throw new Error(\"negative radius: \" + r);\n\n // Is this path empty? Move to (x0,y0).\n if (this._x1 === null) {\n this._ += \"M\" + x0 + \",\" + y0;\n }\n\n // Or, is (x0,y0) not coincident with the previous point? Line to (x0,y0).\n else if (Math.abs(this._x1 - x0) > epsilon || Math.abs(this._y1 - y0) > epsilon) {\n this._ += \"L\" + x0 + \",\" + y0;\n }\n\n // Is this arc empty? We’re done.\n if (!r) return;\n\n // Does the angle go the wrong way? Flip the direction.\n if (da < 0) da = da % tau + tau;\n\n // Is this a complete circle? Draw two arcs to complete the circle.\n if (da > tauEpsilon) {\n this._ += \"A\" + r + \",\" + r + \",0,1,\" + cw + \",\" + (x - dx) + \",\" + (y - dy) + \"A\" + r + \",\" + r + \",0,1,\" + cw + \",\" + (this._x1 = x0) + \",\" + (this._y1 = y0);\n }\n\n // Is this arc non-empty? Draw an arc!\n else if (da > epsilon) {\n this._ += \"A\" + r + \",\" + r + \",0,\" + (+(da >= pi)) + \",\" + cw + \",\" + (this._x1 = x + r * Math.cos(a1)) + \",\" + (this._y1 = y + r * Math.sin(a1));\n }\n },\n rect: function(x, y, w, h) {\n this._ += \"M\" + (this._x0 = this._x1 = +x) + \",\" + (this._y0 = this._y1 = +y) + \"h\" + (+w) + \"v\" + (+h) + \"h\" + (-w) + \"Z\";\n },\n toString: function() {\n return this._;\n }\n};\n\nexport default path;\n","export default function(x) {\n return function constant() {\n return x;\n };\n}\n","export function x(p) {\n return p[0];\n}\n\nexport function y(p) {\n return p[1];\n}\n","export var slice = Array.prototype.slice;\n","import {path} from \"d3-path\";\nimport {slice} from \"../array.js\";\nimport constant from \"../constant.js\";\nimport {x as pointX, y as pointY} from \"../point.js\";\nimport pointRadial from \"../pointRadial.js\";\n\nfunction linkSource(d) {\n return d.source;\n}\n\nfunction linkTarget(d) {\n return d.target;\n}\n\nfunction link(curve) {\n var source = linkSource,\n target = linkTarget,\n x = pointX,\n y = pointY,\n context = null;\n\n function link() {\n var buffer, argv = slice.call(arguments), s = source.apply(this, argv), t = target.apply(this, argv);\n if (!context) context = buffer = path();\n curve(context, +x.apply(this, (argv[0] = s, argv)), +y.apply(this, argv), +x.apply(this, (argv[0] = t, argv)), +y.apply(this, argv));\n if (buffer) return context = null, buffer + \"\" || null;\n }\n\n link.source = function(_) {\n return arguments.length ? (source = _, link) : source;\n };\n\n link.target = function(_) {\n return arguments.length ? (target = _, link) : target;\n };\n\n link.x = function(_) {\n return arguments.length ? (x = typeof _ === \"function\" ? _ : constant(+_), link) : x;\n };\n\n link.y = function(_) {\n return arguments.length ? (y = typeof _ === \"function\" ? _ : constant(+_), link) : y;\n };\n\n link.context = function(_) {\n return arguments.length ? ((context = _ == null ? null : _), link) : context;\n };\n\n return link;\n}\n\nfunction curveHorizontal(context, x0, y0, x1, y1) {\n context.moveTo(x0, y0);\n context.bezierCurveTo(x0 = (x0 + x1) / 2, y0, x0, y1, x1, y1);\n}\n\nfunction curveVertical(context, x0, y0, x1, y1) {\n context.moveTo(x0, y0);\n context.bezierCurveTo(x0, y0 = (y0 + y1) / 2, x1, y0, x1, y1);\n}\n\nfunction curveRadial(context, x0, y0, x1, y1) {\n var p0 = pointRadial(x0, y0),\n p1 = pointRadial(x0, y0 = (y0 + y1) / 2),\n p2 = pointRadial(x1, y0),\n p3 = pointRadial(x1, y1);\n context.moveTo(p0[0], p0[1]);\n context.bezierCurveTo(p1[0], p1[1], p2[0], p2[1], p3[0], p3[1]);\n}\n\nexport function linkHorizontal() {\n return link(curveHorizontal);\n}\n\nexport function linkVertical() {\n return link(curveVertical);\n}\n\nexport function linkRadial() {\n var l = link(curveRadial);\n l.angle = l.x, delete l.x;\n l.radius = l.y, delete l.y;\n return l;\n}\n","import {linkHorizontal} from \"d3-shape\";\n\nfunction horizontalSource(d) {\n return [d.source.x1, d.y0];\n}\n\nfunction horizontalTarget(d) {\n return [d.target.x0, d.y1];\n}\n\nexport default function() {\n return linkHorizontal()\n .source(horizontalSource)\n .target(horizontalTarget);\n}\n","import { select } from 'd3'\nimport {\n\tsankey as d3Sankey,\n\tsankeyLinkHorizontal,\n\tsankeyLeft,\n\tsankeyRight,\n\tsankeyJustify\n} from 'd3-sankey'\nimport { debounce } from 'lodash-es'\nimport { getProperty, getTransformOffsets } from '@/tools'\nimport { alluvial as alluvialConfigs } from '@/configuration'\nimport { Component } from '@/components/component'\nimport { DOMUtils } from '@/services/essentials/dom-utils'\nimport { Events, ColorClassNameTypes, RenderTypes, Alignments } from '@/interfaces/enums'\n\n// BUG: Typing is not working for this.services.domUtils from the base class Component.\n// DOMUtils is already imported directly to this module so why bother using this.services.domUtils?\n\nexport class Alluvial extends Component {\n\ttype = 'alluvial'\n\trenderType = RenderTypes.SVG\n\n\tprivate graph: any\n\tgradient_id = 'gradient-id-' + Math.floor(Math.random() * 99999999999)\n\n\t// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n\t// @ts-ignore\n\t// eslint-disable-next-line @typescript-eslint/no-unused-vars\n\trender(animate = true) {\n\t\t// svg and container widths\n\t\tconst svg = this.getComponentContainer({ ariaLabel: 'alluvial graphs', withinChartClip: true })\n\t\tsvg.html('')\n\n\t\tconst { width, height } = DOMUtils.getSVGElementSize(svg, {\n\t\t\tuseAttrs: true\n\t\t})\n\n\t\t// Because of a Firefox bug with regards to sizing & d3 packs,\n\t\t// rather than checking if height or width aren't 0,\n\t\t// we have to make sure they're not smaller than 1\n\t\tif (width < 1 || height < 1) {\n\t\t\treturn\n\t\t}\n\t\tconst options = this.model.getOptions()\n\t\tconst data = this.model.getDisplayData()\n\n\t\t// Is gradient enabled or not\n\t\tconst isGradientAllowed: boolean = getProperty(\n\t\t\tthis.getOptions(),\n\t\t\t'color',\n\t\t\t'gradient',\n\t\t\t'enabled'\n\t\t)\n\n\t\t// Set the custom node padding if provided\n\t\tlet nodePadding = alluvialConfigs.minNodePadding\n\t\tif (options.alluvial.nodePadding > alluvialConfigs.minNodePadding) {\n\t\t\tnodePadding = options.alluvial.nodePadding\n\t\t}\n\n\t\tconst alignment = getProperty(options, 'alluvial', 'nodeAlignment')\n\n\t\tlet nodeAlignment = sankeyJustify\n\n\t\tif (alignment === Alignments.LEFT) {\n\t\t\tnodeAlignment = sankeyLeft\n\t\t} else if (alignment === Alignments.RIGHT) {\n\t\t\tnodeAlignment = sankeyRight\n\t\t}\n\n\t\tconst sankey = d3Sankey()\n\t\t\t.nodeId((node: any) => node.name)\n\t\t\t.nodeWidth(alluvialConfigs.nodeWidth)\n\t\t\t// Distance nodes are apart from each other\n\t\t\t.nodePadding(nodePadding)\n\t\t\t// Alignment of nodes within chart\n\t\t\t.nodeAlign(nodeAlignment)\n\t\t\t// Size of the chart and its padding\n\t\t\t// Chart starts at 2 and ends at width - 2 so the outer nodes can expand from center\n\t\t\t// Chart starts from 30 so node categories can be displayed\n\t\t\t.extent([\n\t\t\t\t[2, 30],\n\t\t\t\t[width - 2, height]\n\t\t\t])\n\n\t\t// Construct a graph with the provided user data\n\t\t// Data must be deep cloned to ensure user passed data isn't deleted when themes change\n\t\tthis.graph = sankey({\n\t\t\tnodes: options.alluvial.nodes.map((d: any) => Object.assign({}, d)),\n\t\t\tlinks: data.map((d: any) => Object.assign({}, d))\n\t\t})\n\n\t\t// Filter out unused nodes so they are not rendered\n\t\tthis.graph.nodes = this.graph.nodes.filter((node: any) => node.value !== 0)\n\n\t\t// Determine the category name placement x position\n\t\tconst nodeCoordinates: any = {}\n\t\tthis.graph.nodes.forEach((element: any) => {\n\t\t\tconst point = element.x0\n\n\t\t\t// Only 1 category per x-value\n\t\t\tif (element.category) {\n\t\t\t\tnodeCoordinates[point] = element?.category\n\t\t\t}\n\t\t})\n\n\t\t// Add node category text\n\t\tconst alluvialCategory = svg\n\t\t\t.append('g')\n\t\t\t.classed('header-arrows', true)\n\t\t\t.selectAll('g')\n\t\t\t.data(Object.keys(nodeCoordinates))\n\t\t\t.join('g')\n\t\t\t.attr('transform', (d: any) => {\n\t\t\t\treturn `translate(${d}, 0)`\n\t\t\t})\n\n\t\t// Add the category text\n\t\talluvialCategory\n\t\t\t.append('text')\n\t\t\t.attr('id', (_: any, i: number) =>\n\t\t\t\tthis.services.domUtils.generateElementIDString(`alluvial-category-${i}`)\n\t\t\t)\n\t\t\t.style('font-size', '14px')\n\t\t\t.text((d: any) => {\n\t\t\t\tif (nodeCoordinates[d]) {\n\t\t\t\t\treturn nodeCoordinates[d]\n\t\t\t\t}\n\t\t\t\treturn ''\n\t\t\t})\n\t\t\t.attr('y', 20)\n\t\t\t.attr('x', (d: any, i: number) => {\n\t\t\t\tconst elementID = this.services.domUtils.generateElementIDString(\n\t\t\t\t\t`alluvial-category-${i}`\n\t\t\t\t) as string\n\n\t\t\t\tconst { width: textWidth } = DOMUtils.getSVGElementSize(select(`text#${elementID}`), {\n\t\t\t\t\tuseBBox: true\n\t\t\t\t})\n\n\t\t\t\t// Make the text on the left on node group (except first column)\n\t\t\t\tlet x = 0\n\t\t\t\tif (d + x >= textWidth) {\n\t\t\t\t\tx = -textWidth + 4\n\t\t\t\t}\n\t\t\t\treturn x\n\t\t\t})\n\n\t\t// Draws the links (Waves)\n\t\tconst links = svg.append('g').attr('fill', 'none').selectAll('g').data(this.graph.links)\n\n\t\t// Exit so we can have multiple appends in group\n\t\tlinks.exit().remove()\n\n\t\t// Add gradient if requsted\n\t\tif (isGradientAllowed) {\n\t\t\tconst scale = getProperty(this.getOptions(), 'color', 'scale')\n\n\t\t\tif (scale) {\n\t\t\t\tlinks\n\t\t\t\t\t.enter()\n\t\t\t\t\t.append('linearGradient')\n\t\t\t\t\t.attr('id', (d: any) => `${this.gradient_id}-link-${d.index}`)\n\t\t\t\t\t.attr('gradientUnits', 'userSpaceOnUse')\n\t\t\t\t\t.call((gradient: any) =>\n\t\t\t\t\t\tgradient\n\t\t\t\t\t\t\t.append('stop')\n\t\t\t\t\t\t\t.attr('offset', '0%')\n\t\t\t\t\t\t\t.attr('stop-color', (d: any) => {\n\t\t\t\t\t\t\t\treturn scale[d.source.name]\n\t\t\t\t\t\t\t})\n\t\t\t\t\t)\n\t\t\t\t\t.call((gradient: any) =>\n\t\t\t\t\t\tgradient\n\t\t\t\t\t\t\t.append('stop')\n\t\t\t\t\t\t\t.attr('offset', '100%')\n\t\t\t\t\t\t\t.attr('stop-color', (d: any) => {\n\t\t\t\t\t\t\t\treturn scale[d.target.name]\n\t\t\t\t\t\t\t})\n\t\t\t\t\t)\n\t\t\t}\n\t\t\t// Exit so path can be appended to the group\n\t\t\tlinks.exit().remove()\n\t\t}\n\n\t\tlinks\n\t\t\t.enter()\n\t\t\t.append('path')\n\t\t\t.classed('link', true)\n\t\t\t.attr('d', sankeyLinkHorizontal())\n\t\t\t.attr('id', (d: any) =>\n\t\t\t\tthis.services.domUtils.generateElementIDString(`alluvial-line-${d.index}`)\n\t\t\t)\n\t\t\t.attr('class', (d: any) => {\n\t\t\t\t// Use a single color for the lines\n\t\t\t\tif (options.alluvial.monochrome) {\n\t\t\t\t\treturn this.model.getColorClassName({\n\t\t\t\t\t\tclassNameTypes: [ColorClassNameTypes.STROKE],\n\t\t\t\t\t\tdataGroupName: 0,\n\t\t\t\t\t\toriginalClassName: 'link'\n\t\t\t\t\t})\n\t\t\t\t}\n\n\t\t\t\treturn this.model.getColorClassName({\n\t\t\t\t\tclassNameTypes: [ColorClassNameTypes.STROKE],\n\t\t\t\t\tdataGroupName: d.source.index,\n\t\t\t\t\toriginalClassName: 'link'\n\t\t\t\t})\n\t\t\t})\n\t\t\t.style('stroke', (d: any) => {\n\t\t\t\tif (isGradientAllowed) {\n\t\t\t\t\treturn `url(#${this.gradient_id}-link-${d.index})`\n\t\t\t\t}\n\t\t\t\treturn this.model.getFillColor(d.source.name, null, {\n\t\t\t\t\t...d,\n\t\t\t\t\tsource: d.source.name,\n\t\t\t\t\ttarget: d.target.name\n\t\t\t\t})\n\t\t\t})\n\t\t\t.attr('stroke-width', (d: any) => Math.max(1, d.width))\n\t\t\t.style('stroke-opacity', alluvialConfigs.opacity.default)\n\t\t\t.attr(\n\t\t\t\t'aria-label',\n\t\t\t\t(d: any) =>\n\t\t\t\t\t`${d.source.name} → ${d.target.name} (${d.value}${\n\t\t\t\t\t\toptions.alluvial.units ? ' ' + options.alluvial.units : ''\n\t\t\t\t\t})`\n\t\t\t)\n\n\t\t// Creating the groups\n\t\tconst node = svg\n\t\t\t.append('g')\n\t\t\t.selectAll('g')\n\t\t\t.data(this.graph.nodes)\n\t\t\t.enter()\n\t\t\t.append('g')\n\t\t\t.attr('id', (d: any) =>\n\t\t\t\tthis.services.domUtils.generateElementIDString(`alluvial-node-${d.index}`)\n\t\t\t)\n\t\t\t.classed('node-group', true)\n\t\t\t.attr('transform', (d: any) => `translate(${d.x0}, ${d.y0})`)\n\n\t\t// Creating the nodes\n\t\tnode\n\t\t\t.append('rect')\n\t\t\t.classed('node', true)\n\t\t\t.attr('height', (d: any) => d.y1 - d.y0)\n\t\t\t.attr('width', (d: any) => d.x1 - d.x0)\n\t\t\t.attr('fill', 'black')\n\n\t\t// Group to hold the text & rectangle background\n\t\tconst textNode = node\n\t\t\t.append('g')\n\t\t\t.attr('id', (d: any) =>\n\t\t\t\tthis.services.domUtils.generateElementIDString(`alluvial-node-title-${d.index}`)\n\t\t\t)\n\n\t\tconst { code: localeCode, number: numberFormatter } = getProperty(options, 'locale')\n\t\t// Node title - text\n\t\ttextNode\n\t\t\t.append('text')\n\t\t\t.attr('id', (d: any) =>\n\t\t\t\tthis.services.domUtils.generateElementIDString(`alluvial-node-text-${d.index}`)\n\t\t\t)\n\t\t\t.attr('class', 'node-text')\n\t\t\t.style('font-size', '12px')\n\t\t\t.attr('text-anchor', 'start')\n\t\t\t.attr('fill', 'white')\n\t\t\t// Padding to text\n\t\t\t.attr('x', 4)\n\t\t\t// shift 13 pixels down to fit background container\n\t\t\t.attr('dy', 13)\n\t\t\t.text((d: any) => {\n\t\t\t\treturn `${d.name} (${numberFormatter(d.value, localeCode)})`\n\t\t\t})\n\t\t\t.attr('aria-label', (d: any) => {\n\t\t\t\treturn `${d.name} (${d.value})`\n\t\t\t})\n\n\t\t// Text background\n\t\ttextNode\n\t\t\t.append('rect')\n\t\t\t.classed('node-text-bg', true)\n\t\t\t.attr('width', (_: any, i: number) => {\n\t\t\t\tconst elementID = this.services.domUtils.generateElementIDString(\n\t\t\t\t\t`alluvial-node-text-${i}`\n\t\t\t\t) as string\n\n\t\t\t\t// Determine rectangle width based on text width\n\t\t\t\tconst { width: textWidth } = DOMUtils.getSVGElementSize(select(`text#${elementID}`), {\n\t\t\t\t\tuseBBox: true\n\t\t\t\t})\n\n\t\t\t\treturn textWidth + 8\n\t\t\t})\n\t\t\t.attr('height', 18)\n\t\t\t.attr('stroke-width', 2)\n\t\t\t.lower()\n\n\t\t// Position group based on text width\n\t\ttextNode.attr('transform', (d: any, i: number) => {\n\t\t\tconst elementID = this.services.domUtils.generateElementIDString(\n\t\t\t\t`alluvial-node-text-${i}`\n\t\t\t) as string\n\n\t\t\tconst { width: textWidth } = DOMUtils.getSVGElementSize(select(`text#${elementID}`), {\n\t\t\t\tuseBBox: true\n\t\t\t})\n\n\t\t\t// Subtracting 9 since text background is 18 to center\n\t\t\tconst y = (d.y1 - d.y0) / 2 - 9\n\t\t\t// Node width\n\t\t\tlet x = d.x1 - d.x0\n\n\t\t\t// Display bars on the right instead of left of the node\n\t\t\tif (d.x1 >= textWidth) {\n\t\t\t\t// 16 = node width (4) + text container padding (8) + distance between node and text container (4)\n\t\t\t\tx = x - (textWidth + 16)\n\t\t\t} else {\n\t\t\t\t// Add padding to text containers\n\t\t\t\tx += 4\n\t\t\t}\n\n\t\t\treturn `translate(${x}, ${y})`\n\t\t})\n\n\t\tthis.addLineEventListener()\n\t\tthis.addNodeEventListener()\n\t}\n\n\taddLineEventListener() {\n\t\tconst options = this.getOptions()\n\t\tconst self = this\n\t\tconst { number: numberFormatter, code: localeCode } = getProperty(this.getOptions(), 'locale')\n\n\t\t// Set delay to counter flashy behaviour\n\t\tconst debouncedLineHighlight = debounce((link, event = 'mouseover') => {\n\t\t\tconst allLinks = self.parent\n\t\t\t\t.selectAll('path.link')\n\t\t\t\t.transition()\n\t\t\t\t.call((t: any) =>\n\t\t\t\t\tself.services.transitions.setupTransition({\n\t\t\t\t\t\ttransition: t,\n\t\t\t\t\t\tname: 'alluvial-links-mouse-highlight'\n\t\t\t\t\t})\n\t\t\t\t)\n\n\t\t\tif (event === 'mouseout') {\n\t\t\t\tselect(link).lower()\n\t\t\t\tallLinks.style('stroke-opacity', alluvialConfigs.opacity.default)\n\t\t\t} else {\n\t\t\t\tallLinks.style('stroke-opacity', function () {\n\t\t\t\t\t// highlight and raise if link is this\n\t\t\t\t\tif (link === this) {\n\t\t\t\t\t\tselect(this).raise()\n\t\t\t\t\t\treturn alluvialConfigs.opacity.selected\n\t\t\t\t\t}\n\n\t\t\t\t\treturn alluvialConfigs.opacity.unfocus\n\t\t\t\t})\n\t\t\t}\n\t\t}, 33)\n\n\t\tthis.parent\n\t\t\t.selectAll('path.link')\n\t\t\t.on('mouseover', function (event: MouseEvent, datum: any) {\n\t\t\t\tconst hoveredElement = select(this)\n\t\t\t\tdebouncedLineHighlight(this, 'mouseover')\n\t\t\t\thoveredElement.classed('link-hovered', true)\n\n\t\t\t\tconst strokeColor = getComputedStyle(this as Element).getPropertyValue('stroke')\n\n\t\t\t\t// Dispatch mouse over event\n\t\t\t\tself.services.events.dispatchEvent(Events.Alluvial.LINE_MOUSEOVER, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: hoveredElement,\n\t\t\t\t\tdatum\n\t\t\t\t})\n\n\t\t\t\t// Dispatch tooltip show event\n\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.SHOW, {\n\t\t\t\t\tevent,\n\t\t\t\t\thoveredElement,\n\t\t\t\t\titems: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel: datum.target.name,\n\t\t\t\t\t\t\tvalue:\n\t\t\t\t\t\t\t\t(numberFormatter(datum.value, localeCode)\n\t\t\t\t\t\t\t\t\t? `${numberFormatter(datum.value, localeCode)}`\n\t\t\t\t\t\t\t\t\t: '-') + (options.alluvial.units ? ` ${options.alluvial.units}` : ''),\n\t\t\t\t\t\t\tcolor: strokeColor,\n\t\t\t\t\t\t\tlabelIcon: self.getRightArrowIcon()\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t})\n\t\t\t})\n\t\t\t.on('mousemove', function (event: MouseEvent, datum: any) {\n\t\t\t\t// Dispatch mouse move event\n\t\t\t\tself.services.events.dispatchEvent(Events.Alluvial.LINE_MOUSEMOVE, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: select(this),\n\t\t\t\t\tdatum\n\t\t\t\t})\n\t\t\t\t// Dispatch tooltip move event\n\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.MOVE, {\n\t\t\t\t\tevent\n\t\t\t\t})\n\t\t\t})\n\t\t\t.on('click', function (event: MouseEvent, datum: any) {\n\t\t\t\t// Dispatch mouse click event\n\t\t\t\tself.services.events.dispatchEvent(Events.Alluvial.LINE_CLICK, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: select(this),\n\t\t\t\t\tdatum\n\t\t\t\t})\n\t\t\t})\n\t\t\t.on('mouseout', function (event: MouseEvent, datum: any) {\n\t\t\t\tconst hoveredElement = select(this)\n\t\t\t\tdebouncedLineHighlight(this, 'mouseout')\n\t\t\t\thoveredElement.classed('link-hovered', false)\n\n\t\t\t\t// Dispatch mouse out event\n\t\t\t\tself.services.events.dispatchEvent(Events.Alluvial.LINE_MOUSEOUT, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: hoveredElement,\n\t\t\t\t\tdatum\n\t\t\t\t})\n\n\t\t\t\t// Dispatch hide tooltip event\n\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.HIDE, {\n\t\t\t\t\tevent,\n\t\t\t\t\thoveredElement\n\t\t\t\t})\n\t\t\t})\n\t}\n\n\taddNodeEventListener() {\n\t\tconst self = this\n\n\t\t// Set delay to counter flashy behaviour\n\t\tconst debouncedLineHighlight = debounce((links = [], event = 'mouseover') => {\n\t\t\tif (event === 'mouseout' || links.length === 0) {\n\t\t\t\t// set all links to default opacity & corret link order\n\t\t\t\tself.parent\n\t\t\t\t\t.selectAll('path.link')\n\t\t\t\t\t.classed('link-hovered', false)\n\t\t\t\t\t.data(this.graph.links, (d: any) => d.index)\n\t\t\t\t\t.order()\n\t\t\t\t\t.style('stroke-opacity', alluvialConfigs.opacity.default)\n\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\t// Highlight all nodes\n\t\t\tconst allLinks = self.parent\n\t\t\t\t.selectAll('path.link')\n\t\t\t\t.transition()\n\t\t\t\t.call((t: any) =>\n\t\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\t\ttransition: t,\n\t\t\t\t\t\tname: 'alluvial-link-mouse-highlight'\n\t\t\t\t\t})\n\t\t\t\t)\n\n\t\t\tallLinks.style('stroke-opacity', function (d: any) {\n\t\t\t\t// Raise the links & increase stroke-opacity to selected\n\t\t\t\tif (links.some((element: any) => element === d.index)) {\n\t\t\t\t\tselect(this).classed('link-hovered', true).raise()\n\t\t\t\t\treturn alluvialConfigs.opacity.selected\n\t\t\t\t}\n\n\t\t\t\treturn alluvialConfigs.opacity.unfocus\n\t\t\t})\n\t\t}, 66)\n\n\t\tself.parent\n\t\t\t.selectAll('.node-group')\n\t\t\t.on('mouseover', function (event: MouseEvent, datum: any) {\n\t\t\t\tconst hoveredElement = select(this)\n\n\t\t\t\t// Highlight all links that pass through node\n\t\t\t\tconst paths: any[] = []\n\n\t\t\t\t// Outgoing links\n\t\t\t\tself.traverse({ link: 'sourceLinks', node: 'target' }, datum, paths)\n\n\t\t\t\t//Incoming links\n\t\t\t\tself.traverse({ link: 'targetLinks', node: 'source' }, datum, paths)\n\n\t\t\t\t// Highlight all linked lines in the graph data structure\n\t\t\t\tif (paths.length) {\n\t\t\t\t\t// Get transformation value of node\n\t\t\t\t\tconst nodeMatrix = getTransformOffsets(hoveredElement.attr('transform'))\n\n\t\t\t\t\t// Move node to the left by 2 to grow node from the center\n\t\t\t\t\thoveredElement.attr('transform', `translate(${nodeMatrix.x - 2}, ${nodeMatrix.y})`)\n\n\t\t\t\t\thoveredElement.classed('node-hovered', true).selectAll('rect.node').attr('width', 8)\n\n\t\t\t\t\t// Translate first column text container to the\n\t\t\t\t\t// right so it doesn't clash with expanding node\n\t\t\t\t\tif (datum.x0 - 2 === 0) {\n\t\t\t\t\t\tconst elementID = self.services.domUtils.generateElementIDString(\n\t\t\t\t\t\t\t`alluvial-node-title-${datum.index}`\n\t\t\t\t\t\t)\n\n\t\t\t\t\t\tconst titleContainer = self.parent.select(`g#${elementID}`)\n\t\t\t\t\t\tconst titleMatrix = getTransformOffsets(titleContainer.attr('transform'))\n\n\t\t\t\t\t\ttitleContainer.attr('transform', `translate(${titleMatrix.x + 4},${titleMatrix.y})`)\n\t\t\t\t\t}\n\n\t\t\t\t\tconst elementID = self.services.domUtils.generateElementIDString(\n\t\t\t\t\t\t`alluvial-node-text-${datum.index}`\n\t\t\t\t\t)\n\n\t\t\t\t\tself.parent.select(`text#${elementID}`).style('font-weight', 'bold')\n\n\t\t\t\t\tdebouncedLineHighlight(paths, 'mouseover')\n\n\t\t\t\t\t// Dispatch mouse over event\n\t\t\t\t\tself.services.events.dispatchEvent(Events.Alluvial.NODE_MOUSEOVER, {\n\t\t\t\t\t\tevent,\n\t\t\t\t\t\telement: hoveredElement,\n\t\t\t\t\t\tdatum\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t})\n\t\t\t.on('mousemove', function (event: MouseEvent, datum: any) {\n\t\t\t\t// Dispatch mouse move event\n\t\t\t\tself.services.events.dispatchEvent(Events.Alluvial.NODE_MOUSEMOVE, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: select(this),\n\t\t\t\t\tdatum\n\t\t\t\t})\n\n\t\t\t\t// Dispatch tooltip move event\n\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.MOVE, {\n\t\t\t\t\tevent\n\t\t\t\t})\n\t\t\t})\n\t\t\t.on('click', function (event: MouseEvent, datum: any) {\n\t\t\t\t// Dispatch mouse click event\n\t\t\t\tself.services.events.dispatchEvent(Events.Alluvial.NODE_CLICK, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: select(this),\n\t\t\t\t\tdatum\n\t\t\t\t})\n\t\t\t})\n\t\t\t.on('mouseout', function (event: MouseEvent, datum: any) {\n\t\t\t\tconst hoveredElement = select(this)\n\n\t\t\t\t// Set the node position to initial state (unexpanded)\n\t\t\t\tconst nodeMatrix = getTransformOffsets(hoveredElement.attr('transform'))\n\n\t\t\t\thoveredElement\n\t\t\t\t\t.classed('node-hovered', false)\n\t\t\t\t\t.attr('transform', `translate(${nodeMatrix.x + 2}, ${nodeMatrix.y})`)\n\t\t\t\t\t.select('rect.node')\n\t\t\t\t\t.attr('width', alluvialConfigs.nodeWidth)\n\n\t\t\t\t// Translate text container back to initial state\n\t\t\t\tif (datum.x0 - 2 === 0) {\n\t\t\t\t\tconst elementID = self.services.domUtils.generateElementIDString(\n\t\t\t\t\t\t`alluvial-node-title-${datum.index}`\n\t\t\t\t\t)\n\n\t\t\t\t\tconst titleContainer = self.parent.select(`g#${elementID}`)\n\t\t\t\t\tconst titleMatrix = getTransformOffsets(titleContainer.attr('transform'))\n\n\t\t\t\t\ttitleContainer.attr('transform', `translate(${titleMatrix.x - 4},${titleMatrix.y})`)\n\t\t\t\t}\n\n\t\t\t\tconst elementID = self.services.domUtils.generateElementIDString(\n\t\t\t\t\t`alluvial-node-text-${datum.index}`\n\t\t\t\t)\n\n\t\t\t\tself.parent.select(`text#${elementID}`).style('font-weight', 'normal')\n\n\t\t\t\tdebouncedLineHighlight([], 'mouseout')\n\n\t\t\t\t// Dispatch mouse out event\n\t\t\t\tself.services.events.dispatchEvent(Events.Alluvial.NODE_MOUSEOUT, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: hoveredElement,\n\t\t\t\t\tdatum\n\t\t\t\t})\n\n\t\t\t\t// Dispatch hide tooltip event\n\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.HIDE, {\n\t\t\t\t\thoveredElement\n\t\t\t\t})\n\t\t\t})\n\t}\n\n\t// Traverse graph and get all connected links to node\n\tprivate traverse(\n\t\tdirection: { link: 'sourceLinks'; node: 'target' } | { link: 'targetLinks'; node: 'source' },\n\t\tnode: any,\n\t\tvisited: any[] = []\n\t) {\n\t\tconst links = node[direction.link].map((element: any) => {\n\t\t\tvisited.push(element.index)\n\t\t\treturn element[direction.node]\n\t\t})\n\n\t\t// Retrieve the child nodes\n\t\tlinks.forEach((element: any) => this.traverse(direction, element, visited))\n\t}\n\n\tgetRightArrowIcon() {\n\t\treturn `\n\t\t\n\t\t\t \n\t\t\t\n\t\t `\n\t}\n\n\t// Remove event listeners\n\tdestroy() {\n\t\tthis.parent\n\t\t\t.selectAll('path.line,.node-group')\n\t\t\t.on('mouseover', null)\n\t\t\t.on('mousemove', null)\n\t\t\t.on('click', null)\n\t\t\t.on('mouseout', null)\n\t}\n}\n","import { axisBottom, axisLeft } from 'd3'\nimport { getProperty, getTranslationValues } from '@/tools'\nimport { Component } from '@/components/component'\nimport { DOMUtils } from '@/services/essentials/dom-utils'\nimport { RenderTypes } from '@/interfaces/enums'\n\nexport class Grid extends Component {\n\ttype = 'grid'\n\trenderType = RenderTypes.SVG\n\n\tbackdrop: any\n\n\trender(animate = true) {\n\t\tconst isXGridEnabled = getProperty(this.getOptions(), 'grid', 'x', 'enabled')\n\t\tconst isYGridEnabled = getProperty(this.getOptions(), 'grid', 'y', 'enabled')\n\n\t\t// Draw the backdrop\n\t\tthis.drawBackdrop(isXGridEnabled, isYGridEnabled)\n\n\t\tif (!isXGridEnabled && !isYGridEnabled) {\n\t\t\treturn\n\t\t}\n\n\t\tif (isXGridEnabled) {\n\t\t\tDOMUtils.appendOrSelect(this.backdrop, 'g.x.grid')\n\t\t\tthis.drawXGrid(animate)\n\t\t}\n\n\t\tif (isYGridEnabled) {\n\t\t\tDOMUtils.appendOrSelect(this.backdrop, 'g.y.grid')\n\t\t\tthis.drawYGrid(animate)\n\t\t}\n\t}\n\n\tdrawXGrid(animate: boolean) {\n\t\tconst svg = this.parent\n\n\t\tconst height = this.backdrop.attr('height')\n\n\t\tconst mainXScale = this.services.cartesianScales.getMainXScale()\n\t\tconst xGrid = axisBottom(mainXScale as any)\n\t\t\t.tickSizeInner(-height)\n\t\t\t.tickSizeOuter(0)\n\n\t\t// if the main range axis has a custom domain, align the gridlines to the ticks\n\t\tconst alignToTicks = getProperty(this.getOptions(), 'grid', 'x', 'alignWithAxisTicks')\n\n\t\tif (alignToTicks) {\n\t\t\tconst mainXPosition = this.services.cartesianScales.getDomainAxisPosition()\n\t\t\tconst customDomain = getProperty(this.getOptions(), 'axes', mainXPosition, 'ticks', 'values')\n\t\t\t// use custom domain if there is one\n\t\t\t// otherwise d3 defaults to using one gridline per tick\n\t\t\tif (customDomain) {\n\t\t\t\txGrid.tickValues(customDomain)\n\t\t\t}\n\t\t} else {\n\t\t\t// Determine number of ticks\n\t\t\tconst numberOfTicks = getProperty(this.getOptions(), 'grid', 'x', 'numberOfTicks')\n\n\t\t\txGrid.ticks(numberOfTicks)\n\t\t}\n\n\t\tconst g = svg\n\t\t\t.select('.x.grid')\n\t\t\t.attr('transform', `translate(${-this.backdrop.attr('x')}, ${height})`)\n\n\t\tif (animate) {\n\t\t\tg.transition()\n\t\t\t\t.call((t: any) =>\n\t\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\t\ttransition: t,\n\t\t\t\t\t\tname: 'grid-update',\n\t\t\t\t\t\tanimate\n\t\t\t\t\t})\n\t\t\t\t)\n\t\t\t\t.call(xGrid as any)\n\t\t} else {\n\t\t\tg.call(xGrid as any)\n\t\t}\n\n\t\tthis.cleanGrid(g)\n\t}\n\n\tdrawYGrid(animate: boolean) {\n\t\tconst svg = this.parent\n\t\tconst width = this.backdrop.attr('width')\n\n\t\tconst mainYScale = this.services.cartesianScales.getMainYScale()\n\t\tconst yGrid = axisLeft(mainYScale as any)\n\t\t\t.tickSizeInner(-width)\n\t\t\t.tickSizeOuter(0)\n\n\t\t// if the main range axis has a custom domain, align the gridlines to the ticks\n\t\tconst alignToTicks = getProperty(this.getOptions(), 'grid', 'y', 'alignWithAxisTicks')\n\n\t\tif (alignToTicks) {\n\t\t\tconst mainYPosition = this.services.cartesianScales.getRangeAxisPosition()\n\n\t\t\tconst customDomain = getProperty(this.getOptions(), 'axes', mainYPosition, 'ticks', 'values')\n\n\t\t\t// use custom domain if there is one\n\t\t\t// otherwise d3 defaults to using one gridline per tick\n\t\t\tif (customDomain) {\n\t\t\t\tyGrid.tickValues(customDomain)\n\t\t\t}\n\t\t} else {\n\t\t\t// Determine number of ticks\n\t\t\tconst numberOfTicks = getProperty(this.getOptions(), 'grid', 'y', 'numberOfTicks')\n\n\t\t\tyGrid.ticks(numberOfTicks)\n\t\t}\n\n\t\tconst g = svg.select('.y.grid').attr('transform', `translate(0, ${-this.backdrop.attr('y')})`)\n\n\t\tif (animate) {\n\t\t\tg.transition()\n\t\t\t\t.call((t: any) =>\n\t\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\t\ttransition: t,\n\t\t\t\t\t\tname: 'grid-update',\n\t\t\t\t\t\tanimate\n\t\t\t\t\t})\n\t\t\t\t)\n\t\t\t\t.call(yGrid as any)\n\t\t} else {\n\t\t\tg.call(yGrid as any)\n\t\t}\n\n\t\tthis.cleanGrid(g)\n\t}\n\n\t/**\n\t * Returns the threshold for the gridline tooltips based on the mouse location.\n\t * Calculated based on the mouse position between the two closest gridlines or edges of chart.\n\t */\n\tgetGridlineThreshold(mousePos: any) {\n\t\t// use the space between axis grid ticks to adjust the threshold for the tooltips\n\t\tconst svg = this.parent\n\n\t\t// sort in ascending x translation value order\n\t\tconst gridlinesX = svg\n\t\t\t.selectAll('.x.grid .tick')\n\t\t\t.nodes()\n\t\t\t.sort((a: HTMLElement, b: HTMLElement) => {\n\t\t\t\treturn Number(getTranslationValues(a).tx) - Number(getTranslationValues(b).tx)\n\t\t\t})\n\n\t\t// find the 2 gridlines on either side of the mouse\n\t\tlet floor = -1\n\t\tif (!gridlinesX.length) {\n\t\t\treturn\n\t\t}\n\n\t\tgridlinesX.forEach((line: HTMLElement) => {\n\t\t\tif (mousePos[0] >= +getTranslationValues(line).tx) {\n\t\t\t\tfloor++\n\t\t\t}\n\t\t})\n\t\tconst ceiling = floor + 1 < gridlinesX.length ? floor + 1 : gridlinesX.length\n\n\t\t// get the 'step' between chart gridlines\n\t\tconst line1 = gridlinesX[floor]\n\t\tconst line2 = gridlinesX[ceiling]\n\t\tlet lineSpacing\n\n\t\t// if the mouse is on edge of charts (mouseX < first gridline || mouseX > last gridline)\n\t\t// we can use the chart edge to determind the threshold for the gridlines\n\t\tif (!line1) {\n\t\t\t// we are between the first gridline and the chart edge\n\t\t\tlineSpacing = +getTranslationValues(line2 as any).tx\n\t\t} else if (!line2) {\n\t\t\t// we need to use the chart right bounds in case there isnt a domain axis\n\t\t\tconst gridElement = svg.select('rect.chart-grid-backdrop').node()\n\t\t\tconst width = DOMUtils.getSVGElementSize(gridElement as any).width\n\n\t\t\tlineSpacing = width - +getTranslationValues(line1 as any).tx\n\t\t} else {\n\t\t\t// there are two gridlines to use\n\t\t\tlineSpacing = +getTranslationValues(line2 as any).tx - +getTranslationValues(line1 as any).tx\n\t\t}\n\t\tconst { threshold } = this.getOptions().tooltip.gridline\n\t\t// return the threshold\n\t\treturn lineSpacing * threshold\n\t}\n\n\t/**\n\t * Returns the active gridlines based on the gridline threshold and mouse position.\n\t * @param position mouse positon\n\t */\n\tgetActiveGridline(position: any) {\n\t\tconst userSpecifiedThreshold = getProperty(this.getOptions, 'tooltip', 'gridline', 'threshold')\n\t\tconst threshold = userSpecifiedThreshold\n\t\t\t? userSpecifiedThreshold\n\t\t\t: this.getGridlineThreshold(position)\n\t\tconst svg = this.parent\n\n\t\tconst xGridlines = svg.selectAll('.x.grid .tick').filter(function () {\n\t\t\tconst translations = getTranslationValues(this as any)\n\n\t\t\t// threshold for when to display a gridline tooltip\n\t\t\tconst bounds = {\n\t\t\t\tmin: Number(translations.tx) - threshold,\n\t\t\t\tmax: Number(translations.tx) + threshold\n\t\t\t}\n\n\t\t\treturn bounds.min <= position[0] && position[0] <= bounds.max\n\t\t})\n\n\t\treturn xGridlines\n\t}\n\n\tdrawBackdrop(isXGridEnabled: boolean, isYGridEnabled: boolean) {\n\t\tconst svg = this.parent\n\n\t\tconst mainXScale = this.services.cartesianScales.getMainXScale()\n\t\tconst mainYScale = this.services.cartesianScales.getMainYScale()\n\n\t\tconst [xScaleStart, xScaleEnd] = mainXScale.range()\n\t\tconst [yScaleEnd, yScaleStart] = mainYScale.range()\n\n\t\t// Get height from the grid\n\t\tthis.backdrop = DOMUtils.appendOrSelect(svg, 'svg.chart-grid-backdrop').attr(\n\t\t\t'role',\n\t\t\t'presentation'\n\t\t)\n\t\tconst backdropRect = DOMUtils.appendOrSelect(\n\t\t\tthis.backdrop,\n\t\t\tisXGridEnabled || isYGridEnabled\n\t\t\t\t? 'rect.chart-grid-backdrop.stroked'\n\t\t\t\t: 'rect.chart-grid-backdrop'\n\t\t)\n\n\t\tthis.backdrop\n\t\t\t.merge(backdropRect)\n\t\t\t.attr('x', xScaleStart)\n\t\t\t.attr('y', yScaleStart)\n\t\t\t.attr('width', Math.abs(xScaleEnd - xScaleStart))\n\t\t\t.attr('height', Math.abs(yScaleEnd - yScaleStart))\n\t\t\t.lower()\n\n\t\tbackdropRect.attr('width', '100%').attr('height', '100%')\n\t}\n\n\tcleanGrid(g: any) {\n\t\t// Remove extra elements\n\t\tg.selectAll('text').remove()\n\t\tg.select('.domain').remove()\n\t}\n}\n","import { area, select } from 'd3'\nimport { getProperty } from '@/tools'\nimport { area as areaConfigs } from '@/configuration'\nimport { Component } from '@/components/component'\nimport { CartesianOrientations, Events, ColorClassNameTypes, RenderTypes } from '@/interfaces/enums'\nimport { GradientUtils } from '@/services/essentials/gradient-utils'\n\nexport class Area extends Component {\n\ttype = 'area'\n\trenderType = RenderTypes.SVG\n\n\tgradient_id = 'gradient-id-' + Math.floor(Math.random() * 99999999999)\n\n\tinit() {\n\t\tconst eventsFragment = this.services.events\n\n\t\t// Highlight correct area on legend item hovers\n\t\teventsFragment.addEventListener(Events.Legend.ITEM_HOVER, this.handleLegendOnHover)\n\n\t\t// Un-highlight area on legend item mouseouts\n\t\teventsFragment.addEventListener(Events.Legend.ITEM_MOUSEOUT, this.handleLegendMouseOut)\n\t}\n\n\trender(animate = true) {\n\t\tconst svg = this.getComponentContainer({ ariaLabel: 'area graphs', withinChartClip: true })\n\t\tconst options = this.getOptions()\n\t\tlet domain = [0, 0]\n\n\t\tconst { cartesianScales } = this.services\n\n\t\tconst orientation = cartesianScales.getOrientation()\n\t\tconst areaGenerator = area()\n\t\t\t.curve(this.services.curves.getD3Curve())\n\t\t\t.defined((datum: any) => {\n\t\t\t\tconst rangeIdentifier = cartesianScales.getRangeIdentifier()\n\t\t\t\tconst value = datum[rangeIdentifier]\n\t\t\t\tif (value === null || value === undefined) {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\t\t\t\treturn true\n\t\t\t})\n\n\t\t// Update the bound data on area groups\n\t\tconst groupedData = this.model.getGroupedData(this.configs.groups)\n\n\t\tconst bounds = getProperty(options, 'bounds')\n\t\tconst boundsEnabled = bounds && groupedData && groupedData.length === 1\n\n\t\tif (!boundsEnabled && bounds) {\n\t\t\tconsole.warn(\n\t\t\t\t`Bounds can only be shown when having 1 single datagroup, you've supplied ${groupedData.length}`\n\t\t\t)\n\t\t}\n\n\t\tlet upperBoundRangeValue = 0\n\t\t// If includeZero is enabled, we want to replace upperBoundRange from 0 to domain value\n\t\tconst includeZeroInRangeValue = (position: any, _domain: any) => {\n\t\t\tif (getProperty(options, 'axes', position, 'includeZero') === false) {\n\t\t\t\t// Replace upperBoundRangeValue if domain is positive\n\t\t\t\tif (_domain[0] > 0 && _domain[1] > 0) {\n\t\t\t\t\tupperBoundRangeValue = _domain[0]\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tconst upperBound = (d: any) =>\n\t\t\tboundsEnabled\n\t\t\t\t? cartesianScales.getBoundedScaledValues(d)[0]\n\t\t\t\t: cartesianScales.getRangeValue(upperBoundRangeValue)\n\n\t\tconst lowerBound = (d: any) =>\n\t\t\tboundsEnabled\n\t\t\t\t? cartesianScales.getBoundedScaledValues(d)[1]\n\t\t\t\t: cartesianScales.getRangeValue(d)\n\n\t\tif (orientation === CartesianOrientations.VERTICAL) {\n\t\t\tdomain = cartesianScales.getMainYScale().domain() as number[]\n\t\t\tincludeZeroInRangeValue(cartesianScales.getMainYAxisPosition(), domain)\n\n\t\t\tareaGenerator\n\t\t\t\t.x((d: any) => cartesianScales.getDomainValue(d))\n\t\t\t\t.y0((d: any) => upperBound(d))\n\t\t\t\t.y1((d: any) => lowerBound(d))\n\t\t} else {\n\t\t\tdomain = cartesianScales.getMainXScale().domain() as number[]\n\t\t\tincludeZeroInRangeValue(cartesianScales.getMainXAxisPosition(), domain)\n\n\t\t\tareaGenerator\n\t\t\t\t.x0((d: any) => upperBound(d))\n\t\t\t\t.x1((d: any) => lowerBound(d))\n\t\t\t\t.y((d: any) => cartesianScales.getDomainValue(d))\n\t\t}\n\n\t\t// Is gradient enabled or not\n\t\tconst isGradientEnabled = getProperty(options, 'color', 'gradient', 'enabled')\n\n\t\t// Should gradient style be applicable\n\t\tconst isGradientAllowed = groupedData && groupedData.length === 1 && isGradientEnabled\n\n\t\tif (groupedData.length > 1 && isGradientEnabled) {\n\t\t\tconsole.error('Gradients can only be enabled when having 1 single dataset')\n\t\t}\n\n\t\tconst areas = svg.selectAll('path.area').data(groupedData, (group: any) => group.name)\n\n\t\tconst chartMainContainer = select(this.services.domUtils.getMainContainer())\n\n\t\t// Remove elements that need to be exited\n\t\t// We need exit at the top here to make sure that\n\t\t// Data filters are processed before entering new elements\n\t\t// Or updating existing ones\n\t\tareas.exit().attr('opacity', 0).remove()\n\n\t\t// if there is no grouped data (if all data groups are turned OFF with legend which can happen in the case of combo charts)\n\t\tif (!groupedData.length) {\n\t\t\treturn\n\t\t}\n\n\t\tif (isGradientAllowed) {\n\t\t\t// The fill value of area has been overwritten, get color value from stroke color class instead\n\t\t\tconst strokePathElement = chartMainContainer\n\t\t\t\t.select(\n\t\t\t\t\t`path.${this.model.getColorClassName({\n\t\t\t\t\t\tclassNameTypes: [ColorClassNameTypes.STROKE],\n\t\t\t\t\t\tdataGroupName: groupedData[0].name\n\t\t\t\t\t})}`\n\t\t\t\t)\n\t\t\t\t.node()\n\n\t\t\tlet colorValue\n\t\t\tif (strokePathElement) {\n\t\t\t\tcolorValue = getComputedStyle(strokePathElement as HTMLElement, null).getPropertyValue(\n\t\t\t\t\t'stroke'\n\t\t\t\t)\n\t\t\t} else {\n\t\t\t\tconst sparklineColorObject = getProperty(this.model.getOptions(), 'color', 'scale')\n\n\t\t\t\tif (sparklineColorObject !== null) {\n\t\t\t\t\tconst sparklineColorObjectKeys = Object.keys(sparklineColorObject)\n\t\t\t\t\tcolorValue = sparklineColorObject[sparklineColorObjectKeys[0]]\n\t\t\t\t}\n\t\t\t}\n\t\t\tGradientUtils.appendOrUpdateLinearGradient({\n\t\t\t\tsvg: this.parent,\n\t\t\t\tid: this.services.domUtils.generateElementIDString(\n\t\t\t\t\t`${groupedData[0].name.replace(' ', '')}_${this.gradient_id}`\n\t\t\t\t),\n\t\t\t\tx1: '0%',\n\t\t\t\tx2: '0%',\n\t\t\t\ty1: '0%',\n\t\t\t\ty2: '100%',\n\t\t\t\tstops: GradientUtils.getStops(domain, colorValue)\n\t\t\t})\n\t\t} else {\n\t\t\t// make sure there is no linearGradient if no gradient is allowed\n\t\t\tif (!this.parent.selectAll('defs linearGradient').empty()) {\n\t\t\t\tthis.parent.selectAll('defs linearGradient').each(function () {\n\t\t\t\t\t;(this as any).parentNode.remove()\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\n\t\tconst self = this\n\n\t\t// Enter paths that need to be introduced\n\t\tconst enteringAreas = areas.enter().append('path')\n\t\tif (isGradientAllowed) {\n\t\t\tenteringAreas\n\t\t\t\t.merge(areas as any)\n\t\t\t\t.style(\n\t\t\t\t\t'fill',\n\t\t\t\t\t(group: any) =>\n\t\t\t\t\t\t`url(#${this.services.domUtils.generateElementIDString(\n\t\t\t\t\t\t\t`${group.name.replace(' ', '')}_${this.gradient_id}`\n\t\t\t\t\t\t)})`\n\t\t\t\t)\n\t\t\t\t.attr('class', 'area')\n\t\t\t\t.attr('class', (group: any) =>\n\t\t\t\t\tthis.model.getColorClassName({\n\t\t\t\t\t\tclassNameTypes: [ColorClassNameTypes.FILL],\n\t\t\t\t\t\tdataGroupName: group.name,\n\t\t\t\t\t\toriginalClassName: 'area'\n\t\t\t\t\t})\n\t\t\t\t)\n\t\t\t\t.attr('d', (group: any) => {\n\t\t\t\t\tconst { data } = group\n\t\t\t\t\treturn areaGenerator(data)\n\t\t\t\t})\n\t\t} else {\n\t\t\tenteringAreas\n\t\t\t\t.attr('opacity', 0)\n\t\t\t\t.merge(areas as any)\n\t\t\t\t.attr('class', 'area')\n\t\t\t\t.attr('class', (group: any) =>\n\t\t\t\t\tthis.model.getColorClassName({\n\t\t\t\t\t\tclassNameTypes: [ColorClassNameTypes.FILL, ColorClassNameTypes.STROKE],\n\t\t\t\t\t\tdataGroupName: group.name,\n\t\t\t\t\t\toriginalClassName: 'area'\n\t\t\t\t\t})\n\t\t\t\t)\n\t\t\t\t.style('fill', (group: any) => self.model.getFillColor(group.name, null, group.data))\n\t\t\t\t.transition()\n\t\t\t\t.call((t: any) =>\n\t\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\t\ttransition: t,\n\t\t\t\t\t\tname: 'area-update-enter',\n\t\t\t\t\t\tanimate\n\t\t\t\t\t})\n\t\t\t\t)\n\t\t\t\t.attr('opacity', boundsEnabled ? 1 : areaConfigs.opacity.selected)\n\t\t\t\t.attr('d', (group: any) => {\n\t\t\t\t\tconst { data } = group\n\t\t\t\t\treturn areaGenerator(data)\n\t\t\t\t})\n\n\t\t\tif (boundsEnabled) {\n\t\t\t\tenteringAreas\n\t\t\t\t\t.attr('fill-opacity', areaConfigs.opacity.selected)\n\t\t\t\t\t.style('stroke', (group: any) => self.model.getStrokeColor(group.name, null, group.data))\n\t\t\t\t\t.style('stroke-dasharray', '2, 2')\n\t\t\t\t\t.attr('stroke-width', 0.7 + 'px')\n\t\t\t}\n\t\t}\n\t}\n\n\thandleLegendOnHover = (event: CustomEvent) => {\n\t\tconst { hoveredElement } = event.detail\n\n\t\tthis.parent\n\t\t\t.selectAll('path.area')\n\t\t\t.transition('legend-hover-area')\n\t\t\t.call((t: any) =>\n\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\ttransition: t,\n\t\t\t\t\tname: 'legend-hover-area'\n\t\t\t\t})\n\t\t\t)\n\t\t\t.attr('opacity', (group: any) => {\n\t\t\t\tif (group.name !== hoveredElement.datum()['name']) {\n\t\t\t\t\treturn areaConfigs.opacity.unselected\n\t\t\t\t}\n\n\t\t\t\treturn areaConfigs.opacity.selected\n\t\t\t})\n\t}\n\n\thandleLegendMouseOut = () => {\n\t\tthis.parent\n\t\t\t.selectAll('path.area')\n\t\t\t.transition('legend-mouseout-area')\n\t\t\t.call((t: any) =>\n\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\ttransition: t,\n\t\t\t\t\tname: 'legend-mouseout-area'\n\t\t\t\t})\n\t\t\t)\n\t\t\t.attr('opacity', areaConfigs.opacity.selected)\n\t}\n\n\tdestroy() {\n\t\t// Remove legend listeners\n\t\tconst eventsFragment = this.services.events\n\t\teventsFragment.removeEventListener(Events.Legend.ITEM_HOVER, this.handleLegendOnHover)\n\t\teventsFragment.removeEventListener(Events.Legend.ITEM_MOUSEOUT, this.handleLegendMouseOut)\n\t}\n}\n","import { line } from 'd3'\nimport { some } from 'lodash-es'\nimport { flipDomainAndRangeBasedOnOrientation, getProperty } from '@/tools'\nimport { lines as lineConfigs } from '@/configuration'\nimport { Component } from '@/components/component'\nimport { Events, ColorClassNameTypes, RenderTypes } from '@/interfaces/enums'\nimport { Roles } from '@/interfaces/a11y'\n\nexport class Line extends Component {\n\ttype = 'line'\n\trenderType = RenderTypes.SVG\n\n\tinit() {\n\t\tconst { events } = this.services\n\t\t// Highlight correct line legend item hovers\n\t\tevents.addEventListener(Events.Legend.ITEM_HOVER, this.handleLegendOnHover)\n\t\t// Un-highlight lines on legend item mouseouts\n\t\tevents.addEventListener(Events.Legend.ITEM_MOUSEOUT, this.handleLegendMouseOut)\n\t}\n\n\trender(animate = true) {\n\t\tconst svg = this.getComponentContainer({ ariaLabel: 'lines', withinChartClip: true })\n\t\tconst { cartesianScales, curves } = this.services\n\n\t\tconst getDomainValue = (d: any) => cartesianScales.getDomainValue(d)\n\t\tconst getRangeValue = (d: any) => cartesianScales.getRangeValue(d)\n\t\tconst [getXValue, getYValue] = flipDomainAndRangeBasedOnOrientation(\n\t\t\tgetDomainValue,\n\t\t\tgetRangeValue,\n\t\t\tcartesianScales.getOrientation()\n\t\t)\n\t\tconst options = this.getOptions()\n\n\t\t// D3 line generator function\n\t\tconst lineGenerator = line()\n\t\t\t.x(getXValue)\n\t\t\t.y(getYValue)\n\t\t\t.curve(curves.getD3Curve())\n\t\t\t.defined((datum: any) => {\n\t\t\t\tconst rangeIdentifier = cartesianScales.getRangeIdentifier(datum)\n\t\t\t\tconst value = datum[rangeIdentifier]\n\t\t\t\tif (value === null || value === undefined) {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\t\t\t\treturn true\n\t\t\t})\n\n\t\tlet data = []\n\t\tif (this.configs.stacked) {\n\t\t\tconst percentage = Object.keys(options.axes).some(axis => options.axes[axis].percentage)\n\t\t\tconst { groupMapsTo } = options.data\n\t\t\tconst stackedData = this.model.getStackedData({\n\t\t\t\tgroups: this.configs.groups,\n\t\t\t\tpercentage\n\t\t\t})\n\n\t\t\tdata = stackedData.map((d: any) => {\n\t\t\t\tconst domainIdentifier = this.services.cartesianScales.getDomainIdentifier(d)\n\t\t\t\tconst rangeIdentifier = this.services.cartesianScales.getRangeIdentifier(d)\n\t\t\t\treturn {\n\t\t\t\t\tname: getProperty(d, 0, groupMapsTo),\n\t\t\t\t\tdata: d.map((datum: any) => ({\n\t\t\t\t\t\t[domainIdentifier]: datum.data.sharedStackKey,\n\t\t\t\t\t\t[groupMapsTo]: datum[groupMapsTo],\n\t\t\t\t\t\t[rangeIdentifier]: datum[1]\n\t\t\t\t\t})),\n\t\t\t\t\thidden: !some(d, (datum: any) => datum[0] !== datum[1])\n\t\t\t\t}\n\t\t\t})\n\t\t} else {\n\t\t\tdata = this.model.getGroupedData(this.configs.groups)\n\t\t}\n\n\t\t// Update the bound data on lines\n\t\tconst lines = svg.selectAll('path.line').data(data, (group: any) => group.name)\n\n\t\t// Remove elements that need to be exited\n\t\t// We need exit at the top here to make sure that\n\t\t// Data filters are processed before entering new elements\n\t\t// Or updating existing ones\n\t\tlines.exit().attr('opacity', 0).remove()\n\n\t\t// Add lines that need to be introduced\n\t\tconst enteringLines = lines.enter().append('path').classed('line', true).attr('opacity', 0)\n\n\t\t// Apply styles and datum\n\t\tenteringLines\n\t\t\t.merge(lines as any)\n\t\t\t.data(data, (group: any) => group.name)\n\t\t\t.attr('class', (group: any) =>\n\t\t\t\tthis.model.getColorClassName({\n\t\t\t\t\tclassNameTypes: [ColorClassNameTypes.STROKE],\n\t\t\t\t\tdataGroupName: group.name,\n\t\t\t\t\toriginalClassName: 'line'\n\t\t\t\t})\n\t\t\t)\n\t\t\t.style('stroke', (group: any) => this.model.getStrokeColor(group.name, null, group.data))\n\t\t\t// a11y\n\t\t\t.attr('role', Roles.GRAPHICS_SYMBOL)\n\t\t\t.attr('aria-roledescription', 'line')\n\t\t\t.attr('aria-label', (group: any) => {\n\t\t\t\tconst { data: groupData } = group\n\t\t\t\treturn groupData\n\t\t\t\t\t.map((datum: any) => {\n\t\t\t\t\t\tconst rangeIdentifier = this.services.cartesianScales.getRangeIdentifier(datum)\n\t\t\t\t\t\treturn datum[rangeIdentifier]\n\t\t\t\t\t})\n\t\t\t\t\t.join(',')\n\t\t\t})\n\t\t\t// Transition\n\t\t\t.transition()\n\t\t\t.call((t: any) =>\n\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\ttransition: t,\n\t\t\t\t\tname: 'line-update-enter',\n\t\t\t\t\tanimate\n\t\t\t\t})\n\t\t\t)\n\t\t\t.attr('opacity', (d: any) => (d.hidden ? 0 : 1))\n\t\t\t.attr('d', (group: any) => {\n\t\t\t\tconst { data: groupData } = group\n\t\t\t\treturn lineGenerator(groupData)\n\t\t\t})\n\t}\n\n\thandleLegendOnHover = (event: CustomEvent) => {\n\t\tconst { hoveredElement } = event.detail\n\n\t\tthis.parent\n\t\t\t.selectAll('path.line')\n\t\t\t.transition('legend-hover-line')\n\t\t\t.call((t: any) =>\n\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\ttransition: t,\n\t\t\t\t\tname: 'legend-hover-line'\n\t\t\t\t})\n\t\t\t)\n\t\t\t.attr('opacity', (group: any) => {\n\t\t\t\tif (group.name !== hoveredElement.datum()['name']) {\n\t\t\t\t\treturn lineConfigs.opacity.unselected\n\t\t\t\t}\n\n\t\t\t\treturn lineConfigs.opacity.selected\n\t\t\t})\n\t}\n\n\thandleLegendMouseOut = () => {\n\t\tthis.parent\n\t\t\t.selectAll('path.line')\n\t\t\t.transition('legend-mouseout-line')\n\t\t\t.call((t: any) =>\n\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\ttransition: t,\n\t\t\t\t\tname: 'legend-mouseout-line'\n\t\t\t\t})\n\t\t\t)\n\t\t\t.attr('opacity', lineConfigs.opacity.selected)\n\t}\n\n\tdestroy() {\n\t\t// Remove legend listeners\n\t\tconst eventsFragment = this.services.events\n\t\teventsFragment.removeEventListener(Events.Legend.ITEM_HOVER, this.handleLegendOnHover)\n\t\teventsFragment.removeEventListener(Events.Legend.ITEM_MOUSEOUT, this.handleLegendMouseOut)\n\t}\n}\n","import { Selection, pointer } from 'd3'\nimport { isEqual } from 'lodash-es'\nimport { debounceWithD3MousePosition, getProperty } from '@/tools'\nimport { Component } from '@/components/component'\nimport { DOMUtils } from '@/services/essentials/dom-utils'\nimport { CartesianOrientations, Events, RenderTypes } from '@/interfaces/enums'\n\nexport type GenericSvgSelection = Selection\n\nconst THRESHOLD = 5\n\n/** check if x is inside threshold area extents */\nfunction pointIsWithinThreshold(dx: number, x: number) {\n\treturn dx > x - THRESHOLD && dx < x + THRESHOLD\n}\n\nexport class Ruler extends Component {\n\ttype = 'ruler'\n\trenderType = RenderTypes.SVG\n\n\tbackdrop: GenericSvgSelection\n\telementsToHighlight: GenericSvgSelection\n\tpointsWithinLine: {\n\t\tdomainValue: number\n\t\toriginalData: any\n\t}[]\n\tisXGridEnabled = getProperty(this.getOptions(), 'grid', 'x', 'enabled')\n\tisYGridEnabled = getProperty(this.getOptions(), 'grid', 'y', 'enabled')\n\t// flag for checking whether ruler event listener is added or not\n\tisEventListenerAdded = false\n\n\t// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n\t// @ts-ignore\n\t// eslint-disable-next-line @typescript-eslint/no-unused-vars\n\trender(animate = false) {\n\t\tconst isRulerEnabled = getProperty(this.getOptions(), 'ruler', 'enabled')\n\n\t\tthis.drawBackdrop()\n\n\t\tif (isRulerEnabled && !this.isEventListenerAdded) {\n\t\t\tthis.addBackdropEventListeners()\n\t\t} else if (!isRulerEnabled && this.isEventListenerAdded) {\n\t\t\tthis.removeBackdropEventListeners()\n\t\t}\n\t}\n\n\tremoveBackdropEventListeners() {\n\t\tthis.isEventListenerAdded = false\n\t\tthis.backdrop.on('mousemove mouseover mouseout', null)\n\t}\n\n\tformatTooltipData(tooltipData: any) {\n\t\treturn tooltipData\n\t}\n\n\tshowRuler(event: CustomEvent, [x, y]: [number, number]) {\n\t\tconst svg = this.parent\n\n\t\tconst orientation: CartesianOrientations = this.services.cartesianScales.getOrientation()\n\n\t\tconst displayData = this.model.getDisplayData()\n\n\t\tconst rangeScale = this.services.cartesianScales.getRangeScale()\n\t\tconst [yScaleEnd, yScaleStart] = rangeScale.range()\n\n\t\tconst mouseCoordinate = orientation === CartesianOrientations.HORIZONTAL ? y : x\n\t\tconst ruler = DOMUtils.appendOrSelect(svg, 'g.ruler').attr('aria-label', 'ruler')\n\t\tconst rulerLine = DOMUtils.appendOrSelect(ruler, 'line.ruler-line')\n\t\tconst dataPointElements: GenericSvgSelection = svg.selectAll('[role=graphics-symbol]')\n\n\t\tconst pointsWithinLine = displayData\n\t\t\t.map((d: any) => ({\n\t\t\t\tdomainValue: this.services.cartesianScales.getDomainValue(d) as number,\n\t\t\t\toriginalData: d\n\t\t\t}))\n\t\t\t.filter((d: any) => pointIsWithinThreshold(d.domainValue, mouseCoordinate))\n\n\t\tif (\n\t\t\tthis.pointsWithinLine &&\n\t\t\tpointsWithinLine.length === this.pointsWithinLine.length &&\n\t\t\tpointsWithinLine.map((point: any) => point.domainValue).join() ===\n\t\t\t\tthis.pointsWithinLine.map(point => point.domainValue).join()\n\t\t) {\n\t\t\tthis.pointsWithinLine = pointsWithinLine\n\t\t\treturn this.services.events.dispatchEvent(Events.Tooltip.MOVE, {\n\t\t\t\tmousePosition: [x, y]\n\t\t\t})\n\t\t}\n\n\t\tthis.pointsWithinLine = pointsWithinLine\n\n\t\t/**\n\t\t * Find matches, reduce is used instead of filter\n\t\t * to only get elements which belong to the same axis coordinate\n\t\t */\n\t\tconst dataPointsMatchingRulerLine: {\n\t\t\tdomainValue: number\n\t\t\toriginalData: any\n\t\t}[] = this.pointsWithinLine.reduce((accum, currentValue) => {\n\t\t\tif (accum.length === 0) {\n\t\t\t\taccum.push(currentValue)\n\t\t\t\treturn accum\n\t\t\t}\n\n\t\t\t// store the first element of the accumulator array to compare it with current element being processed\n\t\t\tconst sampleAccumValue = accum[0].domainValue\n\n\t\t\tconst distanceToCurrentValue = Math.abs(mouseCoordinate - currentValue.domainValue)\n\t\t\tconst distanceToAccumValue = Math.abs(mouseCoordinate - sampleAccumValue)\n\n\t\t\tif (distanceToCurrentValue > distanceToAccumValue) {\n\t\t\t\t// if distance with current value is bigger than already existing value in the accumulator, skip current iteration\n\t\t\t\treturn accum\n\t\t\t} else if (distanceToCurrentValue < distanceToAccumValue) {\n\t\t\t\t// currentValue data point is closer to mouse inside the threshold area, so reinstantiate array\n\t\t\t\taccum = [currentValue]\n\t\t\t} else {\n\t\t\t\t// currentValue is equal to already stored values, which means there's another match on the same coordinate\n\t\t\t\taccum.push(currentValue)\n\t\t\t}\n\n\t\t\treturn accum\n\t\t}, [])\n\n\t\t// some data point match\n\t\tif (dataPointsMatchingRulerLine.length > 0) {\n\t\t\tconst tooltipData = dataPointsMatchingRulerLine\n\t\t\t\t.map((d: any) => d.originalData)\n\t\t\t\t.filter((d: any) => {\n\t\t\t\t\tconst rangeIdentifier = this.services.cartesianScales.getRangeIdentifier(d)\n\t\t\t\t\tconst value = d[rangeIdentifier]\n\t\t\t\t\treturn value !== null && value !== undefined\n\t\t\t\t})\n\n\t\t\t// get elements on which we should trigger mouse events\n\t\t\tconst domainValuesMatchingRulerLine = dataPointsMatchingRulerLine.map(\n\t\t\t\t(d: any) => d.domainValue\n\t\t\t)\n\t\t\tconst elementsToHighlight = dataPointElements.filter((d: any) => {\n\t\t\t\tconst domainValue = this.services.cartesianScales.getDomainValue(d) as number\n\t\t\t\treturn domainValuesMatchingRulerLine.includes(domainValue)\n\t\t\t})\n\n\t\t\t/** if we pass from a trigger area to another one\n\t\t\t * mouseout on previous elements won't get dispatched\n\t\t\t * so we need to do it manually\n\t\t\t */\n\t\t\tif (\n\t\t\t\tthis.elementsToHighlight &&\n\t\t\t\tthis.elementsToHighlight.size() > 0 &&\n\t\t\t\t!isEqual(this.elementsToHighlight, elementsToHighlight)\n\t\t\t) {\n\t\t\t\tthis.hideRuler()\n\t\t\t}\n\n\t\t\telementsToHighlight.dispatch('mouseover')\n\n\t\t\t// set current hovered elements\n\t\t\tthis.elementsToHighlight = elementsToHighlight\n\n\t\t\tthis.services.events.dispatchEvent(Events.Tooltip.SHOW, {\n\t\t\t\tevent,\n\t\t\t\tmousePosition: [x, y],\n\t\t\t\thoveredElement: rulerLine,\n\t\t\t\tdata: this.formatTooltipData(tooltipData)\n\t\t\t})\n\n\t\t\truler.attr('opacity', 1)\n\n\t\t\t// line snaps to matching point\n\t\t\tconst sampleMatch = dataPointsMatchingRulerLine[0]\n\t\t\tif (orientation === 'horizontal') {\n\t\t\t\trulerLine\n\t\t\t\t\t.attr('x1', yScaleStart)\n\t\t\t\t\t.attr('x2', yScaleEnd)\n\t\t\t\t\t.attr('y1', sampleMatch.domainValue)\n\t\t\t\t\t.attr('y2', sampleMatch.domainValue)\n\t\t\t} else {\n\t\t\t\trulerLine\n\t\t\t\t\t.attr('y1', yScaleStart)\n\t\t\t\t\t.attr('y2', yScaleEnd)\n\t\t\t\t\t.attr('x1', sampleMatch.domainValue)\n\t\t\t\t\t.attr('x2', sampleMatch.domainValue)\n\t\t\t}\n\t\t} else {\n\t\t\tthis.hideRuler()\n\t\t}\n\t}\n\n\thideRuler() {\n\t\tconst svg = this.parent\n\t\tconst ruler = DOMUtils.appendOrSelect(svg, 'g.ruler')\n\t\tconst dataPointElements = svg.selectAll('[role=graphics-symbol]')\n\n\t\tdataPointElements.dispatch('mouseout')\n\t\tthis.services.events.dispatchEvent(Events.Tooltip.HIDE)\n\t\truler.attr('opacity', 0)\n\t}\n\n\t/**\n\t * Adds the listener on the X grid to trigger multiple point tooltips along the x axis.\n\t */\n\taddBackdropEventListeners() {\n\t\tthis.isEventListenerAdded = true\n\n\t\tconst self = this\n\n\t\tconst holder = this.services.domUtils.getHolder()\n\n\t\tconst displayData = this.model.getDisplayData()\n\n\t\tlet mouseMoveCallback = function (event: CustomEvent) {\n\t\t\tconst pos = pointer(event, self.parent.node())\n\n\t\t\tself.showRuler(event, pos)\n\t\t}\n\n\t\t// Debounce mouseMoveCallback if there are more than 100 datapoints\n\t\tif (displayData.length > 100) {\n\t\t\tconst debounceThreshold = (displayData.length % 50) * 12.5\n\n\t\t\tmouseMoveCallback = debounceWithD3MousePosition(\n\t\t\t\tfunction (event: CustomEvent) {\n\t\t\t\t\tconst { mousePosition } = this\n\t\t\t\t\tself.showRuler(event, mousePosition)\n\t\t\t\t},\n\t\t\t\tdebounceThreshold,\n\t\t\t\tholder\n\t\t\t)\n\t\t}\n\n\t\tthis.backdrop\n\t\t\t.on('mousemove mouseover', mouseMoveCallback)\n\t\t\t.on('mouseout', this.hideRuler.bind(this))\n\t}\n\n\tdrawBackdrop() {\n\t\tconst svg = this.parent\n\n\t\t// Get height from the grid\n\t\tthis.backdrop = DOMUtils.appendOrSelect(svg, 'svg.chart-grid-backdrop')\n\t}\n}\n","import { select, Selection } from 'd3'\nimport { flipDomainAndRangeBasedOnOrientation, getProperty } from '@/tools'\nimport { Component } from '@/components/component'\nimport { Events, ColorClassNameTypes, RenderTypes } from '@/interfaces/enums'\nimport { Roles } from '@/interfaces/a11y'\n\nexport class Scatter extends Component {\n\ttype = 'scatter'\n\trenderType = RenderTypes.SVG\n\n\tscatterData: any\n\n\tinit() {\n\t\tconst { events } = this.services\n\t\tif (!events) throw new Error('Services events are undefined.')\n\n\t\t// Highlight correct circle on legend item hovers\n\t\tevents.addEventListener(\n\t\t\tEvents.Legend.ITEM_HOVER,\n\t\t\tthis.handleLegendOnHover as EventListenerOrEventListenerObject\n\t\t)\n\t\t// Un-highlight circles on legend item mouseouts\n\t\tevents.addEventListener(Events.Legend.ITEM_MOUSEOUT, this.handleLegendMouseOut)\n\n\t\tconst { fadeInOnChartHolderMouseover } = this.configs\n\t\tif (fadeInOnChartHolderMouseover) {\n\t\t\t// Fade-in scatter circles\n\t\t\tevents.addEventListener(Events.Chart.MOUSEOVER, this.handleChartHolderOnHover)\n\t\t\t// Fade-out scatter circles\n\t\t\tevents.addEventListener(Events.Chart.MOUSEOUT, this.handleChartHolderOnMouseOut)\n\t\t}\n\t}\n\n\tfilterBasedOnZoomDomain(data: any) {\n\t\tconst { cartesianScales } = this.services\n\t\tif (!cartesianScales) throw new Error('Services cartesianScales are undefined.')\n\n\t\tconst domainIdentifier = cartesianScales.getDomainIdentifier(data)\n\t\tconst zoomDomain = this.model.get('zoomDomain')\n\t\tif (zoomDomain !== undefined) {\n\t\t\treturn data.filter(\n\t\t\t\t(d: any) =>\n\t\t\t\t\td[domainIdentifier].getTime() >= zoomDomain[0].getTime() &&\n\t\t\t\t\td[domainIdentifier].getTime() <= zoomDomain[1].getTime()\n\t\t\t)\n\t\t}\n\t\treturn data\n\t}\n\n\tgetScatterData() {\n\t\tconst options = this.getOptions()\n\n\t\tconst { stacked } = this.configs\n\n\t\tlet scatterData\n\t\tif (stacked) {\n\t\t\tconst percentage = Object.keys(options.axes).some(axis => options.axes[axis].percentage)\n\t\t\tscatterData = this.model.getStackedData({\n\t\t\t\tgroups: this.configs.groups,\n\t\t\t\tpercentage\n\t\t\t})\n\t\t} else {\n\t\t\tconst { cartesianScales } = this.services\n\t\t\tif (!cartesianScales) throw new Error('Services cartesianScales are undefined.')\n\t\t\tscatterData = this.model.getDisplayData(this.configs.groups).filter((d: any) => {\n\t\t\t\tconst rangeIdentifier = cartesianScales.getRangeIdentifier(d)\n\t\t\t\treturn d[rangeIdentifier] !== undefined && d[rangeIdentifier] !== null\n\t\t\t})\n\t\t}\n\n\t\t// filter out datapoints that aren't part of the zoomed domain\n\t\treturn this.filterBasedOnZoomDomain(scatterData)\n\t}\n\n\trender(animate: boolean) {\n\t\tconst isScatterEnabled =\n\t\t\tgetProperty(this.getOptions(), 'points', 'enabled') ||\n\t\t\tgetProperty(this.getOptions(), 'bubble', 'enabled')\n\n\t\tif (!isScatterEnabled) {\n\t\t\treturn\n\t\t}\n\n\t\t// Grab container SVG\n\t\tconst svg = this.getComponentContainer({ ariaLabel: 'scatter points', withinChartClip: true })\n\n\t\tconst options = this.getOptions()\n\t\tconst { groupMapsTo } = options.data\n\n\t\tconst { cartesianScales } = this.services\n\t\tif (!cartesianScales) throw new Error('Services cartesianScales are undefined.')\n\t\tconst domainIdentifier = cartesianScales.getDomainIdentifier()\n\n\t\t// Update data on dot groups\n\t\tconst circles = svg\n\t\t\t.selectAll('circle.dot')\n\t\t\t.data(\n\t\t\t\tthis.getScatterData(),\n\t\t\t\t(datum: any) => `${datum[groupMapsTo]}-${datum[domainIdentifier]}`\n\t\t\t) as Selection\n\n\t\t// Remove circles that need to be removed\n\t\tcircles.exit().attr('opacity', 0).remove()\n\n\t\t// Add the dot groups that need to be introduced\n\t\tconst enteringCircles = circles.enter().append('circle').classed('dot', true).attr('opacity', 0)\n\n\t\t// Apply styling & position\n\t\tconst circlesToStyle = enteringCircles.merge(circles)\n\t\tthis.styleCircles(circlesToStyle, animate)\n\n\t\t// Add event listeners to elements drawn\n\t\tthis.addEventListeners()\n\t}\n\n\t// A value is an anomaly if is above all defined domain and range thresholds\n\tisDatapointThresholdAnomaly(datum: any) {\n\t\tconst { handleThresholds } = this.configs\n\t\tif (!handleThresholds) {\n\t\t\treturn false\n\t\t}\n\n\t\tconst { cartesianScales } = this.services\n\t\tif (!cartesianScales) throw new Error('Cartesian scales service is undefined')\n\n\t\tconst orientation = cartesianScales.getOrientation()\n\n\t\t// Get highest domain and range thresholds\n\t\tconst [xThreshold, yThreshold] = flipDomainAndRangeBasedOnOrientation(\n\t\t\tcartesianScales.getHighestDomainThreshold(),\n\t\t\tcartesianScales.getHighestRangeThreshold(),\n\t\t\torientation\n\t\t)\n\n\t\tconst [getXValue, getYValue] = flipDomainAndRangeBasedOnOrientation(\n\t\t\t(d: any) => cartesianScales.getDomainValue(d),\n\t\t\t(d: any) => cartesianScales.getRangeValue(d),\n\t\t\torientation\n\t\t)\n\n\t\t// Get datum x and y values\n\t\tconst xValue = getXValue(datum)\n\t\tconst yValue = getYValue(datum)\n\n\t\t// To be an anomaly, the value has to be higher or equal than the threshold value\n\t\t// (if are present, both range and domain threshold values)\n\t\tif (yThreshold && xThreshold) {\n\t\t\treturn yValue <= yThreshold.scaleValue && xValue >= xThreshold.scaleValue\n\t\t}\n\n\t\tif (yThreshold) {\n\t\t\treturn yValue <= yThreshold.scaleValue\n\t\t}\n\n\t\tif (xThreshold) {\n\t\t\treturn xValue >= xThreshold.scaleValue\n\t\t}\n\n\t\treturn false\n\t}\n\n\tstyleCircles(selection: Selection, animate: boolean) {\n\t\t// Chart options mixed with the internal configurations\n\t\tconst options = this.getOptions()\n\t\tconst { filled, fillOpacity } = options.points\n\t\tconst { cartesianScales } = this.services\n\t\tif (!cartesianScales) throw new Error('Cartesian scales service is undefined')\n\n\t\tconst { groupMapsTo } = options.data\n\n\t\tconst getDomainValue = (d: any) => cartesianScales.getDomainValue(d)\n\t\tconst getRangeValue = (d: any) => cartesianScales.getRangeValue(d)\n\t\tconst [getXValue, getYValue] = flipDomainAndRangeBasedOnOrientation(\n\t\t\tgetDomainValue,\n\t\t\tgetRangeValue,\n\t\t\tcartesianScales.getOrientation()\n\t\t)\n\n\t\tconst { fadeInOnChartHolderMouseover } = this.configs\n\n\t\tselection\n\t\t\t.raise()\n\t\t\t.classed('dot', true)\n\t\t\t.attr('class', (d: any) => {\n\t\t\t\t// one element in ChartTabularData (Record)\n\t\t\t\tconst domainIdentifier = cartesianScales.getDomainIdentifier(d)\n\t\t\t\tconst isFilled = this.model.getIsFilled(d[groupMapsTo], d[domainIdentifier], d, filled)\n\t\t\t\tconst classNamesNeeded = isFilled\n\t\t\t\t\t? [ColorClassNameTypes.FILL, ColorClassNameTypes.STROKE]\n\t\t\t\t\t: [ColorClassNameTypes.STROKE]\n\n\t\t\t\treturn (\n\t\t\t\t\tthis.model.getColorClassName({\n\t\t\t\t\t\tclassNameTypes: classNamesNeeded,\n\t\t\t\t\t\tdataGroupName: d[groupMapsTo],\n\t\t\t\t\t\toriginalClassName: 'dot'\n\t\t\t\t\t}) || ''\n\t\t\t\t)\n\t\t\t})\n\t\t\t// Set class to highlight the dots that are above all the thresholds, in both directions (vertical and horizontal)\n\t\t\t.classed('threshold-anomaly', (d: any) => this.isDatapointThresholdAnomaly(d))\n\t\t\t.classed('filled', (d: any) => {\n\t\t\t\tconst domainIdentifier = cartesianScales.getDomainIdentifier(d)\n\t\t\t\treturn this.model.getIsFilled(d[groupMapsTo], d[domainIdentifier], d, filled)\n\t\t\t})\n\t\t\t.classed('unfilled', (d: any) => {\n\t\t\t\tconst domainIdentifier = cartesianScales.getDomainIdentifier(d)\n\t\t\t\treturn !this.model.getIsFilled(d[groupMapsTo], d[domainIdentifier], d, filled)\n\t\t\t})\n\t\t\t.transition()\n\t\t\t.call((t: any) =>\n\t\t\t\tthis.services.transitions?.setupTransition({\n\t\t\t\t\ttransition: t,\n\t\t\t\t\tname: 'scatter-update-enter',\n\t\t\t\t\tanimate\n\t\t\t\t})\n\t\t\t)\n\t\t\t.attr('cx', getXValue)\n\t\t\t.attr('cy', getYValue)\n\t\t\t.attr('r', options.points.radius)\n\t\t\t.style('fill', (d: any) => {\n\t\t\t\tconst domainIdentifier = cartesianScales.getDomainIdentifier(d)\n\t\t\t\tif (this.model.getIsFilled(d[groupMapsTo], d[domainIdentifier], d, filled)) {\n\t\t\t\t\treturn this.model.getFillColor(d[groupMapsTo], d[domainIdentifier], d)\n\t\t\t\t}\n\t\t\t})\n\t\t\t.style('stroke', (d: any) => {\n\t\t\t\tconst domainIdentifier = cartesianScales.getDomainIdentifier(d)\n\t\t\t\treturn this.model.getStrokeColor(d[groupMapsTo], d[domainIdentifier], d)\n\t\t\t})\n\t\t\t.attr('fill-opacity', filled ? fillOpacity : 1)\n\t\t\t.attr('opacity', fadeInOnChartHolderMouseover ? 0 : 1)\n\t\t\t// a11y\n\t\t\t.attr('role', Roles.GRAPHICS_SYMBOL)\n\t\t\t.attr('aria-roledescription', 'point')\n\t\t\t.attr('aria-label', (d: any) => {\n\t\t\t\tconst rangeIdentifier = cartesianScales.getRangeIdentifier(d)\n\t\t\t\treturn d[rangeIdentifier]\n\t\t\t})\n\n\t\t// Add event listeners to elements drawn\n\t\tthis.addEventListeners()\n\t}\n\n\thandleChartHolderOnHover = () => {\n\t\tif (!this.parent) throw new Error('Parent not defined')\n\t\tthis.parent\n\t\t\t.selectAll('circle.dot')\n\t\t\t.transition('chart-holder-hover-scatter')\n\t\t\t.call((t: any) =>\n\t\t\t\tthis.services.transitions?.setupTransition({\n\t\t\t\t\ttransition: t,\n\t\t\t\t\tname: 'chart-holder-hover-scatter'\n\t\t\t\t})\n\t\t\t)\n\t\t\t.attr('opacity', 1)\n\t}\n\n\thandleChartHolderOnMouseOut = () => {\n\t\tif (!this.parent) throw new Error('Parent not defined')\n\t\tthis.parent\n\t\t\t.selectAll('circle.dot')\n\t\t\t.transition('chart-holder-mouseout-scatter')\n\t\t\t.call((t: any) =>\n\t\t\t\tthis.services.transitions?.setupTransition({\n\t\t\t\t\ttransition: t,\n\t\t\t\t\tname: 'chart-holder-mouseout-scatter'\n\t\t\t\t})\n\t\t\t)\n\t\t\t.attr('opacity', 0)\n\t}\n\n\t// TODO: follow signature of EventListenerOrEventListenerObject\n\thandleLegendOnHover = (evt: CustomEvent) => {\n\t\tconst { hoveredElement } = evt.detail\n\t\tconst { groupMapsTo } = this.getOptions().data\n\n\t\tif (!this.parent) throw new Error('Parent not defined')\n\t\tthis.parent\n\t\t\t.selectAll('circle.dot')\n\t\t\t.transition('legend-hover-scatter')\n\t\t\t.call((t: any) =>\n\t\t\t\tthis.services.transitions?.setupTransition({\n\t\t\t\t\ttransition: t,\n\t\t\t\t\tname: 'legend-hover-scatter'\n\t\t\t\t})\n\t\t\t)\n\t\t\t.attr('opacity', (d: any) => (d[groupMapsTo] !== hoveredElement.datum()['name'] ? 0.3 : 1))\n\t}\n\n\thandleLegendMouseOut = () => {\n\t\tif (!this.parent) throw new Error('Parent not defined')\n\n\t\tthis.parent\n\t\t\t.selectAll('circle.dot')\n\t\t\t.transition('legend-mouseout-scatter')\n\t\t\t.call((t: any) =>\n\t\t\t\tthis.services.transitions?.setupTransition({\n\t\t\t\t\ttransition: t,\n\t\t\t\t\tname: 'legend-mouseout-scatter'\n\t\t\t\t})\n\t\t\t)\n\t\t\t.attr('opacity', 1)\n\t}\n\n\t// Extended in bubble graphs\n\t// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n\t// @ts-ignore\n\t// eslint-disable-next-line @typescript-eslint/no-unused-vars\n\tgetTooltipAdditionalItems(datum: any) {\n\t\treturn null as any\n\t}\n\n\taddEventListeners() {\n\t\tconst self = this\n\t\tconst { groupMapsTo } = self.getOptions().data\n\n\t\tif (!this.parent) throw new Error('Parent not defined')\n\t\tthis.parent\n\t\t\t.selectAll('circle')\n\t\t\t.on('mouseover', function (event: MouseEvent, datum: any) {\n\t\t\t\tconst hoveredElement = select(this)\n\n\t\t\t\thoveredElement\n\t\t\t\t\t.classed('hovered', true)\n\t\t\t\t\t.attr('class', (d: any) =>\n\t\t\t\t\t\tself.model.getColorClassName({\n\t\t\t\t\t\t\tclassNameTypes: [ColorClassNameTypes.FILL],\n\t\t\t\t\t\t\tdataGroupName: d[groupMapsTo],\n\t\t\t\t\t\t\toriginalClassName: hoveredElement.attr('class')\n\t\t\t\t\t\t})\n\t\t\t\t\t)\n\t\t\t\t\t.style('fill', (d: any) => {\n\t\t\t\t\t\tconst domainIdentifier = self.services.cartesianScales?.getDomainIdentifier(d)\n\t\t\t\t\t\treturn self.model.getFillColor(d[groupMapsTo], d[domainIdentifier], d)\n\t\t\t\t\t})\n\t\t\t\t\t.classed('unfilled', false)\n\n\t\t\t\t// Show tooltip\n\t\t\t\tself.services.events?.dispatchEvent(Events.Tooltip.SHOW, {\n\t\t\t\t\tevent,\n\t\t\t\t\thoveredElement,\n\t\t\t\t\tdata: [datum],\n\t\t\t\t\tadditionalItems: self.getTooltipAdditionalItems(datum)\n\t\t\t\t})\n\n\t\t\t\t// Dispatch mouse event\n\t\t\t\tself.services.events?.dispatchEvent(Events.Scatter.SCATTER_MOUSEOVER, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: hoveredElement,\n\t\t\t\t\tdatum\n\t\t\t\t})\n\t\t\t})\n\t\t\t.on('mousemove', function (event: MouseEvent, datum: any) {\n\t\t\t\tconst hoveredElement = select(this)\n\n\t\t\t\t// Dispatch mouse event\n\t\t\t\tself.services.events?.dispatchEvent(Events.Scatter.SCATTER_MOUSEMOVE, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: hoveredElement,\n\t\t\t\t\tdatum\n\t\t\t\t})\n\n\t\t\t\tself.services.events?.dispatchEvent(Events.Tooltip.MOVE, {\n\t\t\t\t\tevent\n\t\t\t\t})\n\t\t\t})\n\t\t\t.on('click', function (event: MouseEvent, datum: any) {\n\t\t\t\t// Dispatch mouse event\n\t\t\t\tself.services.events?.dispatchEvent(Events.Scatter.SCATTER_CLICK, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: select(this),\n\t\t\t\t\tdatum\n\t\t\t\t})\n\t\t\t})\n\t\t\t.on('mouseout', function (event: MouseEvent, datum: any) {\n\t\t\t\tconst hoveredElement = select(this)\n\t\t\t\thoveredElement.classed('hovered', false)\n\n\t\t\t\tif (!self.configs.filled) {\n\t\t\t\t\tconst { filled } = self.getOptions().points\n\t\t\t\t\tconst domainIdentifier = self.services.cartesianScales?.getDomainIdentifier(datum)\n\t\t\t\t\tconst isFilled = self.model.getIsFilled(\n\t\t\t\t\t\tdatum[groupMapsTo],\n\t\t\t\t\t\tdatum[domainIdentifier],\n\t\t\t\t\t\tdatum,\n\t\t\t\t\t\tfilled\n\t\t\t\t\t)\n\t\t\t\t\thoveredElement.classed('unfilled', !isFilled).style('fill', (d: any) => {\n\t\t\t\t\t\tif (isFilled || filled) {\n\t\t\t\t\t\t\treturn self.model.getFillColor(d[groupMapsTo], d[domainIdentifier], d)\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn null\n\t\t\t\t\t})\n\t\t\t\t}\n\n\t\t\t\t// Dispatch mouse event\n\t\t\t\tself.services.events?.dispatchEvent(Events.Scatter.SCATTER_MOUSEOUT, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: hoveredElement,\n\t\t\t\t\tdatum\n\t\t\t\t})\n\n\t\t\t\t// Hide tooltip\n\t\t\t\tself.services.events?.dispatchEvent(Events.Tooltip.HIDE, {\n\t\t\t\t\thoveredElement\n\t\t\t\t})\n\t\t\t})\n\t}\n\n\tdestroy() {\n\t\t// Remove event listeners\n\t\tthis.parent?.selectAll('circle').on('mousemove', null).on('mouseout', null)\n\n\t\t// Remove legend listeners\n\t\tconst { events } = this.services\n\t\tif (!events) throw new Error('Services events undefined')\n\t\tevents.removeEventListener(\n\t\t\tEvents.Legend.ITEM_HOVER,\n\t\t\tthis.handleLegendOnHover as EventListenerOrEventListenerObject\n\t\t)\n\t\tevents.removeEventListener(Events.Legend.ITEM_MOUSEOUT, this.handleLegendMouseOut)\n\t\tevents.removeEventListener(Events.Chart.MOUSEOVER, this.handleChartHolderOnHover)\n\t\tevents.removeEventListener(Events.Chart.MOUSEOUT, this.handleChartHolderOnMouseOut)\n\t}\n}\n","import {\n\taxisBottom,\n\taxisLeft,\n\taxisRight,\n\taxisTop,\n\ttype AxisScale,\n\tselect,\n\ttype Selection as D3Selection\n} from 'd3'\nimport { clamp } from 'lodash-es'\nimport { axis as axisConfigs } from '@/configuration'\nimport { getProperty, getTranslationValues, truncateLabel } from '@/tools'\nimport { Component } from '@/components/component'\nimport {\n\tAxisPositions,\n\tEvents,\n\tScaleTypes,\n\tTruncationTypes,\n\tAxisTitleOrientations,\n\tRenderTypes,\n\tTickRotations\n} from '@/interfaces/enums'\nimport { Roles } from '@/interfaces/a11y'\nimport type { ChartModel } from '@/model/model'\nimport { DOMUtils } from '@/services/essentials/dom-utils'\nimport { computeTimeIntervalName, formatTick, isTickPrimary } from '@/services/time-series'\nimport { sanitizeText } from '@/utils/sanitizeHtml'\n\nexport class Axis extends Component {\n\ttype = 'axes'\n\trenderType = RenderTypes.SVG\n\n\tmargins: any\n\ttruncation = {\n\t\t[AxisPositions.LEFT]: false,\n\t\t[AxisPositions.RIGHT]: false,\n\t\t[AxisPositions.TOP]: false,\n\t\t[AxisPositions.BOTTOM]: false\n\t}\n\n\tscale: AxisScale\n\tscaleType: ScaleTypes\n\n\tconstructor(model: ChartModel, services: any, configs?: any) {\n\t\tsuper(model, services, configs)\n\n\t\tif (configs) {\n\t\t\tthis.configs = configs\n\t\t}\n\n\t\tthis.margins = this.configs.margins\n\t}\n\n\trender(animate = true) {\n\t\tconst { position: axisPosition }: { position: AxisPositions } = this.configs\n\t\tconst options = this.getOptions()\n\t\tconst isAxisVisible = getProperty(options, 'axes', axisPosition, 'visible')\n\n\t\tconst svg = this.getComponentContainer({\n\t\t\tariaLabel: 'axes'\n\t\t}) as D3Selection\n\t\tconst { width, height } = DOMUtils.getSVGElementSize(svg, {\n\t\t\tuseAttrs: true\n\t\t})\n\n\t\t// Add axis into the parent\n\t\tconst container = DOMUtils.appendOrSelect(svg, `g.axis.${axisPosition}`)\n\t\tlet startPosition: number, endPosition: number\n\t\tif (axisPosition === AxisPositions.BOTTOM || axisPosition === AxisPositions.TOP) {\n\t\t\tstartPosition = this.configs.axes[AxisPositions.LEFT] ? this.margins.left : 0\n\t\t\tendPosition = this.configs.axes[AxisPositions.RIGHT] ? width - this.margins.right : width\n\t\t} else {\n\t\t\tstartPosition = height - this.margins.bottom\n\t\t\tendPosition = this.margins.top\n\t\t}\n\n\t\t// Grab the scale off of the Scales service\n\t\tif (!this.services.cartesianScales) throw new Error('Services cartesianScales undefined')\n\t\tconst scale = this.services.cartesianScales.getScaleByPosition(axisPosition) as any\n\n\t\tif (this.scaleType === ScaleTypes.LABELS || this.scaleType === ScaleTypes.LABELS_RATIO) {\n\t\t\tscale.rangeRound([startPosition, endPosition])\n\t\t} else {\n\t\t\tscale.range([startPosition, endPosition])\n\t\t}\n\n\t\t// Identify the corresponding d3 axis function\n\t\tlet axisFunction: any\n\t\tswitch (axisPosition) {\n\t\t\tcase AxisPositions.LEFT:\n\t\t\t\taxisFunction = axisLeft\n\t\t\t\tbreak\n\t\t\tcase AxisPositions.BOTTOM:\n\t\t\t\taxisFunction = axisBottom\n\t\t\t\tbreak\n\t\t\tcase AxisPositions.RIGHT:\n\t\t\t\taxisFunction = axisRight\n\t\t\t\tbreak\n\t\t\tcase AxisPositions.TOP:\n\t\t\t\taxisFunction = axisTop\n\t\t\t\tbreak\n\t\t}\n\n\t\tcontainer.attr('aria-label', `${axisPosition} axis`)\n\t\tconst axisRefExists = !container.select(`g.ticks`).empty()\n\t\tlet axisRef = DOMUtils.appendOrSelect(container, `g.ticks`)\n\t\tif (!axisRefExists) {\n\t\t\taxisRef.attr('role', `${Roles.GRAPHICS_OBJECT} ${Roles.GROUP}`)\n\t\t\taxisRef.attr('aria-label', `${axisPosition} ticks`)\n\t\t}\n\n\t\t// We draw the invisible axis because of the async nature of d3 transitions\n\t\t// To be able to tell the final width & height of the axis when initiaing the transition\n\t\t// The invisible axis is updated instantly and without a transition\n\t\tconst invisibleAxisRef = DOMUtils.appendOrSelect(container, `g.ticks.invisible`)\n\t\t\t.style('opacity', '0')\n\t\t\t.style('pointer-events', 'none')\n\t\t\t.attr('aria-hidden', true)\n\t\t\t.attr('aria-label', `invisible ${axisPosition} ticks`)\n\n\t\tconst axisOptions = getProperty(options, 'axes', axisPosition)\n\t\tconst isTimeScaleType =\n\t\t\tthis.scaleType === ScaleTypes.TIME || axisOptions.scaleType === ScaleTypes.TIME\n\t\tconst isVerticalAxis =\n\t\t\taxisPosition === AxisPositions.LEFT || axisPosition === AxisPositions.RIGHT\n\n\t\t// if zoomDomain is available, scale type is time, and axis position isBOTTOM or TOP\n\t\t// update scale domain to zoomDomain.\n\t\tconst zoomDomain = this.model.get('zoomDomain')\n\t\tif (zoomDomain && isTimeScaleType && !isVerticalAxis) {\n\t\t\tscale.domain(zoomDomain)\n\t\t}\n\n\t\tif (!isAxisVisible) {\n\t\t\taxisRef.attr('aria-hidden', true)\n\t\t\treturn\n\t\t}\n\n\t\tconst axisScaleType = getProperty(axisOptions, 'scaleType')\n\t\tconst isDataLoading = getProperty(options, 'data', 'loading')\n\t\tconst numberOfTicksProvided = getProperty(axisOptions, 'ticks', 'number')\n\n\t\t// user can provide custom ticks to be displayed\n\t\t// ticks need to be in the domain of the axis data\n\t\tconst userProvidedTickValues = getProperty(axisOptions, 'ticks', 'values')\n\n\t\t// get user provided custom values for truncation\n\t\tconst truncationType = getProperty(axisOptions, 'truncation', 'type')\n\t\tconst truncationThreshold = getProperty(axisOptions, 'truncation', 'threshold')\n\t\tconst truncationNumCharacter = getProperty(axisOptions, 'truncation', 'numCharacter')\n\n\t\tconst isNumberOfTicksProvided = numberOfTicksProvided !== null\n\t\tconst timeScaleOptions = getProperty(options, 'timeScale')\n\n\t\t// Append to DOM a fake tick to get the right computed font height\n\t\tconst fakeTick = DOMUtils.appendOrSelect(invisibleAxisRef, `g.tick`)\n\t\tconst fakeTickText = DOMUtils.appendOrSelect(fakeTick, `text`).text('0')\n\t\tconst tickHeight = DOMUtils.getSVGElementSize(fakeTickText.node(), {\n\t\t\tuseBBox: true\n\t\t}).height\n\t\tfakeTick.remove()\n\n\t\tconst scaleType = this.scaleType || axisOptions.scaleType || ScaleTypes.LINEAR\n\n\t\t// Initialize axis object\n\t\tconst axis = axisFunction(scale).tickSizeOuter(0)\n\n\t\tif (scale.ticks) {\n\t\t\tlet numberOfTicks: number\n\n\t\t\tif (isNumberOfTicksProvided) {\n\t\t\t\tnumberOfTicks = numberOfTicksProvided\n\t\t\t} else {\n\t\t\t\tnumberOfTicks = axisConfigs.ticks.number\n\t\t\t\tif (isVerticalAxis) {\n\t\t\t\t\t// Set how many ticks based on height\n\t\t\t\t\tnumberOfTicks = this.getNumberOfFittingTicks(\n\t\t\t\t\t\theight,\n\t\t\t\t\t\ttickHeight,\n\t\t\t\t\t\taxisConfigs.ticks.verticalSpaceRatio\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// scale continuous\n\t\t\t// remove 0 ticks for skeleton\n\t\t\tif (scale.ticks().length === 1 && scale.ticks()[0] === 0) {\n\t\t\t\tnumberOfTicks = 0\n\t\t\t}\n\n\t\t\taxis.ticks(numberOfTicks)\n\n\t\t\tif (isTimeScaleType) {\n\t\t\t\tif (!scale.ticks(numberOfTicks).length) {\n\t\t\t\t\taxis.tickValues([])\n\t\t\t\t} else {\n\t\t\t\t\tconst addSpaceOnEdges = getProperty(options, 'timeScale', 'addSpaceOnEdges')\n\n\t\t\t\t\tconst customDomain = getProperty(options, 'axes', axisPosition, 'domain')\n\n\t\t\t\t\t// scale.nice() will change scale domain which causes extra space near chart edge\n\t\t\t\t\t// so use another scale instance to avoid impacts to original scale\n\t\t\t\t\tconst tempScale = scale.copy()\n\t\t\t\t\tif (addSpaceOnEdges && !customDomain) {\n\t\t\t\t\t\ttempScale.nice(numberOfTicks)\n\t\t\t\t\t}\n\t\t\t\t\tconst tickValues = tempScale.ticks(numberOfTicks)\n\n\t\t\t\t\t// Remove labels on the edges\n\t\t\t\t\t// If there are more than 2 labels to show\n\t\t\t\t\tif (addSpaceOnEdges && tickValues.length > 2 && !customDomain) {\n\t\t\t\t\t\ttickValues.splice(tickValues.length - 1, 1)\n\t\t\t\t\t\ttickValues.splice(0, 1)\n\t\t\t\t\t}\n\n\t\t\t\t\taxis.tickValues(tickValues)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// create the right ticks formatter\n\t\tlet formatter: any\n\t\tconst userProvidedFormatter = getProperty(axisOptions, 'ticks', 'formatter')\n\t\tconst { code: localeCode, number: numberFormatter } = getProperty(options, 'locale')\n\t\tif (isTimeScaleType) {\n\t\t\tconst timeInterval = computeTimeIntervalName(\n\t\t\t\taxis.tickValues(),\n\t\t\t\tgetProperty(options, 'timeScale', 'timeInterval')\n\t\t\t)\n\n\t\t\tif (userProvidedFormatter === null) {\n\t\t\t\tformatter = (t: number, i: number) =>\n\t\t\t\t\tformatTick(t, i, axis.tickValues(), timeInterval, timeScaleOptions, options.locale)\n\t\t\t} else {\n\t\t\t\tformatter = (t: number, i: number) => {\n\t\t\t\t\tconst defaultFormattedValue = formatTick(\n\t\t\t\t\t\tt,\n\t\t\t\t\t\ti,\n\t\t\t\t\t\taxis.tickValues(),\n\t\t\t\t\t\ttimeInterval,\n\t\t\t\t\t\ttimeScaleOptions,\n\t\t\t\t\t\toptions.locale\n\t\t\t\t\t)\n\t\t\t\t\treturn userProvidedFormatter(t, i, defaultFormattedValue)\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tif (userProvidedFormatter === null) {\n\t\t\t\tif (scaleType === ScaleTypes.LINEAR) {\n\t\t\t\t\tformatter = (t: number) => numberFormatter(t, localeCode)\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tformatter = userProvidedFormatter\n\t\t\t}\n\t\t}\n\n\t\t// Set ticks formatter\n\t\taxis.tickFormat(formatter)\n\n\t\t// prioritize using a custom array of values rather than number of ticks\n\t\t// if both are provided. custom tick values need to be within the domain of the scale\n\t\tconst [lowerBound, upperBound] = this.services.cartesianScales\n\t\t\t.getScaleByPosition(axisPosition)\n\t\t\t.domain()\n\t\tlet validTicks: any\n\t\tif (userProvidedTickValues) {\n\t\t\tif (isTimeScaleType) {\n\t\t\t\t// sanitize user-provided tick values\n\t\t\t\tuserProvidedTickValues.forEach((userProvidedTickValue: any, i: number) => {\n\t\t\t\t\tif (userProvidedTickValue.getTime === undefined) {\n\t\t\t\t\t\tuserProvidedTickValues[i] = new Date(userProvidedTickValue)\n\t\t\t\t\t}\n\t\t\t\t})\n\n\t\t\t\t// check the supplied ticks are within the time domain\n\t\t\t\tvalidTicks = userProvidedTickValues.filter((tick: any) => {\n\t\t\t\t\tconst tickTimestamp = tick.getTime()\n\t\t\t\t\treturn (\n\t\t\t\t\t\ttickTimestamp >= new Date(lowerBound).getTime() &&\n\t\t\t\t\t\ttickTimestamp <= new Date(upperBound).getTime()\n\t\t\t\t\t)\n\t\t\t\t})\n\t\t\t} else if (axisScaleType === ScaleTypes.LABELS) {\n\t\t\t\tconst discreteDomain = this.services.cartesianScales\n\t\t\t\t\t.getScaleByPosition(axisPosition)\n\t\t\t\t\t.domain()\n\t\t\t\tvalidTicks = userProvidedTickValues.filter((tick: any) => discreteDomain.includes(tick))\n\t\t\t} else {\n\t\t\t\t// continuous scales\n\t\t\t\tvalidTicks = userProvidedTickValues.filter(\n\t\t\t\t\t(tick: any) => tick >= lowerBound && tick <= upperBound\n\t\t\t\t)\n\t\t\t}\n\n\t\t\taxis.tickValues(validTicks)\n\t\t}\n\n\t\t// Position and transition the axis\n\t\tswitch (axisPosition) {\n\t\t\tcase AxisPositions.LEFT:\n\t\t\t\taxisRef.attr('transform', `translate(${this.margins.left}, 0)`)\n\t\t\t\tbreak\n\t\t\tcase AxisPositions.BOTTOM:\n\t\t\t\taxisRef.attr('transform', `translate(0, ${height - this.margins.bottom})`)\n\t\t\t\tbreak\n\t\t\tcase AxisPositions.RIGHT:\n\t\t\t\taxisRef.attr('transform', `translate(${width - this.margins.right}, 0)`)\n\t\t\t\tbreak\n\t\t\tcase AxisPositions.TOP:\n\t\t\t\taxisRef.attr('transform', `translate(0, ${this.margins.top})`)\n\t\t\t\tbreak\n\t\t}\n\n\t\t// Position the axis title\n\t\t// check that data exists, if they don't, doesn't show the title axis\n\t\tconst isDataEmpty = this.model.isDataEmpty()\n\t\tif (axisOptions.title) {\n\t\t\tconst axisTitleRef = DOMUtils.appendOrSelect(container, `text.axis-title`).html(\n\t\t\t\tisDataEmpty || isDataLoading ? '' : sanitizeText(axisOptions.title)\n\t\t\t)\n\n\t\t\t// vertical axes can have override for title orientation\n\t\t\tconst titleOrientation = getProperty(axisOptions, 'titleOrientation')\n\t\t\tlet titleHeight // avoid lexical declaration in case block\n\t\t\tswitch (axisPosition) {\n\t\t\t\tcase AxisPositions.LEFT:\n\t\t\t\t\tif (titleOrientation === AxisTitleOrientations.RIGHT) {\n\t\t\t\t\t\taxisTitleRef\n\t\t\t\t\t\t\t.attr('transform', 'rotate(90)')\n\t\t\t\t\t\t\t.attr('y', 0)\n\t\t\t\t\t\t\t.attr('x', scale.range()[0] / 2)\n\t\t\t\t\t\t\t.attr('dy', '-0.5em')\n\t\t\t\t\t\t\t.style('text-anchor', 'middle')\n\t\t\t\t\t} else {\n\t\t\t\t\t\taxisTitleRef\n\t\t\t\t\t\t\t.attr('transform', 'rotate(-90)')\n\t\t\t\t\t\t\t.attr('y', 0)\n\t\t\t\t\t\t\t.attr('x', -(scale.range()[0] / 2))\n\t\t\t\t\t\t\t.attr('dy', '0.75em')\n\t\t\t\t\t\t\t.style('text-anchor', 'middle')\n\t\t\t\t\t}\n\t\t\t\t\tbreak\n\t\t\t\tcase AxisPositions.BOTTOM:\n\t\t\t\t\taxisTitleRef\n\t\t\t\t\t\t.attr(\n\t\t\t\t\t\t\t'transform',\n\t\t\t\t\t\t\t`translate(${this.margins.left / 2 + scale.range()[1] / 2}, ${height + 4})`\n\t\t\t\t\t\t)\n\t\t\t\t\t\t.style('text-anchor', 'middle')\n\t\t\t\t\tbreak\n\t\t\t\tcase AxisPositions.RIGHT:\n\t\t\t\t\tif (titleOrientation === AxisTitleOrientations.LEFT) {\n\t\t\t\t\t\taxisTitleRef\n\t\t\t\t\t\t\t.attr('transform', 'rotate(-90)')\n\t\t\t\t\t\t\t.attr('y', width)\n\t\t\t\t\t\t\t.attr('x', -(scale.range()[0] / 2))\n\t\t\t\t\t\t\t.style('text-anchor', 'middle')\n\t\t\t\t\t} else {\n\t\t\t\t\t\taxisTitleRef\n\t\t\t\t\t\t\t.attr('transform', 'rotate(90)')\n\t\t\t\t\t\t\t.attr('y', -width)\n\t\t\t\t\t\t\t.attr('x', scale.range()[0] / 2)\n\t\t\t\t\t\t\t.attr('dy', '0.75em')\n\t\t\t\t\t\t\t.style('text-anchor', 'middle')\n\t\t\t\t\t}\n\t\t\t\t\tbreak\n\t\t\t\tcase AxisPositions.TOP:\n\t\t\t\t\ttitleHeight = DOMUtils.getSVGElementSize(axisTitleRef, {\n\t\t\t\t\t\tuseBBox: true\n\t\t\t\t\t}).height\n\n\t\t\t\t\taxisTitleRef\n\t\t\t\t\t\t.attr(\n\t\t\t\t\t\t\t'transform',\n\t\t\t\t\t\t\t`translate(${this.margins.left / 2 + scale.range()[1] / 2}, ${titleHeight / 2})`\n\t\t\t\t\t\t)\n\t\t\t\t\t\t.style('text-anchor', 'middle')\n\t\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\n\t\t// Apply new axis to the axis element\n\t\tif (isTimeScaleType) {\n\t\t\tconst timeInterval = computeTimeIntervalName(\n\t\t\t\taxis.tickValues(),\n\t\t\t\tgetProperty(options, 'timeScale', 'timeInterval')\n\t\t\t)\n\n\t\t\tconst showDayName = timeScaleOptions.showDayName\n\t\t\tconst axisRefSelection = axisRef\n\n\t\t\tif (animate) {\n\t\t\t\taxisRef = axisRef.transition().call((t: any) =>\n\t\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\t\ttransition: t,\n\t\t\t\t\t\tname: 'axis-update',\n\t\t\t\t\t\tanimate\n\t\t\t\t\t})\n\t\t\t\t) as any\n\t\t\t}\n\t\t\taxisRef = axisRef.call(axis)\n\n\t\t\t// Manipulate tick labels to make bold those that are in long format\n\t\t\tconst ticks = axisRefSelection\n\t\t\t\t.selectAll('.tick')\n\t\t\t\t.data(axis.tickValues(), scale)\n\t\t\t\t.order()\n\t\t\t\t.select('text')\n\t\t\tticks.style('font-weight', (tick: number, i: number) => {\n\t\t\t\treturn isTickPrimary(tick, i, axis.tickValues(), timeInterval, showDayName)\n\t\t\t\t\t? 'bold'\n\t\t\t\t\t: 'normal'\n\t\t\t})\n\t\t} else {\n\t\t\tif (!animate || !axisRefExists) {\n\t\t\t\taxisRef = axisRef.call(axis)\n\t\t\t} else {\n\t\t\t\taxisRef = axisRef\n\t\t\t\t\t.transition()\n\t\t\t\t\t.call((t: any) =>\n\t\t\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\t\t\ttransition: t,\n\t\t\t\t\t\t\tname: 'axis-update',\n\t\t\t\t\t\t\tanimate\n\t\t\t\t\t\t})\n\t\t\t\t\t)\n\t\t\t\t\t.call(axis) as any\n\t\t\t}\n\t\t}\n\n\t\tinvisibleAxisRef.call(axis)\n\n\t\tif (axisPosition === AxisPositions.BOTTOM || axisPosition === AxisPositions.TOP) {\n\t\t\tlet shouldRotateTicks = false\n\t\t\t// user could decide if tick rotation is required during zoom domain changing\n\t\t\tconst tickRotation = getProperty(axisOptions, 'ticks', 'rotation')\n\n\t\t\tif (tickRotation === TickRotations.ALWAYS) {\n\t\t\t\tshouldRotateTicks = true\n\t\t\t} else if (tickRotation === TickRotations.NEVER) {\n\t\t\t\tshouldRotateTicks = false\n\t\t\t} else if (!tickRotation || tickRotation === TickRotations.AUTO) {\n\t\t\t\t// if the option is not set or set to AUTO\n\n\t\t\t\t// depending on if tick rotation is necessary by calculating space\n\t\t\t\t// If we're dealing with a discrete scale type\n\t\t\t\t// We're able to grab the spacing between the ticks\n\t\t\t\tif (scale.step) {\n\t\t\t\t\tconst textNodes = invisibleAxisRef.selectAll('g.tick text').nodes() as any\n\n\t\t\t\t\t// If any ticks are any larger than the scale step size\n\t\t\t\t\tshouldRotateTicks = textNodes.some(\n\t\t\t\t\t\t(textNode: D3Selection) =>\n\t\t\t\t\t\t\tDOMUtils.getSVGElementSize(textNode, {\n\t\t\t\t\t\t\t\tuseBBox: true\n\t\t\t\t\t\t\t}).width >= scale.step()\n\t\t\t\t\t)\n\t\t\t\t} else {\n\t\t\t\t\tshouldRotateTicks = false\n\n\t\t\t\t\tconst mockTextPiece = invisibleAxisRef.append('text').text('A')\n\n\t\t\t\t\tconst averageLetterWidth = DOMUtils.getSVGElementSize(mockTextPiece.node() as any, {\n\t\t\t\t\t\tuseBBox: true\n\t\t\t\t\t}).width as number\n\n\t\t\t\t\tlet lastStartPosition: any\n\n\t\t\t\t\t// Find out whether any text nodes roughly collide\n\t\t\t\t\tinvisibleAxisRef.selectAll('g.tick').each(function () {\n\t\t\t\t\t\tconst selection = select(this)\n\t\t\t\t\t\tconst xTransformation = parseFloat(getProperty(getTranslationValues(this as any), 'tx'))\n\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\txTransformation !== null &&\n\t\t\t\t\t\t\tlastStartPosition + selection.text().length * averageLetterWidth * 0.8 >=\n\t\t\t\t\t\t\t\txTransformation\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tshouldRotateTicks = true\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tlastStartPosition = xTransformation\n\t\t\t\t\t})\n\n\t\t\t\t\t// Cleanup mock text piece\n\t\t\t\t\tmockTextPiece.remove()\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (shouldRotateTicks) {\n\t\t\t\tif (!isNumberOfTicksProvided) {\n\t\t\t\t\taxis.ticks(\n\t\t\t\t\t\tthis.getNumberOfFittingTicks(width, tickHeight, axisConfigs.ticks.horizontalSpaceRatio)\n\t\t\t\t\t)\n\n\t\t\t\t\tinvisibleAxisRef.call(axis)\n\t\t\t\t\taxisRef.call(axis)\n\t\t\t\t}\n\n\t\t\t\tcontainer\n\t\t\t\t\t.selectAll('g.ticks g.tick text')\n\t\t\t\t\t.attr('transform', `rotate(-45)`)\n\t\t\t\t\t.attr('text-anchor', axisPosition === AxisPositions.TOP ? 'start' : 'end')\n\t\t\t} else {\n\t\t\t\tcontainer.selectAll('g.ticks g.tick text').attr('transform', null).attr('text-anchor', null)\n\t\t\t}\n\t\t}\n\n\t\t// we don't need to show axes on empty state and on skeleton state\n\t\t// because the Skeleton component draws them\n\t\tif (isDataLoading) {\n\t\t\tcontainer.attr('opacity', 0)\n\t\t} else {\n\t\t\tcontainer.attr('opacity', 1)\n\t\t}\n\n\t\taxisRef.selectAll('g.tick').attr('aria-label', (d: any) => d)\n\n\t\tinvisibleAxisRef.selectAll('g.tick').attr('aria-label', (d: any) => d)\n\n\t\t// truncate the label if it's too long\n\t\t// only applies to discrete type\n\t\tif (\n\t\t\ttruncationType !== TruncationTypes.NONE &&\n\t\t\taxisScaleType === ScaleTypes.LABELS &&\n\t\t\t!userProvidedTickValues\n\t\t) {\n\t\t\tconst axisTickLabels = this.services.cartesianScales.getScaleDomain(axisPosition)\n\t\t\tif (axisTickLabels.length > 0) {\n\t\t\t\tconst tick_html = svg.select(`g.axis.${axisPosition} g.ticks g.tick`).html()\n\n\t\t\t\tcontainer.selectAll('g.ticks g.tick').html(tick_html)\n\n\t\t\t\tconst self = this\n\t\t\t\tcontainer\n\t\t\t\t\t.selectAll('g.tick text')\n\t\t\t\t\t.data(axisTickLabels)\n\t\t\t\t\t.text(function (d: any) {\n\t\t\t\t\t\tif (d.length > truncationThreshold) {\n\t\t\t\t\t\t\tself.truncation[axisPosition] = true\n\t\t\t\t\t\t\treturn truncateLabel(d, truncationType, truncationNumCharacter)\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treturn d\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\n\t\t\t\tthis.getInvisibleAxisRef()\n\t\t\t\t\t.selectAll('g.tick text')\n\t\t\t\t\t.data(axisTickLabels)\n\t\t\t\t\t.text(function (d: any) {\n\t\t\t\t\t\tif (d.length > truncationThreshold) {\n\t\t\t\t\t\t\treturn truncateLabel(d, truncationType, truncationNumCharacter)\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treturn d\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\n\t\t\t\tcontainer.selectAll('g.ticks').html(this.getInvisibleAxisRef().html())\n\n\t\t\t\tcontainer.selectAll('g.tick text').data(axisTickLabels)\n\t\t\t}\n\t\t}\n\t\t// Add event listeners to elements drawn\n\t\tthis.addEventListeners()\n\t}\n\n\taddEventListeners() {\n\t\tconst svg = this.getComponentContainer()\n\t\tconst { position: axisPosition } = this.configs\n\t\tconst container = DOMUtils.appendOrSelect(svg, `g.axis.${axisPosition}`)\n\t\tconst options = this.getOptions()\n\t\tconst axisOptions = getProperty(options, 'axes', axisPosition)\n\t\tconst axisScaleType = getProperty(axisOptions, 'scaleType')\n\t\tconst truncationThreshold = getProperty(axisOptions, 'truncation', 'threshold')\n\n\t\tconst self = this\n\t\tcontainer\n\t\t\t.selectAll('g.tick text')\n\t\t\t.on('mouseover', function (event: MouseEvent, datum: any) {\n\t\t\t\t// Dispatch mouse event\n\t\t\t\tself.services.events.dispatchEvent(Events.Axis.LABEL_MOUSEOVER, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: select(this),\n\t\t\t\t\tdatum\n\t\t\t\t})\n\n\t\t\t\tif (axisScaleType === ScaleTypes.LABELS && datum.length > truncationThreshold) {\n\t\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.SHOW, {\n\t\t\t\t\t\tevent,\n\t\t\t\t\t\thoveredElement: select(this),\n\t\t\t\t\t\tcontent: datum\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t})\n\t\t\t.on('mousemove', function (event: MouseEvent, datum: any) {\n\t\t\t\t// Dispatch mouse event\n\t\t\t\tself.services.events.dispatchEvent(Events.Axis.LABEL_MOUSEMOVE, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: select(this),\n\t\t\t\t\tdatum\n\t\t\t\t})\n\t\t\t\tif (axisScaleType === ScaleTypes.LABELS && datum.length > truncationThreshold) {\n\t\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.MOVE, {\n\t\t\t\t\t\tevent\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t})\n\t\t\t.on('click', function (event: MouseEvent, datum: any) {\n\t\t\t\t// Dispatch mouse event\n\t\t\t\tself.services.events.dispatchEvent(Events.Axis.LABEL_CLICK, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: select(this),\n\t\t\t\t\tdatum\n\t\t\t\t})\n\t\t\t})\n\t\t\t.on('mouseout', function (event: MouseEvent, datum: any) {\n\t\t\t\t// Dispatch mouse event\n\t\t\t\tself.services.events.dispatchEvent(Events.Axis.LABEL_MOUSEOUT, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: select(this),\n\t\t\t\t\tdatum\n\t\t\t\t})\n\n\t\t\t\tif (axisScaleType === ScaleTypes.LABELS) {\n\t\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.HIDE)\n\t\t\t\t}\n\t\t\t})\n\t}\n\n\tgetInvisibleAxisRef() {\n\t\tconst { position: axisPosition } = this.configs\n\n\t\treturn this.getComponentContainer().select(`g.axis.${axisPosition} g.ticks.invisible`)\n\t}\n\n\tgetTitleRef() {\n\t\tconst { position: axisPosition } = this.configs\n\n\t\treturn this.getComponentContainer().select(`g.axis.${axisPosition} text.axis-title`)\n\t}\n\n\tgetNumberOfFittingTicks(size: number, tickSize: number, spaceRatio: number) {\n\t\tconst numberOfTicksFit = Math.floor(size / (tickSize * spaceRatio))\n\t\treturn clamp(numberOfTicksFit, 2, axisConfigs.ticks.number)\n\t}\n\n\tdestroy() {\n\t\tconst svg = this.getComponentContainer()\n\t\tconst { position: axisPosition } = this.configs\n\t\tconst container = DOMUtils.appendOrSelect(svg, `g.axis.${axisPosition}`)\n\n\t\t// Remove event listeners\n\t\tcontainer\n\t\t\t.selectAll('g.tick text')\n\t\t\t.on('mouseover', null)\n\t\t\t.on('mousemove', null)\n\t\t\t.on('mouseout', null)\n\t}\n}\n","import { select, type Selection } from 'd3'\nimport { getProperty } from '@/tools'\nimport { axis as axisConfigs } from '@/configuration'\nimport { Axis } from './axis'\nimport { AxisPositions, Events, ScaleTypes } from '@/interfaces/enums'\nimport type { ChartModel } from '@/model/model'\nimport { DOMUtils } from '@/services/essentials/dom-utils'\n\nexport class HoverAxis extends Axis {\n\tconstructor(model: ChartModel, services: any, configs?: any) {\n\t\tsuper(model, services, configs)\n\t}\n\n\trender(animate = true) {\n\t\tsuper.render(animate)\n\n\t\t// Remove existing event listeners to avoid flashing behavior\n\t\tsuper.destroy()\n\n\t\tconst axisPosition = this.configs.position as 'left' | 'right' | 'top' | 'bottom'\n\t\tconst svg = this.getComponentContainer({\n\t\t\tariaLabel: 'axes'\n\t\t})\n\t\tconst container = DOMUtils.appendOrSelect(svg, `g.axis.${axisPosition}`)\n\n\t\tconst self = this\n\t\tcontainer.selectAll('g.tick').each(function (_: any, index: number) {\n\t\t\tconst g = select(this) as Selection\n\t\t\tg.classed('tick-hover', true).attr('tabindex', index === 0 ? 0 : -1)\n\t\t\tconst textNode = g.select('text')\n\t\t\tconst { width, height } = DOMUtils.getSVGElementSize(textNode, {\n\t\t\t\tuseBBox: true\n\t\t\t})\n\n\t\t\tconst rectangle = DOMUtils.appendOrSelect(g, 'rect.axis-holder')\n\n\t\t\tlet x = 0,\n\t\t\t\ty = 0\n\n\t\t\t// Depending on axis position, apply correct translation & rotation to align the rect\n\t\t\t// with the text\n\t\t\tswitch (axisPosition) {\n\t\t\t\tcase AxisPositions.LEFT:\n\t\t\t\t\tx = -width + Number(textNode.attr('x'))\n\t\t\t\t\ty = -(height / 2)\n\t\t\t\t\tbreak\n\t\t\t\tcase AxisPositions.RIGHT:\n\t\t\t\t\tx = Math.abs(Number(textNode.attr('x')))\n\t\t\t\t\ty = -(height / 2)\n\t\t\t\t\tbreak\n\t\t\t\tcase AxisPositions.TOP:\n\t\t\t\t\tx = -(width / 2)\n\t\t\t\t\ty = -height + Number(textNode.attr('y')) / 2\n\n\t\t\t\t\tif (self.truncation[axisPosition]) {\n\t\t\t\t\t\tx = 0\n\t\t\t\t\t\trectangle.attr('transform', `rotate(-45)`)\n\t\t\t\t\t}\n\t\t\t\t\tbreak\n\t\t\t\tcase AxisPositions.BOTTOM:\n\t\t\t\t\tx = -(width / 2)\n\t\t\t\t\ty = height / 2 - 2\n\n\t\t\t\t\tif (self.truncation[axisPosition]) {\n\t\t\t\t\t\tx = -width\n\t\t\t\t\t\trectangle.attr('transform', `rotate(-45)`)\n\t\t\t\t\t}\n\t\t\t\t\tbreak\n\t\t\t}\n\n\t\t\t// Translates x position -4 left to keep center after padding\n\t\t\t// Adds padding on left & right\n\t\t\trectangle\n\t\t\t\t.attr('x', x - axisConfigs.hover.rectanglePadding)\n\t\t\t\t.attr('y', y)\n\t\t\t\t.attr('width', width + axisConfigs.hover.rectanglePadding * 2)\n\t\t\t\t.attr('height', height)\n\t\t\t\t.lower()\n\t\t})\n\n\t\t// Add event listeners to element group\n\t\tthis.addEventListeners()\n\t}\n\n\taddEventListeners() {\n\t\tconst svg = this.getComponentContainer()\n\t\tconst { position: axisPosition } = this.configs\n\t\tconst container = DOMUtils.appendOrSelect(svg, `g.axis.${axisPosition}`)\n\t\tconst options = this.getOptions()\n\t\tconst axisOptions = getProperty(options, 'axes', axisPosition)\n\t\tconst axisScaleType = getProperty(axisOptions, 'scaleType')\n\t\tconst truncationThreshold = getProperty(axisOptions, 'truncation', 'threshold')\n\n\t\tconst self = this\n\t\tcontainer\n\t\t\t.selectAll('g.tick.tick-hover')\n\t\t\t.on('mouseover', function (event: MouseEvent) {\n\t\t\t\tconst hoveredElement = select(this).select('text')\n\t\t\t\tconst datum = hoveredElement.datum() as string\n\n\t\t\t\t// Dispatch mouse event\n\t\t\t\tself.services.events.dispatchEvent(Events.Axis.LABEL_MOUSEOVER, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: hoveredElement,\n\t\t\t\t\tdatum\n\t\t\t\t})\n\n\t\t\t\tif (axisScaleType === ScaleTypes.LABELS && datum.length > truncationThreshold) {\n\t\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.SHOW, {\n\t\t\t\t\t\tevent,\n\t\t\t\t\t\telement: hoveredElement,\n\t\t\t\t\t\tdatum\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t})\n\t\t\t.on('mousemove', function (event: MouseEvent) {\n\t\t\t\tconst hoveredElement = select(this).select('text')\n\t\t\t\tconst datum = hoveredElement.datum() as string\n\t\t\t\t// Dispatch mouse event\n\t\t\t\tself.services.events.dispatchEvent(Events.Axis.LABEL_MOUSEMOVE, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: hoveredElement,\n\t\t\t\t\tdatum\n\t\t\t\t})\n\n\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.MOVE, {\n\t\t\t\t\tevent\n\t\t\t\t})\n\t\t\t})\n\t\t\t.on('click', function (event: MouseEvent) {\n\t\t\t\t// Dispatch mouse event\n\t\t\t\tself.services.events.dispatchEvent(Events.Axis.LABEL_CLICK, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: select(this).select('text'),\n\t\t\t\t\tdatum: select(this).select('text').datum()\n\t\t\t\t})\n\t\t\t})\n\t\t\t.on('mouseout', function (event: MouseEvent) {\n\t\t\t\t// Dispatch mouse event\n\t\t\t\tself.services.events.dispatchEvent(Events.Axis.LABEL_MOUSEOUT, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: select(this).select('text'),\n\t\t\t\t\tdatum: select(this).select('text').datum()\n\t\t\t\t})\n\n\t\t\t\tif (axisScaleType === ScaleTypes.LABELS) {\n\t\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.HIDE)\n\t\t\t\t}\n\t\t\t})\n\t\t\t.on('focus', function (event: any) {\n\t\t\t\tconst coordinates = { clientX: 0, clientY: 0 }\n\n\t\t\t\tif (event.target) {\n\t\t\t\t\t// Focus element since we are using arrow keys\n\t\t\t\t\tevent.target.focus()\n\t\t\t\t\tconst boundingRect = event.target.getBoundingClientRect()\n\t\t\t\t\tcoordinates.clientX = boundingRect.x\n\t\t\t\t\tcoordinates.clientY = boundingRect.y\n\t\t\t\t}\n\n\t\t\t\t// Dispatch focus event\n\t\t\t\tself.services.events.dispatchEvent(Events.Axis.LABEL_FOCUS, {\n\t\t\t\t\tevent: { ...event, ...coordinates },\n\t\t\t\t\telement: select(this),\n\t\t\t\t\tdatum: select(this).select('text').datum()\n\t\t\t\t})\n\t\t\t})\n\t\t\t.on('blur', function (event: FocusEvent) {\n\t\t\t\t// Dispatch blur event\n\t\t\t\tself.services.events.dispatchEvent(Events.Axis.LABEL_BLUR, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: select(this),\n\t\t\t\t\tdatum: select(this).select('text').datum()\n\t\t\t\t})\n\t\t\t})\n\t\t\t.on('keydown', function (event: KeyboardEvent) {\n\t\t\t\t// Hide the tooltip when `Escape` is pressed, but keep focus\n\t\t\t\tif (event.key && event.key === 'Escape') {\n\t\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.HIDE)\n\t\t\t\t\tself.services.events.dispatchEvent(Events.Axis.LABEL_BLUR, {\n\t\t\t\t\t\tevent,\n\t\t\t\t\t\telement: select(this),\n\t\t\t\t\t\tdatum: select(this).select('text').datum()\n\t\t\t\t\t})\n\t\t\t\t}\n\n\t\t\t\t// Choose specific arrow key depending on the axis\n\t\t\t\tif (axisPosition === AxisPositions.LEFT || axisPosition === AxisPositions.RIGHT) {\n\t\t\t\t\tif (event.key && event.key === 'ArrowUp') {\n\t\t\t\t\t\tself.goNext(this as HTMLElement, event)\n\t\t\t\t\t} else if (event.key && event.key === 'ArrowDown') {\n\t\t\t\t\t\tself.goPrevious(this as HTMLElement, event)\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif (event.key && event.key === 'ArrowLeft') {\n\t\t\t\t\t\tself.goPrevious(this as HTMLElement, event)\n\t\t\t\t\t} else if (event.key && event.key === 'ArrowRight') {\n\t\t\t\t\t\tself.goNext(this as HTMLElement, event)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t})\n\t}\n\n\t// Focus on the next HTML element sibling\n\tprivate goNext(element: HTMLElement, event: KeyboardEvent) {\n\t\tif (element.nextElementSibling && element.nextElementSibling.tagName !== 'path') {\n\t\t\telement.nextElementSibling.dispatchEvent(new Event('focus'))\n\t\t}\n\n\t\tevent.preventDefault()\n\t}\n\n\t// Focus on the previous HTML element sibling\n\tprivate goPrevious(element: HTMLElement, event: KeyboardEvent) {\n\t\tif (element.previousElementSibling && element.previousElementSibling.tagName !== 'path') {\n\t\t\telement.previousElementSibling.dispatchEvent(new Event('focus'))\n\t\t}\n\n\t\tevent.preventDefault()\n\t}\n\n\tdestroy() {\n\t\tconst svg = this.getComponentContainer()\n\t\tconst { position: axisPosition } = this.configs\n\t\tconst container = DOMUtils.appendOrSelect(svg, `g.axis.${axisPosition}`)\n\n\t\t// Remove event listeners\n\t\tcontainer\n\t\t\t.selectAll('g.tick.tick-hover')\n\t\t\t.on('mouseover', null)\n\t\t\t.on('mousemove', null)\n\t\t\t.on('mouseout', null)\n\t\t\t.on('focus', null)\n\t\t\t.on('blur', null)\n\t}\n}\n","import { getProperty } from '@/tools'\nimport { Axis } from './axis'\nimport { HoverAxis } from './hover-axis'\nimport { Component } from '@/components/component'\nimport type { Threshold } from '@/components/essentials/threshold'\nimport { AxisPositions, Events, RenderTypes, AxisFlavor } from '@/interfaces/enums'\nimport { DOMUtils } from '@/services/essentials/dom-utils'\nimport type { ChartModelCartesian } from '@/model/cartesian-charts'\n\nexport class TwoDimensionalAxes extends Component {\n\ttype = '2D-axes'\n\trenderType = RenderTypes.SVG\n\n\tchildren: any = {}\n\n\tthresholds: Threshold[] = []\n\n\tmargins = {\n\t\ttop: 0,\n\t\tright: 0,\n\t\tbottom: 0,\n\t\tleft: 0\n\t}\n\n\trender(animate = false) {\n\t\tconst axes: any = {}\n\t\tconst axisPositions = Object.keys(AxisPositions)\n\t\tconst axesOptions = getProperty(this.getOptions(), 'axes')\n\n\t\taxisPositions.forEach((axisPosition: keyof typeof AxisPositions) => {\n\t\t\tconst axisOptions = axesOptions[AxisPositions[axisPosition]]\n\t\t\tif (axisOptions) {\n\t\t\t\taxes[AxisPositions[axisPosition]] = true\n\t\t\t}\n\t\t})\n\n\t\tthis.configs.axes = axes\n\n\t\t// Check the configs to know which axes need to be rendered\n\t\taxisPositions.forEach((axisPositionKey: keyof typeof AxisPositions) => {\n\t\t\tconst axisPosition = AxisPositions[axisPositionKey]\n\t\t\tif (this.configs.axes[axisPosition] && !this.children[axisPosition]) {\n\t\t\t\tconst configs = {\n\t\t\t\t\tposition: axisPosition,\n\t\t\t\t\taxes: this.configs.axes,\n\t\t\t\t\tmargins: this.margins\n\t\t\t\t}\n\n\t\t\t\tconst axisComponent =\n\t\t\t\t\t(this.model as ChartModelCartesian).axisFlavor === AxisFlavor.DEFAULT\n\t\t\t\t\t\t? new Axis(this.model, this.services, configs)\n\t\t\t\t\t\t: new HoverAxis(this.model, this.services, configs)\n\n\t\t\t\t// Set model, services & parent for the new axis component\n\t\t\t\taxisComponent.setModel(this.model)\n\t\t\t\taxisComponent.setServices(this.services)\n\t\t\t\taxisComponent.setParent(this.parent)\n\n\t\t\t\tthis.children[axisPosition] = axisComponent\n\t\t\t}\n\t\t})\n\n\t\tObject.keys(this.children).forEach((childKey: any) => {\n\t\t\tconst child = this.children[childKey]\n\t\t\tchild.render(animate)\n\t\t})\n\n\t\tconst margins = {} as any\n\n\t\tObject.keys(this.children).forEach((childKey: any) => {\n\t\t\tconst child = this.children[childKey]\n\t\t\tconst axisPosition = child.configs.position\n\n\t\t\t// Grab the invisibly rendered axis' width & height, and set margins\n\t\t\t// Based off of that\n\t\t\t// We draw the invisible axis because of the async nature of d3 transitions\n\t\t\t// To be able to tell the final width & height of the axis when initiaing the transition\n\t\t\t// The invisible axis is updated instantly and without a transition\n\t\t\tconst invisibleAxisRef = child.getInvisibleAxisRef()\n\t\t\tconst { width, height } = DOMUtils.getSVGElementSize(invisibleAxisRef, { useBBox: true })\n\n\t\t\tlet offset: any\n\t\t\tif (child.getTitleRef().empty()) {\n\t\t\t\toffset = 0\n\t\t\t} else {\n\t\t\t\toffset = DOMUtils.getSVGElementSize(child.getTitleRef(), {\n\t\t\t\t\tuseBBox: true\n\t\t\t\t}).height\n\n\t\t\t\tif (axisPosition === AxisPositions.LEFT || axisPosition === AxisPositions.RIGHT) {\n\t\t\t\t\toffset += 5\n\t\t\t\t}\n\t\t\t}\n\t\t\tswitch (axisPosition) {\n\t\t\t\tcase AxisPositions.TOP:\n\t\t\t\t\tmargins.top = height + offset\n\t\t\t\t\tbreak\n\t\t\t\tcase AxisPositions.BOTTOM:\n\t\t\t\t\tmargins.bottom = height + offset\n\t\t\t\t\tbreak\n\t\t\t\tcase AxisPositions.LEFT:\n\t\t\t\t\tmargins.left = width + offset\n\t\t\t\t\tbreak\n\t\t\t\tcase AxisPositions.RIGHT:\n\t\t\t\t\tmargins.right = width + offset\n\t\t\t\t\tbreak\n\t\t\t}\n\t\t})\n\n\t\tthis.services.events.dispatchEvent(Events.Axis.RENDER_COMPLETE)\n\n\t\t// If the new margins are different than the existing ones\n\t\tconst isNotEqual = Object.keys(margins).some(\n\t\t\t(marginKey: 'top' | 'right' | 'bottom' | 'left') => {\n\t\t\t\treturn this.margins[marginKey] !== margins[marginKey]\n\t\t\t}\n\t\t)\n\n\t\tif (isNotEqual) {\n\t\t\tthis.margins = Object.assign(this.margins, margins)\n\n\t\t\t// also set new margins to model to allow external components to access\n\t\t\tthis.model.set({ axesMargins: this.margins }, { skipUpdate: true })\n\t\t\tthis.services.events.dispatchEvent(Events.ZoomBar.UPDATE)\n\n\t\t\tObject.keys(this.children).forEach((childKey: any) => {\n\t\t\t\tconst child = this.children[childKey]\n\t\t\t\tchild.margins = this.margins\n\t\t\t})\n\n\t\t\tthis.render(true)\n\t\t}\n\t}\n}\n","import { arc, easeLinear, scaleLinear, type ScaleLinear, type Selection } from 'd3'\nimport { getProperty } from '@/tools'\nimport { pie as pieConfigs } from '@/configuration'\nimport { Component } from '@/components/component'\nimport { DOMUtils } from '@/services/essentials/dom-utils'\nimport { Skeletons, CartesianOrientations, Alignments } from '@/interfaces/enums'\n\nexport class Skeleton extends Component {\n\ttype = 'skeleton'\n\txScale: ScaleLinear\n\tyScale: ScaleLinear\n\tbackdrop: Selection\n\n\t// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n\t// @ts-ignore\n\t// eslint-disable-next-line @typescript-eslint/no-unused-vars\n\trender(animate = true) {\n\t\tconst isDataLoading = getProperty(this.getOptions(), 'data', 'loading')\n\n\t\t// display a skeleton if there is no chart data or the loading flag is set to true\n\t\tif (isDataLoading) {\n\t\t\tthis.renderSkeleton(isDataLoading)\n\t\t} else {\n\t\t\tthis.removeSkeleton()\n\t\t}\n\t}\n\n\trenderSkeleton(showShimmerEffect: boolean) {\n\t\tif (this.configs.skeleton === Skeletons.GRID) {\n\t\t\tthis.renderGridSkeleton(showShimmerEffect)\n\t\t} else if (this.configs.skeleton === Skeletons.VERT_OR_HORIZ) {\n\t\t\tthis.renderVertOrHorizSkeleton(showShimmerEffect)\n\t\t} else if (this.configs.skeleton === Skeletons.PIE) {\n\t\t\tthis.renderPieSkeleton(showShimmerEffect)\n\t\t} else if (this.configs.skeleton === Skeletons.DONUT) {\n\t\t\tthis.renderDonutSkeleton(showShimmerEffect)\n\t\t} else {\n\t\t\tthrow new Error(`\"${this.configs.skeleton}\" is not a valid Skeleton type.`)\n\t\t}\n\t}\n\n\trenderGridSkeleton(showShimmerEffect: boolean) {\n\t\tthis.setScales()\n\t\tthis.drawBackdrop(showShimmerEffect)\n\t\tthis.drawXGrid(showShimmerEffect)\n\t\tthis.drawYGrid(showShimmerEffect)\n\t\tif (showShimmerEffect) {\n\t\t\tthis.setShimmerEffect('shimmer-lines')\n\t\t}\n\t}\n\n\trenderVertOrHorizSkeleton(showShimmerEffect: boolean) {\n\t\tconst orientation = this.services.cartesianScales.getOrientation()\n\t\tthis.setScales()\n\t\tthis.drawBackdrop(showShimmerEffect)\n\t\tif (orientation === CartesianOrientations.VERTICAL) {\n\t\t\tthis.drawYGrid(showShimmerEffect)\n\t\t}\n\t\tif (orientation === CartesianOrientations.HORIZONTAL) {\n\t\t\tthis.drawXGrid(showShimmerEffect)\n\t\t}\n\n\t\tthis.setShimmerEffect('shimmer-lines')\n\t}\n\n\trenderPieSkeleton(showShimmerEffect: boolean) {\n\t\tconst outerRadius = this.computeOuterRadius()\n\t\tconst innerRadius = 0\n\t\tthis.drawRing(outerRadius, innerRadius, showShimmerEffect)\n\t\tif (showShimmerEffect) {\n\t\t\tthis.setShimmerEffect('shimmer-areas')\n\t\t}\n\t}\n\n\trenderDonutSkeleton(showShimmerEffect: boolean) {\n\t\tconst outerRadius = this.computeOuterRadius()\n\t\tconst innerRadius = this.computeInnerRadius()\n\t\tthis.drawRing(outerRadius, innerRadius, showShimmerEffect)\n\t\tif (showShimmerEffect) {\n\t\t\tthis.setShimmerEffect('shimmer-areas')\n\t\t}\n\t}\n\n\tsetScales() {\n\t\tconst xRange = this.services.cartesianScales.getMainXScale().range()\n\t\tconst yRange = this.services.cartesianScales.getMainYScale().range()\n\t\tthis.xScale = scaleLinear().domain([0, 1]).range(xRange)\n\t\tthis.yScale = scaleLinear().domain([0, 1]).range(yRange)\n\t}\n\n\tdrawBackdrop(showShimmerEffect: boolean) {\n\t\tconst svg = this.parent\n\t\tconst { width, height } = DOMUtils.getSVGElementSize(svg as any, {\n\t\t\tuseAttrs: true\n\t\t})\n\n\t\tthis.backdrop = DOMUtils.appendOrSelect(svg, 'svg.chart-skeleton.DAII')\n\t\t\t.attr('width', width)\n\t\t\t.attr('height', height)\n\n\t\tconst backdropRect = DOMUtils.appendOrSelect(this.backdrop, 'rect.chart-skeleton-backdrop')\n\t\tbackdropRect.attr('width', '100%').attr('height', '100%')\n\n\t\tconst [xScaleStart] = this.xScale.range()\n\t\tconst [, yScaleStart] = this.yScale.range()\n\n\t\tthis.backdrop.merge(backdropRect).attr('x', xScaleStart).attr('y', yScaleStart)\n\n\t\tbackdropRect\n\t\t\t.classed('shimmer-effect-lines', showShimmerEffect)\n\t\t\t.classed('empty-state-lines', !showShimmerEffect)\n\t\t\t.style(\n\t\t\t\t'stroke',\n\t\t\t\tshowShimmerEffect\n\t\t\t\t\t? `url(#${this.services.domUtils.generateElementIDString(`shimmer-lines`)})`\n\t\t\t\t\t: null\n\t\t\t)\n\t}\n\n\tdrawXGrid(showShimmerEffect: boolean) {\n\t\tconst width = +this.backdrop.attr('width')\n\t\tconst ticksNumber = getProperty(this.getOptions(), 'grid', 'x', 'numberOfTicks')\n\t\tconst ticksValues = this.xScale.ticks(ticksNumber).map((d: any) => d * width)\n\n\t\tconst xGridG = DOMUtils.appendOrSelect(this.backdrop, 'g.x.skeleton')\n\t\tconst update = xGridG.selectAll('line').data(ticksValues)\n\t\tupdate\n\t\t\t.enter()\n\t\t\t.append('line')\n\t\t\t.merge(update as any)\n\t\t\t.attr('x1', (d: any) => d)\n\t\t\t.attr('x2', (d: any) => d)\n\t\t\t.attr('y1', 0)\n\t\t\t.attr('y2', '100%')\n\n\t\txGridG\n\t\t\t.selectAll('line')\n\t\t\t.classed('shimmer-effect-lines', showShimmerEffect)\n\t\t\t.classed('empty-state-lines', !showShimmerEffect)\n\t\t\t.style(\n\t\t\t\t'stroke',\n\t\t\t\tshowShimmerEffect\n\t\t\t\t\t? `url(#${this.services.domUtils.generateElementIDString(`shimmer-lines`)})`\n\t\t\t\t\t: null\n\t\t\t)\n\t}\n\n\tdrawYGrid(showShimmerEffect: boolean) {\n\t\tconst height = +this.backdrop.attr('height')\n\t\tconst width = this.backdrop.attr('width')\n\t\tconst ticksNumber = getProperty(this.getOptions(), 'grid', 'y', 'numberOfTicks')\n\t\tconst ticksValues = this.xScale.ticks(ticksNumber).map((d: any) => d * height)\n\n\t\tconst yGridG = DOMUtils.appendOrSelect(this.backdrop, 'g.y.skeleton')\n\t\tconst update = yGridG.selectAll('line').data(ticksValues)\n\t\tupdate\n\t\t\t.enter()\n\t\t\t.append('line')\n\t\t\t.merge(update as any)\n\t\t\t.attr('x1', 0)\n\t\t\t.attr('x2', width)\n\t\t\t.attr('y1', (d: any) => d)\n\t\t\t.attr('y2', (d: any) => d)\n\n\t\tyGridG\n\t\t\t.selectAll('line')\n\t\t\t.classed('shimmer-effect-lines', showShimmerEffect)\n\t\t\t.classed('empty-state-lines', !showShimmerEffect)\n\t\t\t.style(\n\t\t\t\t'stroke',\n\t\t\t\tshowShimmerEffect\n\t\t\t\t\t? `url(#${this.services.domUtils.generateElementIDString(`shimmer-lines`)})`\n\t\t\t\t\t: null\n\t\t\t)\n\t}\n\n\tdrawRing(outerRadius: number, innerRadius: number, shimmer = true) {\n\t\tconst svg = this.parent\n\t\tconst { width, height } = DOMUtils.getSVGElementSize(svg as any, {\n\t\t\tuseAttrs: true\n\t\t})\n\n\t\tconst container = DOMUtils.appendOrSelect(svg, 'svg.chart-skeleton')\n\t\t\t.attr('width', width)\n\t\t\t.attr('height', height)\n\n\t\tconst optionName = innerRadius === 0 ? 'pie' : 'donut'\n\n\t\tconst alignment = getProperty(this.getOptions(), optionName, 'alignment')\n\n\t\tDOMUtils.appendOrSelect(container, 'rect.chart-skeleton-area-container')\n\t\t\t.attr('width', width)\n\t\t\t.attr('height', height)\n\t\t\t.attr('fill', 'none')\n\n\t\tconst arcPathGenerator = arc()\n\t\t\t.innerRadius(innerRadius)\n\t\t\t.outerRadius(outerRadius)\n\t\t\t.startAngle(0)\n\t\t\t.endAngle(Math.PI * 2)\n\n\t\t// centering circle inside the container\n\t\tconst tcx = outerRadius + Math.abs(pieConfigs.radiusOffset)\n\t\tconst tcy = outerRadius + (Math.min(width, height) - outerRadius * 2) / 2\n\n\t\tconst skeletonAreaShape = DOMUtils.appendOrSelect(container, 'path')\n\t\t\t.attr('class', 'skeleton-area-shape')\n\t\t\t.attr('transform', `translate(${tcx}, ${tcy})`)\n\t\t\t.attr('d', arcPathGenerator)\n\t\t\t.classed('shimmer-effect-areas', shimmer)\n\t\t\t.classed('empty-state-areas', !shimmer)\n\t\t\t.style(\n\t\t\t\t'fill',\n\t\t\t\tshimmer ? `url(#${this.services.domUtils.generateElementIDString(`shimmer-areas`)})` : null\n\t\t\t)\n\n\t\t// Position skeleton\n\t\tlet translateX = outerRadius + pieConfigs.xOffset\n\t\tif (alignment === Alignments.CENTER) {\n\t\t\ttranslateX = width / 2\n\t\t} else if (alignment === Alignments.RIGHT) {\n\t\t\ttranslateX = width - outerRadius - pieConfigs.xOffset\n\t\t}\n\n\t\tconst translateY = outerRadius + pieConfigs.yOffset\n\t\tskeletonAreaShape.attr('transform', `translate(${translateX}, ${translateY})`)\n\t}\n\n\t// same logic in pie\n\tcomputeOuterRadius() {\n\t\tconst { width, height } = DOMUtils.getSVGElementSize(this.parent as any, {\n\t\t\tuseAttrs: true\n\t\t})\n\t\tconst radius = Math.min(width, height) / 2\n\t\treturn radius + pieConfigs.radiusOffset\n\t}\n\n\t// same logic in donut\n\tcomputeInnerRadius() {\n\t\treturn this.computeOuterRadius() * (3 / 4)\n\t}\n\n\tsetShimmerEffect(gradientId: string) {\n\t\tconst animationDuration = 2000 // ms\n\t\tconst delay = 1000 // ms\n\t\tconst shimmerWidth = 0.2\n\t\tconst stopBgShimmerClass = 'stop-bg-shimmer'\n\t\tconst stopShimmerClass = 'stop-shimmer'\n\t\tconst container = this.parent.select('.chart-skeleton')\n\t\tconst { width } = DOMUtils.getSVGElementSize(this.parent as any, {\n\t\t\tuseAttrs: true\n\t\t})\n\t\tconst startPoint = 0\n\t\tconst endPoint = width\n\n\t\t// append the defs as first child of container\n\t\tconst defs = DOMUtils.appendOrSelect(container as any, 'defs').lower()\n\t\tconst linearGradient = DOMUtils.appendOrSelect(defs, 'linearGradient')\n\t\t\t.attr('id', this.services.domUtils.generateElementIDString(gradientId))\n\t\t\t.attr('class', gradientId)\n\t\t\t.attr('x1', startPoint - 3 * shimmerWidth * width)\n\t\t\t.attr('x2', endPoint)\n\t\t\t.attr('y1', 0)\n\t\t\t.attr('y2', 0)\n\t\t\t.attr('gradientUnits', 'userSpaceOnUse')\n\t\t\t.attr('gradientTransform', `translate(0, 0)`)\n\t\tconst stops = `\n\t\t\t \n\t\t\t \n\t\t\t \n\t\t`\n\t\tlinearGradient.html(stops)\n\n\t\trepeat()\n\t\tfunction repeat() {\n\t\t\tlinearGradient\n\t\t\t\t.attr('gradientTransform', `translate(${startPoint - 3 * shimmerWidth * width}, 0)`)\n\t\t\t\t.transition()\n\t\t\t\t.duration(animationDuration)\n\t\t\t\t.delay(delay)\n\t\t\t\t.ease(easeLinear)\n\t\t\t\t.attr('gradientTransform', `translate(${endPoint + 3 * shimmerWidth * width}, 0)`)\n\t\t\t\t.on('end', repeat)\n\t\t}\n\t}\n\n\tremoveSkeleton() {\n\t\tconst container = this.parent.select('.chart-skeleton')\n\t\tcontainer.remove()\n\t}\n}\n","import { select } from 'd3'\nimport { flipDomainAndRangeBasedOnOrientation, generateSVGPathString, getProperty } from '@/tools'\nimport { boxplot as boxplotConfigs } from '@/configuration'\nimport { BoxplotChartModel } from '@/model/boxplot'\nimport { Component } from '@/components/component'\nimport { CartesianOrientations, ColorClassNameTypes, Events, RenderTypes } from '@/interfaces/enums'\nimport { Roles } from '@/interfaces/a11y'\n\nexport class Boxplot extends Component {\n\ttype = 'boxplot'\n\trenderType = RenderTypes.SVG\n\n\trender(animate: boolean) {\n\t\t// Grab container SVG\n\t\tconst svg = this.getComponentContainer({ ariaLabel: 'box plots', withinChartClip: true })\n\n\t\tconst options = this.getOptions()\n\t\tconst { groupMapsTo } = options.data\n\n\t\tconst dataGroupNames = this.model.getDataGroupNames()\n\n\t\t/*\n\t\t * Get graphable dimensions\n\t\t */\n\t\tconst mainXScale = this.services.cartesianScales.getMainXScale()\n\t\tconst mainYScale = this.services.cartesianScales.getMainYScale()\n\t\tconst [xScaleStart, xScaleEnd] = mainXScale.range()\n\t\tconst [yScaleEnd, yScaleStart] = mainYScale.range()\n\t\tconst width = xScaleEnd - xScaleStart\n\t\tconst height = yScaleEnd - yScaleStart\n\t\tif (width === 0) {\n\t\t\treturn\n\t\t}\n\n\t\t// Get orientation of the chart\n\t\tconst { cartesianScales } = this.services\n\t\tconst orientation = cartesianScales.getOrientation()\n\t\tconst isInVerticalOrientation = orientation === CartesianOrientations.VERTICAL\n\t\tconst [getXValue, getYValue] = flipDomainAndRangeBasedOnOrientation(\n\t\t\t(d: any) => this.services.cartesianScales.getDomainValue(d),\n\t\t\t(d: any) => this.services.cartesianScales.getRangeValue(d),\n\t\t\torientation\n\t\t)\n\n\t\tconst gridSize = Math.floor((isInVerticalOrientation ? width : height) / dataGroupNames.length)\n\t\tconst boxWidth = Math.min(gridSize / 2, 16)\n\n\t\tconst boxplotData = (this.model as BoxplotChartModel).getBoxplotData()\n\n\t\t/*\n\t\t * update or initialize all box groups\n\t\t */\n\t\tconst boxGroups = svg.selectAll('.box-group').data(boxplotData)\n\t\tboxGroups.exit().remove()\n\n\t\tconst boxGroupsEnter = boxGroups.enter().append('g').attr('class', 'box-group')\n\n\t\tconst allBoxGroups = boxGroups.merge(boxGroupsEnter)\n\n\t\t/*\n\t\t * draw the 2 range lines for each box\n\t\t */\n\t\t// Start range line\n\t\tboxGroupsEnter\n\t\t\t.append('path')\n\t\t\t.merge(boxGroups.select('path.vertical-line.start'))\n\t\t\t.attr('class', () =>\n\t\t\t\tthis.model.getColorClassName({\n\t\t\t\t\tclassNameTypes: [ColorClassNameTypes.STROKE],\n\t\t\t\t\toriginalClassName: 'vertical-line start'\n\t\t\t\t})\n\t\t\t)\n\t\t\t.attr('stroke-width', boxplotConfigs.strokeWidth.default)\n\t\t\t.attr('fill', 'none')\n\t\t\t.transition()\n\t\t\t.call((t: any) =>\n\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\ttransition: t,\n\t\t\t\t\tname: 'boxplot-update-verticalstartline',\n\t\t\t\t\tanimate\n\t\t\t\t})\n\t\t\t)\n\t\t\t.attr('d', (d: any) => {\n\t\t\t\tconst x0 = cartesianScales.getDomainValue(d[groupMapsTo])\n\t\t\t\tconst x1 = x0\n\t\t\t\tconst y0 = cartesianScales.getRangeValue(d.whiskers.min)\n\t\t\t\tconst y1 = cartesianScales.getRangeValue(d.quartiles.q_25)\n\n\t\t\t\treturn generateSVGPathString({ x0, x1, y0, y1 }, orientation)\n\t\t\t})\n\n\t\t// End range line\n\t\tboxGroupsEnter\n\t\t\t.append('path')\n\t\t\t.merge(boxGroups.select('path.vertical-line.end'))\n\t\t\t.attr('class', () =>\n\t\t\t\tthis.model.getColorClassName({\n\t\t\t\t\tclassNameTypes: [ColorClassNameTypes.STROKE],\n\t\t\t\t\toriginalClassName: 'vertical-line end'\n\t\t\t\t})\n\t\t\t)\n\t\t\t.attr('stroke-width', boxplotConfigs.strokeWidth.default)\n\t\t\t.attr('fill', 'none')\n\t\t\t.transition()\n\t\t\t.call((t: any) =>\n\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\ttransition: t,\n\t\t\t\t\tname: 'boxplot-update-verticalendline',\n\t\t\t\t\tanimate\n\t\t\t\t})\n\t\t\t)\n\t\t\t.attr('d', (d: any) => {\n\t\t\t\tconst x0 = cartesianScales.getDomainValue(d[groupMapsTo])\n\t\t\t\tconst x1 = x0\n\t\t\t\tconst y0 = cartesianScales.getRangeValue(d.whiskers.max)\n\t\t\t\tconst y1 = cartesianScales.getRangeValue(d.quartiles.q_75)\n\n\t\t\t\treturn generateSVGPathString({ x0, x1, y0, y1 }, orientation)\n\t\t\t})\n\n\t\t/*\n\t\t * Draw out and update the boxes\n\t\t */\n\t\tboxGroupsEnter\n\t\t\t.append('path')\n\t\t\t.merge(boxGroups.select('path.box'))\n\t\t\t.attr('class', () =>\n\t\t\t\tthis.model.getColorClassName({\n\t\t\t\t\tclassNameTypes: [ColorClassNameTypes.FILL, ColorClassNameTypes.STROKE],\n\t\t\t\t\toriginalClassName: 'box'\n\t\t\t\t})\n\t\t\t)\n\t\t\t.attr('fill-opacity', boxplotConfigs.box.opacity.default)\n\t\t\t.attr('stroke-width', boxplotConfigs.strokeWidth.default)\n\t\t\t.attr('role', Roles.GRAPHICS_SYMBOL)\n\t\t\t.attr('aria-roledescription', 'box')\n\t\t\t.attr('aria-label', (d: any) => d[groupMapsTo])\n\t\t\t.transition()\n\t\t\t.call((t: any) =>\n\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\ttransition: t,\n\t\t\t\t\tname: 'boxplot-update-quartiles',\n\t\t\t\t\tanimate\n\t\t\t\t})\n\t\t\t)\n\t\t\t.attr('d', (d: any) => {\n\t\t\t\tconst x0 = cartesianScales.getDomainValue(d[groupMapsTo]) - boxWidth / 2\n\t\t\t\tconst x1 = x0 + boxWidth\n\t\t\t\tconst y0 = cartesianScales.getRangeValue(\n\t\t\t\t\tMath[isInVerticalOrientation ? 'max' : 'min'](d.quartiles.q_75, d.quartiles.q_25)\n\t\t\t\t)\n\t\t\t\tconst y1 =\n\t\t\t\t\ty0 +\n\t\t\t\t\tMath.abs(\n\t\t\t\t\t\tcartesianScales.getRangeValue(d.quartiles.q_75) -\n\t\t\t\t\t\t\tcartesianScales.getRangeValue(d.quartiles.q_25)\n\t\t\t\t\t)\n\n\t\t\t\treturn generateSVGPathString({ x0, x1, y0, y1 }, orientation)\n\t\t\t})\n\n\t\t/*\n\t\t * Draw out and update highlight areas\n\t\t */\n\t\tboxGroupsEnter\n\t\t\t.append('path')\n\t\t\t.merge(boxGroups.select('path.highlight-area'))\n\t\t\t.attr('class', 'highlight-area')\n\t\t\t.attr('opacity', 0)\n\t\t\t.attr('d', (d: any) => {\n\t\t\t\tconst x0 = cartesianScales.getDomainValue(d[groupMapsTo]) - boxWidth / 2\n\t\t\t\tconst x1 = x0 + boxWidth\n\t\t\t\tconst y0 = cartesianScales.getRangeValue(d.whiskers.min)\n\t\t\t\tconst y1 = cartesianScales.getRangeValue(d.whiskers.max)\n\n\t\t\t\treturn generateSVGPathString({ x0, x1, y0, y1 }, orientation)\n\t\t\t})\n\n\t\t/*\n\t\t * Draw out and update the starting whisker\n\t\t */\n\t\tboxGroupsEnter\n\t\t\t.append('path')\n\t\t\t.merge(boxGroups.select('path.whisker.start'))\n\t\t\t.attr('class', () =>\n\t\t\t\tthis.model.getColorClassName({\n\t\t\t\t\tclassNameTypes: [ColorClassNameTypes.STROKE],\n\t\t\t\t\toriginalClassName: 'whisker start'\n\t\t\t\t})\n\t\t\t)\n\t\t\t.attr('stroke-width', boxplotConfigs.strokeWidth.thicker)\n\t\t\t.attr('fill', 'none')\n\t\t\t.transition()\n\t\t\t.call((t: any) =>\n\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\ttransition: t,\n\t\t\t\t\tname: 'boxplot-update-startingwhisker',\n\t\t\t\t\tanimate\n\t\t\t\t})\n\t\t\t)\n\t\t\t.attr('d', (d: any) => {\n\t\t\t\tconst x0 = cartesianScales.getDomainValue(d[groupMapsTo]) - boxWidth / 4\n\t\t\t\tconst x1 = x0 + boxWidth / 2\n\t\t\t\tconst y0 = cartesianScales.getRangeValue(d.whiskers.min)\n\t\t\t\tconst y1 = cartesianScales.getRangeValue(d.whiskers.min)\n\n\t\t\t\treturn generateSVGPathString({ x0, x1, y0, y1 }, orientation)\n\t\t\t})\n\n\t\t/*\n\t\t * Draw out and update the median line\n\t\t */\n\t\tboxGroupsEnter\n\t\t\t.append('path')\n\t\t\t.merge(boxGroups.select('path.median'))\n\t\t\t.attr('fill', 'none')\n\t\t\t.attr('class', () =>\n\t\t\t\tthis.model.getColorClassName({\n\t\t\t\t\tclassNameTypes: [ColorClassNameTypes.STROKE],\n\t\t\t\t\toriginalClassName: 'median'\n\t\t\t\t})\n\t\t\t)\n\t\t\t.attr('stroke-width', 2)\n\t\t\t.transition()\n\t\t\t.call((t: any) =>\n\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\ttransition: t,\n\t\t\t\t\tname: 'boxplot-update-median',\n\t\t\t\t\tanimate\n\t\t\t\t})\n\t\t\t)\n\t\t\t.attr('d', (d: any) => {\n\t\t\t\tconst x0 = cartesianScales.getDomainValue(d[groupMapsTo]) - boxWidth / 2\n\t\t\t\tconst x1 = x0 + boxWidth\n\t\t\t\tconst y0 = cartesianScales.getRangeValue(d.quartiles.q_50)\n\t\t\t\tconst y1 = y0\n\n\t\t\t\treturn generateSVGPathString({ x0, x1, y0, y1 }, orientation)\n\t\t\t})\n\n\t\t/*\n\t\t * Draw out and update the ending whisker\n\t\t */\n\t\tboxGroupsEnter\n\t\t\t.append('path')\n\t\t\t.merge(boxGroups.select('path.whisker.end'))\n\t\t\t.attr('class', () =>\n\t\t\t\tthis.model.getColorClassName({\n\t\t\t\t\tclassNameTypes: [ColorClassNameTypes.STROKE],\n\t\t\t\t\toriginalClassName: 'whisker end'\n\t\t\t\t})\n\t\t\t)\n\t\t\t.attr('stroke-width', boxplotConfigs.strokeWidth.thicker)\n\t\t\t.attr('fill', 'none')\n\t\t\t.transition()\n\t\t\t.call((t: any) =>\n\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\ttransition: t,\n\t\t\t\t\tname: 'boxplot-update-endingwhisker',\n\t\t\t\t\tanimate\n\t\t\t\t})\n\t\t\t)\n\t\t\t.attr('d', (d: any) => {\n\t\t\t\tconst x0 = cartesianScales.getDomainValue(d[groupMapsTo]) - boxWidth / 4\n\t\t\t\tconst x1 = x0 + boxWidth / 2\n\t\t\t\tconst y0 = cartesianScales.getRangeValue(d.whiskers.max)\n\t\t\t\tconst y1 = cartesianScales.getRangeValue(d.whiskers.max)\n\n\t\t\t\treturn generateSVGPathString({ x0, x1, y0, y1 }, orientation)\n\t\t\t})\n\n\t\t/*\n\t\t * Draw out and update the outlier circles\n\t\t */\n\t\tconst circles = allBoxGroups.selectAll('circle.outlier').data((d: any) =>\n\t\t\td.outliers.map((outlier: any) => {\n\t\t\t\treturn {\n\t\t\t\t\tmin: d.whiskers.min,\n\t\t\t\t\tmax: d.whiskers.max,\n\t\t\t\t\t[groupMapsTo]: d[groupMapsTo],\n\t\t\t\t\tvalue: outlier\n\t\t\t\t}\n\t\t\t})\n\t\t)\n\n\t\tcircles.exit().remove()\n\n\t\tconst circlesEnter = circles.enter().append('circle')\n\n\t\tcircles\n\t\t\t.merge(circlesEnter)\n\t\t\t.attr('r', boxplotConfigs.circle.radius)\n\t\t\t.attr('class', () =>\n\t\t\t\tthis.model.getColorClassName({\n\t\t\t\t\tclassNameTypes: [ColorClassNameTypes.FILL, ColorClassNameTypes.STROKE],\n\t\t\t\t\toriginalClassName: 'outlier'\n\t\t\t\t})\n\t\t\t)\n\t\t\t.attr('fill-opacity', boxplotConfigs.circle.opacity.default)\n\t\t\t.attr('cx', getXValue)\n\t\t\t.transition()\n\t\t\t.call((t: any) =>\n\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\ttransition: t,\n\t\t\t\t\tname: 'boxplot-update-circles',\n\t\t\t\t\tanimate\n\t\t\t\t})\n\t\t\t)\n\t\t\t.attr('cy', getYValue)\n\n\t\tthis.addBoxEventListeners()\n\t\tthis.addCircleEventListeners()\n\t}\n\n\taddBoxEventListeners() {\n\t\tconst self = this\n\n\t\tconst options = this.getOptions()\n\t\tconst { groupMapsTo } = options.data\n\n\t\tthis.parent\n\t\t\t.selectAll('path.highlight-area')\n\t\t\t.on('mouseover', function (event: MouseEvent, datum: any) {\n\t\t\t\tconst hoveredElement = select(this)\n\t\t\t\tconst parentElement = select((this as any).parentNode)\n\t\t\t\tparentElement\n\t\t\t\t\t.select('path.box')\n\t\t\t\t\t.classed('hovered', true)\n\t\t\t\t\t.attr('fill-opacity', boxplotConfigs.box.opacity.hovered)\n\n\t\t\t\t// Show tooltip for single datapoint\n\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.SHOW, {\n\t\t\t\t\tevent,\n\t\t\t\t\thoveredElement,\n\t\t\t\t\titems: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel:\n\t\t\t\t\t\t\t\tgetProperty(options, 'locale', 'translations', 'group') ||\n\t\t\t\t\t\t\t\tgetProperty(options, 'tooltip', 'groupLabel') ||\n\t\t\t\t\t\t\t\t'Group',\n\t\t\t\t\t\t\tvalue: datum[groupMapsTo],\n\t\t\t\t\t\t\tclass: self.model.getColorClassName({\n\t\t\t\t\t\t\t\tclassNameTypes: [ColorClassNameTypes.TOOLTIP]\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel: 'Minimum',\n\t\t\t\t\t\t\tvalue: datum.whiskers.min\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel: 'Q1',\n\t\t\t\t\t\t\tvalue: datum.quartiles.q_25\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel: 'Median',\n\t\t\t\t\t\t\tvalue: datum.quartiles.q_50\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel: 'Q3',\n\t\t\t\t\t\t\tvalue: datum.quartiles.q_75\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel: 'Maximum',\n\t\t\t\t\t\t\tvalue: datum.whiskers.max\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel: 'IQR',\n\t\t\t\t\t\t\tvalue: datum.quartiles.q_75 - datum.quartiles.q_25\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t})\n\n\t\t\t\t// Dispatch mouse event\n\t\t\t\tself.services.events.dispatchEvent(Events.Boxplot.BOX_MOUSEOVER, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: hoveredElement,\n\t\t\t\t\tdatum\n\t\t\t\t})\n\t\t\t})\n\t\t\t.on('mousemove', function (event: MouseEvent, datum: any) {\n\t\t\t\tconst hoveredElement = select(this)\n\n\t\t\t\t// Dispatch mouse event\n\t\t\t\tself.services.events.dispatchEvent(Events.Boxplot.BOX_MOUSEMOVE, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: hoveredElement,\n\t\t\t\t\tdatum\n\t\t\t\t})\n\n\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.MOVE, {\n\t\t\t\t\tevent\n\t\t\t\t})\n\t\t\t})\n\t\t\t.on('click', function (event: MouseEvent, datum: any) {\n\t\t\t\t// Dispatch mouse event\n\t\t\t\tself.services.events.dispatchEvent(Events.Boxplot.BOX_CLICK, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: select(this),\n\t\t\t\t\tdatum\n\t\t\t\t})\n\t\t\t})\n\t\t\t.on('mouseout', function (event: MouseEvent, datum: any) {\n\t\t\t\tconst hoveredElement = select(this)\n\t\t\t\tconst parentElement = select((this as any).parentNode)\n\t\t\t\tparentElement\n\t\t\t\t\t.select('path.box')\n\t\t\t\t\t.classed('hovered', false)\n\t\t\t\t\t.attr('fill-opacity', boxplotConfigs.box.opacity.default)\n\n\t\t\t\t// Dispatch mouse event\n\t\t\t\tself.services.events.dispatchEvent(Events.Boxplot.BOX_MOUSEOUT, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: hoveredElement,\n\t\t\t\t\tdatum\n\t\t\t\t})\n\n\t\t\t\t// Hide tooltip\n\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.HIDE, {\n\t\t\t\t\thoveredElement\n\t\t\t\t})\n\t\t\t})\n\t}\n\n\taddCircleEventListeners() {\n\t\tconst self = this\n\n\t\tconst options = this.getOptions()\n\t\tconst { groupMapsTo } = options.data\n\n\t\tconst rangeIdentifier = this.services.cartesianScales.getRangeIdentifier()\n\n\t\tthis.parent\n\t\t\t.selectAll('circle')\n\t\t\t.on('mouseover', function (event: MouseEvent, datum: any) {\n\t\t\t\tconst hoveredElement = select(this)\n\n\t\t\t\thoveredElement\n\t\t\t\t\t.classed('hovered', true)\n\t\t\t\t\t.attr('fill-opacity', boxplotConfigs.circle.opacity.hovered)\n\t\t\t\t\t.classed('unfilled', false)\n\n\t\t\t\t// Show tooltip for single datapoint\n\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.SHOW, {\n\t\t\t\t\tevent,\n\t\t\t\t\thoveredElement,\n\t\t\t\t\titems: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel:\n\t\t\t\t\t\t\t\tgetProperty(options, 'locale', 'translations', 'group') ||\n\t\t\t\t\t\t\t\tgetProperty(options, 'tooltip', 'groupLabel') ||\n\t\t\t\t\t\t\t\t'Group',\n\t\t\t\t\t\t\tvalue: datum[groupMapsTo],\n\t\t\t\t\t\t\tclass: self.model.getColorClassName({\n\t\t\t\t\t\t\t\tclassNameTypes: [ColorClassNameTypes.TOOLTIP]\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel: 'Outlier',\n\t\t\t\t\t\t\tvalue: datum[rangeIdentifier]\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t})\n\n\t\t\t\t// Dispatch mouse event\n\t\t\t\tself.services.events.dispatchEvent(Events.Boxplot.OUTLIER_MOUSEOVER, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: hoveredElement,\n\t\t\t\t\tdatum\n\t\t\t\t})\n\t\t\t})\n\t\t\t.on('mousemove', function (event: MouseEvent, datum: any) {\n\t\t\t\tconst hoveredElement = select(this)\n\n\t\t\t\t// Dispatch mouse event\n\t\t\t\tself.services.events.dispatchEvent(Events.Boxplot.OUTLIER_MOUSEMOVE, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: hoveredElement,\n\t\t\t\t\tdatum\n\t\t\t\t})\n\n\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.MOVE, {\n\t\t\t\t\tevent\n\t\t\t\t})\n\t\t\t})\n\t\t\t.on('click', function (event: MouseEvent, datum: any) {\n\t\t\t\t// Dispatch mouse event\n\t\t\t\tself.services.events.dispatchEvent(Events.Boxplot.OUTLIER_CLICK, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: select(this),\n\t\t\t\t\tdatum\n\t\t\t\t})\n\t\t\t})\n\t\t\t.on('mouseout', function (event: MouseEvent, datum: any) {\n\t\t\t\tconst hoveredElement = select(this)\n\t\t\t\thoveredElement\n\t\t\t\t\t.classed('hovered', false)\n\t\t\t\t\t.attr('fill-opacity', boxplotConfigs.circle.opacity.default)\n\n\t\t\t\t// Dispatch mouse event\n\t\t\t\tself.services.events.dispatchEvent(Events.Boxplot.OUTLIER_MOUSEOUT, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: hoveredElement,\n\t\t\t\t\tdatum\n\t\t\t\t})\n\n\t\t\t\t// Hide tooltip\n\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.HIDE, {\n\t\t\t\t\thoveredElement\n\t\t\t\t})\n\t\t\t})\n\t}\n}\n","import { flipSVGCoordinatesBasedOnOrientation } from '@/tools'\nimport { Component } from '@/components/component'\nimport { DOMUtils } from '@/services/essentials/dom-utils'\nimport { RenderTypes } from '@/interfaces/enums'\n\nexport class ZeroLine extends Component {\n\ttype = 'zero-line'\n\trenderType = RenderTypes.SVG\n\n\trender(animate: boolean) {\n\t\tconst axisPosition = this.services.cartesianScales.getRangeAxisPosition({\n\t\t\tgroups: this.configs.groups\n\t\t})\n\t\tconst rangeScale = this.services.cartesianScales.getScaleByPosition(axisPosition)\n\t\t// check the domain\n\t\tconst [minDomainValue, maxDomainValue] = rangeScale.domain()\n\n\t\tconst drawZeroLine =\n\t\t\t(minDomainValue > 0 && maxDomainValue < 0) || (minDomainValue < 0 && maxDomainValue > 0)\n\n\t\t// Grab container SVG\n\t\tconst svg = this.getComponentContainer({\n\t\t\tisPresentational: true\n\t\t})\n\n\t\t// show zero line only if is necessary, otherwise make sure tto remove zero line if the chart\n\t\t// previously had a domain that went into negatives\n\t\tif (!drawZeroLine) {\n\t\t\t// otherwise if a chart draws a zero line and then the domain change the zero line is still in the DOM\n\t\t\tsvg.selectAll('line.domain').remove()\n\t\t\treturn\n\t\t}\n\n\t\t// Get x & y position of the line\n\t\tconst [x0, x1] = this.services.cartesianScales.getDomainScale().range()\n\t\tlet yPosition = +rangeScale(0) + 0.5\n\n\t\t// if scale domain contains NaN, return the first value of the range\n\t\t// this is necessary for the zero line y position that otherwise is NaN\n\t\t// so on the top of the chart while we want it on the bottom\n\t\tif (!yPosition) {\n\t\t\tyPosition = rangeScale.range()[0]\n\t\t}\n\n\t\tconst lineCoordinates = flipSVGCoordinatesBasedOnOrientation(\n\t\t\t{\n\t\t\t\tx0,\n\t\t\t\tx1,\n\t\t\t\ty0: yPosition,\n\t\t\t\ty1: yPosition\n\t\t\t},\n\t\t\tthis.services.cartesianScales.getOrientation()\n\t\t)\n\n\t\tconst line = DOMUtils.appendOrSelect(svg, 'line.domain')\n\t\tline\n\t\t\t.transition()\n\t\t\t.call((t: any) =>\n\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\ttransition: t,\n\t\t\t\t\tname: 'zero-line-update',\n\t\t\t\t\tanimate\n\t\t\t\t})\n\t\t\t)\n\t\t\t.attr('y1', lineCoordinates.y0)\n\t\t\t.attr('y2', lineCoordinates.y1)\n\t\t\t.attr('x1', lineCoordinates.x0)\n\t\t\t.attr('x2', lineCoordinates.x1)\n\t}\n}\n","import { extent, scaleLinear, type Selection } from 'd3'\nimport { flipDomainAndRangeBasedOnOrientation, getProperty } from '@/tools'\nimport { Scatter } from './scatter'\nimport { DOMUtils } from '@/services/essentials/dom-utils'\nimport { ColorClassNameTypes, RenderTypes } from '@/interfaces/enums'\nimport { Roles } from '@/interfaces/a11y'\n\nexport class Bubble extends Scatter {\n\ttype = 'bubble'\n\trenderType = RenderTypes.SVG\n\n\tgetRadiusScale(selection: Selection) {\n\t\tconst options = this.getOptions()\n\t\tconst { radiusMapsTo } = options.bubble\n\n\t\tconst data = selection.data()\n\t\t// Filter out any null/undefined values\n\t\tconst allRadii = data.map((d: any) => d[radiusMapsTo]).filter(radius => radius)\n\t\tconst chartSize = DOMUtils.getHTMLElementSize(this.services.domUtils.getMainContainer())\n\n\t\t// We need the ternary operator here in case the user\n\t\t// doesn't provide radius values in data\n\t\tconst radiusDataIsValid = allRadii.length > 0\n\t\tconst domain = radiusDataIsValid ? extent(allRadii) : [1, 1]\n\n\t\treturn scaleLinear()\n\t\t\t.domain(domain)\n\t\t\t.range(radiusDataIsValid ? options.bubble.radiusRange(chartSize, data) : [4, 4])\n\t}\n\n\tstyleCircles(selection: Selection, animate: boolean) {\n\t\t// Chart options mixed with the internal configurations\n\t\tconst options = this.getOptions()\n\t\tconst { radiusMapsTo } = options.bubble\n\n\t\tconst radiusScale = this.getRadiusScale(selection)\n\t\tconst { groupMapsTo } = options.data\n\n\t\tconst { cartesianScales } = this.services\n\t\tconst getDomainValue = (d: any) => cartesianScales.getDomainValue(d)\n\t\tconst getRangeValue = (d: any) => cartesianScales.getRangeValue(d)\n\t\tconst [getXValue, getYValue] = flipDomainAndRangeBasedOnOrientation(\n\t\t\tgetDomainValue,\n\t\t\tgetRangeValue,\n\t\t\tcartesianScales.getOrientation()\n\t\t)\n\n\t\tselection\n\t\t\t.raise()\n\t\t\t.classed('dot', true)\n\t\t\t.attr('role', Roles.GRAPHICS_SYMBOL)\n\t\t\t.attr('aria-label', (d: any) => {\n\t\t\t\tconst rangeIdentifier = cartesianScales.getRangeIdentifier(d)\n\t\t\t\treturn d[rangeIdentifier]\n\t\t\t})\n\t\t\t.transition()\n\t\t\t.call((t: any) =>\n\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\ttransition: t,\n\t\t\t\t\tname: 'bubble-update-enter',\n\t\t\t\t\tanimate\n\t\t\t\t})\n\t\t\t)\n\t\t\t.attr('cx', getXValue)\n\t\t\t.attr('cy', getYValue)\n\t\t\t// We need `|| 1` here in case the user doesn't provide radius values in data\n\t\t\t.attr('r', (d: any) => radiusScale(d[radiusMapsTo] || 1))\n\t\t\t.attr('class', (d: any) =>\n\t\t\t\tthis.model.getColorClassName({\n\t\t\t\t\tclassNameTypes: [ColorClassNameTypes.FILL, ColorClassNameTypes.STROKE],\n\t\t\t\t\tdataGroupName: d[groupMapsTo],\n\t\t\t\t\toriginalClassName: 'dot'\n\t\t\t\t})\n\t\t\t)\n\t\t\t.style('fill', (d: any) => {\n\t\t\t\tconst domainIdentifier = this.services.cartesianScales.getDomainIdentifier(d)\n\t\t\t\treturn this.model.getFillColor(d[groupMapsTo], d[domainIdentifier], d)\n\t\t\t})\n\t\t\t.style('stroke', (d: any) => {\n\t\t\t\tconst domainIdentifier = this.services.cartesianScales.getDomainIdentifier(d)\n\t\t\t\treturn this.model.getStrokeColor(d[groupMapsTo], d[domainIdentifier], d)\n\t\t\t})\n\t\t\t.attr('fill-opacity', options.bubble.fillOpacity)\n\t\t\t.attr('opacity', 1)\n\t}\n\n\tgetTooltipAdditionalItems(datum: any) {\n\t\tconst bubbleOptions = getProperty(this.getOptions(), 'bubble')\n\n\t\treturn [\n\t\t\t{\n\t\t\t\tlabel: getProperty(bubbleOptions, 'radiusLabel'),\n\t\t\t\tvalue: datum[getProperty(bubbleOptions, 'radiusMapsTo')]\n\t\t\t}\n\t\t]\n\t}\n}\n","import { select } from 'd3'\nimport { generateSVGPathString, getProperty } from '@/tools'\nimport { Component } from '@/components/component'\nimport { Events, ColorClassNameTypes, RenderTypes } from '@/interfaces/enums'\nimport { Roles } from '@/interfaces/a11y'\nimport { DOMUtils } from '@/services/essentials/dom-utils'\nimport { BulletChartModel } from '@/model/bullet'\n\nexport class Bullet extends Component {\n\ttype = 'bullet'\n\trenderType = RenderTypes.SVG\n\n\tinit() {\n\t\tconst eventsFragment = this.services.events\n\n\t\t// Highlight correct circle on legend item hovers\n\t\teventsFragment.addEventListener(Events.Legend.ITEM_HOVER, this.handleLegendOnHover)\n\n\t\t// Un-highlight circles on legend item mouseouts\n\t\teventsFragment.addEventListener(Events.Legend.ITEM_MOUSEOUT, this.handleLegendMouseOut)\n\t}\n\n\trender(animate: boolean) {\n\t\tconst options = this.getOptions()\n\t\tconst { groupMapsTo } = options.data\n\n\t\t// Grab container SVG\n\t\tconst svg = this.getComponentContainer({ ariaLabel: 'bullet graphs', withinChartClip: true })\n\n\t\tconst data = this.model.getDisplayData(this.configs.groups)\n\n\t\tconst rangeScale = this.services.cartesianScales.getRangeScale()\n\t\tconst rangeIdentifier = this.services.cartesianScales.getRangeIdentifier()\n\t\tconst [rangeScaleStart, rangeScaleEnd] = rangeScale.range()\n\t\tconst [, rangeScaleDomainMax] = rangeScale.domain()\n\n\t\tconst renderRangeBoxes = () => {\n\t\t\tconst rangeBoxData: any[] = []\n\t\t\tdata.forEach((datum: any) => {\n\t\t\t\tif (datum.ranges) {\n\t\t\t\t\tdatum.ranges.forEach((range: any, i: number) => {\n\t\t\t\t\t\tif (range !== null && range !== undefined && range < rangeScaleDomainMax) {\n\t\t\t\t\t\t\trangeBoxData.push({\n\t\t\t\t\t\t\t\tdatum,\n\t\t\t\t\t\t\t\tvalue: range,\n\t\t\t\t\t\t\t\torder: i + 1\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t} else {\n\t\t\t\t\trangeBoxData.push({\n\t\t\t\t\t\tdatum,\n\t\t\t\t\t\torder: 1\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t})\n\n\t\t\t// Update data on all lines\n\t\t\tconst rangeBoxes = DOMUtils.appendOrSelect(svg, 'g.range-boxes')\n\t\t\t\t.selectAll('path.range-box')\n\t\t\t\t.data(rangeBoxData, (datum: any) => `${datum[groupMapsTo]}-${datum.order}`)\n\n\t\t\t// Remove lines that are no longer needed\n\t\t\trangeBoxes.exit().attr('opacity', 0).remove()\n\n\t\t\t// Add the paths that need to be introduced\n\t\t\tconst rangeBoxesEnter = rangeBoxes.enter().append('path').attr('opacity', 0)\n\n\t\t\trangeBoxesEnter\n\t\t\t\t.merge(rangeBoxes as any)\n\t\t\t\t.attr('class', (d: any) => `range-box order-${d.order}`)\n\t\t\t\t.transition()\n\t\t\t\t.call((t: any) =>\n\t\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\t\ttransition: t,\n\t\t\t\t\t\tname: 'bullet-range-box-update-enter',\n\t\t\t\t\t\tanimate\n\t\t\t\t\t})\n\t\t\t\t)\n\t\t\t\t.attr('d', (d: any) => {\n\t\t\t\t\t/*\n\t\t\t\t\t * Orientation support for horizontal/vertical bar charts\n\t\t\t\t\t * Determine coordinates needed for a vertical set of paths\n\t\t\t\t\t * to draw the bars needed, and pass those coordinates down to\n\t\t\t\t\t * generateSVGPathString() to decide whether it needs to flip them\n\t\t\t\t\t */\n\t\t\t\t\tconst lineHeight = 16\n\n\t\t\t\t\tlet x0: number, x1: number, y0: number, y1: number\n\t\t\t\t\tif (d.order === 1) {\n\t\t\t\t\t\tx0 = this.services.cartesianScales.getDomainValue(d.datum) - lineHeight / 2\n\t\t\t\t\t\tx1 = x0 + lineHeight\n\t\t\t\t\t\ty0 = rangeScaleEnd - 2\n\t\t\t\t\t\ty1 = rangeScaleStart + 1\n\t\t\t\t\t} else {\n\t\t\t\t\t\tx0 = this.services.cartesianScales.getDomainValue(d.datum) - lineHeight / 2\n\t\t\t\t\t\tx1 = x0 + lineHeight\n\t\t\t\t\t\ty0 = this.services.cartesianScales.getRangeValue(d.value)\n\t\t\t\t\t\ty1 = rangeScaleEnd\n\t\t\t\t\t}\n\n\t\t\t\t\treturn generateSVGPathString(\n\t\t\t\t\t\t{ x0, x1, y0, y1 },\n\t\t\t\t\t\tthis.services.cartesianScales.getOrientation()\n\t\t\t\t\t)\n\t\t\t\t})\n\t\t\t\t.attr('opacity', 1)\n\t\t}\n\n\t\tconst renderBars = () => {\n\t\t\t// Update data on all bars\n\t\t\tconst bars = DOMUtils.appendOrSelect(svg, 'g.bars')\n\t\t\t\t.selectAll('path.bar')\n\t\t\t\t.data(data, (datum: any) => datum[groupMapsTo])\n\n\t\t\t// Remove bars that are no longer needed\n\t\t\tbars.exit().attr('opacity', 0).remove()\n\n\t\t\t// Add the paths that need to be introduced\n\t\t\tconst barsEnter = bars.enter().append('path').attr('opacity', 0)\n\n\t\t\tbarsEnter\n\t\t\t\t.merge(bars as any)\n\t\t\t\t.classed('bar', true)\n\t\t\t\t.transition()\n\t\t\t\t.call((t: any) =>\n\t\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\t\ttransition: t,\n\t\t\t\t\t\tname: 'bullet-bar-update-enter',\n\t\t\t\t\t\tanimate\n\t\t\t\t\t})\n\t\t\t\t)\n\t\t\t\t.attr('class', (d: any) =>\n\t\t\t\t\tthis.model.getColorClassName({\n\t\t\t\t\t\tclassNameTypes: [ColorClassNameTypes.FILL],\n\t\t\t\t\t\tdataGroupName: d[groupMapsTo],\n\t\t\t\t\t\toriginalClassName: 'bar'\n\t\t\t\t\t})\n\t\t\t\t)\n\t\t\t\t.style('fill', (d: any) => {\n\t\t\t\t\tconst domainIdentifier = this.services.cartesianScales.getDomainIdentifier(d)\n\t\t\t\t\treturn this.model.getFillColor(d[groupMapsTo], d[domainIdentifier], d)\n\t\t\t\t})\n\t\t\t\t.attr('d', (d: any) => {\n\t\t\t\t\t/*\n\t\t\t\t\t * Orientation support for horizontal/vertical bar charts\n\t\t\t\t\t * Determine coordinates needed for a vertical set of paths\n\t\t\t\t\t * to draw the bars needed, and pass those coordinates down to\n\t\t\t\t\t * generateSVGPathString() to decide whether it needs to flip them\n\t\t\t\t\t */\n\t\t\t\t\tconst barWidth = 8\n\t\t\t\t\tconst x0 = this.services.cartesianScales.getDomainValue(d) - barWidth / 2\n\t\t\t\t\tconst x1 = x0 + barWidth\n\t\t\t\t\tconst y0 = this.services.cartesianScales.getRangeValue(0) + 1\n\t\t\t\t\tconst y1 = this.services.cartesianScales.getRangeValue(d)\n\n\t\t\t\t\treturn generateSVGPathString(\n\t\t\t\t\t\t{ x0, x1, y0, y1 },\n\t\t\t\t\t\tthis.services.cartesianScales.getOrientation()\n\t\t\t\t\t)\n\t\t\t\t})\n\t\t\t\t.attr('opacity', 1)\n\t\t\t\t// a11y\n\t\t\t\t.attr('role', Roles.GRAPHICS_SYMBOL)\n\t\t\t\t.attr('aria-roledescription', 'bar')\n\t\t\t\t.attr('aria-label', (d: any) => d.value)\n\t\t}\n\n\t\tconst renderTargetLines = () => {\n\t\t\t// Update data on all lines\n\t\t\tconst lines = DOMUtils.appendOrSelect(svg, 'g.markers')\n\t\t\t\t.selectAll('path.marker')\n\t\t\t\t.data(\n\t\t\t\t\tdata.filter((d: any) => getProperty(d, 'marker') !== null),\n\t\t\t\t\t(datum: any) => datum[groupMapsTo]\n\t\t\t\t)\n\n\t\t\t// Remove lines that are no longer needed\n\t\t\tlines.exit().attr('opacity', 0).remove()\n\n\t\t\t// Add the paths that need to be introduced\n\t\t\tconst linesEnter = lines.enter().append('path').attr('opacity', 0)\n\n\t\t\tlinesEnter\n\t\t\t\t.merge(lines as any)\n\t\t\t\t.classed('marker', true)\n\t\t\t\t.transition()\n\t\t\t\t.call((t: any) =>\n\t\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\t\ttransition: t,\n\t\t\t\t\t\tname: 'bullet-marker-update-enter',\n\t\t\t\t\t\tanimate\n\t\t\t\t\t})\n\t\t\t\t)\n\t\t\t\t.attr('d', (d: any) => {\n\t\t\t\t\t/*\n\t\t\t\t\t * Orientation support for horizontal/vertical bar charts\n\t\t\t\t\t * Determine coordinates needed for a vertical set of paths\n\t\t\t\t\t * to draw the bars needed, and pass those coordinates down to\n\t\t\t\t\t * generateSVGPathString() to decide whether it needs to flip them\n\t\t\t\t\t */\n\t\t\t\t\tconst lineHeight = 24\n\t\t\t\t\tconst x0 = this.services.cartesianScales.getDomainValue(d) - lineHeight / 2\n\t\t\t\t\tconst x1 = x0 + lineHeight\n\t\t\t\t\tconst y0 = this.services.cartesianScales.getRangeValue(d.marker)\n\t\t\t\t\tconst y1 = y0\n\n\t\t\t\t\treturn generateSVGPathString(\n\t\t\t\t\t\t{ x0, x1, y0, y1 },\n\t\t\t\t\t\tthis.services.cartesianScales.getOrientation()\n\t\t\t\t\t)\n\t\t\t\t})\n\t\t\t\t.attr('opacity', 1)\n\t\t}\n\n\t\tconst renderTargetQuartiles = () => {\n\t\t\tlet quartilesData: any[] = []\n\t\t\tdata\n\t\t\t\t.filter((d: any) => getProperty(d, 'marker') !== null)\n\t\t\t\t.forEach((d: any) => {\n\t\t\t\t\tconst value = d.marker\n\t\t\t\t\tconst barValue = d[rangeIdentifier]\n\n\t\t\t\t\tquartilesData = quartilesData.concat([\n\t\t\t\t\t\t{ datum: d, value: value * 0.25, barValue },\n\t\t\t\t\t\t{ datum: d, value: value * 0.5, barValue },\n\t\t\t\t\t\t{ datum: d, value: value * 0.75, barValue }\n\t\t\t\t\t])\n\t\t\t\t})\n\n\t\t\t// Update data on all lines\n\t\t\tconst lines = DOMUtils.appendOrSelect(svg, 'g.quartiles')\n\t\t\t\t.selectAll('path.quartile')\n\t\t\t\t.data(quartilesData, (datum: any) => datum[groupMapsTo])\n\n\t\t\t// Remove lines that are no longer needed\n\t\t\tlines.exit().attr('opacity', 0).remove()\n\n\t\t\t// Add the paths that need to be introduced\n\t\t\tconst linesEnter = lines.enter().append('path').attr('opacity', 0)\n\n\t\t\tlinesEnter\n\t\t\t\t.merge(lines as any)\n\t\t\t\t.attr('class', (d: any) => {\n\t\t\t\t\treturn `quartile ${d.value <= d.barValue ? 'over-bar' : ''}`\n\t\t\t\t})\n\t\t\t\t.transition()\n\t\t\t\t.call((t: any) =>\n\t\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\t\ttransition: t,\n\t\t\t\t\t\tname: 'bullet-quartile-update-enter',\n\t\t\t\t\t\tanimate\n\t\t\t\t\t})\n\t\t\t\t)\n\t\t\t\t.attr('d', ({ datum: d, value }: { datum: any; value: any }) => {\n\t\t\t\t\t/*\n\t\t\t\t\t * Orientation support for horizontal/vertical bar charts\n\t\t\t\t\t * Determine coordinates needed for a vertical set of paths\n\t\t\t\t\t * to draw the bars needed, and pass those coordinates down to\n\t\t\t\t\t * generateSVGPathString() to decide whether it needs to flip them\n\t\t\t\t\t */\n\t\t\t\t\tlet lineHeight = 4\n\t\t\t\t\t// if it lines up with a performance area border\n\t\t\t\t\t// make the line taller\n\t\t\t\t\tif (d.ranges && d.ranges.indexOf(value) !== -1) {\n\t\t\t\t\t\tlineHeight = 8\n\t\t\t\t\t}\n\n\t\t\t\t\tconst x0 = this.services.cartesianScales.getDomainValue(d) - lineHeight / 2\n\t\t\t\t\tconst x1 = x0 + lineHeight\n\t\t\t\t\tconst y0 = this.services.cartesianScales.getRangeValue(value)\n\t\t\t\t\tconst y1 = y0\n\n\t\t\t\t\treturn generateSVGPathString(\n\t\t\t\t\t\t{ x0, x1, y0, y1 },\n\t\t\t\t\t\tthis.services.cartesianScales.getOrientation()\n\t\t\t\t\t)\n\t\t\t\t})\n\t\t\t\t.attr('opacity', 1)\n\t\t}\n\n\t\trenderRangeBoxes()\n\t\trenderBars()\n\t\trenderTargetLines()\n\t\trenderTargetQuartiles()\n\n\t\t// Add event listeners to elements drawn\n\t\tthis.addEventListeners()\n\t}\n\n\thandleLegendOnHover = (event: CustomEvent) => {\n\t\tconst { hoveredElement } = event.detail\n\t\tconst { groupMapsTo } = this.getOptions().data\n\n\t\tthis.parent\n\t\t\t.selectAll('path.bar')\n\t\t\t.transition('legend-hover-simple-bar')\n\t\t\t.call((t: any) =>\n\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\ttransition: t,\n\t\t\t\t\tname: 'legend-hover-simple-bar'\n\t\t\t\t})\n\t\t\t)\n\t\t\t.attr('opacity', (d: any) => (d[groupMapsTo] !== hoveredElement.datum()['name'] ? 0.3 : 1))\n\t}\n\n\thandleLegendMouseOut = () => {\n\t\tthis.parent\n\t\t\t.selectAll('path.bar')\n\t\t\t.transition('legend-mouseout-simple-bar')\n\t\t\t.call((t: any) =>\n\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\ttransition: t,\n\t\t\t\t\tname: 'legend-mouseout-simple-bar'\n\t\t\t\t})\n\t\t\t)\n\t\t\t.attr('opacity', 1)\n\t}\n\n\taddEventListeners() {\n\t\tconst self = this\n\n\t\tconst options = this.getOptions()\n\t\tconst { groupMapsTo } = options.data\n\n\t\tconst rangeIdentifier = this.services.cartesianScales.getRangeIdentifier()\n\n\t\tconst { code: localeCode, number: numberFormatter } = getProperty(options, 'locale')\n\n\t\tthis.parent\n\t\t\t.selectAll('path.bar')\n\t\t\t.on('mouseover', function (event: MouseEvent, datum: any) {\n\t\t\t\tconst hoveredElement = select(this)\n\t\t\t\thoveredElement.classed('hovered', true)\n\n\t\t\t\t// Dispatch mouse event\n\t\t\t\tself.services.events.dispatchEvent(Events.Bar.BAR_MOUSEOVER, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: hoveredElement,\n\t\t\t\t\tdatum\n\t\t\t\t})\n\n\t\t\t\tconst performanceAreaTitles = getProperty(options, 'bullet', 'performanceAreaTitles')\n\t\t\t\tconst matchingRangeIndex = (\n\t\t\t\t\tself.model as BulletChartModel\n\t\t\t\t).getMatchingRangeIndexForDatapoint(datum)\n\n\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.SHOW, {\n\t\t\t\t\tevent,\n\t\t\t\t\thoveredElement,\n\t\t\t\t\titems: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel:\n\t\t\t\t\t\t\t\tgetProperty(options, 'locale', 'translations', 'group') ||\n\t\t\t\t\t\t\t\tgetProperty(options, 'tooltip', 'groupLabel') ||\n\t\t\t\t\t\t\t\t'Group',\n\t\t\t\t\t\t\tvalue: datum[groupMapsTo],\n\t\t\t\t\t\t\tclass: self.model.getColorClassName({\n\t\t\t\t\t\t\t\tclassNameTypes: [ColorClassNameTypes.TOOLTIP],\n\t\t\t\t\t\t\t\tdataGroupName: datum[groupMapsTo]\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel: 'Value',\n\t\t\t\t\t\t\tvalue: datum[rangeIdentifier]\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel: 'Target',\n\t\t\t\t\t\t\tvalue: datum.marker\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel: 'Percentage',\n\t\t\t\t\t\t\tvalue: `${numberFormatter(Math.floor((datum[rangeIdentifier] / datum.marker) * 100), localeCode)}%`\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel: 'Performance',\n\t\t\t\t\t\t\tvalue: performanceAreaTitles[matchingRangeIndex]\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t})\n\t\t\t})\n\t\t\t.on('mousemove', function (event: MouseEvent, datum: any) {\n\t\t\t\t// Dispatch mouse event\n\t\t\t\tself.services.events.dispatchEvent(Events.Bar.BAR_MOUSEMOVE, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: select(this),\n\t\t\t\t\tdatum\n\t\t\t\t})\n\n\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.MOVE, {\n\t\t\t\t\tevent\n\t\t\t\t})\n\t\t\t})\n\t\t\t.on('click', function (event: MouseEvent, datum: any) {\n\t\t\t\t// Dispatch mouse event\n\t\t\t\tself.services.events.dispatchEvent(Events.Bar.BAR_CLICK, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: select(this),\n\t\t\t\t\tdatum\n\t\t\t\t})\n\t\t\t})\n\t\t\t.on('mouseout', function (event: MouseEvent, datum: any) {\n\t\t\t\tconst hoveredElement = select(this)\n\t\t\t\thoveredElement.classed('hovered', false)\n\n\t\t\t\t// Dispatch mouse event\n\t\t\t\tself.services.events.dispatchEvent(Events.Bar.BAR_MOUSEOUT, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: hoveredElement,\n\t\t\t\t\tdatum\n\t\t\t\t})\n\n\t\t\t\t// Hide tooltip\n\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.HIDE, {\n\t\t\t\t\thoveredElement\n\t\t\t\t})\n\t\t\t})\n\t}\n\n\tdestroy() {\n\t\t// Remove event listeners\n\t\tthis.parent\n\t\t\t.selectAll('path.bar')\n\t\t\t.on('mouseover', null)\n\t\t\t.on('mousemove', null)\n\t\t\t.on('mouseout', null)\n\n\t\t// Remove legend listeners\n\t\tconst eventsFragment = this.services.events\n\t\teventsFragment.removeEventListener(Events.Legend.ITEM_HOVER, this.handleLegendOnHover)\n\t\teventsFragment.removeEventListener(Events.Legend.ITEM_MOUSEOUT, this.handleLegendMouseOut)\n\t}\n}\n","export default function(x) {\n return x;\n}\n","import identity from \"./identity.js\";\n\nexport default function(transform) {\n if (transform == null) return identity;\n var x0,\n y0,\n kx = transform.scale[0],\n ky = transform.scale[1],\n dx = transform.translate[0],\n dy = transform.translate[1];\n return function(input, i) {\n if (!i) x0 = y0 = 0;\n var j = 2, n = input.length, output = new Array(n);\n output[0] = (x0 += input[0]) * kx + dx;\n output[1] = (y0 += input[1]) * ky + dy;\n while (j < n) output[j] = input[j], ++j;\n return output;\n };\n}\n","export default function(array, n) {\n var t, j = array.length, i = j - n;\n while (i < --j) t = array[i], array[i++] = array[j], array[j] = t;\n}\n","import reverse from \"./reverse.js\";\nimport transform from \"./transform.js\";\n\nexport default function(topology, o) {\n if (typeof o === \"string\") o = topology.objects[o];\n return o.type === \"GeometryCollection\"\n ? {type: \"FeatureCollection\", features: o.geometries.map(function(o) { return feature(topology, o); })}\n : feature(topology, o);\n}\n\nfunction feature(topology, o) {\n var id = o.id,\n bbox = o.bbox,\n properties = o.properties == null ? {} : o.properties,\n geometry = object(topology, o);\n return id == null && bbox == null ? {type: \"Feature\", properties: properties, geometry: geometry}\n : bbox == null ? {type: \"Feature\", id: id, properties: properties, geometry: geometry}\n : {type: \"Feature\", id: id, bbox: bbox, properties: properties, geometry: geometry};\n}\n\nexport function object(topology, o) {\n var transformPoint = transform(topology.transform),\n arcs = topology.arcs;\n\n function arc(i, points) {\n if (points.length) points.pop();\n for (var a = arcs[i < 0 ? ~i : i], k = 0, n = a.length; k < n; ++k) {\n points.push(transformPoint(a[k], k));\n }\n if (i < 0) reverse(points, n);\n }\n\n function point(p) {\n return transformPoint(p);\n }\n\n function line(arcs) {\n var points = [];\n for (var i = 0, n = arcs.length; i < n; ++i) arc(arcs[i], points);\n if (points.length < 2) points.push(points[0]); // This should never happen per the specification.\n return points;\n }\n\n function ring(arcs) {\n var points = line(arcs);\n while (points.length < 4) points.push(points[0]); // This may happen if an arc has only two points.\n return points;\n }\n\n function polygon(arcs) {\n return arcs.map(ring);\n }\n\n function geometry(o) {\n var type = o.type, coordinates;\n switch (type) {\n case \"GeometryCollection\": return {type: type, geometries: o.geometries.map(geometry)};\n case \"Point\": coordinates = point(o.coordinates); break;\n case \"MultiPoint\": coordinates = o.coordinates.map(point); break;\n case \"LineString\": coordinates = line(o.arcs); break;\n case \"MultiLineString\": coordinates = o.arcs.map(line); break;\n case \"Polygon\": coordinates = polygon(o.arcs); break;\n case \"MultiPolygon\": coordinates = o.arcs.map(polygon); break;\n default: return null;\n }\n return {type: type, coordinates: coordinates};\n }\n\n return geometry(o);\n}\n","export default function(topology, arcs) {\n var stitchedArcs = {},\n fragmentByStart = {},\n fragmentByEnd = {},\n fragments = [],\n emptyIndex = -1;\n\n // Stitch empty arcs first, since they may be subsumed by other arcs.\n arcs.forEach(function(i, j) {\n var arc = topology.arcs[i < 0 ? ~i : i], t;\n if (arc.length < 3 && !arc[1][0] && !arc[1][1]) {\n t = arcs[++emptyIndex], arcs[emptyIndex] = i, arcs[j] = t;\n }\n });\n\n arcs.forEach(function(i) {\n var e = ends(i),\n start = e[0],\n end = e[1],\n f, g;\n\n if (f = fragmentByEnd[start]) {\n delete fragmentByEnd[f.end];\n f.push(i);\n f.end = end;\n if (g = fragmentByStart[end]) {\n delete fragmentByStart[g.start];\n var fg = g === f ? f : f.concat(g);\n fragmentByStart[fg.start = f.start] = fragmentByEnd[fg.end = g.end] = fg;\n } else {\n fragmentByStart[f.start] = fragmentByEnd[f.end] = f;\n }\n } else if (f = fragmentByStart[end]) {\n delete fragmentByStart[f.start];\n f.unshift(i);\n f.start = start;\n if (g = fragmentByEnd[start]) {\n delete fragmentByEnd[g.end];\n var gf = g === f ? f : g.concat(f);\n fragmentByStart[gf.start = g.start] = fragmentByEnd[gf.end = f.end] = gf;\n } else {\n fragmentByStart[f.start] = fragmentByEnd[f.end] = f;\n }\n } else {\n f = [i];\n fragmentByStart[f.start = start] = fragmentByEnd[f.end = end] = f;\n }\n });\n\n function ends(i) {\n var arc = topology.arcs[i < 0 ? ~i : i], p0 = arc[0], p1;\n if (topology.transform) p1 = [0, 0], arc.forEach(function(dp) { p1[0] += dp[0], p1[1] += dp[1]; });\n else p1 = arc[arc.length - 1];\n return i < 0 ? [p1, p0] : [p0, p1];\n }\n\n function flush(fragmentByEnd, fragmentByStart) {\n for (var k in fragmentByEnd) {\n var f = fragmentByEnd[k];\n delete fragmentByStart[f.start];\n delete f.start;\n delete f.end;\n f.forEach(function(i) { stitchedArcs[i < 0 ? ~i : i] = 1; });\n fragments.push(f);\n }\n }\n\n flush(fragmentByEnd, fragmentByStart);\n flush(fragmentByStart, fragmentByEnd);\n arcs.forEach(function(i) { if (!stitchedArcs[i < 0 ? ~i : i]) fragments.push([i]); });\n\n return fragments;\n}\n","import {object} from \"./feature.js\";\nimport stitch from \"./stitch.js\";\n\nfunction planarRingArea(ring) {\n var i = -1, n = ring.length, a, b = ring[n - 1], area = 0;\n while (++i < n) a = b, b = ring[i], area += a[0] * b[1] - a[1] * b[0];\n return Math.abs(area); // Note: doubled area!\n}\n\nexport default function(topology) {\n return object(topology, mergeArcs.apply(this, arguments));\n}\n\nexport function mergeArcs(topology, objects) {\n var polygonsByArc = {},\n polygons = [],\n groups = [];\n\n objects.forEach(geometry);\n\n function geometry(o) {\n switch (o.type) {\n case \"GeometryCollection\": o.geometries.forEach(geometry); break;\n case \"Polygon\": extract(o.arcs); break;\n case \"MultiPolygon\": o.arcs.forEach(extract); break;\n }\n }\n\n function extract(polygon) {\n polygon.forEach(function(ring) {\n ring.forEach(function(arc) {\n (polygonsByArc[arc = arc < 0 ? ~arc : arc] || (polygonsByArc[arc] = [])).push(polygon);\n });\n });\n polygons.push(polygon);\n }\n\n function area(ring) {\n return planarRingArea(object(topology, {type: \"Polygon\", arcs: [ring]}).coordinates[0]);\n }\n\n polygons.forEach(function(polygon) {\n if (!polygon._) {\n var group = [],\n neighbors = [polygon];\n polygon._ = 1;\n groups.push(group);\n while (polygon = neighbors.pop()) {\n group.push(polygon);\n polygon.forEach(function(ring) {\n ring.forEach(function(arc) {\n polygonsByArc[arc < 0 ? ~arc : arc].forEach(function(polygon) {\n if (!polygon._) {\n polygon._ = 1;\n neighbors.push(polygon);\n }\n });\n });\n });\n }\n }\n });\n\n polygons.forEach(function(polygon) {\n delete polygon._;\n });\n\n return {\n type: \"MultiPolygon\",\n arcs: groups.map(function(polygons) {\n var arcs = [], n;\n\n // Extract the exterior (unique) arcs.\n polygons.forEach(function(polygon) {\n polygon.forEach(function(ring) {\n ring.forEach(function(arc) {\n if (polygonsByArc[arc < 0 ? ~arc : arc].length < 2) {\n arcs.push(arc);\n }\n });\n });\n });\n\n // Stitch the arcs into one or more rings.\n arcs = stitch(topology, arcs);\n\n // If more than one ring is returned,\n // at most one of these rings can be the exterior;\n // choose the one with the greatest absolute area.\n if ((n = arcs.length) > 1) {\n for (var i = 1, k = area(arcs[0]), ki, t; i < n; ++i) {\n if ((ki = area(arcs[i])) > k) {\n t = arcs[0], arcs[0] = arcs[i], arcs[i] = t, k = ki;\n }\n }\n }\n\n return arcs;\n }).filter(function(arcs) {\n return arcs.length > 0;\n })\n };\n}\n","import { select, type Selection } from 'd3'\nimport { get, isEqual } from 'lodash-es'\nimport { getProperty } from '@/tools'\nimport { Ruler } from './ruler'\nimport { DOMUtils } from '@/services/essentials/dom-utils'\nimport { CartesianOrientations, ColorClassNameTypes, Events, RenderTypes } from '@/interfaces/enums'\n\nexport class BinnedRuler extends Ruler {\n\ttype = 'ruler-binned'\n\trenderType = RenderTypes.SVG\n\n\tshowRuler(event: CustomEvent, [x, y]: [number, number]) {\n\t\tconst svg = this.parent\n\n\t\tconst options = this.model.getOptions()\n\t\tconst { cartesianScales } = this.services\n\n\t\tconst orientation: CartesianOrientations = cartesianScales.getOrientation()\n\n\t\tconst rangeScale = cartesianScales.getRangeScale()\n\t\tconst [yScaleEnd, yScaleStart] = rangeScale.range()\n\n\t\tconst domainScale = cartesianScales.getDomainScale()\n\n\t\tconst correspondingDomainValue = domainScale.invert(\n\t\t\torientation === CartesianOrientations.VERTICAL ? x : y\n\t\t)\n\n\t\tconst ruler = DOMUtils.appendOrSelect(svg, 'g.ruler').attr('aria-label', 'ruler')\n\t\tconst rulerLine = DOMUtils.appendOrSelect(ruler, 'line.ruler-line')\n\n\t\tconst dataPointElements = svg.selectAll('[role=graphics-symbol]') as Selection<\n\t\t\tSVGGraphicsElement,\n\t\t\tany,\n\t\t\tElement,\n\t\t\tany\n\t\t>\n\n\t\tconst elementsToHighlight = dataPointElements.filter((d: any) => {\n\t\t\tif (\n\t\t\t\tparseFloat(get(d, 'data.x0')) <= correspondingDomainValue &&\n\t\t\t\tparseFloat(get(d, 'data.x1')) >= correspondingDomainValue\n\t\t\t) {\n\t\t\t\treturn true\n\t\t\t}\n\t\t})\n\n\t\t// some data point match\n\t\tif (elementsToHighlight.size() > 0) {\n\t\t\t/** if we pass from a trigger area to another one\n\t\t\t * mouseout on previous elements won't get dispatched\n\t\t\t * so we need to do it manually\n\t\t\t */\n\t\t\tif (\n\t\t\t\tthis.elementsToHighlight &&\n\t\t\t\tthis.elementsToHighlight.size() > 0 &&\n\t\t\t\t!isEqual(this.elementsToHighlight, elementsToHighlight)\n\t\t\t) {\n\t\t\t\tthis.hideRuler()\n\t\t\t}\n\n\t\t\telementsToHighlight.dispatch('mouseover')\n\n\t\t\t// set current hovered elements\n\t\t\tthis.elementsToHighlight = elementsToHighlight\n\n\t\t\tconst sampleMatchData = select(elementsToHighlight.nodes()[0]).datum()\n\n\t\t\tconst x0 = parseFloat(get(sampleMatchData, 'data.x0'))\n\t\t\tconst x1 = parseFloat(get(sampleMatchData, 'data.x1'))\n\n\t\t\tconst activeDataGroupNames = this.model.getActiveDataGroupNames()\n\n\t\t\tconst tooltipDataGroups = activeDataGroupNames\n\t\t\t\t.reverse()\n\t\t\t\t.map((dataGroupName: string) => ({\n\t\t\t\t\tlabel: dataGroupName,\n\t\t\t\t\tvalue: get(sampleMatchData, `data.${dataGroupName}`),\n\t\t\t\t\tclass: this.model.getColorClassName({\n\t\t\t\t\t\tclassNameTypes: [ColorClassNameTypes.TOOLTIP],\n\t\t\t\t\t\tdataGroupName\n\t\t\t\t\t})\n\t\t\t\t}))\n\t\t\t\t.filter((d: any) => d.value !== 0)\n\t\t\tconst thereIsMatchingData = tooltipDataGroups.length > 0\n\n\t\t\tif (thereIsMatchingData) {\n\t\t\t\tthis.services.events.dispatchEvent(Events.Tooltip.SHOW, {\n\t\t\t\t\tevent,\n\t\t\t\t\tmousePosition: [x, y],\n\t\t\t\t\thoveredElement: rulerLine,\n\t\t\t\t\titems: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel: get(options, 'bins.rangeLabel') || 'Range',\n\t\t\t\t\t\t\tvalue: `${x0} – ${x1}`\n\t\t\t\t\t\t},\n\t\t\t\t\t\t...tooltipDataGroups,\n\t\t\t\t\t\t...(getProperty(options, 'tooltip', 'showTotal') === true\n\t\t\t\t\t\t\t? [\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tlabel:\n\t\t\t\t\t\t\t\t\t\t\tget(options, 'locale.translations.total') ||\n\t\t\t\t\t\t\t\t\t\t\tget(options, 'tooltip.totalLabel') ||\n\t\t\t\t\t\t\t\t\t\t\t'Total',\n\t\t\t\t\t\t\t\t\t\tvalue: activeDataGroupNames.reduce(\n\t\t\t\t\t\t\t\t\t\t\t(accum: number, currentValue: any) =>\n\t\t\t\t\t\t\t\t\t\t\t\taccum + parseFloat(get(sampleMatchData, `data.${currentValue}`)),\n\t\t\t\t\t\t\t\t\t\t\t0\n\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t: [])\n\t\t\t\t\t]\n\t\t\t\t})\n\n\t\t\t\truler.attr('opacity', 1)\n\n\t\t\t\tconst rulerPosition = domainScale((x0 + x1) / 2)\n\n\t\t\t\t// line snaps to matching point\n\t\t\t\tif (orientation === 'horizontal') {\n\t\t\t\t\trulerLine\n\t\t\t\t\t\t.attr('x1', yScaleStart)\n\t\t\t\t\t\t.attr('x2', yScaleEnd)\n\t\t\t\t\t\t.attr('y1', rulerPosition)\n\t\t\t\t\t\t.attr('y2', rulerPosition)\n\t\t\t\t} else {\n\t\t\t\t\trulerLine\n\t\t\t\t\t\t.attr('y1', yScaleStart)\n\t\t\t\t\t\t.attr('y2', yScaleEnd)\n\t\t\t\t\t\t.attr('x1', rulerPosition)\n\t\t\t\t\t\t.attr('x2', rulerPosition)\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tthis.hideRuler()\n\t\t\t}\n\t\t} else {\n\t\t\tthis.hideRuler()\n\t\t}\n\t}\n}\n","import { Ruler } from './ruler'\n\nexport class StackedRuler extends Ruler {\n\tformatTooltipData(tooltipData: any) {\n\t\treturn tooltipData.reverse()\n\t}\n}\n","import { path as d3Path } from 'd3'\nimport type { Coordinates } from '@/interfaces/layout'\n\n/**\n * Returns a path string for a straight path\n * @param {Coordinates} source - The source coordinates\n * @param {Coordinates} target - The target coordinates\n * @return {string} The path string\n */\nconst buildStraightPathString = (source: Coordinates, target: Coordinates) => {\n\tconst sx = source.x as number\n\tconst sy = source.y as number\n\tconst tx = target.x as number\n\tconst ty = target.y as number\n\n\tconst path = d3Path()\n\n\tpath.moveTo(sx, sy)\n\tpath.lineTo(tx, ty)\n\n\treturn path.toString()\n}\n\n/**\n * Returns a path string for an elbow path with a bend point\n * @param {Coordinates} source - The source coordinates\n * @param {Coordinates} target - The target coordinates\n * @param {number} percent - Where the bend point should appear between the source and target\n * @return {string} The path string\n */\nconst buildElbowPathString = (source: Coordinates, target: Coordinates, percent = 0.5) => {\n\tconst sx = source.x\n\tconst sy = source.y\n\tconst tx = target.x\n\tconst ty = target.y\n\n\tconst path = d3Path()\n\n\tpath.moveTo(sx, sy)\n\tpath.lineTo(sx + (tx - sx) * percent, sy)\n\tpath.lineTo(sx + (tx - sx) * percent, ty)\n\tpath.lineTo(tx, ty)\n\n\treturn path.toString()\n}\n\n/**\n * Returns a path string for a path with a custom bezier curve.\n * @param {Coordinates} source - The source coordinates.\n * @param {Coordinates} target - The target coordinates.\n * @param {number} cpx1 - X coordinate for the first control point.\n * @param {number} cpy1 - Y coordinate for the first control point.\n * @param {number} cpx2 - X coordinate for the second control point.\n * @param {number} cpy2 - Y coordinate for the second control point.\n * @returns {string} The path string.\n */\nconst buildBezierPathString = (\n\tsource: Coordinates,\n\ttarget: Coordinates,\n\tcpx1: number,\n\tcpy1: number,\n\tcpx2: number,\n\tcpy2: number\n) => {\n\tconst sx = source.x\n\tconst sy = source.y\n\tconst tx = target.x\n\tconst ty = target.y\n\n\tconst path = d3Path()\n\n\tpath.moveTo(sx, sy)\n\tpath.bezierCurveTo(cpx1, cpy1, cpx2, cpy2, tx, ty)\n\n\treturn path.toString()\n}\n\nexport { buildStraightPathString, buildElbowPathString, buildBezierPathString }\n","const arrowLeft = {\n\td: 'M7 0v8L0 4z',\n\theight: 8,\n\twidth: 7.5,\n\tid: 'arrowLeft'\n}\n\nconst arrowRight = {\n\td: 'M0 0v8l7-4z',\n\theight: 8,\n\twidth: 7.5,\n\tid: 'arrowRight'\n}\n\nconst circle = {\n\td: 'M5.32 9.513a4.75 4.75 0 100-9.5 4.75 4.75 0 000 9.5z',\n\theight: 10,\n\twidth: 10,\n\tid: 'circle'\n}\n\nconst diamond = {\n\td: 'M5.03517654-1e-7l4.99999996 5-4.99999996 5-5-5L2.4517844 2.58339204z',\n\theight: 10,\n\twidth: 10,\n\tid: 'diamond'\n}\n\nconst square = {\n\td: 'M0 .44974747h8v8H0v-3.6830331z',\n\theight: 9,\n\twidth: 8,\n\tid: 'square'\n}\n\nconst tee = {\n\td: 'M0 0h1.5v8H0z',\n\theight: 8,\n\twidth: 2,\n\tid: 'tee'\n}\n\nexport { arrowLeft, arrowRight, square, diamond, circle, tee }\n","import { axisBottom, interpolateNumber, quantize, scaleBand, scaleLinear } from 'd3'\nimport { isEmpty } from 'lodash-es'\nimport { getProperty } from '@/tools'\nimport { legend as legendConfigs } from '@/configuration'\nimport { ColorLegendType, Events, RenderTypes } from '@/interfaces/enums'\nimport { Legend } from './legend'\nimport { DOMUtils } from '@/services/essentials/dom-utils'\nimport { getDomain } from '@/services/color-scale-utils'\nimport type { ChartModel } from '@/model'\n\nexport class ColorScaleLegend extends Legend {\n\ttype = 'color-legend'\n\trenderType = RenderTypes.SVG\n\n\tprivate gradient_id = `gradient-id-${Math.floor(Math.random() * 99999999999)}`\n\tprivate chartType: string\n\n\tconstructor(model: ChartModel, services: any, configs?: any) {\n\t\tsuper(model, services, configs)\n\t\tthis.chartType = configs.chartType\n\t}\n\n\tinit() {\n\t\t// Highlight correct circle on legend item hovers\n\t\tif (this.chartType === 'heatmap') {\n\t\t\tconst eventsFragment = this.services.events\n\t\t\teventsFragment.addEventListener(Events.Axis.RENDER_COMPLETE, this.handleAxisCompleteEvent)\n\t\t}\n\t}\n\n\t// Position legend after axis have rendered\n\thandleAxisCompleteEvent = () => {\n\t\tconst svg = this.getComponentContainer()\n\n\t\tconst { width } = DOMUtils.getSVGElementSize(svg, {\n\t\t\tuseAttrs: true\n\t\t})\n\n\t\tconst isDataLoading = getProperty(this.getOptions(), 'data', 'loading')\n\n\t\tif (width > legendConfigs.color.barWidth && !isDataLoading) {\n\t\t\tconst title = getProperty(this.getOptions(), 'heatmap', 'colorLegend', 'title')\n\n\t\t\tconst { cartesianScales } = this.services\n\n\t\t\t// Get axis width & start/end positions\n\t\t\tconst mainXScale = cartesianScales.getMainXScale()\n\t\t\tconst xDimensions = mainXScale.range()\n\n\t\t\t// Align legend with the axis\n\t\t\tif (xDimensions[0] > 1) {\n\t\t\t\tsvg.select('g.legend').attr('transform', `translate(${xDimensions[0]}, 0)`)\n\n\t\t\t\tif (title) {\n\t\t\t\t\tconst { width: textWidth } = DOMUtils.getSVGElementSize(\n\t\t\t\t\t\tsvg.select('g.legend-title').select('text'),\n\t\t\t\t\t\t{ useBBox: true }\n\t\t\t\t\t)\n\n\t\t\t\t\t// D3 moves the LEFT y-axis labels by 9\n\t\t\t\t\tconst availableSpace = xDimensions[0] - textWidth - 9\n\n\t\t\t\t\t// If space is available, align the label with the axis labels\n\t\t\t\t\tif (availableSpace > 1) {\n\t\t\t\t\t\tsvg.select('g.legend-title').attr('transform', `translate(${availableSpace}, 0)`)\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Move the legend down by 16 pixels to display legend text on top\n\t\t\t\t\t\tsvg.select('g.legend').attr('transform', `translate(${xDimensions[0]}, 16)`)\n\n\t\t\t\t\t\t// Align legend title with start of axis\n\t\t\t\t\t\tsvg.select('g.legend-title').attr('transform', `translate(${xDimensions[0]}, 0)`)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t// Default state\n\t\t\tsvg.select('g.legend-title').attr('transform', `translate(0, 0)`)\n\t\t}\n\t}\n\n\t// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n\t// @ts-ignore\n\t// eslint-disable-next-line @typescript-eslint/no-unused-vars\n\trender(animate = false) {\n\t\tconst options = this.getOptions()\n\t\tconst svg = this.getComponentContainer({\n\t\t\tariaLabel: 'legend'\n\t\t})\n\t\tconst { width } = DOMUtils.getSVGElementSize(svg, {\n\t\t\tuseAttrs: true\n\t\t})\n\n\t\tconst customColors = getProperty(options, 'color', 'gradient', 'colors')\n\n\t\tconst colorScaleType = getProperty(options, this.chartType, 'colorLegend', 'type')\n\n\t\tlet colorPairingOption = getProperty(options, 'color', 'pairing', 'option')\n\n\t\tconst title = getProperty(options, 'heatmap', 'colorLegend', 'title')\n\n\t\t// Clear DOM if loading\n\t\tconst isDataLoading = getProperty(this.getOptions(), 'data', 'loading')\n\n\t\tif (isDataLoading) {\n\t\t\tsvg.html('')\n\t\t\treturn\n\t\t}\n\n\t\tconst customColorsEnabled = !isEmpty(customColors)\n\t\tconst domain = getDomain(this.model.getDisplayData())\n\n\t\tconst useDefaultBarWidth = !(width <= legendConfigs.color.barWidth)\n\t\tconst barWidth = useDefaultBarWidth ? legendConfigs.color.barWidth : width\n\n\t\tconst legendGroupElement = DOMUtils.appendOrSelect(svg, 'g.legend')\n\t\tconst axisElement = DOMUtils.appendOrSelect(legendGroupElement, 'g.legend-axis')\n\n\t\t// Render title if it exists\n\t\tif (title) {\n\t\t\tconst legendTitleGroup = DOMUtils.appendOrSelect(svg, 'g.legend-title')\n\t\t\tconst legendTitle = DOMUtils.appendOrSelect(legendTitleGroup, 'text')\n\t\t\tlegendTitle.text(title).attr('dy', '0.7em')\n\n\t\t\t// Move the legend down by 16 pixels to display legend text on top\n\t\t\tlegendGroupElement.attr('transform', `translate(0, 16)`)\n\t\t}\n\n\t\t// If domain consists of negative and positive values, use diverging palettes\n\t\tconst colorScheme = domain[0] < 0 && domain[1] > 0 ? 'diverge' : 'mono'\n\n\t\t// Use default color pairing options if not in defined range\n\t\tif (colorPairingOption < 1 && colorPairingOption > 4 && colorScheme === 'mono') {\n\t\t\tcolorPairingOption = 1\n\t\t} else if (colorPairingOption < 1 && colorPairingOption > 2 && colorScheme === 'diverge') {\n\t\t\tcolorPairingOption = 1\n\t\t}\n\n\t\tlet colorPairing = []\n\t\t// Carbon charts has 11 colors for a single monochromatic palette & 17 for a divergent palette\n\t\tconst colorGroupingLength = colorScheme === 'diverge' ? 17 : 11\n\n\t\tif (!customColorsEnabled) {\n\t\t\t// Add class names to list and the amount based on the color scheme\n\t\t\tfor (let i = 1; i < colorGroupingLength + 1; i++) {\n\t\t\t\tcolorPairing.push(\n\t\t\t\t\tcolorScaleType === ColorLegendType.LINEAR\n\t\t\t\t\t\t? `stop-color-${colorScheme}-${colorPairingOption}-${i}`\n\t\t\t\t\t\t: `fill-${colorScheme}-${colorPairingOption}-${i}`\n\t\t\t\t)\n\t\t\t}\n\t\t} else {\n\t\t\t// Use custom colors\n\t\t\tcolorPairing = customColors\n\t\t}\n\n\t\t// Generate equal chunks between range to act as ticks\n\t\tconst interpolator = interpolateNumber(domain[0], domain[1])\n\t\tconst quant = quantize(interpolator, 3)\n\n\t\t// Create scale & ticks\n\t\tconst linearScale = scaleLinear().domain(domain).range([0, barWidth])\n\t\tconst legendAxis = axisBottom(linearScale).tickSize(0).tickValues(quant)\n\n\t\t//translating ticks into given locale language\n\t\tconst { code: localeCode, number: numberFormatter } = getProperty(options, 'locale')\n\t\tlegendAxis.tickFormat(d => numberFormatter(d, localeCode))\n\n\t\tlet rangeStart: any // avoid unexpected lexical declaration in case block\n\t\tswitch (colorScaleType) {\n\t\t\tcase ColorLegendType.LINEAR:\n\t\t\t\tthis.drawLinear(colorPairing, legendGroupElement, barWidth)\n\t\t\t\tbreak\n\t\t\tcase ColorLegendType.QUANTIZE:\n\t\t\t\trangeStart = this.drawQuantize(\n\t\t\t\t\tcolorPairing,\n\t\t\t\t\tcolorScheme,\n\t\t\t\t\tcustomColorsEnabled,\n\t\t\t\t\tlegendGroupElement,\n\t\t\t\t\tbarWidth\n\t\t\t\t)\n\t\t\t\t// Using range provided by drawQuantize for alignment purposes\n\t\t\t\tlinearScale.range([rangeStart, barWidth])\n\t\t\t\tbreak\n\t\t\tdefault:\n\t\t\t\tthrow Error('Entered color legend type is not supported.')\n\t\t}\n\n\t\t// Align axes at the bottom of the rectangle and delete the domain line\n\t\taxisElement\n\t\t\t.attr('transform', `translate(0,${legendConfigs.color.axisYTranslation})`)\n\t\t\t.call(legendAxis)\n\n\t\t// Remove auto generated axis bottom line\n\t\taxisElement.select('.domain').remove()\n\n\t\t// Translate first/last axis tick if barWidth equals chart width\n\t\t// Ensures text is not clipped when default bar width (300px) is not used\n\t\taxisElement\n\t\t\t.select('g.tick:last-of-type text')\n\t\t\t.style('text-anchor', useDefaultBarWidth ? 'middle' : 'end')\n\t\taxisElement\n\t\t\t.select('g.tick:first-of-type text')\n\t\t\t.style(\n\t\t\t\t'text-anchor',\n\t\t\t\tuseDefaultBarWidth && this.chartType !== 'choropleth' ? 'middle' : 'start'\n\t\t\t)\n\t}\n\n\t// Renders gradient legend\n\tdrawLinear(colorPairing: any, legendGroupElement: any, barWidth: any) {\n\t\tconst stopLengthPercentage = 100 / (colorPairing.length - 1)\n\n\t\t// Generate the gradient\n\t\tconst linearGradient = DOMUtils.appendOrSelect(legendGroupElement, 'linearGradient')\n\t\t// Rendering gradient\n\t\tlinearGradient\n\t\t\t.attr('id', `${this.gradient_id}-legend`)\n\t\t\t.selectAll('stop')\n\t\t\t.data(colorPairing)\n\t\t\t.enter()\n\t\t\t.append('stop')\n\t\t\t.attr('offset', (_: any, i: number) => `${i * stopLengthPercentage}%`)\n\t\t\t.attr('class', (_: any, i: number) => colorPairing[i])\n\t\t\t.attr('stop-color', (d: string) => d)\n\n\t\t// Create the legend container\n\t\tconst rectangle = DOMUtils.appendOrSelect(legendGroupElement, 'rect')\n\t\trectangle\n\t\t\t.attr('width', barWidth)\n\t\t\t.attr('height', legendConfigs.color.barHeight)\n\t\t\t.style('fill', `url(#${this.gradient_id}-legend)`)\n\t}\n\n\t/**\n\t * Renders quantized legend\n\t * @returns number (range start)\n\t */\n\tdrawQuantize(\n\t\tcolorPairing: any,\n\t\tcolorScheme: any,\n\t\tcustomColorsEnabled: any,\n\t\tlegendGroupElement: any,\n\t\tbarWidth: any\n\t) {\n\t\t// If divergent && non-custom color, remove 0/white from being displayed\n\t\tif (!customColorsEnabled && colorScheme === 'diverge') {\n\t\t\tcolorPairing.splice(colorPairing.length / 2, 1)\n\t\t}\n\n\t\tconst colorScaleBand = scaleBand().domain(colorPairing).range([0, barWidth])\n\n\t\t// Render the quantized rectangles\n\t\tconst rectangle = DOMUtils.appendOrSelect(legendGroupElement, 'g.quantized-rect')\n\n\t\trectangle\n\t\t\t.selectAll('rect')\n\t\t\t.data(colorScaleBand.domain())\n\t\t\t.join('rect')\n\t\t\t.attr('x', (d: string) => colorScaleBand(d))\n\t\t\t.attr('y', 0)\n\t\t\t.attr('width', Math.max(0, colorScaleBand.bandwidth() - 1))\n\t\t\t.attr('height', legendConfigs.color.barHeight)\n\t\t\t.attr('class', (d: string) => d)\n\t\t\t.attr('fill', (d: string) => d)\n\n\t\treturn (!customColorsEnabled && colorScheme) === 'mono' ? colorScaleBand.bandwidth() - 1 : 0\n\t}\n\n\tdestroy() {\n\t\tif (this.chartType === 'heatmap') {\n\t\t\t// Remove legend listeners\n\t\t\tconst eventsFragment = this.services.events\n\t\t\teventsFragment.removeEventListener(Events.Axis.RENDER_COMPLETE, this.handleAxisCompleteEvent)\n\t\t}\n\t}\n}\n","import type { Selection as D3Selection } from 'd3'\nimport { getProperty } from '@/tools'\nimport { meter as meterConfigs } from '@/configuration'\nimport { Title } from './title'\nimport { DOMUtils } from '@/services/essentials/dom-utils'\nimport { RenderTypes, Statuses } from '@/interfaces/enums'\nimport { MeterChartModel } from '@/model/meter'\n\nexport class MeterTitle extends Title {\n\ttype = 'meter-title'\n\trenderType = RenderTypes.SVG\n\n\t// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n\t// @ts-ignore\n\t// eslint-disable-next-line @typescript-eslint/no-unused-vars\n\trender(animate = false) {\n\t\tconst dataset = getProperty(this.model.getDisplayData(), 0)\n\t\tconst options = this.getOptions()\n\t\tconst svg = this.getComponentContainer({\n\t\t\tariaLabel: 'meter title'\n\t\t})\n\t\tconst { groupMapsTo } = options.data\n\t\tconst meterTitle = options.locale.translations.meter.title\n\t\tconst proportional = getProperty(options, 'meter', 'proportional')\n\n\t\tif (proportional) {\n\t\t\tthis.displayTotal()\n\t\t\tthis.displayBreakdownTitle()\n\t\t} else {\n\t\t\t// the title for a meter, is the label for that dataset\n\t\t\tconst title = svg\n\t\t\t\t.selectAll('text.meter-title')\n\t\t\t\t.data(meterTitle ? [meterTitle] : [dataset[groupMapsTo]])\n\t\t\ttitle\n\t\t\t\t.enter()\n\t\t\t\t.append('text')\n\t\t\t\t.classed('meter-title', true)\n\t\t\t\t.merge(title as any)\n\t\t\t\t.attr('x', 0)\n\t\t\t\t.attr('y', '1em')\n\t\t\t\t.text((d: any) => d)\n\n\t\t\ttitle.exit().remove()\n\n\t\t\t// appends the associated percentage after title\n\t\t\tthis.appendPercentage()\n\t\t}\n\n\t\t// if status ranges are provided (custom or default), display indicator\n\t\tthis.displayStatus()\n\n\t\t// get the max width of a title (with consideration for the status/percentage)\n\t\tconst maxWidth = this.getMaxTitleWidth()\n\t\tconst titleElement = DOMUtils.appendOrSelect(svg, 'text.meter-title')\n\n\t\tif (maxWidth > 0 && titleElement.node().getComputedTextLength() > maxWidth) {\n\t\t\tthis.truncateTitle(titleElement, maxWidth)\n\t\t}\n\t}\n\n\tdisplayBreakdownTitle() {\n\t\tconst svg = this.getComponentContainer()\n\t\tconst options = this.getOptions()\n\t\tconst datasetsTotal = (this.model as MeterChartModel).getMaximumDomain(\n\t\t\tthis.model.getDisplayData()\n\t\t)\n\t\tconst total = getProperty(options, 'meter', 'proportional', 'total')\n\t\tconst unit = getProperty(options, 'meter', 'proportional', 'unit')\n\t\t\t? getProperty(options, 'meter', 'proportional', 'unit')\n\t\t\t: ''\n\n\t\tlet data\n\t\tif (datasetsTotal === total) {\n\t\t\tdata = null\n\t\t} else {\n\t\t\tconst difference = total !== null ? total - datasetsTotal : datasetsTotal\n\t\t\tconst breakdownFormatter = getProperty(options, 'meter', 'proportional', 'breakdownFormatter')\n\t\t\tconst { code: localeCode, number: numberFormatter } = getProperty(options, 'locale')\n\t\t\tdata =\n\t\t\t\tbreakdownFormatter !== null\n\t\t\t\t\t? breakdownFormatter({\n\t\t\t\t\t\t\tdatasetsTotal: datasetsTotal,\n\t\t\t\t\t\t\ttotal: total\n\t\t\t\t\t\t})\n\t\t\t\t\t: `${numberFormatter(datasetsTotal, localeCode)} ${unit} used (${numberFormatter(difference, localeCode)} ${unit} available)`\n\t\t}\n\n\t\t// the breakdown part to whole of the datasets to the overall total\n\t\tconst title = svg.selectAll('text.proportional-meter-title').data([data])\n\n\t\ttitle\n\t\t\t.enter()\n\t\t\t.append('text')\n\t\t\t.classed('proportional-meter-title', true)\n\t\t\t.merge(title as any)\n\t\t\t.attr('x', 0)\n\t\t\t.attr('y', '1em')\n\t\t\t.text((d: any) => d)\n\n\t\ttitle.exit().remove()\n\n\t\tconst maxWidth = this.getMaxTitleWidth()\n\t\tconst titleElement = DOMUtils.appendOrSelect(svg, 'text.proportional-meter-title')\n\n\t\tif (maxWidth > 0 && titleElement.node().getComputedTextLength() > maxWidth) {\n\t\t\tthis.truncateTitle(titleElement, maxWidth)\n\t\t}\n\t}\n\n\t// show the total for prop meter\n\tdisplayTotal() {\n\t\tconst svg = this.getComponentContainer()\n\t\tconst options = this.getOptions()\n\n\t\tconst total = getProperty(options, 'meter', 'proportional', 'total')\n\n\t\tconst totalValue = total\n\t\t\t? getProperty(options, 'meter', 'proportional', 'total')\n\t\t\t: (this.model as MeterChartModel).getMaximumDomain(this.model.getDisplayData())\n\n\t\tconst unit = getProperty(options, 'meter', 'proportional', 'unit')\n\t\t\t? getProperty(options, 'meter', 'proportional', 'unit')\n\t\t\t: ''\n\n\t\tconst totalFormatter = getProperty(options, 'meter', 'proportional', 'totalFormatter')\n\t\tconst { code: localeCode, number: numberFormatter } = getProperty(options, 'locale')\n\n\t\tconst totalString =\n\t\t\ttotalFormatter !== null\n\t\t\t\t? totalFormatter(totalValue)\n\t\t\t\t: `${numberFormatter(total, localeCode)} ${unit} total`\n\n\t\tconst containerWidth = DOMUtils.getHTMLElementSize(this.parent.node() as HTMLElement).width\n\n\t\tconst title = svg.selectAll('text.proportional-meter-total').data([totalString])\n\n\t\ttitle\n\t\t\t.enter()\n\t\t\t.append('text')\n\t\t\t.classed('proportional-meter-total', true)\n\t\t\t.merge(title as any)\n\t\t\t// Position the total text -24 pixels to add spacing between text and status icon (if status exists)\n\t\t\t.attr(\n\t\t\t\t'x',\n\t\t\t\tthis.model.getStatus() && typeof containerWidth !== 'string'\n\t\t\t\t\t? containerWidth - meterConfigs.total.paddingRight\n\t\t\t\t\t: containerWidth\n\t\t\t)\n\t\t\t.attr('y', '1em')\n\t\t\t.attr('text-anchor', 'end')\n\t\t\t.text((d: any) => d)\n\n\t\ttitle.exit().remove()\n\t}\n\n\t/**\n\t * Appends the corresponding status based on the value and the peak.\n\t */\n\tdisplayStatus() {\n\t\tconst self = this\n\t\tconst svg = this.getComponentContainer()\n\n\t\tconst containerWidth = DOMUtils.getHTMLElementSize(this.parent.node() as HTMLElement).width || 0\n\n\t\t// get the status from the model\n\t\tconst status = this.model.getStatus()\n\t\tconst radius = meterConfigs.status.indicatorSize / 2\n\n\t\t// create a group for the icon/inner path\n\t\tconst statusGroup = DOMUtils.appendOrSelect(svg, `g.status-indicator`)\n\t\t\t.attr('class', status !== null ? `status-indicator status--${status}` : '')\n\t\t\t.attr('transform', `translate(${containerWidth - radius}, 0)`)\n\n\t\tconst data = status ? [status] : []\n\t\tconst icon = statusGroup.selectAll('circle.status').data(data) as D3Selection<\n\t\t\tSVGCircleElement,\n\t\t\tany,\n\t\t\tElement,\n\t\t\tany\n\t\t>\n\n\t\ticon\n\t\t\t.enter()\n\t\t\t.append('circle')\n\t\t\t.merge(icon)\n\t\t\t.attr('class', 'status')\n\t\t\t.attr('r', radius)\n\t\t\t.attr('cx', 0)\n\t\t\t.attr('cy', 8) // replaced `calc(1em / 2)` which is not an acceptable value for an SVG element's cy value\n\n\t\tconst innerIcon = statusGroup.selectAll('path.innerFill').data(data)\n\n\t\tinnerIcon\n\t\t\t.enter()\n\t\t\t.append('path')\n\t\t\t.merge(innerIcon as any)\n\t\t\t.attr('d', self.getStatusIconPathString(status))\n\t\t\t.attr('transform', `translate(-${radius}, 0)`)\n\t\t\t.attr('class', 'innerFill')\n\n\t\tinnerIcon.exit().remove()\n\t\ticon.exit().remove()\n\t}\n\n\t/**\n\t * Appends the associated percentage to the end of the title\n\t */\n\tappendPercentage() {\n\t\tconst dataValue = getProperty(this.model.getDisplayData(), 0, 'value')\n\t\tconst { code: localeCode, number: numberFormatter } = getProperty(this.getOptions(), 'locale')\n\t\t// use the title's position to append the percentage to the end\n\t\tconst svg = this.getComponentContainer()\n\t\tconst title = DOMUtils.appendOrSelect(svg, 'text.meter-title')\n\n\t\t// check if it is enabled\n\t\tconst data =\n\t\t\tgetProperty(this.getOptions(), 'meter', 'statusBar', 'percentageIndicator', 'enabled') ===\n\t\t\ttrue\n\t\t\t\t? [dataValue]\n\t\t\t\t: []\n\n\t\t// append a percentage if it is enabled, update it\n\t\tconst percentage = svg.selectAll('text.percent-value').data(data)\n\n\t\t// the horizontal offset of the percentage value from the title\n\t\tconst offset = meterConfigs.statusBar.paddingRight\n\n\t\tpercentage\n\t\t\t.enter()\n\t\t\t.append('text')\n\t\t\t.classed('percent-value', true)\n\t\t\t.merge(percentage as any)\n\t\t\t.text((d: any) => `${d !== null && d !== undefined ? numberFormatter(d, localeCode) : 0}%`)\n\t\t\t.attr('x', +title.attr('x') + title.node().getComputedTextLength() + offset) // set the position to after the title\n\t\t\t.attr('y', title.attr('y'))\n\n\t\tpercentage.exit().remove()\n\t}\n\n\t/**\n\t * Uses the parent class truncate logic\n\t * @param title d3 selection of title element that will be truncated\n\t * @param maxWidth the max width the title can take\n\t */\n\ttruncateTitle(title: any, maxWidth: number) {\n\t\tsuper.truncateTitle(title, maxWidth)\n\n\t\t// update the position on the percentage to be inline with the title\n\t\tconst tspan = DOMUtils.appendOrSelect(this.parent, 'tspan')\n\t\tconst offset = meterConfigs.statusBar.paddingRight\n\t\tconst tspanLength = Math.ceil(tspan.node().getComputedTextLength())\n\n\t\tconst percentage = DOMUtils.appendOrSelect(this.parent, 'text.percent-value')\n\t\tpercentage.attr(\n\t\t\t'x',\n\t\t\t+title.attr('x') + title.node().getComputedTextLength() + tspanLength + offset\n\t\t)\n\t}\n\n\t// computes the maximum space a title can take\n\tprotected getMaxTitleWidth() {\n\t\tconst proportional = getProperty(this.getOptions(), 'meter', 'proportional')\n\n\t\tconst containerWidth = DOMUtils.getHTMLElementSize(this.parent.node() as HTMLElement).width\n\n\t\tif (proportional !== null) {\n\t\t\tconst total = DOMUtils.appendOrSelect(this.parent, 'text.proportional-meter-total').node()\n\n\t\t\tconst totalWidth = DOMUtils.getSVGElementSize(total, {\n\t\t\t\tuseBBox: true\n\t\t\t}).width\n\n\t\t\treturn containerWidth - totalWidth - meterConfigs.total.paddingLeft\n\t\t} else {\n\t\t\tconst percentage = DOMUtils.appendOrSelect(this.parent, 'text.percent-value')\n\t\t\t// the title needs to fit the width of the container without crowding the status, and percentage value\n\t\t\tconst offset = meterConfigs.statusBar.paddingRight\n\t\t\tconst percentageWidth = percentage.node().getComputedTextLength()\n\n\t\t\tconst statusGroup = DOMUtils.appendOrSelect(this.parent, 'g.status-indicator').node()\n\t\t\tconst statusWidth =\n\t\t\t\tDOMUtils.getSVGElementSize(statusGroup, { useBBox: true }).width +\n\t\t\t\tmeterConfigs.status.paddingLeft\n\n\t\t\treturn containerWidth - percentageWidth - offset - statusWidth\n\t\t}\n\t}\n\n\t/**\n\t * Get the associated status icon for the data\n\t * @param status the active status for the meter chart\n\t */\n\tprotected getStatusIconPathString(status: Statuses) {\n\t\tswitch (status) {\n\t\t\tcase Statuses.SUCCESS:\n\t\t\t\treturn 'M6.875 11.3125 3.75 8.1875 4.74375 7.25 6.875 9.34375 11.50625 4.75 12.5 5.7375 Z'\n\t\t\tcase Statuses.DANGER:\n\t\t\t\treturn 'M10.7 11.5 4.5 5.3 5.3 4.5 11.5 10.7 Z'\n\t\t\tcase Statuses.WARNING:\n\t\t\t\treturn 'M7.9375,11.125 C7.41973305,11.125 7,11.544733 7,12.0625 C7,12.580267 7.41973305,13 7.9375,13 C8.45526695,13 8.875,12.580267 8.875,12.0625 C8.875,11.544733 8.45526695,11.125 7.9375,11.125 M7.3125, 3 8.5625, 3 8.5625, 9.875 7.3125, 9.875, 7.3125, 3 Z'\n\t\t}\n\t}\n}\n","// Internal Imports\nimport { Component } from '@/components/component'\nimport { DOMUtils } from '@/services/essentials/dom-utils'\nimport { getProperty } from '@/tools'\n\nexport class Bar extends Component {\n\t// Gets the correct width for bars based on options & configurations\n\tprotected getBarWidth() {\n\t\tconst options = this.getOptions()\n\t\tif (options.bars.width) {\n\t\t\treturn options.bars.width\n\t\t}\n\n\t\tconst numberOfDatapoints = this.model.getDisplayData().length\n\t\tconst mainXScale = this.services.cartesianScales.getMainXScale()\n\t\tconst chartWidth = DOMUtils.getSVGElementSize((this as any).parent, {\n\t\t\tuseAttrs: true\n\t\t}).width\n\n\t\tif (!(mainXScale as any).step) {\n\t\t\tconst spacingFactor = getProperty(options, 'bars', 'spacingFactor')\n\n\t\t\treturn Math.min(options.bars.maxWidth, (chartWidth * spacingFactor) / numberOfDatapoints)\n\t\t}\n\n\t\treturn Math.min(options.bars.maxWidth, (mainXScale as any).step() / 2)\n\t}\n\n\tprotected isOutsideZoomedDomain(x0: number, x1: number) {\n\t\tconst dataCount = this.model.getDisplayData().length\n\t\t// if only one data point, never out of zoom domain\n\t\t// or it becomes a blank chart\n\t\tif (dataCount <= 1) {\n\t\t\treturn false\n\t\t}\n\n\t\tconst zoomDomain = this.model.get('zoomDomain')\n\t\tif (zoomDomain !== undefined) {\n\t\t\tconst domainScale = this.services.cartesianScales.getDomainScale()\n\t\t\treturn x0 < domainScale(zoomDomain[0]) || x1 > domainScale(zoomDomain[1])\n\t\t}\n\t\treturn false\n\t}\n}\n","import { hierarchy as d3Hierarchy, pack as D3Pack, select } from 'd3'\nimport { get } from 'lodash-es'\nimport { getProperty } from '@/tools'\nimport { canvasZoomSettings, circlePack as circlePackConfigs } from '@/configuration'\nimport { Component } from '@/components/component'\nimport { DOMUtils } from '@/services/essentials/dom-utils'\nimport { ColorClassNameTypes, Events, RenderTypes } from '@/interfaces/enums'\nimport { CirclePackChartModel } from '@/model/circle-pack'\n\nexport class CirclePack extends Component {\n\ttype = 'circle-pack'\n\trenderType = RenderTypes.SVG\n\n\tfocal: any\n\n\t// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n\t// @ts-ignore\n\t// eslint-disable-next-line @typescript-eslint/no-unused-vars\n\trender(animate = true) {\n\t\t// svg and container widths\n\t\tconst svg = this.getComponentContainer({\n\t\t\tariaLabel: 'circle packs',\n\t\t\twithinChartClip: true\n\t\t})\n\t\tconst { width, height } = DOMUtils.getSVGElementSize(this.parent as any, {\n\t\t\tuseAttrs: true\n\t\t})\n\n\t\t// Because of a Firefox bug with regards to sizing & d3 packs,\n\t\t// rather than checking if height or width aren't 0,\n\t\t// we have to make sure they're not smaller than 1\n\t\tif (width < 1 || height < 1) {\n\t\t\t// on first render the svg is width and height 0\n\t\t\t// the circle packing layout functionality will not run\n\t\t\treturn\n\t\t}\n\n\t\t// data and options (zoom/not zoom)\n\t\tlet displayData = this.model.getDisplayData()\n\t\t// check if there is just one parent for the data\n\t\tconst parentNode = (this.model as CirclePackChartModel).hasParentNode()\n\t\tconst hierarchyLevel = (this.model as CirclePackChartModel).getHierarchyLevel()\n\t\tconst options = this.getOptions()\n\t\tconst canvasZoomEnabled = getProperty(options, 'canvasZoom', 'enabled')\n\n\t\t// check if there is one root for the data\n\t\t// that root will be the only datagroup (colorscale will be monochrome)\n\t\tif (parentNode && getProperty(displayData, 0, 'children')) {\n\t\t\t// remove want to remove the parent from being rendered\n\t\t\tdisplayData = getProperty(displayData, 0, 'children')\n\t\t}\n\n\t\tconst root = d3Hierarchy({ children: displayData })\n\t\t\t.sum((d: any) => d.value)\n\t\t\t.sort((a, b) => b.value - a.value)\n\n\t\tconst packLayout = D3Pack()\n\t\t\t.size([width, height])\n\t\t\t.padding((d: any) => {\n\t\t\t\t// add 3 px to account for the stroke width 1.5px\n\t\t\t\treturn d.depth >= 1\n\t\t\t\t\t? circlePackConfigs.padding.children + 3\n\t\t\t\t\t: circlePackConfigs.padding.mainGroup + 3\n\t\t\t})\n\n\t\tconst nodeData = packLayout(root)\n\t\t\t.descendants()\n\t\t\t.splice(1)\n\t\t\t.filter(node => {\n\t\t\t\t// filter based on hierarchy level\n\t\t\t\treturn node.depth <= hierarchyLevel\n\t\t\t})\n\n\t\t// enter the circles\n\t\tconst circles = svg.selectAll('circle.node').data(nodeData)\n\n\t\tcircles.exit().attr('width', 0).attr('height', 0).remove()\n\n\t\tconst enteringCircles = circles.enter().append('circle').classed('node', true)\n\n\t\tenteringCircles\n\t\t\t.merge(circles as any)\n\t\t\t.attr('class', (d: any) => {\n\t\t\t\tconst originalClass = canvasZoomEnabled && hierarchyLevel === 3 ? this.getZoomClass(d) : ''\n\t\t\t\treturn this.model.getColorClassName({\n\t\t\t\t\tclassNameTypes: [ColorClassNameTypes.FILL, ColorClassNameTypes.STROKE],\n\t\t\t\t\tdataGroupName: d.data.dataGroupName,\n\t\t\t\t\toriginalClassName: d.children\n\t\t\t\t\t\t? `node ${originalClass}`\n\t\t\t\t\t\t: `node node-leaf ${originalClass}`\n\t\t\t\t})\n\t\t\t})\n\t\t\t.style('fill', (d: any) => this.model.getFillColor(d.data.dataGroupName, null, d.data))\n\t\t\t.style('stroke', (d: any) => this.model.getFillColor(d.data.dataGroupName, null, d.data))\n\t\t\t.attr('cx', (d: any) => d.x)\n\t\t\t.attr('cy', (d: any) => d.y)\n\t\t\t.transition('circlepack-leaf-update-enter')\n\t\t\t.call((t: any) =>\n\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\ttransition: t,\n\t\t\t\t\tname: 'circlepack-leaf-update-enter'\n\t\t\t\t})\n\t\t\t)\n\t\t\t.attr('r', (d: any) => d.r)\n\t\t\t.attr('opacity', 1)\n\t\t\t.attr('fill-opacity', circlePackConfigs.circles.fillOpacity)\n\n\t\tif (canvasZoomEnabled === true && this.focal) {\n\t\t\tthis.services.canvasZoom.zoomIn(this.focal, enteringCircles, canvasZoomSettings)\n\t\t\tthis.setBackgroundListeners()\n\t\t}\n\n\t\tif (!parentNode) {\n\t\t\t// add legend filtering if it isnt a monochrome chart\n\t\t\tthis.addLegendListeners()\n\t\t}\n\n\t\t// Add event listeners to elements drawn\n\t\tthis.addEventListeners()\n\t}\n\n\t// turn off the highlight class on children circles\n\tunhighlightChildren(childData: any) {\n\t\tconst data = childData.map((d: any) => d.data)\n\n\t\tthis.parent\n\t\t\t.selectAll('circle.node')\n\t\t\t.filter((d: any) => data.some((datum: any) => datum === d.data) && d.depth > 1)\n\t\t\t.style('stroke', (d: any) => this.model.getFillColor(d.data.dataGroupName, null, d.data))\n\t}\n\n\t// highlight the children circles with a stroke\n\thighlightChildren(childData: any) {\n\t\tconst data = childData.map((d: any) => d.data)\n\n\t\tthis.parent\n\t\t\t.selectAll('circle.node')\n\t\t\t.filter((d: any) => data.some((datum: any) => datum === d.data) && d.depth > 1)\n\t\t\t.style('stroke', circlePackConfigs.circles.hover.stroke)\n\t}\n\n\tgetZoomClass(node: any) {\n\t\tif ((this.model as CirclePackChartModel).getHierarchyLevel() === 3 && this.focal) {\n\t\t\tif (\n\t\t\t\tnode.data === this.focal.data ||\n\t\t\t\tthis.focal.children.some((d: any) => d.data === node.data)\n\t\t\t) {\n\t\t\t\treturn 'focal'\n\t\t\t}\n\t\t}\n\t\treturn 'non-focal'\n\t}\n\n\taddLegendListeners() {\n\t\tconst { events } = this.services\n\t\t// Highlight correct circle on legend item hovers\n\t\tevents.addEventListener(Events.Legend.ITEM_HOVER, this.handleLegendOnHover)\n\t\t// Un-highlight circles on legend item mouseouts\n\t\tevents.addEventListener(Events.Legend.ITEM_MOUSEOUT, this.handleLegendMouseOut)\n\t}\n\n\tremoveBackgroundListeners() {\n\t\tconst chartSvg = select(this.services.domUtils.getMainContainer())\n\t\tchartSvg.on('click', () => null)\n\t}\n\n\tsetBackgroundListeners() {\n\t\tconst chartSvg = select(this.services.domUtils.getMainContainer())\n\t\tconst self = this\n\t\tconst canvasSelection = this.parent.selectAll('circle.node')\n\n\t\tchartSvg.on('click', () => {\n\t\t\tself.focal = null as any\n\t\t\t;(self.model as CirclePackChartModel).updateHierarchyLevel(2)\n\t\t\tchartSvg.classed('zoomed-in', false)\n\t\t\tself.services.canvasZoom.zoomOut(canvasSelection, canvasZoomSettings)\n\t\t})\n\t}\n\n\thandleLegendOnHover = (event: CustomEvent) => {\n\t\tconst { hoveredElement } = event.detail\n\n\t\tthis.parent\n\t\t\t.selectAll('circle.node')\n\t\t\t.transition('legend-hover-circlepack')\n\t\t\t.call((t: any) =>\n\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\ttransition: t,\n\t\t\t\t\tname: 'legend-hover-circlepack'\n\t\t\t\t})\n\t\t\t)\n\t\t\t.attr('opacity', (d: any) => {\n\t\t\t\treturn d.data.dataGroupName === hoveredElement.datum()['name']\n\t\t\t\t\t? 1\n\t\t\t\t\t: circlePackConfigs.circles.fillOpacity\n\t\t\t})\n\t}\n\n\thandleLegendMouseOut = () => {\n\t\tthis.parent\n\t\t\t.selectAll('circle.node')\n\t\t\t.transition('legend-mouseout-circlepack')\n\t\t\t.call((t: any) =>\n\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\ttransition: t,\n\t\t\t\t\tname: 'legend-mouseout-circlepack'\n\t\t\t\t})\n\t\t\t)\n\t\t\t.attr('opacity', 1)\n\t}\n\n\t// Zoom icon to be appended to the label in the tooltip\n\tgetZoomIcon() {\n\t\treturn `\n\t\t\n\t\t\t \n\t\t\t\n\t\t `\n\t}\n\n\t// add event listeners for tooltip on the circles\n\taddEventListeners() {\n\t\tconst self = this\n\t\tthis.parent\n\t\t\t.selectAll('circle.node')\n\t\t\t.on('mouseover', function (event: MouseEvent, datum: any) {\n\t\t\t\tconst hoveredElement = select(this)\n\t\t\t\thoveredElement.classed('hovered', true)\n\n\t\t\t\tconst hierarchyLevel = (self.model as CirclePackChartModel).getHierarchyLevel()\n\t\t\t\tconst disabled = hierarchyLevel > 2 && !hoveredElement.classed('focal')\n\t\t\t\tconst canvasZoomEnabled = getProperty(self.model.getOptions(), 'canvasZoom', 'enabled')\n\n\t\t\t\tlet zoomable = false\n\t\t\t\tif (!disabled) {\n\t\t\t\t\t// get the children data for the tooltip\n\t\t\t\t\tlet childrenData = []\n\t\t\t\t\tlet totalValue: any[] = []\n\t\t\t\t\tlet parentValue = null\n\t\t\t\t\tif (datum.children) {\n\t\t\t\t\t\tif (datum.depth > 1 && canvasZoomEnabled) {\n\t\t\t\t\t\t\tzoomable = true\n\t\t\t\t\t\t\thoveredElement.classed('clickable', true)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tchildrenData = datum.children.map((child: any) => {\n\t\t\t\t\t\t\tif (child !== null) {\n\t\t\t\t\t\t\t\t// retrieve the children values if there are any 3rd level\n\t\t\t\t\t\t\t\tif (typeof child.data.value === 'number') {\n\t\t\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\t\t\tlabel: child.data.name,\n\t\t\t\t\t\t\t\t\t\tvalue: child.data.value\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\t\t\tlabel: child.data.name,\n\t\t\t\t\t\t\t\t\t\tlabelIcon: canvasZoomEnabled && hierarchyLevel <= 2 ? self.getZoomIcon() : null,\n\t\t\t\t\t\t\t\t\t\tvalue: child.value\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t})\n\n\t\t\t\t\t\tconst options = self.model.getOptions()\n\t\t\t\t\t\ttotalValue = [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tlabel:\n\t\t\t\t\t\t\t\t\tget(options, 'locale.translations.total') ||\n\t\t\t\t\t\t\t\t\tget(options, 'tooltip.totalLabel') ||\n\t\t\t\t\t\t\t\t\t'Total',\n\t\t\t\t\t\t\t\tvalue: datum.value,\n\t\t\t\t\t\t\t\tbold: true\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t]\n\t\t\t\t\t\t// children get a highlight stroke\n\t\t\t\t\t\tself.highlightChildren(datum.children)\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// if there is no children we want to display the value for the data\n\t\t\t\t\t\tparentValue = datum.value\n\t\t\t\t\t}\n\n\t\t\t\t\tconst fillColor = getComputedStyle(this as Element, null).getPropertyValue('fill')\n\n\t\t\t\t\t// Show tooltip\n\t\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.SHOW, {\n\t\t\t\t\t\tevent,\n\t\t\t\t\t\thoveredElement,\n\t\t\t\t\t\titems: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tcolor: fillColor,\n\t\t\t\t\t\t\t\tlabel: datum.data.name,\n\t\t\t\t\t\t\t\tlabelIcon:\n\t\t\t\t\t\t\t\t\tzoomable && canvasZoomEnabled && hierarchyLevel <= 2 ? self.getZoomIcon() : null,\n\t\t\t\t\t\t\t\tvalue: parentValue\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t...childrenData,\n\t\t\t\t\t\t\t...totalValue\n\t\t\t\t\t\t]\n\t\t\t\t\t})\n\t\t\t\t}\n\n\t\t\t\t// Dispatch mouse event\n\t\t\t\tself.services.events.dispatchEvent(Events.CirclePack.CIRCLE_MOUSEOVER, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: hoveredElement,\n\t\t\t\t\tdatum\n\t\t\t\t})\n\t\t\t})\n\t\t\t.on('mousemove', function (event: MouseEvent, datum: any) {\n\t\t\t\tconst hoveredElement = select(this)\n\n\t\t\t\t// Dispatch mouse event\n\t\t\t\tself.services.events.dispatchEvent(Events.CirclePack.CIRCLE_MOUSEMOVE, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: hoveredElement,\n\t\t\t\t\tdatum\n\t\t\t\t})\n\n\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.MOVE, {\n\t\t\t\t\tevent\n\t\t\t\t})\n\t\t\t})\n\t\t\t.on('mouseout', function (event: MouseEvent, datum: any) {\n\t\t\t\tconst hoveredElement = select(this)\n\t\t\t\thoveredElement.classed('hovered', false)\n\n\t\t\t\tif (datum.children) {\n\t\t\t\t\tself.unhighlightChildren(datum.children)\n\t\t\t\t}\n\n\t\t\t\t// Dispatch mouse event\n\t\t\t\tself.services.events.dispatchEvent(Events.CirclePack.CIRCLE_MOUSEOUT, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: hoveredElement,\n\t\t\t\t\tdatum\n\t\t\t\t})\n\n\t\t\t\t// Hide tooltip\n\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.HIDE, {\n\t\t\t\t\thoveredElement\n\t\t\t\t})\n\t\t\t})\n\t\t\t.on('click', function (event: MouseEvent, datum: any) {\n\t\t\t\tconst hoveredElement = select(this)\n\t\t\t\tconst disabled = hoveredElement.classed('non-focal')\n\n\t\t\t\tconst canvasZoomEnabled = getProperty(self.model.getOptions(), 'canvasZoom', 'enabled')\n\n\t\t\t\tif (canvasZoomEnabled && (self.model as CirclePackChartModel).getHierarchyLevel() > 2) {\n\t\t\t\t\tconst canvasSelection = self.parent.selectAll('circle.node')\n\t\t\t\t\tconst chartSvg = select(self.services.domUtils.getMainContainer())\n\t\t\t\t\tchartSvg.classed('zoomed-in', false)\n\t\t\t\t\tself.focal = null as any\n\t\t\t\t\t;(self.model as CirclePackChartModel).updateHierarchyLevel(2)\n\t\t\t\t\tself.services.canvasZoom.zoomOut(canvasSelection, canvasZoomSettings)\n\t\t\t\t}\n\t\t\t\t// zoom if chart has zoom enabled and if its a depth 2 circle that has children\n\t\t\t\telse if (datum.depth === 2 && datum.children && !disabled && canvasZoomEnabled) {\n\t\t\t\t\tconst canvasSelection = self.parent.selectAll('circle.node')\n\t\t\t\t\tconst chartSvg = select(self.services.domUtils.getMainContainer())\n\t\t\t\t\tchartSvg.classed('zoomed-in', true)\n\t\t\t\t\tself.focal = datum as any\n\t\t\t\t\t;(self.model as CirclePackChartModel).updateHierarchyLevel(3)\n\t\t\t\t\tself.services.canvasZoom.zoomIn(datum, canvasSelection, canvasZoomSettings)\n\t\t\t\t\t// don't want the click event to propagate to the background zoom out\n\t\t\t\t\t// does not clash with the tooltip/other events because it does need to close the\n\t\t\t\t\t// tooltip on the click event in order to zoom in/out\n\t\t\t\t\tevent.stopPropagation()\n\t\t\t\t}\n\n\t\t\t\t// Dispatch mouse event\n\t\t\t\tself.services.events.dispatchEvent(Events.CirclePack.CIRCLE_CLICK, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: hoveredElement,\n\t\t\t\t\tdatum\n\t\t\t\t})\n\t\t\t})\n\t}\n\n\tdestroy() {\n\t\t// Remove event listeners\n\t\tthis.parent\n\t\t\t.selectAll('circle.node')\n\t\t\t.on('mouseover', null)\n\t\t\t.on('mousemove', null)\n\t\t\t.on('mouseout', null)\n\t\t\t.on('click', null)\n\n\t\t// remove the listeners on the legend\n\t\tconst eventsFragment = this.services.events\n\t\teventsFragment.removeEventListener(Events.Legend.ITEM_HOVER, this.handleLegendOnHover)\n\t\teventsFragment.removeEventListener(Events.Legend.ITEM_MOUSEOUT, this.handleLegendMouseOut)\n\n\t\tthis.removeBackgroundListeners()\n\t}\n}\n","import { arc, interpolate, pie, select } from 'd3'\nimport { delay } from 'lodash-es'\nimport { convertValueToPercentage, getProperty } from '@/tools'\nimport { pie as pieConfigs } from '@/configuration'\nimport { Component } from '@/components/component'\nimport { DOMUtils } from '@/services/essentials/dom-utils'\nimport {\n\tCalloutDirections,\n\tEvents,\n\tAlignments,\n\tColorClassNameTypes,\n\tRenderTypes\n} from '@/interfaces/enums'\nimport { Roles } from '@/interfaces/a11y'\n\n// Pie slice tween function\nfunction arcTween(a: any, arcFunc: any) {\n\tconst i = interpolate(this._current, a)\n\n\treturn (t: any) => {\n\t\tthis._current = i(t)\n\t\treturn arcFunc(this._current)\n\t}\n}\n\nexport class Pie extends Component {\n\ttype = 'pie'\n\trenderType = RenderTypes.SVG\n\tisRendering = false\n\n\t// We need to store our arcs\n\t// So that addEventListeners()\n\t// Can access them\n\tarc: any\n\thoverArc: any\n\n\tinit() {\n\t\tconst eventsFragment = this.services.events\n\n\t\t// Highlight correct circle on legend item hovers\n\t\teventsFragment.addEventListener(Events.Legend.ITEM_HOVER, this.handleLegendOnHover)\n\n\t\t// Un-highlight circles on legend item mouseouts\n\t\teventsFragment.addEventListener(Events.Legend.ITEM_MOUSEOUT, this.handleLegendMouseOut)\n\t}\n\n\tgetInnerRadius() {\n\t\treturn pieConfigs.innerRadius\n\t}\n\n\trender(animate = true) {\n\t\tconst self = this\n\t\tconst svg = this.getComponentContainer({\n\t\t\tariaLabel: 'pie graph'\n\t\t})\n\n\t\tconst options = this.getOptions()\n\t\tconst { groupMapsTo } = options.data\n\t\tconst { valueMapsTo } = options.pie\n\n\t\tthis.isRendering = true\n\n\t\t// remove any slices that are valued at 0 because they dont need to be rendered and will create extra padding\n\t\tconst displayData = this.model.getDisplayData().filter((data: any) => data[valueMapsTo] > 0)\n\n\t\t// Compute the outer radius needed\n\t\tconst radius = this.computeRadius()\n\n\t\tthis.arc = arc().innerRadius(this.getInnerRadius()).outerRadius(radius)\n\n\t\t// Set the hover arc radius\n\t\tthis.hoverArc = arc()\n\t\t\t.innerRadius(this.getInnerRadius())\n\t\t\t.outerRadius(radius + pieConfigs.hoverArc.outerRadiusOffset)\n\n\t\t// Setup the pie layout\n\t\tconst pieLayout = pie()\n\t\t\t.value((d: any) => d[valueMapsTo])\n\t\t\t.sort(getProperty(options, 'pie', 'sortFunction'))\n\t\t\t.padAngle(pieConfigs.padAngle)\n\n\t\t// Add data to pie layout\n\t\tconst pieLayoutData = pieLayout(displayData)\n\n\t\t// Update data on all slices\n\t\tconst slicesGroup = DOMUtils.appendOrSelect(svg, 'g.slices')\n\t\t\t.attr('role', Roles.GROUP)\n\t\t\t.attr('data-name', 'slices')\n\n\t\tconst paths = slicesGroup\n\t\t\t.selectAll('path.slice')\n\t\t\t.data(pieLayoutData, (d: any) => d.data[groupMapsTo])\n\n\t\t// Remove slices that need to be exited\n\t\tpaths.exit().attr('opacity', 0).remove()\n\n\t\t// Add new slices that are being introduced\n\t\tconst enteringPaths = paths.enter().append('path').classed('slice', true).attr('opacity', 0)\n\n\t\t// Update styles & position on existing and entering slices\n\t\tconst allPaths = enteringPaths\n\t\t\t.merge(paths as any)\n\t\t\t.attr('class', (d: any) =>\n\t\t\t\tthis.model.getColorClassName({\n\t\t\t\t\tclassNameTypes: [ColorClassNameTypes.FILL],\n\t\t\t\t\tdataGroupName: d.data[groupMapsTo],\n\t\t\t\t\toriginalClassName: 'slice'\n\t\t\t\t})\n\t\t\t)\n\t\t\t.style('fill', (d: any) => self.model.getFillColor(d.data[groupMapsTo], null, d.data))\n\t\t\t.attr('d', this.arc)\n\n\t\tallPaths\n\t\t\t.transition()\n\t\t\t.call((t: any) =>\n\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\ttransition: t,\n\t\t\t\t\tname: 'pie_slice_enter_update',\n\t\t\t\t\tanimate\n\t\t\t\t})\n\t\t\t)\n\t\t\t.attr('opacity', 1)\n\t\t\t// a11y\n\t\t\t.attr('role', Roles.GRAPHICS_SYMBOL)\n\t\t\t.attr('aria-roledescription', 'slice')\n\t\t\t.attr(\n\t\t\t\t'aria-label',\n\t\t\t\t(d: any) =>\n\t\t\t\t\t`${d[valueMapsTo]}, ${\n\t\t\t\t\t\tconvertValueToPercentage(d.data[valueMapsTo], displayData, valueMapsTo) + '%'\n\t\t\t\t\t}`\n\t\t\t)\n\t\t\t// Tween\n\t\t\t.attrTween('d', function (a: any) {\n\t\t\t\treturn arcTween.bind(this)(a, self.arc)\n\t\t\t})\n\t\t\t.on('end', () => {\n\t\t\t\tself.isRendering = false\n\t\t\t})\n\n\t\t// Draw the slice labels\n\t\tconst { code: localeCode, number: numberFormatter } = getProperty(options, 'locale')\n\t\tconst renderLabels = options.pie.labels.enabled\n\t\tconst labelData = renderLabels\n\t\t\t? pieLayoutData.filter(x => (x.data as any)[valueMapsTo] > 0)\n\t\t\t: []\n\t\tconst labelsGroup = DOMUtils.appendOrSelect(svg, 'g.labels')\n\t\t\t.attr('role', Roles.GROUP)\n\t\t\t.attr('data-name', 'labels')\n\n\t\tconst labels = labelsGroup\n\t\t\t.selectAll('text.pie-label')\n\t\t\t.data(labelData, (d: any) => d.data[groupMapsTo])\n\n\t\t// Remove labels that are existing\n\t\tlabels.exit().attr('opacity', 0).remove()\n\n\t\t// Add labels that are being introduced\n\t\tconst enteringLabels = labels.enter().append('text').classed('pie-label', true)\n\n\t\t// Update styles & position on existing & entering labels\n\t\tconst calloutData: any[] = []\n\t\tenteringLabels\n\t\t\t.merge(labels as any)\n\t\t\t.style('text-anchor', 'middle')\n\t\t\t.text((d: any) => {\n\t\t\t\tif (options.pie.labels.formatter) {\n\t\t\t\t\treturn options.pie.labels.formatter({\n\t\t\t\t\t\t...d,\n\t\t\t\t\t\tpercentageValue: convertValueToPercentage(\n\t\t\t\t\t\t\td.data[valueMapsTo],\n\t\t\t\t\t\t\tdisplayData,\n\t\t\t\t\t\t\tvalueMapsTo,\n\t\t\t\t\t\t\ttrue\n\t\t\t\t\t\t)\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t\treturn (\n\t\t\t\t\tnumberFormatter(\n\t\t\t\t\t\tconvertValueToPercentage(d.data[valueMapsTo], displayData, valueMapsTo),\n\t\t\t\t\t\tlocaleCode\n\t\t\t\t\t) + '%'\n\t\t\t\t)\n\t\t\t})\n\t\t\t// Calculate dimensions in order to transform\n\t\t\t.datum(function (d: any) {\n\t\t\t\tconst marginedRadius = radius + 7\n\n\t\t\t\tconst theta = (d.endAngle - d.startAngle) / 2 + d.startAngle\n\t\t\t\tconst deg = (theta / Math.PI) * 180\n\n\t\t\t\tconst textLength = this.getComputedTextLength()\n\t\t\t\td.textOffsetX = textLength / 2\n\t\t\t\td.textOffsetY = deg > 90 && deg < 270 ? 10 : 0\n\n\t\t\t\td.xPosition = (d.textOffsetX + marginedRadius) * Math.sin(theta)\n\t\t\t\td.yPosition = (d.textOffsetY + marginedRadius) * -Math.cos(theta)\n\n\t\t\t\treturn d\n\t\t\t})\n\t\t\t.attr('transform', function (d: any, i: number) {\n\t\t\t\tconst totalSlices = labelData.length\n\t\t\t\tconst sliceAngleDeg = (d.endAngle - d.startAngle) * (180 / Math.PI)\n\n\t\t\t\t// check if last 2 slices (or just last) are < the threshold\n\t\t\t\tif (i >= totalSlices - 2) {\n\t\t\t\t\tif (sliceAngleDeg < pieConfigs.callout.minSliceDegree) {\n\t\t\t\t\t\tlet labelTranslateX, labelTranslateY\n\t\t\t\t\t\tif (d.index === totalSlices - 1) {\n\t\t\t\t\t\t\tlabelTranslateX =\n\t\t\t\t\t\t\t\td.xPosition +\n\t\t\t\t\t\t\t\tpieConfigs.callout.offsetX +\n\t\t\t\t\t\t\t\tpieConfigs.callout.textMargin +\n\t\t\t\t\t\t\t\td.textOffsetX\n\t\t\t\t\t\t\tlabelTranslateY = d.yPosition - pieConfigs.callout.offsetY\n\n\t\t\t\t\t\t\t// Set direction of callout\n\t\t\t\t\t\t\td.direction = CalloutDirections.RIGHT\n\t\t\t\t\t\t\tcalloutData.push(d)\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tlabelTranslateX =\n\t\t\t\t\t\t\t\td.xPosition -\n\t\t\t\t\t\t\t\tpieConfigs.callout.offsetX -\n\t\t\t\t\t\t\t\td.textOffsetX -\n\t\t\t\t\t\t\t\tpieConfigs.callout.textMargin\n\t\t\t\t\t\t\tlabelTranslateY = d.yPosition - pieConfigs.callout.offsetY\n\n\t\t\t\t\t\t\t// Set direction of callout\n\t\t\t\t\t\t\td.direction = CalloutDirections.LEFT\n\t\t\t\t\t\t\tcalloutData.push(d)\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn `translate(${labelTranslateX}, ${labelTranslateY})`\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn `translate(${d.xPosition}, ${d.yPosition})`\n\t\t\t})\n\n\t\t// Render pie label callouts\n\t\tthis.renderCallouts(calloutData)\n\n\t\tconst optionName = getProperty(options, 'donut') ? 'donut' : 'pie'\n\t\tconst alignment = getProperty(options, optionName, 'alignment')\n\n\t\tconst { width } = DOMUtils.getSVGElementSize(this.getParent() as any, {\n\t\t\tuseAttrs: true\n\t\t})\n\n\t\t// don't add padding for labels & callouts if they are disabled\n\t\tconst xOffset = renderLabels ? pieConfigs.xOffset : 0\n\t\tconst yOffset = renderLabels ? pieConfigs.yOffset : 0\n\n\t\t// Position Pie\n\t\tlet pieTranslateX = radius + xOffset\n\t\tif (alignment === Alignments.CENTER) {\n\t\t\tpieTranslateX = width / 2\n\t\t} else if (alignment === Alignments.RIGHT) {\n\t\t\tpieTranslateX = width - radius - pieConfigs.xOffset\n\t\t}\n\n\t\tlet pieTranslateY = radius + yOffset\n\t\tif (calloutData.length > 0) {\n\t\t\tpieTranslateY += pieConfigs.yOffsetCallout\n\t\t}\n\n\t\tsvg.attr('x', pieTranslateX + 7).attr('y', pieTranslateY)\n\n\t\t// Add event listeners\n\t\tthis.addEventListeners()\n\t}\n\n\trenderCallouts(calloutData: any[]) {\n\t\tconst svg = DOMUtils.appendOrSelect(this.getComponentContainer(), 'g.callouts')\n\t\t\t.attr('role', Roles.GROUP)\n\t\t\t.attr('data-name', 'callouts')\n\n\t\t// Update data on callouts\n\t\tconst callouts = svg.selectAll('g.callout').data(calloutData)\n\n\t\tcallouts.exit().remove()\n\n\t\tconst enteringCallouts = callouts\n\t\t\t.enter()\n\t\t\t.append('g')\n\t\t\t.classed('callout', true)\n\t\t\t// a11y\n\t\t\t.attr('role', Roles.GROUP)\n\t\t\t.attr('aria-roledescription', 'label callout')\n\n\t\t// Update data values for each callout\n\t\t// For the horizontal and vertical lines to use\n\t\tenteringCallouts.merge(callouts as any).datum(function (d: any) {\n\t\t\tconst { xPosition, yPosition, direction } = d\n\n\t\t\tif (direction === CalloutDirections.RIGHT) {\n\t\t\t\td.startPos = {\n\t\t\t\t\tx: xPosition,\n\t\t\t\t\ty: yPosition + d.textOffsetY\n\t\t\t\t}\n\n\t\t\t\t// end position for the callout line\n\t\t\t\td.endPos = {\n\t\t\t\t\tx: xPosition + pieConfigs.callout.offsetX,\n\t\t\t\t\ty: yPosition - pieConfigs.callout.offsetY + d.textOffsetY\n\t\t\t\t}\n\n\t\t\t\t// the intersection point of the vertical and horizontal line\n\t\t\t\td.intersectPointX = d.endPos.x - pieConfigs.callout.horizontalLineLength\n\t\t\t} else {\n\t\t\t\t// start position for the callout line\n\t\t\t\td.startPos = {\n\t\t\t\t\tx: xPosition,\n\t\t\t\t\ty: yPosition + d.textOffsetY\n\t\t\t\t}\n\n\t\t\t\t// end position for the callout line should be bottom aligned to the title\n\t\t\t\td.endPos = {\n\t\t\t\t\tx: xPosition - pieConfigs.callout.offsetX,\n\t\t\t\t\ty: yPosition - pieConfigs.callout.offsetY + d.textOffsetY\n\t\t\t\t}\n\n\t\t\t\t// the intersection point of the vertical and horizontal line\n\t\t\t\td.intersectPointX = d.endPos.x + pieConfigs.callout.horizontalLineLength\n\t\t\t}\n\n\t\t\t// Store the necessary data in the DOM element\n\t\t\treturn d\n\t\t})\n\n\t\t// draw vertical line\n\t\tconst enteringVerticalLines = enteringCallouts.append('line').classed('vertical-line', true)\n\n\t\tenteringVerticalLines\n\t\t\t.merge(svg.selectAll('line.vertical-line'))\n\t\t\t.datum(function () {\n\t\t\t\treturn select(this.parentNode as any).datum()\n\t\t\t})\n\t\t\t.style('stroke-width', '1px')\n\t\t\t.attr('x1', (d: any) => d.startPos.x)\n\t\t\t.attr('y1', (d: any) => d.startPos.y)\n\t\t\t.attr('x2', (d: any) => d.intersectPointX)\n\t\t\t.attr('y2', (d: any) => d.endPos.y)\n\n\t\t// draw horizontal line\n\t\tconst enteringHorizontalLines = enteringCallouts.append('line').classed('horizontal-line', true)\n\n\t\tenteringHorizontalLines\n\t\t\t.merge(svg.selectAll('line.horizontal-line'))\n\t\t\t.datum(function () {\n\t\t\t\treturn select(this.parentNode as any).datum()\n\t\t\t})\n\t\t\t.style('stroke-width', '1px')\n\t\t\t.attr('x1', (d: any) => d.intersectPointX)\n\t\t\t.attr('y1', (d: any) => d.endPos.y)\n\t\t\t.attr('x2', (d: any) => d.endPos.x)\n\t\t\t.attr('y2', (d: any) => d.endPos.y)\n\t}\n\n\t// Highlight elements that match the hovered legend item\n\thandleLegendOnHover = (event: CustomEvent) => {\n\t\tconst { hoveredElement } = event.detail\n\t\tconst { groupMapsTo } = this.getOptions().data\n\n\t\tthis.parent\n\t\t\t.selectAll('path.slice')\n\t\t\t.transition('legend-hover-bar')\n\t\t\t.call((t: any) =>\n\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\ttransition: t,\n\t\t\t\t\tname: 'legend-hover-bar'\n\t\t\t\t})\n\t\t\t)\n\t\t\t.attr('opacity', (d: any) =>\n\t\t\t\td.data[groupMapsTo] !== hoveredElement.datum()['name'] ? 0.3 : 1\n\t\t\t)\n\t}\n\n\t// Un-highlight all elements\n\thandleLegendMouseOut = () => {\n\t\tthis.parent\n\t\t\t.selectAll('path.slice')\n\t\t\t.transition('legend-mouseout-bar')\n\t\t\t.call((t: any) =>\n\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\ttransition: t,\n\t\t\t\t\tname: 'legend-mouseout-bar'\n\t\t\t\t})\n\t\t\t)\n\t\t\t.attr('opacity', 1)\n\t}\n\n\taddEventListeners() {\n\t\tconst self = this\n\n\t\tthis.parent\n\t\t\t.selectAll('path.slice')\n\t\t\t.on('mouseover', function (event: MouseEvent, datum: any) {\n\t\t\t\tconst hoveredElement = select(this)\n\t\t\t\tif (!self.isRendering) {\n\t\t\t\t\thoveredElement\n\t\t\t\t\t\t.classed('hovered', true)\n\t\t\t\t\t\t.transition('pie_slice_mouseover')\n\t\t\t\t\t\t.call((t: any) =>\n\t\t\t\t\t\t\tself.services.transitions.setupTransition({\n\t\t\t\t\t\t\t\ttransition: t,\n\t\t\t\t\t\t\t\tname: 'pie_slice_mouseover'\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t)\n\t\t\t\t\t\t.attr('d', self.hoverArc)\n\t\t\t\t}\n\n\t\t\t\t// Dispatch mouse event\n\t\t\t\tself.services.events.dispatchEvent(Events.Pie.SLICE_MOUSEOVER, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: select(this),\n\t\t\t\t\tdatum\n\t\t\t\t})\n\n\t\t\t\tconst { groupMapsTo } = self.getOptions().data\n\t\t\t\tconst { valueMapsTo } = self.getOptions().pie\n\t\t\t\t// Show tooltip\n\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.SHOW, {\n\t\t\t\t\tevent,\n\t\t\t\t\thoveredElement,\n\t\t\t\t\titems: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel: datum.data[groupMapsTo],\n\t\t\t\t\t\t\tvalue: datum.data[valueMapsTo]\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t})\n\t\t\t})\n\t\t\t.on('mousemove', function (event: MouseEvent, datum: any) {\n\t\t\t\tconst hoveredElement = select(this)\n\n\t\t\t\t// Dispatch mouse event\n\t\t\t\tself.services.events.dispatchEvent(Events.Pie.SLICE_MOUSEMOVE, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: hoveredElement,\n\t\t\t\t\tdatum\n\t\t\t\t})\n\n\t\t\t\t// Show tooltip\n\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.MOVE, {\n\t\t\t\t\tevent\n\t\t\t\t})\n\t\t\t})\n\t\t\t.on('click', function (event: MouseEvent, datum: any) {\n\t\t\t\t// Dispatch mouse event\n\t\t\t\tself.services.events.dispatchEvent(Events.Pie.SLICE_CLICK, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: select(this),\n\t\t\t\t\tdatum\n\t\t\t\t})\n\t\t\t})\n\t\t\t.on('mouseout', function (event: MouseEvent, datum: any) {\n\t\t\t\tconst hoveredElement = select(this)\n\t\t\t\tdelay(() => {\n\t\t\t\t\tif (!self.isRendering) {\n\t\t\t\t\t\thoveredElement\n\t\t\t\t\t\t\t.classed('hovered', false)\n\t\t\t\t\t\t\t.transition('pie_slice_mouseout')\n\t\t\t\t\t\t\t.call((t: any) =>\n\t\t\t\t\t\t\t\tself.services.transitions.setupTransition({\n\t\t\t\t\t\t\t\t\ttransition: t,\n\t\t\t\t\t\t\t\t\tname: 'pie_slice_mouseout'\n\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t.attr('d', self.arc)\n\t\t\t\t\t}\n\t\t\t\t}, 100)\n\n\t\t\t\t// Dispatch mouse event\n\t\t\t\tself.services.events.dispatchEvent(Events.Pie.SLICE_MOUSEOUT, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: hoveredElement,\n\t\t\t\t\tdatum\n\t\t\t\t})\n\n\t\t\t\t// Hide tooltip\n\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.HIDE, {\n\t\t\t\t\thoveredElement\n\t\t\t\t})\n\t\t\t})\n\t}\n\n\t// Helper functions\n\tprotected computeRadius() {\n\t\tconst { width, height } = DOMUtils.getSVGElementSize(this.parent as any, {\n\t\t\tuseAttrs: true\n\t\t})\n\n\t\tconst options = this.getOptions()\n\t\tconst radius: number = Math.min(width, height) / 2\n\t\tconst renderLabels = options.pie.labels.enabled\n\n\t\treturn renderLabels ? radius + pieConfigs.radiusOffset : radius\n\t}\n}\n","import { interpolateNumber, interpolateRound, select } from 'd3'\nimport { getProperty } from '@/tools'\nimport { Pie } from './pie'\nimport { DOMUtils } from '@/services/essentials/dom-utils'\nimport { RenderTypes } from '@/interfaces/enums'\n\nexport class Donut extends Pie {\n\ttype = 'donut'\n\trenderType = RenderTypes.SVG\n\n\trender(animate = true) {\n\t\t// Call render() from Pie\n\t\tsuper.render(animate)\n\n\t\tconst self = this\n\n\t\t// if there are no data, remove the center content\n\t\t// that is the old one and do nothing\n\t\tif (this.model.isDataEmpty()) {\n\t\t\tthis.getComponentContainer({\n\t\t\t\tariaLabel: 'donut graph'\n\t\t\t})\n\t\t\t\t.select('g.center')\n\t\t\t\t.remove()\n\t\t\treturn\n\t\t}\n\n\t\tconst svg = DOMUtils.appendOrSelect(\n\t\t\tthis.getComponentContainer({\n\t\t\t\tariaLabel: 'donut graph'\n\t\t\t}),\n\t\t\t'g.center'\n\t\t)\n\t\tconst options = this.getOptions()\n\n\t\t// Compute the outer radius needed\n\t\tconst radius = this.computeRadius()\n\t\tconst donutTitle = getProperty(options, 'donut', 'center', 'label')\n\n\t\t// Add the number shown in the center of the donut\n\t\tDOMUtils.appendOrSelect(svg, 'text.donut-figure')\n\t\t\t.attr('text-anchor', 'middle')\n\t\t\t.style('dominant-baseline', () => {\n\t\t\t\t// Center figure if title is empty\n\t\t\t\tif (donutTitle === null || donutTitle === '') {\n\t\t\t\t\treturn 'central'\n\t\t\t\t}\n\n\t\t\t\treturn 'initial'\n\t\t\t})\n\t\t\t.style('font-size', () => options.donut.center.numberFontSize(radius))\n\t\t\t.transition()\n\t\t\t.call((t: any) =>\n\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\ttransition: t,\n\t\t\t\t\tname: 'donut-figure-enter-update',\n\t\t\t\t\tanimate\n\t\t\t\t})\n\t\t\t)\n\t\t\t.tween('text', function () {\n\t\t\t\treturn self.centerNumberTween(select(this))\n\t\t\t})\n\n\t\t// Title will be rendered only if it isn't empty\n\t\tif (donutTitle !== null && donutTitle !== '') {\n\t\t\t// Add the label below the number in the center of the donut\n\t\t\tDOMUtils.appendOrSelect(svg, 'text.donut-title')\n\t\t\t\t.attr('text-anchor', 'middle')\n\t\t\t\t.style('font-size', () => options.donut.center.titleFontSize(radius))\n\t\t\t\t.attr('y', options.donut.center.titleYPosition(radius))\n\t\t\t\t.text(donutTitle)\n\t\t}\n\t}\n\n\tgetInnerRadius() {\n\t\t// Compute the outer radius needed\n\t\tconst radius = this.computeRadius()\n\n\t\treturn radius * (3 / 4)\n\t}\n\n\tcenterNumberTween(d3Ref: any) {\n\t\tconst options = this.getOptions()\n\n\t\tlet donutCenterFigure = getProperty(options, 'donut', 'center', 'number')\n\t\tif (donutCenterFigure === null) {\n\t\t\tdonutCenterFigure = this.model.getDisplayData().reduce((accumulator: number, d: any) => {\n\t\t\t\treturn accumulator + d[options.pie.valueMapsTo]\n\t\t\t}, 0)\n\t\t}\n\n\t\t// Remove commas from the current value string, and convert to an int\n\t\tconst currentValue = parseInt(d3Ref.text().replace(/[, ]+/g, ''), 10) || 0\n\n\t\tlet interpolateFunction\n\t\tif (currentValue % 1 === 0 && donutCenterFigure % 1 === 0) {\n\t\t\tinterpolateFunction = interpolateRound\n\t\t} else {\n\t\t\tinterpolateFunction = interpolateNumber\n\t\t}\n\n\t\tconst i = interpolateFunction(currentValue, donutCenterFigure)\n\n\t\treturn (t: any) => {\n\t\t\tconst { numberFormatter } = options.donut.center\n\t\t\tif (numberFormatter) {\n\t\t\t\td3Ref.text(numberFormatter(i(t)))\n\t\t\t} else {\n\t\t\t\tconst { code: localeCode, number: localeNumberFormatter } = getProperty(options, 'locale')\n\t\t\t\td3Ref.text(localeNumberFormatter(Math.floor(i(t)), localeCode))\n\t\t\t}\n\t\t}\n\t}\n}\n","import { arc, select } from 'd3'\nimport { clamp } from 'lodash-es'\nimport { getProperty } from '@/tools'\nimport { Component } from '@/components/component'\nimport { DOMUtils } from '@/services/essentials/dom-utils'\nimport {\n\tEvents,\n\tGaugeTypes,\n\tArrowDirections,\n\tColorClassNameTypes,\n\tAlignments,\n\tRenderTypes\n} from '@/interfaces/enums'\nimport { Roles } from '@/interfaces/a11y'\n\n// arrow paths for delta\nconst ARROW_UP_PATH_STRING = '4,10 8,6 12,10'\nconst ARROW_DOWN_PATH_STRING = '12,6 8,10 4,6'\n\nexport class Gauge extends Component {\n\ttype = 'gauge'\n\trenderType = RenderTypes.SVG\n\n\t// We need to store our arcs so that addEventListeners() can access them\n\tarc: any\n\tbackgroundArc: any\n\n\tgetValue(): number {\n\t\tconst data = this.model.getData()\n\t\tconst value = data.find((d: any) => d.group === 'value')?.value ?? null\n\t\treturn value\n\t}\n\n\tgetValueRatio(): number {\n\t\tconst value = clamp(this.getValue(), 0, 100)\n\t\treturn value / 100\n\t}\n\n\tgetDelta(): number {\n\t\tconst data = this.model.getData()\n\t\tconst delta = data.find((d: any) => d.group === 'delta')?.value ?? null\n\t\treturn delta\n\t}\n\n\tgetArcRatio(): number {\n\t\tconst options = this.getOptions()\n\t\tconst type = getProperty(options, 'gauge', 'type')\n\t\tconst arcRatio = type === GaugeTypes.FULL ? 1 : 0.5\n\t\treturn arcRatio\n\t}\n\n\tgetArcSize(): number {\n\t\treturn this.getArcRatio() * Math.PI * 2\n\t}\n\n\tgetStartAngle(): number {\n\t\tconst arcSize = this.getArcSize()\n\t\tif (arcSize === 2 * Math.PI) {\n\t\t\treturn 0\n\t\t}\n\t\treturn -arcSize / 2\n\t}\n\n\t// use provided arrow direction or default to using the delta\n\tgetArrow(delta: any): string {\n\t\tconst options = this.getOptions()\n\t\tconst arrowDirection = getProperty(options, 'gauge', 'deltaArrow', 'direction')\n\n\t\tswitch (arrowDirection) {\n\t\t\tcase ArrowDirections.UP:\n\t\t\t\treturn ARROW_UP_PATH_STRING\n\t\t\tcase ArrowDirections.DOWN:\n\t\t\t\treturn ARROW_DOWN_PATH_STRING\n\t\t\tdefault:\n\t\t\t\treturn delta > 0 ? ARROW_UP_PATH_STRING : ARROW_DOWN_PATH_STRING\n\t\t}\n\t}\n\n\t// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n\t// @ts-ignore\n\t// eslint-disable-next-line @typescript-eslint/no-unused-vars\n\trender(animate = true) {\n\t\tconst svg = this.getComponentContainer({\n\t\t\tariaLabel: 'gauge graph'\n\t\t}).attr('width', '100%').attr('height', '100%')\n\t\tconst options = this.getOptions()\n\n\t\tconst value = this.getValue()\n\t\tconst valueRatio = this.getValueRatio()\n\t\tconst arcSize = this.getArcSize()\n\n\t\t// angles for drawing the gauge\n\t\tconst startAngle = this.getStartAngle()\n\t\tconst rotationAngle = valueRatio * arcSize\n\t\tconst currentAngle = startAngle + rotationAngle\n\t\tconst endAngle = startAngle + arcSize\n\n\t\t// Compute the outer radius needed\n\t\tconst radius = this.computeRadius()\n\t\tconst innerRadius = this.getInnerRadius()\n\n\t\t// draw the container and arc\n\t\tthis.backgroundArc = arc()\n\t\t\t.innerRadius(innerRadius)\n\t\t\t.outerRadius(radius)\n\t\t\t.startAngle(currentAngle)\n\t\t\t.endAngle(endAngle)\n\n\t\tthis.arc = arc()\n\t\t\t.innerRadius(innerRadius)\n\t\t\t.outerRadius(radius)\n\t\t\t.startAngle(startAngle)\n\t\t\t.endAngle(currentAngle)\n\n\t\t// draw the container\n\t\tDOMUtils.appendOrSelect(svg, 'path.arc-background').attr('d', this.backgroundArc)\n\n\t\t// Add data arc\n\t\tconst arcValue = svg.selectAll('path.arc-foreground').data([value])\n\t\tconst arcEnter = arcValue.enter().append('path')\n\n\t\tarcEnter\n\t\t\t.merge(arcValue as any)\n\t\t\t.attr(\n\t\t\t\t'class',\n\t\t\t\tthis.model.getColorClassName({\n\t\t\t\t\tclassNameTypes: [ColorClassNameTypes.FILL],\n\t\t\t\t\tdataGroupName: 'value',\n\t\t\t\t\toriginalClassName: 'arc-foreground'\n\t\t\t\t})\n\t\t\t)\n\t\t\t.style('fill', () => getProperty(this.getOptions(), 'color', 'scale', 'value'))\n\t\t\t.attr('d', this.arc)\n\t\t\t// a11y\n\t\t\t.attr('role', Roles.GRAPHICS_SYMBOL)\n\t\t\t.attr('aria-roledescription', 'value')\n\t\t\t.attr('aria-label', (d: any) => d)\n\n\t\t// draw the value and delta to the center\n\t\tthis.drawValueNumber()\n\t\tthis.drawDelta()\n\n\t\tarcValue.exit().remove()\n\n\t\tconst alignment = getProperty(options, 'gauge', 'alignment')\n\n\t\tconst { width } = DOMUtils.getSVGElementSize(this.getParent() as any, {\n\t\t\tuseAttrs: true\n\t\t})\n\n\t\t// Position gauge\n\t\tlet gaugeTranslateX = radius\n\t\tif (alignment === Alignments.CENTER) {\n\t\t\tgaugeTranslateX = width / 2\n\t\t} else if (alignment === Alignments.RIGHT) {\n\t\t\tgaugeTranslateX = width - radius\n\t\t}\n\t\tsvg.attr('x', gaugeTranslateX).attr('y', radius)\n\n\t\t// Add event listeners\n\t\tthis.addEventListeners()\n\t}\n\n\t/**\n\t * draws the value number associated with the Gauge component in the center\n\t */\n\tdrawValueNumber() {\n\t\tconst svg = this.getComponentContainer()\n\t\tconst options = this.getOptions()\n\n\t\tconst arcType = getProperty(options, 'gauge', 'type')\n\t\tconst value = this.getValue()\n\t\tconst delta = this.getDelta()\n\n\t\t// Sizing and positions relative to the radius\n\t\tconst radius = this.computeRadius()\n\n\t\tconst valueFontSize = getProperty(options, 'gauge', 'valueFontSize')\n\t\t// if there is a delta, use the size to center the numbers, otherwise center the valueNumber\n\t\tconst deltaFontSize = getProperty(options, 'gauge', 'deltaFontSize')\n\n\t\tconst numberSpacing = getProperty(options, 'gauge', 'numberSpacing')\n\n\t\tconst showPercentageSymbol = getProperty(options, 'gauge', 'showPercentageSymbol')\n\n\t\t// circular gauge without delta should have valueNumber centered\n\t\tlet numbersYPosition = 0\n\t\tif (arcType === GaugeTypes.FULL && !delta) {\n\t\t\tnumbersYPosition = deltaFontSize(radius)\n\t\t} else if (arcType === GaugeTypes.SEMI && delta) {\n\t\t\t// semi circular gauge we want the numbers aligned to the chart container\n\t\t\tnumbersYPosition = -(deltaFontSize(radius) + numberSpacing)\n\t\t}\n\n\t\t// Add the numbers at the center\n\t\tconst numbersGroup = DOMUtils.appendOrSelect(svg, 'g.gauge-numbers').attr(\n\t\t\t'transform',\n\t\t\t`translate(0, ${numbersYPosition})`\n\t\t)\n\n\t\tconst fontSize = valueFontSize(radius)\n\t\t// Add the big number\n\t\tconst valueNumberGroup = DOMUtils.appendOrSelect(numbersGroup, 'g.gauge-value-number')\n\t\tconst { code: localeCode, number: localeNumberFormatter } = getProperty(options, 'locale')\n\t\tconst numberFormatter = getProperty(options, 'gauge', 'numberFormatter')\n\t\tconst valueNumber = valueNumberGroup.selectAll('text.gauge-value-number').data([value])\n\n\t\tvalueNumber\n\t\t\t.enter()\n\t\t\t.append('text')\n\t\t\t.attr('class', 'gauge-value-number')\n\t\t\t.merge(valueNumber as any)\n\t\t\t.style('font-size', `${fontSize}px`)\n\t\t\t.attr('text-anchor', 'middle')\n\t\t\t.text((d: any) => {\n\t\t\t\tlet numericValue: number\n\t\t\t\tif (d !== null && d !== undefined) {\n\t\t\t\t\tnumericValue = Number(d.toFixed(2)) % 1 !== 0 ? d.toFixed(2) : d.toFixed()\n\t\t\t\t} else {\n\t\t\t\t\tnumericValue = 0\n\t\t\t\t}\n\t\t\t\tif (numberFormatter) {\n\t\t\t\t\treturn numberFormatter(numericValue)\n\t\t\t\t} else {\n\t\t\t\t\treturn localeNumberFormatter(Number(numericValue), localeCode)\n\t\t\t\t}\n\t\t\t})\n\n\t\t// add the percentage symbol beside the valueNumber\n\t\tconst { width: valueNumberWidth } = DOMUtils.getSVGElementSize(\n\t\t\tDOMUtils.appendOrSelect(svg, 'text.gauge-value-number'),\n\t\t\t{ useBBox: true }\n\t\t)\n\n\t\tconst symbolFontSize = fontSize / 2\n\t\tconst gaugeSymbol = showPercentageSymbol ? '%' : ''\n\t\tconst symbol = DOMUtils.appendOrSelect(valueNumberGroup, 'text.gauge-value-symbol')\n\t\t\t.style('font-size', `${symbolFontSize}px`)\n\t\t\t.attr('x', valueNumberWidth / 2)\n\t\t\t.text(gaugeSymbol)\n\n\t\tconst { width: symbolWidth, height: symbolHeight } = DOMUtils.getSVGElementSize(symbol, {\n\t\t\tuseBBox: true\n\t\t})\n\n\t\t// adjust the symbol to superscript using the bbox instead of the font-size cause\n\t\t// we want to align the actual character to the value number\n\t\tsymbol.attr('y', `-${symbolHeight / 2}px`)\n\n\t\t// move the value group depending on the symbol's drawn size\n\t\tvalueNumberGroup.attr('transform', `translate(-${symbolWidth / 2}, 0)`) // Optical centering for the presence of the smaller % symbol\n\t}\n\n\t/**\n\t * adds the delta number for the gauge\n\t */\n\tdrawDelta() {\n\t\tconst self = this\n\t\tconst svg = this.getComponentContainer()\n\t\tconst options = this.getOptions()\n\t\tconst delta = this.getDelta()\n\t\tconst { code: localeCode, number: localeNumberFormatter } = getProperty(options, 'locale')\n\t\tif (!delta) {\n\t\t\tconst deltaGroup = svg.select('g.gauge-delta')\n\n\t\t\tif (!deltaGroup.empty()) {\n\t\t\t\tdeltaGroup.remove()\n\t\t\t}\n\t\t} else {\n\t\t\t// Sizing and positions relative to the radius\n\t\t\tconst radius = this.computeRadius()\n\t\t\tconst deltaFontSize = delta ? getProperty(options, 'gauge', 'deltaFontSize') : () => 0\n\n\t\t\t// use numberFormatter here only if there is a delta supplied\n\t\t\tconst numberFormatter = delta\n\t\t\t\t? getProperty(options, 'gauge', 'numberFormatter')\n\t\t\t\t: (): any => null\n\n\t\t\tconst arrowSize = getProperty(options, 'gauge', 'deltaArrow', 'size')\n\t\t\tconst numberSpacing = getProperty(options, 'gauge', 'numberSpacing')\n\n\t\t\tconst showPercentageSymbol = getProperty(options, 'gauge', 'showPercentageSymbol')\n\n\t\t\tconst numbersGroup = DOMUtils.appendOrSelect(svg, 'g.gauge-numbers')\n\n\t\t\t// Add the smaller number of the delta\n\t\t\tconst deltaGroup = DOMUtils.appendOrSelect(numbersGroup, 'g.gauge-delta').attr(\n\t\t\t\t'transform',\n\t\t\t\t`translate(0, ${deltaFontSize(radius) + numberSpacing})`\n\t\t\t)\n\n\t\t\tconst deltaNumber = DOMUtils.appendOrSelect(deltaGroup, 'text.gauge-delta-number')\n\t\t\tconst gaugeSymbol = showPercentageSymbol ? '%' : ''\n\n\t\t\tdeltaNumber.data(delta === null ? [] : [delta])\n\n\t\t\tdeltaNumber\n\t\t\t\t.enter()\n\t\t\t\t.append('text')\n\t\t\t\t.classed('gauge-delta-number', true)\n\t\t\t\t.merge(deltaNumber)\n\t\t\t\t.attr('text-anchor', 'middle')\n\t\t\t\t.style('font-size', `${deltaFontSize(radius)}px`)\n\t\t\t\t.text((d: any) => {\n\t\t\t\t\tlet value\n\t\t\t\t\tif (d !== null && d !== undefined) {\n\t\t\t\t\t\tvalue = Number(d.toFixed(2)) % 1 !== 0 ? d.toFixed(2) : d.toFixed()\n\t\t\t\t\t} else {\n\t\t\t\t\t\tvalue = 0\n\t\t\t\t\t}\n\t\t\t\t\tif (numberFormatter) {\n\t\t\t\t\t\treturn `${numberFormatter(value)}${gaugeSymbol}`\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn `${localeNumberFormatter(Number(value), localeCode)}${gaugeSymbol}`\n\t\t\t\t\t}\n\t\t\t\t})\n\n\t\t\t// Add the caret for the delta number\n\t\t\tconst { width: deltaNumberWidth } = DOMUtils.getSVGElementSize(\n\t\t\t\tDOMUtils.appendOrSelect(svg, '.gauge-delta-number'),\n\t\t\t\t{ useBBox: true }\n\t\t\t)\n\n\t\t\t// check if delta arrow is disabled\n\t\t\tconst arrowEnabled = getProperty(options, 'gauge', 'deltaArrow', 'enabled')\n\n\t\t\tconst deltaArrow = deltaGroup\n\t\t\t\t.selectAll('svg.gauge-delta-arrow')\n\t\t\t\t.data(delta !== null && arrowEnabled ? [delta] : [])\n\n\t\t\tdeltaArrow\n\t\t\t\t.enter()\n\t\t\t\t.append('svg')\n\t\t\t\t.merge(deltaArrow as any)\n\t\t\t\t.attr('class', 'gauge-delta-arrow')\n\t\t\t\t.attr('x', -arrowSize(radius) - deltaNumberWidth / 2)\n\t\t\t\t.attr('y', -arrowSize(radius) / 2 - deltaFontSize(radius) * 0.35)\n\t\t\t\t.attr('width', arrowSize(radius))\n\t\t\t\t.attr('height', arrowSize(radius))\n\t\t\t\t.attr('viewBox', '0 0 16 16')\n\t\t\t\t/*\n\t\t\t\t * using .each() here to ensure that the below function runs\n\t\t\t\t * after svg.gauge-delta-arrow has been mounted onto the DOM\n\t\t\t\t */\n\t\t\t\t.each(function () {\n\t\t\t\t\tconst deltaArrowSelection = select(this)\n\n\t\t\t\t\t// Needed to correctly size SVG in Firefox\n\t\t\t\t\tDOMUtils.appendOrSelect(deltaArrowSelection, 'rect.gauge-delta-arrow-backdrop')\n\t\t\t\t\t\t.attr('width', '16')\n\t\t\t\t\t\t.attr('height', '16')\n\t\t\t\t\t\t.attr('fill', 'none')\n\n\t\t\t\t\t// Draw the arrow with status\n\t\t\t\t\tconst status = getProperty(options, 'gauge', 'status')\n\t\t\t\t\tDOMUtils.appendOrSelect(deltaArrowSelection, 'polygon.gauge-delta-arrow')\n\t\t\t\t\t\t.attr('class', status !== null ? `gauge-delta-arrow status--${status}` : '')\n\t\t\t\t\t\t.attr('points', self.getArrow(delta))\n\t\t\t\t})\n\n\t\t\tdeltaArrow.exit().remove()\n\t\t\tdeltaNumber.exit().remove()\n\t\t}\n\t}\n\n\tgetInnerRadius() {\n\t\t// Compute the outer radius needed\n\t\tconst radius = this.computeRadius()\n\t\tconst arcWidth = getProperty(this.getOptions(), 'gauge', 'arcWidth')\n\t\treturn radius - arcWidth\n\t}\n\n\taddEventListeners() {\n\t\tconst self = this\n\t\tthis.parent\n\t\t\t.selectAll('path.arc-foreground')\n\t\t\t.on('mouseover', function (event: MouseEvent, datum: any) {\n\t\t\t\t// Dispatch mouse event\n\t\t\t\tself.services.events.dispatchEvent(Events.Gauge.ARC_MOUSEOVER, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: select(this),\n\t\t\t\t\tdatum\n\t\t\t\t})\n\t\t\t})\n\t\t\t.on('mousemove', function (event: MouseEvent, datum: any) {\n\t\t\t\tconst hoveredElement = select(this)\n\n\t\t\t\t// Dispatch mouse event\n\t\t\t\tself.services.events.dispatchEvent(Events.Gauge.ARC_MOUSEMOVE, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: hoveredElement,\n\t\t\t\t\tdatum\n\t\t\t\t})\n\t\t\t})\n\t\t\t.on('click', function (event: MouseEvent, datum: any) {\n\t\t\t\t// Dispatch mouse event\n\t\t\t\tself.services.events.dispatchEvent(Events.Gauge.ARC_CLICK, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: select(this),\n\t\t\t\t\tdatum\n\t\t\t\t})\n\t\t\t})\n\t\t\t.on('mouseout', function (event: MouseEvent, datum: any) {\n\t\t\t\tconst hoveredElement = select(this)\n\n\t\t\t\t// Dispatch mouse event\n\t\t\t\tself.services.events.dispatchEvent(Events.Gauge.ARC_MOUSEOUT, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: hoveredElement,\n\t\t\t\t\tdatum\n\t\t\t\t})\n\t\t\t})\n\t}\n\n\t// Helper functions\n\tprotected computeRadius() {\n\t\tconst options = this.getOptions()\n\t\tconst arcType = getProperty(options, 'gauge', 'type')\n\n\t\tconst { width, height } = DOMUtils.getSVGElementSize(this.parent as any, {\n\t\t\tuseAttrs: true\n\t\t})\n\t\tconst radius =\n\t\t\tarcType === GaugeTypes.SEMI ? Math.min(width / 2, height) : Math.min(width / 2, height / 2)\n\n\t\treturn radius\n\t}\n}\n","import { ScaleBand, scaleBand, select } from 'd3'\nimport { uniq } from 'lodash-es'\nimport { generateSVGPathString, getProperty } from '@/tools'\nimport { Bar } from './bar'\nimport { CartesianOrientations, ColorClassNameTypes, Events, RenderTypes } from '@/interfaces/enums'\nimport { Roles } from '@/interfaces/a11y'\n\nexport class GroupedBar extends Bar {\n\ttype = 'grouped-bar'\n\trenderType = RenderTypes.SVG\n\n\tgroupScale: ScaleBand\n\n\tpadding = 5\n\n\t// A factor to normalize padding between bars regardless of bar group density.\n\treadonly defaultStepFactor = 70\n\n\tinit() {\n\t\tconst eventsFragment = this.services.events\n\n\t\t// Highlight correct circle on legend item hovers\n\t\teventsFragment.addEventListener(Events.Legend.ITEM_HOVER, this.handleLegendOnHover)\n\n\t\t// Un-highlight circles on legend item mouseouts\n\t\teventsFragment.addEventListener(Events.Legend.ITEM_MOUSEOUT, this.handleLegendMouseOut)\n\t}\n\n\trender(animate: boolean) {\n\t\t// Chart options mixed with the internal configurations\n\t\tconst displayData = this.model.getDisplayData(this.configs.groups)\n\t\tconst options = this.getOptions()\n\t\tconst { groupMapsTo } = options.data\n\n\t\t// Get unique labels\n\t\tthis.setGroupScale()\n\n\t\t// Grab container SVG\n\t\tconst svg = this.getComponentContainer({ ariaLabel: 'grouped bar graphs', withinChartClip: true })\n\n\t\tconst allDataLabels = uniq(\n\t\t\tdisplayData.map((datum: any) => {\n\t\t\t\tconst domainIdentifier = this.services.cartesianScales.getDomainIdentifier(datum)\n\n\t\t\t\treturn datum[domainIdentifier] && typeof datum[domainIdentifier].toString === 'function'\n\t\t\t\t\t? datum[domainIdentifier].toString()\n\t\t\t\t\t: datum[domainIdentifier]\n\t\t\t})\n\t\t)\n\n\t\t// Update data on bar groups\n\t\tconst barGroups = svg.selectAll('g.bars').data(allDataLabels, (label: string) => label)\n\n\t\t// Remove dot groups that need to be removed\n\t\tbarGroups.exit().attr('opacity', 0).remove()\n\n\t\t// Add the bar groups that need to be introduced\n\t\tconst barGroupsEnter = barGroups\n\t\t\t.enter()\n\t\t\t.append('g')\n\t\t\t.classed('bars', true)\n\t\t\t.attr('role', Roles.GROUP)\n\t\t\t.attr('data-name', 'bars')\n\n\t\t// Update data on all bars\n\t\tconst allBarGroups = barGroupsEnter.merge(barGroups as any)\n\n\t\tallBarGroups\n\t\t\t// Transition\n\t\t\t.transition()\n\t\t\t.call((t: any) =>\n\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\ttransition: t,\n\t\t\t\t\tname: 'bar-group-update-enter',\n\t\t\t\t\tanimate\n\t\t\t\t})\n\t\t\t)\n\t\t\t.attr('transform', (label: string) => {\n\t\t\t\tconst scaleValue = this.services.cartesianScales.getDomainValue(label)\n\t\t\t\tconst translateBy = scaleValue - this.getGroupWidth() / 2\n\n\t\t\t\tif (this.services.cartesianScales.getOrientation() === CartesianOrientations.VERTICAL) {\n\t\t\t\t\treturn `translate(${translateBy}, 0)`\n\t\t\t\t} else {\n\t\t\t\t\t// translate in the y direction for horizontal groups\n\t\t\t\t\treturn `translate(0, ${translateBy})`\n\t\t\t\t}\n\t\t\t})\n\n\t\tconst bars = allBarGroups.selectAll('path.bar').data(\n\t\t\t(label: string) => this.getDataCorrespondingToLabel(label),\n\t\t\t(d: any) => d[groupMapsTo]\n\t\t)\n\n\t\t// Remove bars that are no longer needed\n\t\tbars.exit().attr('opacity', 0).remove()\n\n\t\t// Add the bars that need to be introduced\n\t\tconst barsEnter = bars.enter().append('path').attr('opacity', 0)\n\n\t\t// code for vertical grouped bar charts\n\t\tbarsEnter\n\t\t\t.merge(bars as any)\n\t\t\t.classed('bar', true)\n\t\t\t.transition()\n\t\t\t.call((t: any) =>\n\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\ttransition: t,\n\t\t\t\t\tname: 'bar-update-enter',\n\t\t\t\t\tanimate\n\t\t\t\t})\n\t\t\t)\n\t\t\t.attr('class', (d: any) =>\n\t\t\t\tthis.model.getColorClassName({\n\t\t\t\t\tclassNameTypes: [ColorClassNameTypes.FILL],\n\t\t\t\t\tdataGroupName: d[groupMapsTo],\n\t\t\t\t\toriginalClassName: 'bar'\n\t\t\t\t})\n\t\t\t)\n\t\t\t.style('fill', (d: any) => {\n\t\t\t\tconst domainIdentifier = this.services.cartesianScales.getDomainIdentifier(d)\n\t\t\t\treturn this.model.getFillColor(d[groupMapsTo], d[domainIdentifier], d)\n\t\t\t})\n\t\t\t.attr('d', (d: any) => {\n\t\t\t\t/*\n\t\t\t\t * Orientation support for horizontal/vertical bar charts\n\t\t\t\t * Determine coordinates needed for a vertical set of paths\n\t\t\t\t * to draw the bars needed, and pass those coordinates down to\n\t\t\t\t * generateSVGPathString() to decide whether it needs to flip them\n\t\t\t\t */\n\t\t\t\tconst startX = this.groupScale(d[groupMapsTo])\n\t\t\t\tconst barWidth = this.getBarWidth()\n\n\t\t\t\tconst x0 = startX\n\t\t\t\tconst x1 = startX + barWidth\n\t\t\t\tconst rangeAxis = this.services.cartesianScales.getRangeAxisPosition({ datum: d })\n\t\t\t\tconst lowerBound = this.services.cartesianScales.getDomainLowerBound(rangeAxis)\n\t\t\t\tconst y0 = this.services.cartesianScales.getValueThroughAxisPosition(rangeAxis, lowerBound)\n\t\t\t\tconst y1 = this.services.cartesianScales.getRangeValue(d)\n\n\t\t\t\t// don't show if part of bar is out of zoom domain - test zoom on bar pos, not group\n\t\t\t\tconst zoomx0 = this.services.cartesianScales.getDomainValue(d) - barWidth / 2\n\t\t\t\tconst zoomx1 = zoomx0 + barWidth\n\t\t\t\tif (this.isOutsideZoomedDomain(zoomx0, zoomx1)) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\treturn generateSVGPathString(\n\t\t\t\t\t{ x0, x1, y0, y1 },\n\t\t\t\t\tthis.services.cartesianScales.getOrientation()\n\t\t\t\t)\n\t\t\t})\n\t\t\t.attr('opacity', 1)\n\t\t\t// a11y\n\t\t\t.attr('role', Roles.GRAPHICS_SYMBOL)\n\t\t\t.attr('aria-roledescription', 'bar')\n\t\t\t.attr('aria-label', (d: any) => d.value)\n\n\t\t// Add event listeners to elements drawn\n\t\tthis.addEventListeners()\n\t}\n\n\t// Highlight elements that match the hovered legend item\n\thandleLegendOnHover = (event: CustomEvent) => {\n\t\tconst { hoveredElement } = event.detail\n\n\t\tconst { groupMapsTo } = this.getOptions().data\n\n\t\tthis.parent\n\t\t\t.selectAll('path.bar')\n\t\t\t.transition('legend-hover-bar')\n\t\t\t.call((t: any) =>\n\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\ttransition: t,\n\t\t\t\t\tname: 'legend-hover-bar'\n\t\t\t\t})\n\t\t\t)\n\t\t\t.attr('opacity', (d: any) => (d[groupMapsTo] !== hoveredElement.datum()['name'] ? 0.3 : 1))\n\t}\n\n\t// Un-highlight all elements\n\thandleLegendMouseOut = () => {\n\t\tthis.parent\n\t\t\t.selectAll('path.bar')\n\t\t\t.transition('legend-mouseout-bar')\n\t\t\t.call((t: any) =>\n\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\ttransition: t,\n\t\t\t\t\tname: 'legend-mouseout-bar'\n\t\t\t\t})\n\t\t\t)\n\t\t\t.attr('opacity', 1)\n\t}\n\n\taddEventListeners() {\n\t\tconst self = this\n\n\t\tthis.parent\n\t\t\t.selectAll('path.bar')\n\t\t\t.on('mouseover', function (event: MouseEvent, datum: any) {\n\t\t\t\tconst hoveredElement = select(this)\n\t\t\t\thoveredElement.classed('hovered', true)\n\n\t\t\t\t// Dispatch mouse event\n\t\t\t\tself.services.events.dispatchEvent(Events.Bar.BAR_MOUSEOVER, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: hoveredElement,\n\t\t\t\t\tdatum\n\t\t\t\t})\n\n\t\t\t\t// Show tooltip\n\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.SHOW, {\n\t\t\t\t\tevent,\n\t\t\t\t\thoveredElement,\n\t\t\t\t\tdata: [datum]\n\t\t\t\t})\n\t\t\t})\n\t\t\t.on('mousemove', function (event: MouseEvent, datum: any) {\n\t\t\t\tconst hoveredElement = select(this)\n\n\t\t\t\t// Dispatch mouse event\n\t\t\t\tself.services.events.dispatchEvent(Events.Bar.BAR_MOUSEMOVE, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: hoveredElement,\n\t\t\t\t\tdatum\n\t\t\t\t})\n\n\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.MOVE, {\n\t\t\t\t\tevent\n\t\t\t\t})\n\t\t\t})\n\t\t\t.on('click', function (event: MouseEvent, datum: any) {\n\t\t\t\t// Dispatch mouse event\n\t\t\t\tself.services.events.dispatchEvent(Events.Bar.BAR_CLICK, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: select(this),\n\t\t\t\t\tdatum\n\t\t\t\t})\n\t\t\t})\n\t\t\t.on('mouseout', function (event: MouseEvent, datum: any) {\n\t\t\t\tconst hoveredElement = select(this)\n\t\t\t\thoveredElement.classed('hovered', false)\n\n\t\t\t\t// Dispatch mouse event\n\t\t\t\tself.services.events.dispatchEvent(Events.Bar.BAR_MOUSEOUT, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: hoveredElement,\n\t\t\t\t\tdatum\n\t\t\t\t})\n\n\t\t\t\t// Hide tooltip\n\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.HIDE, {\n\t\t\t\t\thoveredElement\n\t\t\t\t})\n\t\t\t})\n\t}\n\n\tdestroy() {\n\t\t// Remove event listeners\n\t\tthis.parent\n\t\t\t.selectAll('path.bar')\n\t\t\t.on('mouseover', null)\n\t\t\t.on('mousemove', null)\n\t\t\t.on('mouseout', null)\n\n\t\t// Remove legend listeners\n\t\tconst eventsFragment = this.services.events\n\t\teventsFragment.removeEventListener(Events.Legend.ITEM_HOVER, this.handleLegendOnHover)\n\t\teventsFragment.removeEventListener(Events.Legend.ITEM_MOUSEOUT, this.handleLegendMouseOut)\n\t}\n\n\tprotected getDataCorrespondingToLabel(label: string) {\n\t\tconst displayData = this.model.getDisplayData(this.configs.groups)\n\n\t\treturn displayData.filter((datum: any) => {\n\t\t\tconst domainIdentifier = this.services.cartesianScales.getDomainIdentifier(datum)\n\t\t\treturn datum[domainIdentifier].toString() === label\n\t\t})\n\t}\n\n\tprotected getGroupWidth() {\n\t\tconst activeData = this.model.getGroupedData(this.configs.groups)\n\t\tconst totalGroupPadding = this.getTotalGroupPadding()\n\n\t\treturn this.getBarWidth() * activeData.length + totalGroupPadding\n\t}\n\n\tprotected getDomainScaleStep() {\n\t\tconst domainScale =\n\t\t\tthis.services.cartesianScales.getDomainScale() as unknown as ScaleBand\n\t\tconst activeData = this.model.getGroupedData(this.configs.groups)\n\n\t\tlet step = this.defaultStepFactor\n\t\tif (typeof (domainScale as any).step === 'function') {\n\t\t\tstep = domainScale.step()\n\t\t} else if (activeData.length > 0) {\n\t\t\t// as a fallback use distance between first bars of adjacent bar groups\n\t\t\tconst ref = activeData.find((d: any) => d.data?.length > 1)\n\t\t\tif (ref) {\n\t\t\t\tconst domainIdentifier = this.services.cartesianScales.getDomainIdentifier(ref.data[0])\n\t\t\t\tstep = Math.abs(\n\t\t\t\t\tdomainScale(ref.data[1][domainIdentifier]) - domainScale(ref.data[0][domainIdentifier])\n\t\t\t\t)\n\t\t\t}\n\t\t}\n\t\treturn step\n\t}\n\n\tprotected getTotalGroupPadding() {\n\t\tconst activeData = this.model.getGroupedData(this.configs.groups)\n\n\t\tif (activeData.length === 1) {\n\t\t\treturn 0\n\t\t}\n\n\t\tconst padding = Math.min(5, 5 * (this.getDomainScaleStep() / this.defaultStepFactor))\n\n\t\treturn padding * (activeData.length - 1)\n\t}\n\n\t// Gets the correct width for bars based on options & configurations\n\tprotected getBarWidth() {\n\t\tconst options = this.getOptions()\n\t\tconst providedWidth = getProperty(options, 'bars', 'width')\n\t\tconst providedMaxWidth = getProperty(options, 'bars', 'maxWidth')\n\n\t\t// If there's a provided width, compare with maxWidth and\n\t\t// Determine which to return\n\t\tif (providedWidth !== null) {\n\t\t\tif (providedMaxWidth === null || providedWidth <= providedMaxWidth) {\n\t\t\t\treturn providedWidth\n\t\t\t}\n\t\t}\n\n\t\tconst activeData = this.model.getGroupedData(this.configs.groups)\n\t\tconst numOfActiveDataGroups = activeData.length\n\t\tconst totalGroupPadding = this.getTotalGroupPadding()\n\n\t\treturn Math.min(\n\t\t\tprovidedMaxWidth,\n\t\t\t(this.getDomainScaleStep() - totalGroupPadding) / numOfActiveDataGroups\n\t\t)\n\t}\n\n\tprotected setGroupScale() {\n\t\tconst activeData = this.model.getActiveDataGroupNames(this.configs.groups)\n\n\t\tthis.groupScale = scaleBand().domain(activeData).rangeRound([0, this.getGroupWidth()])\n\t}\n}\n","import { min, select } from 'd3'\nimport { get } from 'lodash-es'\nimport { getProperty, getTransformOffsets } from '@/tools'\nimport { heatmap as heatmapConfigs } from '@/configuration'\nimport { Component } from '@/components/component'\nimport { Events, RenderTypes, DividerStatus } from '@/interfaces/enums'\nimport { DOMUtils } from '@/services/essentials/dom-utils'\nimport { HeatmapModel } from '@/model/heatmap'\n\nexport class Heatmap extends Component {\n\ttype = 'heatmap'\n\trenderType = RenderTypes.SVG\n\n\tprivate matrix: any = {}\n\tprivate xBandwidth = 0\n\tprivate yBandwidth = 0\n\tprivate translationUnits = {\n\t\tx: 0,\n\t\ty: 0\n\t}\n\n\tinit() {\n\t\tconst eventsFragment = this.services.events\n\n\t\t// Highlight correct cells on Axis item hovers\n\t\teventsFragment.addEventListener(Events.Axis.LABEL_MOUSEOVER, this.handleAxisOnHover)\n\n\t\t// Highlight correct cells on Axis item mouseouts\n\t\teventsFragment.addEventListener(Events.Axis.LABEL_MOUSEOUT, this.handleAxisMouseOut)\n\n\t\t// Highlight correct cells on Axis item focus\n\t\teventsFragment.addEventListener(Events.Axis.LABEL_FOCUS, this.handleAxisOnHover)\n\n\t\t// Highlight correct cells on Axis item blur\n\t\teventsFragment.addEventListener(Events.Axis.LABEL_BLUR, this.handleAxisMouseOut)\n\t}\n\n\t// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n\t// @ts-ignore\n\t// eslint-disable-next-line @typescript-eslint/no-unused-vars\n\trender(animate = true) {\n\t\tconst svg = this.getComponentContainer({ ariaLabel: 'heatmap', withinChartClip: true })\n\t\t// Lower the chart so the axes are always visible\n\t\tsvg.lower()\n\n\t\tconst { cartesianScales } = this.services\n\t\tthis.matrix = (this.model as HeatmapModel).getMatrix()\n\n\t\tsvg.html('')\n\n\t\tif (getProperty(this.getOptions(), 'data', 'loading')) {\n\t\t\treturn\n\t\t}\n\n\t\t// determine x and y axis scale\n\t\tconst mainXScale = cartesianScales.getMainXScale()\n\t\tconst mainYScale = cartesianScales.getMainYScale()\n\t\tconst domainIdentifier = cartesianScales.getDomainIdentifier()\n\t\tconst rangeIdentifier = cartesianScales.getRangeIdentifier()\n\n\t\t// Get unique axis values & create a matrix\n\t\tconst uniqueDomain = (this.model as HeatmapModel).getUniqueDomain()\n\t\tconst uniqueRange = (this.model as HeatmapModel).getUniqueRanges()\n\n\t\t// Get matrix in the form of an array to create a single heatmap group\n\t\tconst matrixArray = (this.model as HeatmapModel).getMatrixAsArray()\n\n\t\t// Get available chart area\n\t\tconst xRange = mainXScale.range()\n\t\tconst yRange = mainYScale.range()\n\n\t\t// Determine rectangle dimensions based on the number of unique domain and range\n\t\tthis.xBandwidth = Math.abs((xRange[1] - xRange[0]) / uniqueDomain.length)\n\t\tthis.yBandwidth = Math.abs((yRange[1] - yRange[0]) / uniqueRange.length)\n\n\t\tconst patternID = this.services.domUtils.generateElementIDString(`heatmap-pattern-stripes`)\n\n\t\t// Create a striped pattern for missing data\n\t\tsvg\n\t\t\t.append('defs')\n\t\t\t.append('pattern')\n\t\t\t.attr('id', patternID)\n\t\t\t.attr('width', 3)\n\t\t\t.attr('height', 3)\n\t\t\t.attr('patternUnits', 'userSpaceOnUse')\n\t\t\t.attr('patternTransform', 'rotate(45)')\n\t\t\t.append('rect')\n\t\t\t.classed('pattern-fill', true)\n\t\t\t.attr('width', 0.5)\n\t\t\t.attr('height', 8)\n\n\t\tconst rectangles = svg\n\t\t\t.selectAll()\n\t\t\t.data(matrixArray)\n\t\t\t.enter()\n\t\t\t.append('g')\n\t\t\t.attr('class', (d: any) => `heat-${d.index}`)\n\t\t\t.classed('cell', true)\n\t\t\t.attr(\n\t\t\t\t'transform',\n\t\t\t\t(d: any) =>\n\t\t\t\t\t`translate(${mainXScale(d[domainIdentifier])}, ${mainYScale(d[rangeIdentifier])})`\n\t\t\t)\n\t\t\t.append('rect')\n\t\t\t.attr('class', (d: any) =>\n\t\t\t\tthis.model.getColorClassName({\n\t\t\t\t\tvalue: d.value,\n\t\t\t\t\toriginalClassName: `heat-${d.index}`\n\t\t\t\t})\n\t\t\t)\n\t\t\t.classed('heat', true)\n\t\t\t.classed('null-state', (d: any) => (d.index === -1 || d.value === null ? true : false))\n\t\t\t.attr('width', this.xBandwidth)\n\t\t\t.attr('height', this.yBandwidth)\n\t\t\t.style('fill', (d: any) => {\n\t\t\t\tconst domainIdentifierFill = this.services.cartesianScales.getDomainIdentifier(d)\n\t\t\t\t// Check if a valid value exists\n\t\t\t\tif (d.index === -1 || d.value === null) {\n\t\t\t\t\treturn `url(#${patternID})`\n\t\t\t\t}\n\t\t\t\treturn this.model.getFillColor(Number(d.value), d[domainIdentifierFill], d)\n\t\t\t})\n\t\t\t.attr('aria-label', (d: any) => d.value)\n\n\t\t// Cell highlight box\n\t\tthis.createOuterBox('g.cell-highlight', this.xBandwidth, this.yBandwidth)\n\t\t// Column highlight box\n\t\tthis.createOuterBox(\n\t\t\t'g.multi-cell.column-highlight',\n\t\t\tthis.xBandwidth,\n\t\t\tMath.abs(yRange[1] - yRange[0])\n\t\t)\n\t\t// Row highlight box\n\t\tthis.createOuterBox(\n\t\t\t'g.multi-cell.row-highlight',\n\t\t\tMath.abs(xRange[1] - xRange[0]),\n\t\t\tthis.yBandwidth\n\t\t)\n\n\t\tif (this.determineDividerStatus()) {\n\t\t\trectangles.style('stroke-width', '1px')\n\t\t\tthis.parent.select('g.cell-highlight').classed('cell-2', true)\n\t\t}\n\n\t\tthis.addEventListener()\n\t}\n\n\t/**\n\t * Generates a box using lines to create a hover effect\n\t * The lines have drop shadow in their respective direction\n\t * @param parentTag - tag name\n\t * @param xBandwidth - X length\n\t * @param yBandwidth - y length\n\t */\n\tprivate createOuterBox(parentTag: string, xBandwidth: number, yBandwidth: number) {\n\t\t// Create a highlighter in the parent component so the shadow and the lines do not get clipped\n\t\tconst highlight = DOMUtils.appendOrSelect(this.parent, parentTag)\n\t\t\t.classed('shadows', true)\n\t\t\t.classed('highlighter-hidden', true)\n\n\t\tDOMUtils.appendOrSelect(highlight, 'line.top')\n\t\t\t.attr('x1', -1)\n\t\t\t.attr('x2', xBandwidth + 1)\n\n\t\tDOMUtils.appendOrSelect(highlight, 'line.left')\n\t\t\t.attr('x1', 0)\n\t\t\t.attr('y1', -1)\n\t\t\t.attr('x2', 0)\n\t\t\t.attr('y2', yBandwidth + 1)\n\n\t\tDOMUtils.appendOrSelect(highlight, 'line.down')\n\t\t\t.attr('x1', -1)\n\t\t\t.attr('x2', xBandwidth + 1)\n\t\t\t.attr('y1', yBandwidth)\n\t\t\t.attr('y2', yBandwidth)\n\n\t\tDOMUtils.appendOrSelect(highlight, 'line.right')\n\t\t\t.attr('x1', xBandwidth)\n\t\t\t.attr('x2', xBandwidth)\n\t\t\t.attr('y1', -1)\n\t\t\t.attr('y2', yBandwidth + 1)\n\t}\n\n\tprivate determineDividerStatus(): boolean {\n\t\t// Add dividers if status is not off, will assume auto or on by default.\n\t\tconst dividerStatus = getProperty(this.getOptions(), 'heatmap', 'divider', 'state')\n\n\t\t// Determine if cell divider should be displayed\n\t\tif (dividerStatus !== DividerStatus.OFF) {\n\t\t\tif (\n\t\t\t\t(dividerStatus === DividerStatus.AUTO &&\n\t\t\t\t\theatmapConfigs.minCellDividerDimension <= this.xBandwidth &&\n\t\t\t\t\theatmapConfigs.minCellDividerDimension <= this.yBandwidth) ||\n\t\t\t\tdividerStatus === DividerStatus.ON\n\t\t\t) {\n\t\t\t\treturn true\n\t\t\t}\n\t\t}\n\n\t\treturn false\n\t}\n\n\taddEventListener() {\n\t\tconst self = this\n\t\tconst { cartesianScales } = this.services\n\t\tconst options = this.getOptions()\n\t\tconst totalLabel =\n\t\t\tget(options, 'locale.translations.total') || get(options, 'tooltip.totalLabel') || 'Total'\n\n\t\tconst domainIdentifier = cartesianScales.getDomainIdentifier()\n\t\tconst rangeIdentifier = cartesianScales.getRangeIdentifier()\n\n\t\tconst domainLabel = cartesianScales.getDomainLabel()\n\t\tconst rangeLabel = cartesianScales.getRangeLabel()\n\n\t\tthis.parent\n\t\t\t.selectAll('g.cell')\n\t\t\t.on('mouseover', function (event: MouseEvent, datum: any) {\n\t\t\t\tconst cell = select(this)\n\t\t\t\tconst hoveredElement = cell.select('rect.heat')\n\t\t\t\tconst nullState = hoveredElement.classed('null-state')\n\n\t\t\t\t// Dispatch event and tooltip only if value exists\n\t\t\t\tif (!nullState) {\n\t\t\t\t\t// Get transformation value of node\n\t\t\t\t\tconst transform = getTransformOffsets(cell.attr('transform'))\n\n\t\t\t\t\tself.parent\n\t\t\t\t\t\t.select('g.cell-highlight')\n\t\t\t\t\t\t.attr(\n\t\t\t\t\t\t\t'transform',\n\t\t\t\t\t\t\t`translate(${transform.x + self.translationUnits.x}, ${\n\t\t\t\t\t\t\t\ttransform.y + self.translationUnits.y\n\t\t\t\t\t\t\t})`\n\t\t\t\t\t\t)\n\t\t\t\t\t\t.classed('highlighter-hidden', false)\n\n\t\t\t\t\t// Dispatch mouse over event\n\t\t\t\t\tself.services.events.dispatchEvent(Events.Heatmap.HEATMAP_MOUSEOVER, {\n\t\t\t\t\t\tevent,\n\t\t\t\t\t\telement: hoveredElement,\n\t\t\t\t\t\tdatum: datum\n\t\t\t\t\t})\n\n\t\t\t\t\t// Dispatch tooltip show event\n\t\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.SHOW, {\n\t\t\t\t\t\tevent,\n\t\t\t\t\t\titems: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tlabel: domainLabel,\n\t\t\t\t\t\t\t\tvalue: datum[domainIdentifier]\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tlabel: rangeLabel,\n\t\t\t\t\t\t\t\tvalue: datum[rangeIdentifier]\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tlabel: totalLabel,\n\t\t\t\t\t\t\t\tvalue: datum['value'],\n\t\t\t\t\t\t\t\tcolor: hoveredElement.style('fill')\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t]\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t})\n\t\t\t.on('mousemove', function (event: MouseEvent, datum: any) {\n\t\t\t\t// Dispatch mouse move event\n\t\t\t\tself.services.events.dispatchEvent(Events.Heatmap.HEATMAP_MOUSEMOVE, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: select(this),\n\t\t\t\t\tdatum: datum\n\t\t\t\t})\n\t\t\t\t// Dispatch tooltip move event\n\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.MOVE, {\n\t\t\t\t\tevent\n\t\t\t\t})\n\t\t\t})\n\t\t\t.on('click', function (event: MouseEvent, datum: any) {\n\t\t\t\t// Dispatch mouse click event\n\t\t\t\tself.services.events.dispatchEvent(Events.Heatmap.HEATMAP_CLICK, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: select(this),\n\t\t\t\t\tdatum: datum\n\t\t\t\t})\n\t\t\t})\n\t\t\t.on('mouseout', function (event: MouseEvent, datum: any) {\n\t\t\t\tconst cell = select(this)\n\t\t\t\tconst hoveredElement = cell.select('rect.heat')\n\t\t\t\tconst nullState = hoveredElement.classed('null-state')\n\n\t\t\t\tself.parent.select('g.cell-highlight').classed('highlighter-hidden', true)\n\n\t\t\t\t// Dispatch event and tooltip only if value exists\n\t\t\t\tif (!nullState) {\n\t\t\t\t\t// Dispatch mouse out event\n\t\t\t\t\tself.services.events.dispatchEvent(Events.Heatmap.HEATMAP_MOUSEOUT, {\n\t\t\t\t\t\tevent,\n\t\t\t\t\t\telement: hoveredElement,\n\t\t\t\t\t\tdatum: datum\n\t\t\t\t\t})\n\n\t\t\t\t\t// Dispatch hide tooltip event\n\t\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.HIDE, {\n\t\t\t\t\t\tevent,\n\t\t\t\t\t\thoveredElement\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t})\n\t}\n\n\t// Highlight elements that match the hovered axis item\n\thandleAxisOnHover = (event: CustomEvent) => {\n\t\tconst { detail } = event\n\t\tconst { datum } = detail\n\t\t// Unique ranges and domains\n\t\tconst ranges = (this.model as HeatmapModel).getUniqueRanges()\n\t\tconst domains = (this.model as HeatmapModel).getUniqueDomain()\n\t\t// Labels\n\t\tconst domainLabel = this.services.cartesianScales.getDomainLabel()\n\t\tconst rangeLabel = this.services.cartesianScales.getRangeLabel()\n\t\t// Scales\n\t\tconst mainXScale = this.services.cartesianScales.getMainXScale()\n\t\tconst mainYScale = this.services.cartesianScales.getMainYScale()\n\n\t\tlet label = '',\n\t\t\tsum: any = null,\n\t\t\tminimum: any = null,\n\t\t\tmaximum: any = null\n\n\t\t// Check to see where datum belongs\n\t\tif (this.matrix[datum] !== undefined) {\n\t\t\tlabel = domainLabel\n\t\t\t// Iterate through Object and get sum, min, and max\n\t\t\tranges.forEach((element: any) => {\n\t\t\t\tif (typeof this.matrix[datum][element].value === 'number') {\n\t\t\t\t\tconst value = this.matrix[datum][element].value\n\t\t\t\t\tif (sum === null) {\n\t\t\t\t\t\tsum = value\n\t\t\t\t\t\tminimum = value\n\t\t\t\t\t\tmaximum = value\n\t\t\t\t\t\treturn\n\t\t\t\t\t}\n\t\t\t\t\tsum += value\n\t\t\t\t\tminimum = value < minimum ? value : minimum\n\t\t\t\t\tmaximum = value > maximum ? value : maximum\n\t\t\t\t}\n\t\t\t})\n\t\t} else {\n\t\t\tlabel = rangeLabel\n\t\t\tdomains.forEach((element: any) => {\n\t\t\t\tif (typeof this.matrix[element][datum].value === 'number') {\n\t\t\t\t\tconst value = this.matrix[element][datum].value\n\t\t\t\t\tif (sum === null) {\n\t\t\t\t\t\tsum = value\n\t\t\t\t\t\tminimum = value\n\t\t\t\t\t\tmaximum = value\n\t\t\t\t\t\treturn\n\t\t\t\t\t}\n\t\t\t\t\tsum += value\n\t\t\t\t\tminimum = value < minimum ? value : minimum\n\t\t\t\t\tmaximum = value > maximum ? value : maximum\n\t\t\t\t}\n\t\t\t})\n\t\t}\n\n\t\tif (mainXScale(datum) !== undefined) {\n\t\t\tthis.parent\n\t\t\t\t.select('g.multi-cell.column-highlight')\n\t\t\t\t.classed('highlighter-hidden', false)\n\t\t\t\t.attr('transform', `translate(${mainXScale(datum)}, ${min(mainYScale.range())})`)\n\t\t} else if (mainYScale(datum) !== undefined) {\n\t\t\tthis.parent\n\t\t\t\t.select('g.multi-cell.row-highlight')\n\t\t\t\t.classed('highlighter-hidden', false)\n\t\t\t\t.attr('transform', `translate(${min(mainXScale.range())},${mainYScale(datum)})`)\n\t\t}\n\n\t\t// Dispatch tooltip show event\n\t\tthis.services.events.dispatchEvent(Events.Tooltip.SHOW, {\n\t\t\tevent: detail.event,\n\t\t\thoveredElement: select(event.detail.element),\n\t\t\titems: [\n\t\t\t\t{\n\t\t\t\t\tlabel: label,\n\t\t\t\t\tvalue: datum,\n\t\t\t\t\tbold: true\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: 'Min',\n\t\t\t\t\tvalue: minimum !== null ? minimum : '-'\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: 'Max',\n\t\t\t\t\tvalue: maximum !== null ? maximum : '-'\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: 'Average',\n\t\t\t\t\tvalue: sum !== null ? sum / domains.length : '-'\n\t\t\t\t}\n\t\t\t]\n\t\t})\n\t}\n\n\t// Un-highlight all elements\n\thandleAxisMouseOut = (event: CustomEvent) => {\n\t\t// Hide column/row\n\t\tthis.parent.selectAll('g.multi-cell').classed('highlighter-hidden', true)\n\n\t\t// Dispatch hide tooltip event\n\t\tthis.services.events.dispatchEvent(Events.Tooltip.HIDE, {\n\t\t\tevent\n\t\t})\n\t}\n\n\t// Remove event listeners\n\tdestroy() {\n\t\tthis.parent\n\t\t\t.selectAll('rect.heat')\n\t\t\t.on('mouseover', null)\n\t\t\t.on('mousemove', null)\n\t\t\t.on('click', null)\n\t\t\t.on('mouseout', null)\n\n\t\t// Remove legend listeners\n\t\tconst eventsFragment = this.services.events\n\t\teventsFragment.removeEventListener(Events.Legend.ITEM_HOVER, this.handleAxisOnHover)\n\t\teventsFragment.removeEventListener(Events.Legend.ITEM_MOUSEOUT, this.handleAxisMouseOut)\n\t}\n}\n","import { select } from 'd3'\nimport { get } from 'lodash-es'\nimport { generateSVGPathString, getProperty } from '@/tools'\nimport { Events, CartesianOrientations, ColorClassNameTypes, RenderTypes } from '@/interfaces/enums'\nimport { Roles } from '@/interfaces/a11y'\nimport { Component } from '@/components/component'\n\nexport class Histogram extends Component {\n\ttype = 'histogram'\n\trenderType = RenderTypes.SVG\n\n\tinit() {\n\t\tconst eventsFragment = this.services.events\n\n\t\t// Highlight correct circle on legend item hovers\n\t\teventsFragment.addEventListener(Events.Legend.ITEM_HOVER, this.handleLegendOnHover)\n\n\t\t// Un-highlight circles on legend item mouseouts\n\t\teventsFragment.addEventListener(Events.Legend.ITEM_MOUSEOUT, this.handleLegendMouseOut)\n\t}\n\n\trender(animate: boolean) {\n\t\t// Grab container SVG\n\t\tconst svg = this.getComponentContainer({\n\t\t\tariaLabel: 'histogram bars'\n\t\t})\n\n\t\t// Chart options mixed with the internal configurations\n\t\tconst options = this.model.getOptions()\n\t\tconst { groupIdentifier } = options\n\t\tconst { groupMapsTo } = options.data\n\n\t\tconst binnedStackedData = this.model.getBinnedStackedData()\n\n\t\tconst x = this.services.cartesianScales.getMainXScale()\n\n\t\t// Update data on all bar groups\n\t\tconst barGroups = svg\n\t\t\t.selectAll('g.bars')\n\t\t\t.data(binnedStackedData, (d: any) => get(d, `0.${groupMapsTo}`))\n\n\t\tbarGroups.exit().attr('opacity', 0).remove()\n\n\t\t// Add bar groups that need to be introduced\n\t\tbarGroups.enter().append('g').classed('bars', true).attr('role', Roles.GROUP)\n\n\t\t// Update data on all bars\n\t\tconst bars = svg\n\t\t\t.selectAll('g.bars')\n\t\t\t.selectAll('path.bar')\n\t\t\t.data((data: any) => data)\n\n\t\t// Remove bars that need to be removed\n\t\tbars.exit().remove()\n\n\t\tbars\n\t\t\t.enter()\n\t\t\t.append('path')\n\t\t\t.merge(bars as any)\n\t\t\t.classed('bar', true)\n\t\t\t.attr(groupIdentifier, (_: any, i: number) => i)\n\t\t\t.transition()\n\t\t\t.call((t: any) =>\n\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\ttransition: t,\n\t\t\t\t\tname: 'histogram-bar-update-enter',\n\t\t\t\t\tanimate\n\t\t\t\t})\n\t\t\t)\n\t\t\t.attr('class', (d: any) =>\n\t\t\t\tthis.model.getColorClassName({\n\t\t\t\t\tclassNameTypes: [ColorClassNameTypes.FILL],\n\t\t\t\t\tdataGroupName: d[groupMapsTo],\n\t\t\t\t\toriginalClassName: 'bar'\n\t\t\t\t})\n\t\t\t)\n\t\t\t.style('fill', (d: any) => this.model.getFillColor(d[groupMapsTo], null, d))\n\t\t\t.attr('d', (d: any) => {\n\t\t\t\tconst bin = get(d, 'data')\n\n\t\t\t\tif (!bin) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\n\t\t\t\t/*\n\t\t\t\t * Orientation support for horizontal/vertical bar charts\n\t\t\t\t * Determine coordinates needed for a vertical set of paths\n\t\t\t\t * to draw the bars needed, and pass those coordinates down to\n\t\t\t\t * generateSVGPathString() to decide whether it needs to flip them\n\t\t\t\t */\n\t\t\t\tconst barWidth = x(bin.x1) - x(bin.x0) - 1\n\t\t\t\tconst x0 = this.services.cartesianScales.getDomainValue(bin.x0) as number\n\t\t\t\tconst x1 = x0 + barWidth\n\n\t\t\t\tconst y0 = this.services.cartesianScales.getRangeValue(d[0]) as number\n\t\t\t\tlet y1 = this.services.cartesianScales.getRangeValue(d[1]) as number\n\n\t\t\t\t// Add the divider gap\n\t\t\t\tif (Math.abs(y1 - y0) > 0 && Math.abs(y1 - y0) > options.bars.dividerSize) {\n\t\t\t\t\tif (this.services.cartesianScales.getOrientation() === CartesianOrientations.VERTICAL) {\n\t\t\t\t\t\ty1 += 1\n\t\t\t\t\t} else {\n\t\t\t\t\t\ty1 -= 1\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn generateSVGPathString(\n\t\t\t\t\t{ x0, x1, y0, y1 },\n\t\t\t\t\tthis.services.cartesianScales.getOrientation()\n\t\t\t\t)\n\t\t\t})\n\t\t\t.attr('opacity', 1)\n\t\t\t// a11y\n\t\t\t.attr('role', Roles.GRAPHICS_SYMBOL)\n\t\t\t.attr('aria-roledescription', 'bar')\n\t\t\t.attr('aria-label', (d: any) => getProperty(d, 'data', d[groupMapsTo]))\n\n\t\t// Add event listeners for the above elements\n\t\tthis.addEventListeners()\n\t}\n\n\t// Highlight elements that match the hovered legend item\n\thandleLegendOnHover = (event: CustomEvent) => {\n\t\tconst { hoveredElement } = event.detail\n\n\t\tconst options = this.getOptions()\n\t\tconst { groupMapsTo } = options.data\n\n\t\tthis.parent\n\t\t\t.selectAll('path.bar')\n\t\t\t.transition('legend-hover-bar')\n\t\t\t.call((t: any) =>\n\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\ttransition: t,\n\t\t\t\t\tname: 'legend-hover-bar'\n\t\t\t\t})\n\t\t\t)\n\t\t\t.attr('opacity', (d: any) => (d[groupMapsTo] !== hoveredElement.datum()['name'] ? 0.3 : 1))\n\t}\n\n\t// Un-highlight all elements\n\thandleLegendMouseOut = () => {\n\t\tthis.parent\n\t\t\t.selectAll('path.bar')\n\t\t\t.transition('legend-mouseout-bar')\n\t\t\t.call((t: any) =>\n\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\ttransition: t,\n\t\t\t\t\tname: 'legend-mouseout-bar'\n\t\t\t\t})\n\t\t\t)\n\t\t\t.attr('opacity', 1)\n\t}\n\n\taddEventListeners() {\n\t\tconst options = this.model.getOptions()\n\t\tconst { groupMapsTo } = options.data\n\t\tconst { code: localeCode, number: numberFormatter } = getProperty(options, 'locale')\n\t\tconst self = this\n\t\tthis.parent\n\t\t\t.selectAll('path.bar')\n\t\t\t.on('mouseover', function (event: MouseEvent, datum: any) {\n\t\t\t\tconst hoveredElement = select(this)\n\n\t\t\t\thoveredElement.classed('hovered', true)\n\n\t\t\t\tconst x0 = numberFormatter(parseFloat(get(datum, 'data.x0')), localeCode)\n\t\t\t\tconst x1 = numberFormatter(parseFloat(get(datum, 'data.x1')), localeCode)\n\n\t\t\t\tconst rangeAxisPosition = self.services.cartesianScales.getRangeAxisPosition()\n\t\t\t\tconst rangeScaleLabel = self.services.cartesianScales.getScaleLabel(rangeAxisPosition)\n\n\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.SHOW, {\n\t\t\t\t\tevent,\n\t\t\t\t\thoveredElement,\n\t\t\t\t\titems: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel: get(options, 'bins.rangeLabel') || 'Range',\n\t\t\t\t\t\t\tvalue: `${x0} – ${x1}`\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel: options.tooltip.groupLabel || 'Group',\n\t\t\t\t\t\t\tvalue: datum[groupMapsTo],\n\t\t\t\t\t\t\tclass: self.model.getColorClassName({\n\t\t\t\t\t\t\t\tclassNameTypes: [ColorClassNameTypes.TOOLTIP],\n\t\t\t\t\t\t\t\tdataGroupName: datum[groupMapsTo]\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel: rangeScaleLabel,\n\t\t\t\t\t\t\tvalue: get(datum, `data.${datum[groupMapsTo]}`)\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t})\n\t\t\t})\n\t\t\t.on('mousemove', function (event: MouseEvent) {\n\t\t\t\t// Show tooltip\n\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.MOVE, {\n\t\t\t\t\tevent\n\t\t\t\t})\n\t\t\t})\n\t\t\t.on('mouseout', function () {\n\t\t\t\tconst hoveredElement = select(this)\n\n\t\t\t\t// Select all same group elements\n\t\t\t\thoveredElement.classed('hovered', false)\n\n\t\t\t\t// Hide tooltip\n\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.HIDE)\n\t\t\t})\n\t}\n\n\tdestroy() {\n\t\t// Remove event listeners\n\t\tthis.parent\n\t\t\t.selectAll('path.bar')\n\t\t\t.on('mouseover', null)\n\t\t\t.on('mousemove', null)\n\t\t\t.on('mouseout', null)\n\n\t\t// Remove legend listeners\n\t\tconst eventsFragment = this.services.events\n\t\teventsFragment.removeEventListener(Events.Legend.ITEM_HOVER, this.handleLegendOnHover)\n\t\teventsFragment.removeEventListener(Events.Legend.ITEM_MOUSEOUT, this.handleLegendMouseOut)\n\t}\n}\n","import { flipDomainAndRangeBasedOnOrientation } from '@/tools'\nimport { lines as lineConfigs } from '@/configuration'\nimport { Scatter } from './scatter'\nimport { CartesianOrientations, ColorClassNameTypes, Events, RenderTypes } from '@/interfaces/enums'\n\nexport class Lollipop extends Scatter {\n\ttype = 'lollipop'\n\trenderType = RenderTypes.SVG\n\n\tinit() {\n\t\tconst { events } = this.services\n\t\t// Highlight correct line legend item hovers\n\t\tevents.addEventListener(Events.Legend.ITEM_HOVER, this.handleLegendOnHover)\n\t\t// Un-highlight lines on legend item mouseouts\n\t\tevents.addEventListener(Events.Legend.ITEM_MOUSEOUT, this.handleLegendMouseOut)\n\t}\n\n\trender(animate: boolean) {\n\t\t// Grab container SVG\n\t\tconst svg = this.getComponentContainer({ ariaLabel: 'lines', withinChartClip: true })\n\n\t\tconst options = this.model.getOptions()\n\n\t\tconst { groupMapsTo } = options.data\n\n\t\tconst { cartesianScales } = this.services\n\t\tconst mainXScale = cartesianScales.getMainXScale()\n\t\tconst mainYScale = cartesianScales.getMainYScale()\n\t\tconst domainIdentifier = cartesianScales.getDomainIdentifier()\n\n\t\tconst getDomainValue = (d: any) => cartesianScales.getDomainValue(d)\n\t\tconst getRangeValue = (d: any) => cartesianScales.getRangeValue(d)\n\t\tconst orientation = cartesianScales.getOrientation()\n\t\tconst [getXValue, getYValue] = flipDomainAndRangeBasedOnOrientation(\n\t\t\tgetDomainValue,\n\t\t\tgetRangeValue,\n\t\t\torientation\n\t\t)\n\n\t\t// Update data on lines\n\t\tconst lines = svg\n\t\t\t.selectAll('line.line')\n\t\t\t.data(\n\t\t\t\tthis.getScatterData(),\n\t\t\t\t(datum: any) => `${datum[groupMapsTo]}-${datum[domainIdentifier]}`\n\t\t\t)\n\n\t\t// Remove lines that are no longer needed\n\t\tlines.exit().attr('opacity', 0).remove()\n\n\t\t// Remove lines that need to be removed\n\t\tconst enteringLines = lines.enter().append('line').attr('opacity', 0)\n\n\t\tconst allLines = enteringLines\n\t\t\t.merge(lines as any)\n\t\t\t.classed('line', true)\n\t\t\t.attr('class', (d: any) =>\n\t\t\t\tthis.model.getColorClassName({\n\t\t\t\t\tclassNameTypes: [ColorClassNameTypes.STROKE],\n\t\t\t\t\tdataGroupName: d[groupMapsTo],\n\t\t\t\t\toriginalClassName: 'line'\n\t\t\t\t})\n\t\t\t)\n\t\t\t.transition()\n\t\t\t.call((t: any) =>\n\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\ttransition: t,\n\t\t\t\t\tname: 'lollipop-line-update-enter',\n\t\t\t\t\tanimate\n\t\t\t\t})\n\t\t\t)\n\t\t\t.style('stroke', (d: any) => this.model.getFillColor(d[groupMapsTo], d[domainIdentifier], d))\n\t\t\t.attr('opacity', 1)\n\n\t\tif (orientation === CartesianOrientations.HORIZONTAL) {\n\t\t\tallLines\n\t\t\t\t.attr('y1', getYValue)\n\t\t\t\t.attr('y2', getYValue)\n\t\t\t\t.attr('x1', mainXScale.range()[0])\n\t\t\t\t.attr('x2', (d: any) => (getXValue(d) as any) - options.points.radius)\n\t\t} else {\n\t\t\tallLines\n\t\t\t\t.attr('x1', getXValue)\n\t\t\t\t.attr('x2', getXValue)\n\t\t\t\t.attr('y1', mainYScale.range()[0])\n\t\t\t\t.attr('y2', (d: any) => getYValue(d) + options.points.radius)\n\t\t}\n\n\t\tthis.addScatterPointEventListeners()\n\t}\n\n\t// listen for when individual datapoints are hovered\n\taddScatterPointEventListeners() {\n\t\t// Highlight correct line associated when hovering on a scatter point\n\t\tthis.services.events.addEventListener(\n\t\t\tEvents.Scatter.SCATTER_MOUSEOVER,\n\t\t\tthis.handleScatterOnHover\n\t\t)\n\n\t\t// unbolden the line when not hovered on the lollipop scatter point\n\t\tthis.services.events.addEventListener(\n\t\t\tEvents.Scatter.SCATTER_MOUSEOUT,\n\t\t\tthis.handleScatterOnMouseOut\n\t\t)\n\t}\n\n\t// on hover, bolden the line associated with the scatter\n\thandleScatterOnHover = (event: CustomEvent) => {\n\t\tconst hoveredElement = event.detail\n\n\t\tconst options = this.getOptions()\n\t\tconst { groupMapsTo } = options.data\n\n\t\tthis.parent.selectAll('line.line').attr('stroke-width', (d: any) => {\n\t\t\tif (d[groupMapsTo] !== hoveredElement.datum[groupMapsTo]) {\n\t\t\t\treturn lineConfigs.weight.unselected\n\t\t\t}\n\t\t\t// apply selected weight\n\t\t\treturn lineConfigs.weight.selected\n\t\t})\n\t}\n\n\t// on mouse out remove the stroke width assertion\n\thandleScatterOnMouseOut = () => {\n\t\tthis.parent.selectAll('line.line').attr('stroke-width', lineConfigs.weight.unselected)\n\t}\n\n\thandleLegendOnHover = (event: CustomEvent) => {\n\t\tconst { hoveredElement } = event.detail\n\n\t\tconst options = this.getOptions()\n\t\tconst { groupMapsTo } = options.data\n\n\t\tthis.parent\n\t\t\t.selectAll('line.line')\n\t\t\t.transition('legend-hover-line')\n\t\t\t.call((t: any) =>\n\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\ttransition: t,\n\t\t\t\t\tname: 'legend-hover-line'\n\t\t\t\t})\n\t\t\t)\n\t\t\t.attr('opacity', (d: any) => {\n\t\t\t\tif (d[groupMapsTo] !== hoveredElement.datum()['name']) {\n\t\t\t\t\treturn lineConfigs.opacity.unselected\n\t\t\t\t}\n\n\t\t\t\treturn lineConfigs.opacity.selected\n\t\t\t})\n\t}\n\n\thandleLegendMouseOut = () => {\n\t\tthis.parent\n\t\t\t.selectAll('line.line')\n\t\t\t.transition('legend-mouseout-line')\n\t\t\t.call((t: any) =>\n\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\ttransition: t,\n\t\t\t\t\tname: 'legend-mouseout-line'\n\t\t\t\t})\n\t\t\t)\n\t\t\t.attr('opacity', lineConfigs.opacity.selected)\n\t}\n\n\tdestroy() {\n\t\t// Remove legend listeners\n\t\tconst eventsFragment = this.services.events\n\t\teventsFragment.removeEventListener(Events.Legend.ITEM_HOVER, this.handleLegendOnHover)\n\t\teventsFragment.removeEventListener(Events.Legend.ITEM_MOUSEOUT, this.handleLegendMouseOut)\n\n\t\t// remove scatter listeners\n\t\teventsFragment.removeEventListener(Events.Scatter.SCATTER_MOUSEOVER, this.handleScatterOnHover)\n\t\teventsFragment.removeEventListener(\n\t\t\tEvents.Scatter.SCATTER_MOUSEOUT,\n\t\t\tthis.handleScatterOnMouseOut\n\t\t)\n\t}\n}\n","import { scaleLinear, select } from 'd3'\nimport { getProperty } from '@/tools'\nimport { meter as meterConfigs } from '@/configuration'\nimport { Component } from '@/components/component'\nimport { DOMUtils } from '@/services/essentials/dom-utils'\nimport { ColorClassNameTypes, Events, RenderTypes } from '@/interfaces/enums'\nimport { Roles } from '@/interfaces/a11y'\nimport { MeterChartModel } from '@/model/meter'\n\nexport class Meter extends Component {\n\ttype = 'meter'\n\trenderType = RenderTypes.SVG\n\n\tgetStackedBounds(data: any, scale: any) {\n\t\tlet prevX = 0\n\t\tconst stackedData = data.map((d: any, i: number) => {\n\t\t\tif (i !== 0) {\n\t\t\t\tprevX += scale(d.value)\n\t\t\t\treturn {\n\t\t\t\t\t...d,\n\t\t\t\t\twidth: Math.abs(scale(d.value) - meterConfigs.dividerWidth),\n\t\t\t\t\tx: prevX - scale(d.value)\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tprevX = scale(d.value)\n\t\t\t\treturn {\n\t\t\t\t\t...d,\n\t\t\t\t\twidth: Math.abs(scale(d.value) - meterConfigs.dividerWidth),\n\t\t\t\t\tx: 0\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\n\t\treturn stackedData\n\t}\n\n\trender(animate = true) {\n\t\tconst self = this\n\t\tconst svg = this.getComponentContainer({\n\t\t\tariaLabel: 'meter lines'\n\t\t})\n\t\tconst options = this.getOptions()\n\t\tconst proportional = getProperty(options, 'meter', 'proportional')\n\t\tconst data = this.model.getDisplayData()\n\t\tconst status = this.model.getStatus()\n\n\t\tconst { width } = DOMUtils.getSVGElementSize(svg, {\n\t\t\tuseAttrs: true\n\t\t})\n\n\t\tconst { groupMapsTo } = options.data\n\n\t\tlet domainMax: number\n\t\tif (getProperty(options, 'meter', 'proportional') === null) {\n\t\t\tdomainMax = 100\n\t\t} else {\n\t\t\tconst total = getProperty(options, 'meter', 'proportional', 'total')\n\t\t\tdomainMax = total\n\t\t\t\t? total\n\t\t\t\t: (this.model as MeterChartModel).getMaximumDomain(this.model.getDisplayData())\n\t\t}\n\n\t\t// each meter has a scale for the value but no visual axis\n\t\tconst xScale = scaleLinear().domain([0, domainMax]).range([0, width])\n\t\tconst stackedData = this.getStackedBounds(data, xScale)\n\n\t\tconst userProvidedHeight = getProperty(options, 'meter', 'height')\n\n\t\t// draw the container to hold the value\n\t\tDOMUtils.appendOrSelect(svg, 'rect.container')\n\t\t\t.attr('x', 0)\n\t\t\t.attr('y', 0)\n\t\t\t.attr('width', width)\n\t\t\t.attr(\n\t\t\t\t'height',\n\t\t\t\tuserProvidedHeight\n\t\t\t\t\t? userProvidedHeight\n\t\t\t\t\t: proportional\n\t\t\t\t\t\t? meterConfigs.height.proportional\n\t\t\t\t\t\t: meterConfigs.height.default\n\t\t\t)\n\n\t\t// draw the container max range value indicator\n\t\tDOMUtils.appendOrSelect(svg, 'line.rangeIndicator')\n\t\t\t.attr('x1', width)\n\t\t\t.attr('x2', width)\n\t\t\t.attr('y1', 0)\n\t\t\t.attr(\n\t\t\t\t'y2',\n\t\t\t\tuserProvidedHeight\n\t\t\t\t\t? userProvidedHeight\n\t\t\t\t\t: proportional\n\t\t\t\t\t\t? meterConfigs.height.proportional\n\t\t\t\t\t\t: meterConfigs.height.default\n\t\t\t)\n\n\t\t// rect with the value binded\n\t\tconst valued = svg.selectAll('rect.value').data(stackedData)\n\n\t\t// if user provided a color for the bar, we dont want to attach a status class\n\t\tconst className =\n\t\t\tstatus != null && !self.model.isUserProvidedColorScaleValid() && !proportional\n\t\t\t\t? `value status--${status}`\n\t\t\t\t: 'value'\n\n\t\t// draw the value bar\n\t\tvalued\n\t\t\t.enter()\n\t\t\t.append('rect')\n\t\t\t.classed('value', true)\n\t\t\t.merge(valued as any)\n\t\t\t.attr('x', (d: any) => {\n\t\t\t\treturn d.x\n\t\t\t})\n\t\t\t.attr('y', 0)\n\t\t\t.attr('height', () => {\n\t\t\t\treturn userProvidedHeight\n\t\t\t\t\t? userProvidedHeight\n\t\t\t\t\t: proportional\n\t\t\t\t\t\t? meterConfigs.height.proportional\n\t\t\t\t\t\t: meterConfigs.height.default\n\t\t\t})\n\t\t\t.attr('class', (d: any) =>\n\t\t\t\tthis.model.getColorClassName({\n\t\t\t\t\tclassNameTypes: [ColorClassNameTypes.FILL],\n\t\t\t\t\tdataGroupName: d[groupMapsTo],\n\t\t\t\t\toriginalClassName: className\n\t\t\t\t})\n\t\t\t)\n\t\t\t.transition()\n\t\t\t.call((t: any) =>\n\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\ttransition: t,\n\t\t\t\t\tname: 'meter-bar-update',\n\t\t\t\t\tanimate\n\t\t\t\t})\n\t\t\t)\n\t\t\t.attr('width', (d: any) => {\n\t\t\t\treturn d.value > domainMax ? xScale(domainMax) : Math.max(d.width, 2)\n\t\t\t})\n\t\t\t.style('fill', (d: any) => self.model.getFillColor(d[groupMapsTo], null, d))\n\t\t\t// a11y\n\t\t\t.attr('role', Roles.GRAPHICS_SYMBOL)\n\t\t\t.attr('aria-roledescription', 'value')\n\t\t\t.attr('aria-label', (d: any) => d.value)\n\n\t\tvalued.exit().remove()\n\n\t\t// draw the peak\n\t\tconst peakValue = getProperty(options, 'meter', 'peak')\n\n\t\tlet peakData = peakValue\n\t\tif (peakValue !== null) {\n\t\t\tif (peakValue > domainMax) {\n\t\t\t\tpeakData = domainMax\n\t\t\t} else if (peakValue < data[0].value) {\n\t\t\t\tpeakData = data[0].value > domainMax ? domainMax : data[0].value\n\t\t\t}\n\t\t}\n\n\t\t// if a peak is supplied within the domain, we want to render it\n\t\tconst peak = svg.selectAll('line.peak').data(peakData == null ? [] : [peakData])\n\n\t\tpeak\n\t\t\t.enter()\n\t\t\t.append('line')\n\t\t\t.classed('peak', true)\n\t\t\t.merge(peak as any)\n\t\t\t.attr('y1', 0)\n\t\t\t.attr('y2', () => {\n\t\t\t\treturn userProvidedHeight\n\t\t\t\t\t? userProvidedHeight\n\t\t\t\t\t: proportional\n\t\t\t\t\t\t? meterConfigs.height.proportional\n\t\t\t\t\t\t: meterConfigs.height.default\n\t\t\t})\n\t\t\t.transition()\n\t\t\t.call((t: any) =>\n\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\ttransition: t,\n\t\t\t\t\tname: 'peak-line-update',\n\t\t\t\t\tanimate\n\t\t\t\t})\n\t\t\t)\n\t\t\t.attr('x1', (d: any) => xScale(d))\n\t\t\t.attr('x2', (d: any) => xScale(d))\n\t\t\t// a11y\n\t\t\t.attr('role', Roles.GRAPHICS_SYMBOL)\n\t\t\t.attr('aria-roledescription', 'peak')\n\t\t\t.attr('aria-label', (d: any) => d)\n\n\t\tpeak.exit().remove()\n\n\t\t// this forces the meter chart to only take up as much height as needed (if no height is provided)\n\t\tthis.services.domUtils.setSVGMaxHeight()\n\n\t\t// Add event listeners to elements and legend\n\t\tthis.addEventListeners()\n\t}\n\n\t// add event listeners for tooltips on proportional meter bars\n\taddEventListeners() {\n\t\tconst options = this.getOptions()\n\t\tconst { groupMapsTo } = options.data\n\t\tconst self = this\n\t\tconst proportional = getProperty(options, 'meter', 'proportional')\n\n\t\tthis.parent\n\t\t\t.selectAll('rect.value')\n\t\t\t.on('mouseover', function (event: MouseEvent, datum: any) {\n\t\t\t\tconst hoveredElement = select(this)\n\n\t\t\t\t// Dispatch mouse event\n\t\t\t\tself.services.events.dispatchEvent(Events.Meter.METER_MOUSEOVER, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: hoveredElement,\n\t\t\t\t\tdatum\n\t\t\t\t})\n\n\t\t\t\tif (proportional) {\n\t\t\t\t\thoveredElement.classed('hovered', true)\n\n\t\t\t\t\t// Show tooltip\n\t\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.SHOW, {\n\t\t\t\t\t\tevent,\n\t\t\t\t\t\thoveredElement,\n\t\t\t\t\t\titems: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tlabel: datum[groupMapsTo],\n\t\t\t\t\t\t\t\tvalue: datum.value\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t]\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t})\n\t\t\t.on('mousemove', function (event: MouseEvent, datum: any) {\n\t\t\t\tconst hoveredElement = select(this)\n\t\t\t\t// Dispatch mouse event\n\t\t\t\tself.services.events.dispatchEvent(Events.Meter.METER_MOUSEMOVE, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: hoveredElement,\n\t\t\t\t\tdatum\n\t\t\t\t})\n\n\t\t\t\tif (proportional) {\n\t\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.MOVE, {\n\t\t\t\t\t\tevent\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t})\n\t\t\t.on('click', function (event: MouseEvent, datum: any) {\n\t\t\t\t// Dispatch mouse event\n\t\t\t\tself.services.events.dispatchEvent(Events.Meter.METER_CLICK, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: select(this),\n\t\t\t\t\tdatum\n\t\t\t\t})\n\t\t\t})\n\t\t\t.on('mouseout', function (event: MouseEvent, datum: any) {\n\t\t\t\tconst hoveredElement = select(this)\n\n\t\t\t\t// Dispatch mouse event\n\t\t\t\tself.services.events.dispatchEvent(Events.Meter.METER_MOUSEOUT, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: hoveredElement,\n\t\t\t\t\tdatum\n\t\t\t\t})\n\n\t\t\t\tif (proportional) {\n\t\t\t\t\thoveredElement.classed('hovered', false)\n\n\t\t\t\t\t// Hide tooltip\n\t\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.HIDE, {\n\t\t\t\t\t\thoveredElement\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t})\n\t}\n\n\tdestroy() {\n\t\t// Remove event listeners\n\t\tthis.parent\n\t\t\t.selectAll('rect.value')\n\t\t\t.on('mouseover', null)\n\t\t\t.on('mousemove', null)\n\t\t\t.on('mouseout', null)\n\t\t\t.on('click', null)\n\t}\n}\n","import {\n\tcurveLinearClosed,\n\textent,\n\tlineRadial,\n\tmax,\n\tmin,\n\tscaleBand,\n\tscaleLinear,\n\tselect,\n\ttype Selection as D3Selection,\n\ttype Transition\n} from 'd3'\nimport { flatMapDeep, kebabCase, merge } from 'lodash-es'\nimport { getProperty } from '@/tools'\nimport { radar as radarConfigs } from '@/configuration'\nimport { Component } from '@/components/component'\nimport { DOMUtils } from '@/services/essentials/dom-utils'\nimport { Events, ColorClassNameTypes, RenderTypes, Alignments } from '@/interfaces/enums'\nimport { Roles } from '@/interfaces/a11y'\nimport {\n\tPoint,\n\tAngle,\n\tradialLabelPlacement,\n\tradToDeg,\n\tpolarToCartesianCoords,\n\tdistanceBetweenPointOnCircAndVerticalDiameter\n} from '@/services/angle-utils'\n\nexport class Radar extends Component {\n\ttype = 'radar'\n\trenderType = RenderTypes.SVG\n\n\tsvg: SVGElement\n\tgroupMapsTo: string\n\tuniqueKeys: string[]\n\tuniqueGroups: string[]\n\tfullDataNormalized: any\n\tgroupedDataNormalized: any\n\n\tinit() {\n\t\tconst { events } = this.services\n\t\t// Highlight correct line legend item hovers\n\t\tevents.addEventListener(Events.Legend.ITEM_HOVER, this.handleLegendOnHover)\n\t\t// Un-highlight lines on legend item mouseouts\n\t\tevents.addEventListener(Events.Legend.ITEM_MOUSEOUT, this.handleLegendMouseOut)\n\t}\n\n\trender(animate = true) {\n\t\tconst svg = this.getComponentContainer({\n\t\t\tariaLabel: 'radar graph'\n\t\t})\n\t\tconst { width, height } = DOMUtils.getSVGElementSize(svg, {\n\t\t\tuseAttrs: true\n\t\t})\n\n\t\tconst data = this.model.getData()\n\t\tconst groupedData = this.model.getGroupedData()\n\n\t\tconst options = this.getOptions()\n\n\t\tconst groupMapsTo = getProperty(options, 'data', 'groupMapsTo')\n\t\tconst valueMapsTo = getProperty(options, 'radar', 'axes', 'value')\n\n\t\tconst { angle, value } = getProperty(options, 'radar', 'axes')\n\n\t\tconst { xLabelPadding, yLabelPadding, yTicksNumber, minRange, xAxisRectHeight } = radarConfigs\n\n\t\tthis.uniqueKeys = Array.from(new Set(data.map((d: any) => d[angle])))\n\t\tthis.uniqueGroups = Array.from(new Set(data.map((d: any) => d[groupMapsTo])))\n\t\tthis.fullDataNormalized = this.normalizeFlatData(data)\n\t\tthis.groupedDataNormalized = this.normalizeGroupedData(groupedData)\n\n\t\tconst labelHeight = this.getLabelDimensions(this.uniqueKeys[0]).height\n\t\tconst margin = 2 * (labelHeight + yLabelPadding)\n\t\tconst size = Math.min(width, height)\n\t\tconst diameter = size - margin\n\t\tconst radius = diameter / 2\n\n\t\tif (radius <= 0) {\n\t\t\treturn\n\t\t}\n\n\t\t// given a key, return the corresponding angle in radiants\n\t\t// rotated by -PI/2 because we want angle 0° at -y (12 o’clock)\n\t\tconst xScale = scaleBand()\n\t\t\t.domain(this.fullDataNormalized.map((d: any) => d[angle]))\n\t\t\t.range([0, 2 * Math.PI].map((a: number) => a - Math.PI / 2) as [Angle, Angle])\n\n\t\tconst centerPointMinValue = min(this.fullDataNormalized.map((d: any) => d[value]) as number[])\n\t\tconst yScale = scaleLinear()\n\t\t\t.domain([\n\t\t\t\tcenterPointMinValue >= 0 ? 0 : centerPointMinValue,\n\t\t\t\tmax(this.fullDataNormalized.map((d: any) => d[value]) as number[])\n\t\t\t])\n\t\t\t.range([minRange, radius])\n\t\t\t.nice(yTicksNumber)\n\t\tconst yTicks = yScale.ticks(yTicksNumber)\n\n\t\tconst colorScale = (group: string, key?: any, dataForColorScale?: any): string =>\n\t\t\tthis.model.getFillColor(group, key, dataForColorScale)\n\n\t\t// constructs a new radial line generator\n\t\t// the angle accessor returns the angle in radians with 0° at -y (12 o’clock)\n\t\t// so map back the angle\n\t\tconst radialLineGenerator = lineRadial()\n\t\t\t.angle((d: any) => xScale(d[angle]) + Math.PI / 2)\n\t\t\t.radius((d: any) => yScale(d[value]))\n\t\t\t.curve(curveLinearClosed)\n\n\t\t// compute the space that each x label needs\n\t\tconst horizSpaceNeededByEachXLabel = this.uniqueKeys.map((key: any) => {\n\t\t\tconst tickWidth = this.getLabelDimensions(key).width\n\t\t\t// compute the distance between the point that the label rapresents and the vertical diameter\n\t\t\tconst distanceFromDiameter = distanceBetweenPointOnCircAndVerticalDiameter(\n\t\t\t\txScale(key),\n\t\t\t\tradius\n\t\t\t)\n\t\t\t// the space each label occupies is the sum of these two values\n\t\t\treturn tickWidth + distanceFromDiameter\n\t\t})\n\t\tconst leftPadding = max(horizSpaceNeededByEachXLabel)\n\n\t\t// center coordinates\n\t\tconst c: Point = {\n\t\t\tx: leftPadding + xLabelPadding,\n\t\t\ty: height / 2\n\t\t}\n\n\t\t/////////////////////////////\n\t\t// Drawing the radar\n\t\t/////////////////////////////\n\n\t\t// y axes\n\t\tconst yAxes = DOMUtils.appendOrSelect(svg, 'g.y-axes').attr('role', Roles.GROUP)\n\t\tconst yAxisUpdate = yAxes.selectAll('path').data(yTicks, (tick: any) => tick)\n\t\t// for each tick, create array of data corresponding to the points composing the shape\n\t\tconst shapeData = (tick: number) =>\n\t\t\tthis.uniqueKeys.map((key: any) => ({ [angle]: key, [value]: tick }))\n\t\tyAxisUpdate.join(\n\t\t\t(enter: any) =>\n\t\t\t\tenter\n\t\t\t\t\t.append('path')\n\t\t\t\t\t.attr('opacity', 0)\n\t\t\t\t\t.attr('transform', `translate(${c.x}, ${c.y})`)\n\t\t\t\t\t.attr('fill', 'none')\n\t\t\t\t\t.call((selection: D3Selection) =>\n\t\t\t\t\t\tselection\n\t\t\t\t\t\t\t/*\n\t\t\t\t\t\t \tBUG (D3): when \"Radar - Missing datapoints\" is displayed, the path that represents the third\n\t\t\t\t\t\t\tblob (shaded area for Water) generates a d=\"M0,-59L118.248,-38.421L29.879,41.125L-25.079,34.518LNaN,NaNZ\"\n\t\t\t\t\t\t\tvalue because of the intentionally missing datapoint for the path (other paths have 5 points, this one has 4).\n\t\t\t\t\t\t\tIn this case, D3 should generate a d=\"M0,-59L118.248,-38.421L29.879,41.125L-25.079,34.518\". Because the path ends\n\t\t\t\t\t\t\twith \"LNaN,NaNZ\", browsers render the path up to that point creating the desired look but\n\t\t\t\t\t\t\tcausing D3 to throw an error (that we cannot catch because it's async). The error fires on\n\t\t\t\t\t\t\td3-transition/src/transition/attrTween.js:5 (but it's a long call-chain).\n\t\t\t\t\t\t*/\n\t\t\t\t\t\t\t.transition()\n\t\t\t\t\t\t\t.call((t: Transition) =>\n\t\t\t\t\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\t\t\t\t\ttransition: t,\n\t\t\t\t\t\t\t\t\tname: 'radar_y_axes_enter',\n\t\t\t\t\t\t\t\t\tanimate\n\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t.attr('opacity', 1)\n\t\t\t\t\t\t\t.attr('d', (tick: number) => radialLineGenerator(shapeData(tick)))\n\t\t\t\t\t),\n\t\t\t(update: any) =>\n\t\t\t\tupdate.call((selection: any) =>\n\t\t\t\t\tselection\n\t\t\t\t\t\t.transition()\n\t\t\t\t\t\t.call((t: any) =>\n\t\t\t\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\t\t\t\ttransition: t,\n\t\t\t\t\t\t\t\tname: 'radar_y_axes_update',\n\t\t\t\t\t\t\t\tanimate\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t)\n\t\t\t\t\t\t.attr('opacity', 1)\n\t\t\t\t\t\t.attr('transform', `translate(${c.x}, ${c.y})`)\n\t\t\t\t\t\t.attr('d', (tick: any) => radialLineGenerator(shapeData(tick)))\n\t\t\t\t),\n\t\t\t(exit: any) =>\n\t\t\t\texit.call((selection: any) =>\n\t\t\t\t\tselection\n\t\t\t\t\t\t.transition()\n\t\t\t\t\t\t.call((t: any) =>\n\t\t\t\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\t\t\t\ttransition: t,\n\t\t\t\t\t\t\t\tname: 'radar_y_axes_exit',\n\t\t\t\t\t\t\t\tanimate\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t)\n\t\t\t\t\t\t.attr('d', (tick: any) => radialLineGenerator(shapeData(tick)))\n\t\t\t\t\t\t.attr('opacity', 0)\n\t\t\t\t\t\t.remove()\n\t\t\t\t)\n\t\t)\n\n\t\t// x axes\n\t\tconst xAxes = DOMUtils.appendOrSelect(svg, 'g.x-axes').attr('role', Roles.GROUP)\n\t\tconst xAxisUpdate = xAxes.selectAll('line').data(this.uniqueKeys, (key: any) => key)\n\t\txAxisUpdate.join(\n\t\t\t(enter: any) =>\n\t\t\t\tenter\n\t\t\t\t\t.append('line')\n\t\t\t\t\t.attr('opacity', 0)\n\t\t\t\t\t.attr('class', (key: any) => `x-axis-${kebabCase(key)}`) // replace spaces with -\n\t\t\t\t\t.attr('stroke-dasharray', '0')\n\t\t\t\t\t.attr('x1', (key: any) => polarToCartesianCoords(xScale(key), 0, c).x)\n\t\t\t\t\t.attr('y1', (key: any) => polarToCartesianCoords(xScale(key), 0, c).y)\n\t\t\t\t\t.attr('x2', (key: any) => polarToCartesianCoords(xScale(key), 0, c).x)\n\t\t\t\t\t.attr('y2', (key: any) => polarToCartesianCoords(xScale(key), 0, c).y)\n\t\t\t\t\t.call((selection: any) =>\n\t\t\t\t\t\tselection\n\t\t\t\t\t\t\t.transition()\n\t\t\t\t\t\t\t.call((t: any) =>\n\t\t\t\t\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\t\t\t\t\ttransition: t,\n\t\t\t\t\t\t\t\t\tname: 'radar_x_axes_enter',\n\t\t\t\t\t\t\t\t\tanimate\n\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t.attr('opacity', 1)\n\t\t\t\t\t\t\t.attr('x1', (key: any) => polarToCartesianCoords(xScale(key), yScale.range()[0], c).x)\n\t\t\t\t\t\t\t.attr('y1', (key: any) => polarToCartesianCoords(xScale(key), yScale.range()[0], c).y)\n\t\t\t\t\t\t\t.attr('x2', (key: any) => polarToCartesianCoords(xScale(key), yScale.range()[1], c).x)\n\t\t\t\t\t\t\t.attr('y2', (key: any) => polarToCartesianCoords(xScale(key), yScale.range()[1], c).y)\n\t\t\t\t\t),\n\t\t\t(update: any) =>\n\t\t\t\tupdate.call((selection: any) =>\n\t\t\t\t\tselection\n\t\t\t\t\t\t.transition()\n\t\t\t\t\t\t.call((t: any) =>\n\t\t\t\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\t\t\t\ttransition: t,\n\t\t\t\t\t\t\t\tname: 'radar_x_axes_update',\n\t\t\t\t\t\t\t\tanimate\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t)\n\t\t\t\t\t\t.attr('opacity', 1)\n\t\t\t\t\t\t.attr('x1', (key: any) => polarToCartesianCoords(xScale(key), yScale.range()[0], c).x)\n\t\t\t\t\t\t.attr('y1', (key: any) => polarToCartesianCoords(xScale(key), yScale.range()[0], c).y)\n\t\t\t\t\t\t.attr('x2', (key: any) => polarToCartesianCoords(xScale(key), yScale.range()[1], c).x)\n\t\t\t\t\t\t.attr('y2', (key: any) => polarToCartesianCoords(xScale(key), yScale.range()[1], c).y)\n\t\t\t\t),\n\t\t\t(exit: any) =>\n\t\t\t\texit.call((selection: any) =>\n\t\t\t\t\tselection\n\t\t\t\t\t\t.transition()\n\t\t\t\t\t\t.call((t: any) =>\n\t\t\t\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\t\t\t\ttransition: t,\n\t\t\t\t\t\t\t\tname: 'radar_x_axes_exit',\n\t\t\t\t\t\t\t\tanimate\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t)\n\t\t\t\t\t\t.attr('opacity', 0)\n\t\t\t\t\t\t.remove()\n\t\t\t\t)\n\t\t)\n\n\t\t// x labels\n\t\tconst xLabels = DOMUtils.appendOrSelect(svg, 'g.x-labels').attr('role', Roles.GROUP)\n\t\tconst xLabelUpdate = xLabels.selectAll('text').data(this.uniqueKeys)\n\t\txLabelUpdate.join(\n\t\t\t(enter: any) =>\n\t\t\t\tenter\n\t\t\t\t\t.append('text')\n\t\t\t\t\t.text((key: any) => key)\n\t\t\t\t\t.attr('opacity', 0)\n\t\t\t\t\t.attr(\n\t\t\t\t\t\t'x',\n\t\t\t\t\t\t(key: any) =>\n\t\t\t\t\t\t\tpolarToCartesianCoords(xScale(key), yScale.range()[1] + xLabelPadding, c).x\n\t\t\t\t\t)\n\t\t\t\t\t.attr(\n\t\t\t\t\t\t'y',\n\t\t\t\t\t\t(key: any) =>\n\t\t\t\t\t\t\tpolarToCartesianCoords(xScale(key), yScale.range()[1] + xLabelPadding, c).y\n\t\t\t\t\t)\n\t\t\t\t\t.style('text-anchor', (key: any) => radialLabelPlacement(xScale(key)).textAnchor)\n\t\t\t\t\t.style(\n\t\t\t\t\t\t'dominant-baseline',\n\t\t\t\t\t\t(key: any) => radialLabelPlacement(xScale(key)).dominantBaseline\n\t\t\t\t\t)\n\t\t\t\t\t.call((selection: any) =>\n\t\t\t\t\t\tselection\n\t\t\t\t\t\t\t.transition()\n\t\t\t\t\t\t\t.call((t: any) =>\n\t\t\t\t\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\t\t\t\t\ttransition: t,\n\t\t\t\t\t\t\t\t\tname: 'radar_x_labels_enter',\n\t\t\t\t\t\t\t\t\tanimate\n\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t.attr('opacity', 1)\n\t\t\t\t\t),\n\t\t\t(update: any) =>\n\t\t\t\tupdate.call((selection: any) =>\n\t\t\t\t\tselection\n\t\t\t\t\t\t.transition()\n\t\t\t\t\t\t.call((t: any) =>\n\t\t\t\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\t\t\t\ttransition: t,\n\t\t\t\t\t\t\t\tname: 'radar_x_labels_update',\n\t\t\t\t\t\t\t\tanimate\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t)\n\t\t\t\t\t\t.attr('opacity', 1)\n\t\t\t\t\t\t.attr(\n\t\t\t\t\t\t\t'x',\n\t\t\t\t\t\t\t(key: any) =>\n\t\t\t\t\t\t\t\tpolarToCartesianCoords(xScale(key), yScale.range()[1] + xLabelPadding, c).x\n\t\t\t\t\t\t)\n\t\t\t\t\t\t.attr(\n\t\t\t\t\t\t\t'y',\n\t\t\t\t\t\t\t(key: any) =>\n\t\t\t\t\t\t\t\tpolarToCartesianCoords(xScale(key), yScale.range()[1] + xLabelPadding, c).y\n\t\t\t\t\t\t)\n\t\t\t\t\t\t.end()\n\t\t\t\t\t\t.finally(() => {\n\t\t\t\t\t\t\t// Align chart horizontally after x-axies has finished rendering\n\t\t\t\t\t\t\tconst alignment = getProperty(options, 'radar', 'alignment')\n\n\t\t\t\t\t\t\tconst alignmentXOffset = this.getAlignmentXOffset(alignment, svg, this.getParent())\n\t\t\t\t\t\t\tsvg.attr('x', alignmentXOffset)\n\t\t\t\t\t\t})\n\t\t\t\t),\n\t\t\t(exit: any) =>\n\t\t\t\texit.call((selection: any) =>\n\t\t\t\t\tselection\n\t\t\t\t\t\t.transition()\n\t\t\t\t\t\t.call((t: any) =>\n\t\t\t\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\t\t\t\ttransition: t,\n\t\t\t\t\t\t\t\tname: 'radar_x_labels_exit',\n\t\t\t\t\t\t\t\tanimate\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t)\n\t\t\t\t\t\t.attr('opacity', 0)\n\t\t\t\t\t\t.remove()\n\t\t\t\t)\n\t\t)\n\n\t\t// blobs\n\t\tconst blobs = DOMUtils.appendOrSelect(svg, 'g.blobs').attr('role', Roles.GROUP)\n\t\tconst blobUpdate = blobs\n\t\t\t.selectAll('path')\n\t\t\t.data(this.groupedDataNormalized, (group: any) => group.name)\n\n\t\tblobUpdate.join(\n\t\t\t(enter: any) =>\n\t\t\t\tenter\n\t\t\t\t\t.append('path')\n\t\t\t\t\t.attr('class', (group: any) =>\n\t\t\t\t\t\tthis.model.getColorClassName({\n\t\t\t\t\t\t\tclassNameTypes: [ColorClassNameTypes.FILL, ColorClassNameTypes.STROKE],\n\t\t\t\t\t\t\tdataGroupName: group.name,\n\t\t\t\t\t\t\toriginalClassName: 'blob'\n\t\t\t\t\t\t})\n\t\t\t\t\t)\n\t\t\t\t\t.attr('role', Roles.GRAPHICS_SYMBOL)\n\t\t\t\t\t.attr('aria-label', (d: any) => d['name'])\n\t\t\t\t\t.attr('opacity', 0)\n\t\t\t\t\t.attr(\n\t\t\t\t\t\t'transform',\n\t\t\t\t\t\tanimate\n\t\t\t\t\t\t\t? () => `translate(${c.x}, ${c.y}) scale(${1 + Math.random() * 0.35})`\n\t\t\t\t\t\t\t: `translate(${c.x}, ${c.y})`\n\t\t\t\t\t)\n\t\t\t\t\t.style('fill', (group: any) => colorScale(group.name, null, group.data))\n\t\t\t\t\t.style('fill-opacity', radarConfigs.opacity.selected)\n\t\t\t\t\t.style('stroke', (group: any) => colorScale(group.name, null, group.data))\n\t\t\t\t\t.call((selection: any) => {\n\t\t\t\t\t\tconst selectionUpdate = selection.transition().call((t: any) =>\n\t\t\t\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\t\t\t\ttransition: t,\n\t\t\t\t\t\t\t\tname: 'radar_blobs_enter',\n\t\t\t\t\t\t\t\tanimate\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t)\n\n\t\t\t\t\t\tif (animate) {\n\t\t\t\t\t\t\tselectionUpdate\n\t\t\t\t\t\t\t\t.delay(() => Math.random() * 30)\n\t\t\t\t\t\t\t\t.attr('transform', `translate(${c.x}, ${c.y})`)\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tselectionUpdate\n\t\t\t\t\t\t\t.attr('opacity', 1)\n\t\t\t\t\t\t\t.attr('d', (group: any) => radialLineGenerator(group.data))\n\t\t\t\t\t}),\n\t\t\t(update: any) => {\n\t\t\t\tupdate\n\t\t\t\t\t.attr('class', (group: any) =>\n\t\t\t\t\t\tthis.model.getColorClassName({\n\t\t\t\t\t\t\tclassNameTypes: [ColorClassNameTypes.FILL, ColorClassNameTypes.STROKE],\n\t\t\t\t\t\t\tdataGroupName: group.name,\n\t\t\t\t\t\t\toriginalClassName: 'blob'\n\t\t\t\t\t\t})\n\t\t\t\t\t)\n\t\t\t\t\t.style('fill', (group: any) => colorScale(group.name, null, group.data))\n\t\t\t\t\t.style('stroke', (group: any) => colorScale(group.name, null, group.data))\n\t\t\t\tupdate.call((selection: any) =>\n\t\t\t\t\tselection\n\t\t\t\t\t\t.transition()\n\t\t\t\t\t\t.call((t: any) =>\n\t\t\t\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\t\t\t\ttransition: t,\n\t\t\t\t\t\t\t\tname: 'radar_blobs_update',\n\t\t\t\t\t\t\t\tanimate\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t)\n\t\t\t\t\t\t.attr('opacity', 1)\n\t\t\t\t\t\t.attr('transform', `translate(${c.x}, ${c.y})`)\n\t\t\t\t\t\t.attr('d', (group: any) => radialLineGenerator(group.data))\n\t\t\t\t)\n\t\t\t\treturn update\n\t\t\t},\n\t\t\t(exit: any) =>\n\t\t\t\texit.call((selection: any) => {\n\t\t\t\t\tconst selectionUpdate = selection.transition().call((t: any) =>\n\t\t\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\t\t\ttransition: t,\n\t\t\t\t\t\t\tname: 'radar_blobs_exit',\n\t\t\t\t\t\t\tanimate\n\t\t\t\t\t\t})\n\t\t\t\t\t)\n\n\t\t\t\t\tif (animate) {\n\t\t\t\t\t\tselectionUpdate\n\t\t\t\t\t\t\t.delay(() => Math.random() * 30)\n\t\t\t\t\t\t\t.attr(\n\t\t\t\t\t\t\t\t'transform',\n\t\t\t\t\t\t\t\t() => `translate(${c.x}, ${c.y}) scale(${1 + Math.random() * 0.35})`\n\t\t\t\t\t\t\t)\n\t\t\t\t\t}\n\n\t\t\t\t\tselectionUpdate.attr('opacity', 0).remove()\n\t\t\t\t})\n\t\t)\n\n\t\t// data dots\n\t\tconst dots = DOMUtils.appendOrSelect(svg, 'g.dots').attr('role', Roles.GROUP)\n\n\t\tconst dotsUpdate = dots\n\t\t\t.selectAll('circle')\n\t\t\t// Filter out dots with no value so they are not rendered\n\t\t\t.data(this.fullDataNormalized.filter((d: any) => getProperty(d, value) !== null))\n\n\t\tdotsUpdate\n\t\t\t.join(\n\t\t\t\t(enter: any) =>\n\t\t\t\t\tenter\n\t\t\t\t\t\t.append('circle')\n\t\t\t\t\t\t.attr('role', Roles.GRAPHICS_SYMBOL)\n\t\t\t\t\t\t.attr('aria-label', (d: any) => d[valueMapsTo]),\n\t\t\t\t(update: any) => update,\n\t\t\t\t(exit: any) => exit.remove()\n\t\t\t)\n\t\t\t.attr('class', (d: any) =>\n\t\t\t\tthis.model.getColorClassName({\n\t\t\t\t\tclassNameTypes: [ColorClassNameTypes.FILL],\n\t\t\t\t\tdataGroupName: d[groupMapsTo],\n\t\t\t\t\toriginalClassName: kebabCase(d[angle])\n\t\t\t\t})\n\t\t\t)\n\t\t\t.attr('cx', (d: any) => polarToCartesianCoords(xScale(d[angle]), yScale(d[value]), c).x)\n\t\t\t.attr('cy', (d: any) => polarToCartesianCoords(xScale(d[angle]), yScale(d[value]), c).y)\n\t\t\t.attr('r', 0)\n\t\t\t.attr('opacity', 0)\n\t\t\t.style('fill', (d: any) => colorScale(d[groupMapsTo]))\n\n\t\t// rectangles\n\t\tconst xAxesRect = DOMUtils.appendOrSelect(svg, 'g.x-axes-rect').attr('role', Roles.GROUP)\n\t\tconst xAxisRectUpdate = xAxesRect.selectAll('rect').data(this.uniqueKeys)\n\t\txAxisRectUpdate\n\t\t\t.join(\n\t\t\t\t(enter: any) => enter.append('rect'),\n\t\t\t\t(update: any) => update,\n\t\t\t\t(exit: any) => exit.remove()\n\t\t\t)\n\t\t\t.attr('x', c.x)\n\t\t\t.attr('y', c.y - xAxisRectHeight / 2)\n\t\t\t.attr('width', yScale.range()[1])\n\t\t\t.attr('height', xAxisRectHeight)\n\t\t\t.style('fill', 'red')\n\t\t\t.style('fill-opacity', 0)\n\t\t\t.attr('transform', (key: any) => `rotate(${radToDeg(xScale(key))}, ${c.x}, ${c.y})`)\n\n\t\t// y labels (show only the min and the max labels)\n\t\tconst { code: localeCode, number: numberFormatter } = getProperty(options, 'locale')\n\t\tconst yLabels = DOMUtils.appendOrSelect(svg, 'g.y-labels').attr('role', Roles.GROUP)\n\t\tconst yLabelUpdate = yLabels.selectAll('text').data(extent(yTicks))\n\t\tyLabelUpdate.join(\n\t\t\t(enter: any) =>\n\t\t\t\tenter\n\t\t\t\t\t.append('text')\n\t\t\t\t\t.attr('opacity', 0)\n\t\t\t\t\t.text((tick: any) => numberFormatter(tick, localeCode))\n\t\t\t\t\t.attr(\n\t\t\t\t\t\t'x',\n\t\t\t\t\t\t(tick: any) => polarToCartesianCoords(-Math.PI / 2, yScale(tick), c).x + yLabelPadding\n\t\t\t\t\t)\n\t\t\t\t\t.attr('y', (tick: any) => polarToCartesianCoords(-Math.PI / 2, yScale(tick), c).y)\n\t\t\t\t\t.style('text-anchor', 'start')\n\t\t\t\t\t.style('dominant-baseline', 'middle')\n\t\t\t\t\t.call((selection: any) =>\n\t\t\t\t\t\tselection\n\t\t\t\t\t\t\t.transition()\n\t\t\t\t\t\t\t.call((t: any) =>\n\t\t\t\t\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\t\t\t\t\ttransition: t,\n\t\t\t\t\t\t\t\t\tname: 'radar_y_labels_enter',\n\t\t\t\t\t\t\t\t\tanimate\n\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t.attr('opacity', 1)\n\t\t\t\t\t),\n\t\t\t(update: any) =>\n\t\t\t\tupdate.call((selection: any) =>\n\t\t\t\t\tselection\n\t\t\t\t\t\t.transition()\n\t\t\t\t\t\t.call((t: any) =>\n\t\t\t\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\t\t\t\ttransition: t,\n\t\t\t\t\t\t\t\tname: 'radar_y_labels_update',\n\t\t\t\t\t\t\t\tanimate\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t)\n\t\t\t\t\t\t.text((tick: any) => tick)\n\t\t\t\t\t\t.attr('opacity', 1)\n\t\t\t\t\t\t.attr(\n\t\t\t\t\t\t\t'x',\n\t\t\t\t\t\t\t(tick: any) => polarToCartesianCoords(-Math.PI / 2, yScale(tick), c).x + yLabelPadding\n\t\t\t\t\t\t)\n\t\t\t\t\t\t.attr('y', (tick: any) => polarToCartesianCoords(-Math.PI / 2, yScale(tick), c).y)\n\t\t\t\t),\n\t\t\t(exit: any) =>\n\t\t\t\texit.call((selection: any) =>\n\t\t\t\t\tselection\n\t\t\t\t\t\t.transition()\n\t\t\t\t\t\t.call((t: any) =>\n\t\t\t\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\t\t\t\ttransition: t,\n\t\t\t\t\t\t\t\tname: 'radar_y_labels_exit',\n\t\t\t\t\t\t\t\tanimate\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t)\n\t\t\t\t\t\t.attr('opacity', 0)\n\t\t\t\t\t\t.remove()\n\t\t\t\t)\n\t\t)\n\n\t\t// Add event listeners\n\t\tthis.addEventListeners()\n\t}\n\n\tgetAlignmentXOffset(alignment: any, svg: any, parent: any) {\n\t\tconst svgDimensions = DOMUtils.getSVGElementSize(svg, {\n\t\t\tuseBBox: true\n\t\t})\n\t\tconst { width } = DOMUtils.getSVGElementSize(parent, {\n\t\t\tuseAttrs: true\n\t\t})\n\n\t\tlet alignmentOffset = 0\n\t\tif (alignment === Alignments.CENTER) {\n\t\t\talignmentOffset = Math.floor((width - svgDimensions.width) / 2)\n\t\t} else if (alignment === Alignments.RIGHT) {\n\t\t\talignmentOffset = width - svgDimensions.width\n\t\t}\n\n\t\treturn alignmentOffset\n\t}\n\n\t// append temporarily the label to get the exact space that it occupies\n\tgetLabelDimensions = (label: string) => {\n\t\tconst tmpTick = DOMUtils.appendOrSelect(this.getComponentContainer(), `g.tmp-tick`)\n\t\tconst tmpTickText = DOMUtils.appendOrSelect(tmpTick, `text`).text(label)\n\t\tconst { width, height } = DOMUtils.getSVGElementSize(tmpTickText.node(), { useBBox: true })\n\t\ttmpTick.remove()\n\t\treturn { width, height }\n\t}\n\n\t// Given a flat array of objects, if there are missing data on key,\n\t// creates corresponding data with value = null\n\tnormalizeFlatData = (dataset: any) => {\n\t\tconst options = this.getOptions()\n\t\tconst { angle, value } = getProperty(options, 'radar', 'axes')\n\t\tconst groupMapsTo = getProperty(options, 'data', 'groupMapsTo')\n\t\tconst completeBlankData = flatMapDeep(\n\t\t\tthis.uniqueKeys.map((key: any) => {\n\t\t\t\treturn this.uniqueGroups.map(group => ({\n\t\t\t\t\t[angle]: key,\n\t\t\t\t\t[groupMapsTo]: group,\n\t\t\t\t\t[value]: null\n\t\t\t\t}))\n\t\t\t})\n\t\t)\n\t\treturn merge(completeBlankData, dataset)\n\t}\n\n\t// Given a a grouped array of objects, if there are missing data on key,\n\t// creates corresponding data with value = null\n\tnormalizeGroupedData = (dataset: any) => {\n\t\tconst options = this.getOptions()\n\t\tconst { angle, value } = getProperty(options, 'radar', 'axes')\n\t\tconst groupMapsTo = getProperty(options, 'data', 'groupMapsTo')\n\t\treturn dataset.map(({ name, data }: { name: any; data: any }) => {\n\t\t\tconst completeBlankData = this.uniqueKeys.map((k: any) => ({\n\t\t\t\t[groupMapsTo]: name,\n\t\t\t\t[angle]: k,\n\t\t\t\t[value]: null\n\t\t\t}))\n\t\t\treturn { name, data: merge(completeBlankData, data) }\n\t\t})\n\t}\n\n\thandleLegendOnHover = (event: CustomEvent) => {\n\t\tconst { hoveredElement } = event.detail\n\t\tthis.parent\n\t\t\t.selectAll('g.blobs path')\n\t\t\t.transition('legend-hover-blob')\n\t\t\t.call((t: any) =>\n\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\ttransition: t,\n\t\t\t\t\tname: 'legend-hover-blob'\n\t\t\t\t})\n\t\t\t)\n\t\t\t.style('fill-opacity', (group: any) => {\n\t\t\t\tif (group.name !== hoveredElement.datum().name) {\n\t\t\t\t\treturn radarConfigs.opacity.unselected\n\t\t\t\t}\n\t\t\t\treturn radarConfigs.opacity.selected\n\t\t\t})\n\t\t\t.style('stroke-opacity', (group: any) => {\n\t\t\t\tif (group.name !== hoveredElement.datum().name) {\n\t\t\t\t\treturn radarConfigs.opacity.unselected\n\t\t\t\t}\n\t\t\t\treturn 1\n\t\t\t})\n\t}\n\n\thandleLegendMouseOut = () => {\n\t\tthis.parent\n\t\t\t.selectAll('g.blobs path')\n\t\t\t.transition('legend-mouseout-blob')\n\t\t\t.call((t: any) =>\n\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\ttransition: t,\n\t\t\t\t\tname: 'legend-mouseout-blob'\n\t\t\t\t})\n\t\t\t)\n\t\t\t.style('fill-opacity', radarConfigs.opacity.selected)\n\t\t\t.style('stroke-opacity', 1)\n\t}\n\n\tdestroy() {\n\t\t// Remove event listeners\n\t\tthis.parent\n\t\t\t.selectAll('.x-axes-rect > rect')\n\t\t\t.on('mouseover', null)\n\t\t\t.on('mousemove', null)\n\t\t\t.on('mouseout', null)\n\t\t// Remove legend listeners\n\t\tconst eventsFragment = this.services.events\n\t\teventsFragment.removeEventListener(Events.Legend.ITEM_HOVER, this.handleLegendOnHover)\n\t\teventsFragment.removeEventListener(Events.Legend.ITEM_MOUSEOUT, this.handleLegendMouseOut)\n\t}\n\n\taddEventListeners() {\n\t\tconst self = this\n\t\tconst {\n\t\t\taxes: { angle }\n\t\t} = getProperty(this.getOptions(), 'radar')\n\n\t\t// events on x axes rects\n\t\tthis.parent\n\t\t\t.selectAll('.x-axes-rect > rect')\n\t\t\t.on('mouseover', function (event: MouseEvent, datum: any) {\n\t\t\t\tconst hoveredElement = select(this)\n\n\t\t\t\t// Dispatch mouse event\n\t\t\t\tself.services.events.dispatchEvent(Events.Radar.X_AXIS_MOUSEOVER, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: hoveredElement,\n\t\t\t\t\tdatum\n\t\t\t\t})\n\n\t\t\t\tconst axisLine = self.parent.select(`.x-axes .x-axis-${kebabCase(datum)}`)\n\t\t\t\tconst dots = self.parent.selectAll(`.dots circle.${kebabCase(datum)}`)\n\n\t\t\t\tconst activeDataGroupNames = self.model.getActiveDataGroupNames()\n\n\t\t\t\tconst options = self.getOptions()\n\t\t\t\tconst { groupMapsTo } = options.data\n\t\t\t\tconst valueMapsTo = getProperty(options, 'radar', 'axes', 'value')\n\n\t\t\t\t// Change style\n\t\t\t\taxisLine.classed('hovered', true).attr('stroke-dasharray', '4 4')\n\t\t\t\tdots\n\t\t\t\t\t.classed('hovered', true)\n\t\t\t\t\t.attr('opacity', (d: any) =>\n\t\t\t\t\t\tactiveDataGroupNames.indexOf(d[groupMapsTo]) !== -1 ? 1 : 0\n\t\t\t\t\t)\n\t\t\t\t\t.attr('r', radarConfigs.dotsRadius)\n\n\t\t\t\t// get the items that should be highlighted\n\t\t\t\tconst itemsToHighlight = self.fullDataNormalized.filter(\n\t\t\t\t\t(d: any) => d[angle] === datum && activeDataGroupNames.indexOf(d[groupMapsTo]) !== -1\n\t\t\t\t)\n\n\t\t\t\t// Show tooltip\n\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.SHOW, {\n\t\t\t\t\tevent,\n\t\t\t\t\thoveredElement,\n\t\t\t\t\titems: itemsToHighlight\n\t\t\t\t\t\t.filter((d: any) => typeof d[valueMapsTo] === 'number')\n\t\t\t\t\t\t.map((d: any) => ({\n\t\t\t\t\t\t\tlabel: d[groupMapsTo],\n\t\t\t\t\t\t\tvalue: d[valueMapsTo],\n\t\t\t\t\t\t\tcolor: self.model.getFillColor(d[groupMapsTo], null, d),\n\t\t\t\t\t\t\tclass: self.model.getColorClassName({\n\t\t\t\t\t\t\t\tclassNameTypes: [ColorClassNameTypes.TOOLTIP],\n\t\t\t\t\t\t\t\tdataGroupName: d[groupMapsTo]\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t}))\n\t\t\t\t})\n\t\t\t})\n\t\t\t.on('mousemove', function (event: MouseEvent, datum: any) {\n\t\t\t\tconst hoveredElement = select(this)\n\n\t\t\t\t// Dispatch mouse event\n\t\t\t\tself.services.events.dispatchEvent(Events.Radar.X_AXIS_MOUSEMOVE, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: hoveredElement,\n\t\t\t\t\tdatum\n\t\t\t\t})\n\n\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.MOVE, {\n\t\t\t\t\tevent\n\t\t\t\t})\n\t\t\t})\n\t\t\t.on('click', function (event: MouseEvent, datum: any) {\n\t\t\t\t// Dispatch mouse event\n\t\t\t\tself.services.events.dispatchEvent(Events.Radar.X_AXIS_CLICK, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: select(this),\n\t\t\t\t\tdatum\n\t\t\t\t})\n\t\t\t})\n\t\t\t.on('mouseout', function (event: MouseEvent, datum: any) {\n\t\t\t\tconst hoveredElement = select(this)\n\t\t\t\tconst axisLine = self.parent.select(`.x-axes .x-axis-${kebabCase(datum)}`)\n\t\t\t\tconst dots = self.parent.selectAll(`.dots circle.${kebabCase(datum)}`)\n\n\t\t\t\t// Change style\n\t\t\t\taxisLine.classed('hovered', false).attr('stroke-dasharray', '0')\n\n\t\t\t\tdots.classed('hovered', false).attr('opacity', 0).attr('r', 0)\n\n\t\t\t\t// Dispatch mouse event\n\t\t\t\tself.services.events.dispatchEvent(Events.Radar.X_AXIS_MOUSEOUT, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: hoveredElement,\n\t\t\t\t\tdatum\n\t\t\t\t})\n\n\t\t\t\t// Hide tooltip\n\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.HIDE)\n\t\t\t})\n\t}\n}\n","import { select } from 'd3'\nimport { generateSVGPathString } from '@/tools'\nimport { Bar } from './bar'\nimport { Events, RenderTypes, ColorClassNameTypes, CartesianOrientations } from '@/interfaces/enums'\nimport { Roles } from '@/interfaces/a11y'\n\nexport class SimpleBar extends Bar {\n\ttype = 'simple-bar'\n\trenderType = RenderTypes.SVG\n\n\tinit() {\n\t\tconst eventsFragment = this.services.events\n\n\t\t// Highlight correct circle on legend item hovers\n\t\teventsFragment.addEventListener(Events.Legend.ITEM_HOVER, this.handleLegendOnHover)\n\n\t\t// Un-highlight circles on legend item mouseouts\n\t\teventsFragment.addEventListener(Events.Legend.ITEM_MOUSEOUT, this.handleLegendMouseOut)\n\t}\n\n\trender(animate: boolean) {\n\t\tconst options = this.getOptions()\n\t\tconst { groupMapsTo } = options.data\n\n\t\t// Grab container SVG\n\t\tconst svg = this.getComponentContainer({\n\t\t\tariaLabel: 'bar graphs',\n\t\t\twithinChartClip: true\n\t\t})\n\n\t\tconst data = this.model.getDisplayData(this.configs.groups)\n\n\t\tconst orientation = this.services.cartesianScales.getOrientation()\n\n\t\t// Update data on all bars\n\t\tconst bars = svg.selectAll('path.bar').data(data, (datum: any) => datum[groupMapsTo])\n\n\t\t// Remove bars that are no longer needed\n\t\tbars.exit().attr('opacity', 0).remove()\n\n\t\t// Add the paths that need to be introduced\n\t\tconst barsEnter = bars.enter().append('path').attr('opacity', 0)\n\n\t\tbarsEnter\n\t\t\t.merge(bars as any)\n\t\t\t.classed('bar', true)\n\t\t\t.attr('width', this.getBarWidth.bind(this))\n\t\t\t.transition()\n\t\t\t.call((t: any) =>\n\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\ttransition: t,\n\t\t\t\t\tname: 'bar-update-enter',\n\t\t\t\t\tanimate\n\t\t\t\t})\n\t\t\t)\n\t\t\t.attr('class', (d: any) =>\n\t\t\t\tthis.model.getColorClassName({\n\t\t\t\t\tclassNameTypes: [ColorClassNameTypes.FILL],\n\t\t\t\t\tdataGroupName: d[groupMapsTo],\n\t\t\t\t\toriginalClassName: 'bar'\n\t\t\t\t})\n\t\t\t)\n\t\t\t.style('fill', (d: any) => {\n\t\t\t\tconst domainIdentifier = this.services.cartesianScales.getDomainIdentifier(d)\n\t\t\t\treturn this.model.getFillColor(d[groupMapsTo], d[domainIdentifier], d)\n\t\t\t})\n\t\t\t.attr('d', (d: any) => {\n\t\t\t\t/*\n\t\t\t\t * Orientation support for horizontal/vertical bar charts\n\t\t\t\t * Determine coordinates needed for a vertical set of paths\n\t\t\t\t * to draw the bars needed, and pass those coordinates down to\n\t\t\t\t * generateSVGPathString() to decide whether it needs to flip them\n\t\t\t\t */\n\t\t\t\tconst rangeIdentifier = this.services.cartesianScales.getRangeIdentifier()\n\t\t\t\tconst barWidth = this.getBarWidth()\n\t\t\t\tconst value = d[rangeIdentifier]\n\n\t\t\t\tconst x0 = this.services.cartesianScales.getDomainValue(d) - barWidth / 2\n\t\t\t\tconst x1 = x0 + barWidth\n\t\t\t\tlet y0: number, y1: number\n\t\t\t\tif (Array.isArray(value) && value.length === 2) {\n\t\t\t\t\ty0 = this.services.cartesianScales.getRangeValue(value[0])\n\t\t\t\t\ty1 = this.services.cartesianScales.getRangeValue(value[1])\n\t\t\t\t} else {\n\t\t\t\t\tconst rangeScale = this.services.cartesianScales.getRangeScale()\n\t\t\t\t\tconst yScaleDomainStart = rangeScale.domain()[0] as number\n\n\t\t\t\t\ty0 = this.services.cartesianScales.getRangeValue(Math.max(0, yScaleDomainStart))\n\t\t\t\t\ty1 = this.services.cartesianScales.getRangeValue(d)\n\t\t\t\t}\n\n\t\t\t\tconst difference = Math.abs(y1 - y0)\n\t\t\t\t// Set a min-2px size for the bar\n\t\t\t\tif (difference !== 0 && difference < 2) {\n\t\t\t\t\tif (\n\t\t\t\t\t\t(value > 0 && orientation === CartesianOrientations.VERTICAL) ||\n\t\t\t\t\t\t(value < 0 && orientation === CartesianOrientations.HORIZONTAL)\n\t\t\t\t\t) {\n\t\t\t\t\t\ty1 = y0 - 2\n\t\t\t\t\t} else {\n\t\t\t\t\t\ty1 = y0 + 2\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// don't show if part of bar is out of zoom domain\n\t\t\t\tif (this.isOutsideZoomedDomain(x0, x1)) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\n\t\t\t\treturn generateSVGPathString({ x0, x1, y0, y1 }, orientation)\n\t\t\t})\n\t\t\t.attr('opacity', 1)\n\t\t\t// a11y\n\t\t\t.attr('role', Roles.GRAPHICS_SYMBOL)\n\t\t\t.attr('aria-roledescription', 'bar')\n\t\t\t.attr('aria-label', (d: any) => d.value)\n\n\t\t// Add event listeners to elements drawn\n\t\tthis.addEventListeners()\n\t}\n\n\thandleLegendOnHover = (event: CustomEvent) => {\n\t\tconst { hoveredElement } = event.detail\n\t\tconst { groupMapsTo } = this.getOptions().data\n\n\t\tthis.parent\n\t\t\t.selectAll('path.bar')\n\t\t\t.transition('legend-hover-simple-bar')\n\t\t\t.call((t: any) =>\n\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\ttransition: t,\n\t\t\t\t\tname: 'legend-hover-simple-bar'\n\t\t\t\t})\n\t\t\t)\n\t\t\t.attr('opacity', (d: any) => (d[groupMapsTo] !== hoveredElement.datum()['name'] ? 0.3 : 1))\n\t}\n\n\thandleLegendMouseOut = () => {\n\t\tthis.parent\n\t\t\t.selectAll('path.bar')\n\t\t\t.transition('legend-mouseout-simple-bar')\n\t\t\t.call((t: any) =>\n\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\ttransition: t,\n\t\t\t\t\tname: 'legend-mouseout-simple-bar'\n\t\t\t\t})\n\t\t\t)\n\t\t\t.attr('opacity', 1)\n\t}\n\n\taddEventListeners() {\n\t\tconst self = this\n\t\tthis.parent\n\t\t\t.selectAll('path.bar')\n\t\t\t.on('mouseover', function (event: MouseEvent, datum: any) {\n\t\t\t\tconst hoveredElement = select(this)\n\t\t\t\thoveredElement.classed('hovered', true)\n\n\t\t\t\t// Dispatch mouse event\n\t\t\t\tself.services.events.dispatchEvent(Events.Bar.BAR_MOUSEOVER, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: hoveredElement,\n\t\t\t\t\tdatum\n\t\t\t\t})\n\n\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.SHOW, {\n\t\t\t\t\tevent,\n\t\t\t\t\thoveredElement,\n\t\t\t\t\tdata: [datum]\n\t\t\t\t})\n\t\t\t})\n\t\t\t.on('mousemove', function (event: MouseEvent, datum: any) {\n\t\t\t\t// Dispatch mouse event\n\t\t\t\tself.services.events.dispatchEvent(Events.Bar.BAR_MOUSEMOVE, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: select(this),\n\t\t\t\t\tdatum\n\t\t\t\t})\n\n\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.MOVE, {\n\t\t\t\t\tevent\n\t\t\t\t})\n\t\t\t})\n\t\t\t.on('click', function (event: MouseEvent, datum: any) {\n\t\t\t\t// Dispatch mouse event\n\t\t\t\tself.services.events.dispatchEvent(Events.Bar.BAR_CLICK, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: select(this),\n\t\t\t\t\tdatum\n\t\t\t\t})\n\t\t\t})\n\t\t\t.on('mouseout', function (event: MouseEvent, datum: any) {\n\t\t\t\tconst hoveredElement = select(this)\n\t\t\t\thoveredElement.classed('hovered', false)\n\n\t\t\t\t// Dispatch mouse event\n\t\t\t\tself.services.events.dispatchEvent(Events.Bar.BAR_MOUSEOUT, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: hoveredElement,\n\t\t\t\t\tdatum\n\t\t\t\t})\n\n\t\t\t\t// Hide tooltip\n\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.HIDE, {\n\t\t\t\t\thoveredElement\n\t\t\t\t})\n\t\t\t})\n\t}\n\n\tdestroy() {\n\t\t// Remove event listeners\n\t\tthis.parent\n\t\t\t.selectAll('path.bar')\n\t\t\t.on('mouseover', null)\n\t\t\t.on('mousemove', null)\n\t\t\t.on('mouseout', null)\n\n\t\t// Remove legend listeners\n\t\tconst eventsFragment = this.services.events\n\t\teventsFragment.removeEventListener(Events.Legend.ITEM_HOVER, this.handleLegendOnHover)\n\t\teventsFragment.removeEventListener(Events.Legend.ITEM_MOUSEOUT, this.handleLegendMouseOut)\n\t}\n}\n","import type { ScaleLinear, Selection } from 'd3'\nimport { getProperty } from '@/tools'\nimport { Skeleton } from './skeleton'\nimport { DOMUtils } from '@/services/essentials/dom-utils'\n\nexport class SkeletonLines extends Skeleton {\n\ttype = 'skeleton-lines'\n\txScale: ScaleLinear\n\tyScale: ScaleLinear\n\tbackdrop: Selection\n\n\t// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n\t// @ts-ignore\n\t// eslint-disable-next-line @typescript-eslint/no-unused-vars\n\trender(animate = true) {\n\t\tconst isDataLoading = getProperty(this.getOptions(), 'data', 'loading')\n\n\t\tconst isSparkline =\n\t\t\t!getProperty(this.getOptions(), 'grid', 'x', 'enabled') &&\n\t\t\t!getProperty(this.getOptions(), 'grid', 'y', 'enabled') &&\n\t\t\t!getProperty(this.getOptions(), 'axes', 'bottom', 'visible') &&\n\t\t\t!getProperty(this.getOptions(), 'axes', 'left', 'visible')\n\n\t\t// display a skeleton if there is no chart data or the loading flag is set to true\n\t\tif (isDataLoading && !isSparkline) {\n\t\t\tsuper.renderGridSkeleton(isDataLoading)\n\t\t} else if (isDataLoading && isSparkline) {\n\t\t\tthis.renderSparklineSkeleton(isDataLoading)\n\t\t} else {\n\t\t\tthis.removeSkeleton()\n\t\t}\n\t}\n\n\trenderSparklineSkeleton(showShimmerEffect: boolean) {\n\t\tthis.setScales()\n\t\tthis.drawBackdrop(showShimmerEffect)\n\t\tthis.drawSparkline(showShimmerEffect)\n\t\tthis.updateBackdropStyle()\n\t\tif (showShimmerEffect) {\n\t\t\tthis.setShimmerEffect('shimmer-lines')\n\t\t}\n\t}\n\n\tdrawSparkline(showShimmerEffect: boolean) {\n\t\tconst width = this.backdrop.attr('width')\n\t\tconst ticksValues = [100]\n\t\tconst sparklineSkeleton = DOMUtils.appendOrSelect(this.backdrop, 'g.y.skeleton')\n\t\tconst update = sparklineSkeleton.selectAll('line').data(ticksValues)\n\t\tupdate\n\t\t\t.enter()\n\t\t\t.append('line')\n\t\t\t.merge(update as any)\n\t\t\t.attr('x1', 0)\n\t\t\t.attr('x2', width)\n\t\t\t.attr('y1', (d: any) => d)\n\t\t\t.attr('y2', (d: any) => d)\n\n\t\tsparklineSkeleton\n\t\t\t.selectAll('line')\n\t\t\t.classed('shimmer-effect-lines', showShimmerEffect)\n\t\t\t.classed('empty-state-lines', !showShimmerEffect)\n\t\t\t.style(\n\t\t\t\t'stroke',\n\t\t\t\tshowShimmerEffect\n\t\t\t\t\t? `url(#${this.services.domUtils.generateElementIDString(`shimmer-lines`)})`\n\t\t\t\t\t: null\n\t\t\t)\n\t}\n\n\tupdateBackdropStyle() {\n\t\tconst svg = this.parent\n\n\t\tthis.backdrop = DOMUtils.appendOrSelect(svg, 'svg.chart-skeleton.DAII')\n\t\tconst backdropRect = DOMUtils.appendOrSelect(this.backdrop, 'rect.chart-skeleton-backdrop')\n\n\t\tbackdropRect\n\t\t\t.classed('shimmer-effect-lines', false)\n\t\t\t.classed('shimmer-effect-sparkline', true)\n\t\t\t.style('stroke', null)\n\t}\n}\n","import { area } from 'd3'\nimport { getProperty } from '@/tools'\nimport { area as areaConfigs } from '@/configuration'\nimport { Component } from '@/components/component'\nimport { Events, ColorClassNameTypes, RenderTypes } from '@/interfaces/enums'\nimport { Roles } from '@/interfaces/a11y'\n\nexport class StackedArea extends Component {\n\ttype = 'area-stacked'\n\trenderType = RenderTypes.SVG\n\n\tareaGenerator: any\n\n\tinit() {\n\t\tconst eventsFragment = this.services.events\n\n\t\t// Highlight correct area on legend item hovers\n\t\teventsFragment.addEventListener(Events.Legend.ITEM_HOVER, this.handleLegendOnHover)\n\n\t\t// Un-highlight area on legend item mouseouts\n\t\teventsFragment.addEventListener(Events.Legend.ITEM_MOUSEOUT, this.handleLegendMouseOut)\n\t}\n\n\trender(animate = true) {\n\t\tconst svg = this.getComponentContainer({\n\t\t\tariaLabel: 'stacked area graphs',\n\t\t\twithinChartClip: true\n\t\t})\n\t\tconst self = this\n\t\tconst options = this.getOptions()\n\t\tconst { groupMapsTo } = options.data\n\t\tconst percentage = Object.keys(options.axes).some(axis => options.axes[axis].percentage)\n\n\t\tconst stackedData = this.model.getStackedData({\n\t\t\tpercentage,\n\t\t\tgroups: this.configs.groups\n\t\t})\n\t\tconst datum = getProperty(stackedData, 0, 0) as number[] // firstDatum name could not be used by getDomainAxisPosition() and getRangeAxisPosition() below\n\n\t\t// area doesn't have to use the main range and domain axes - they can be mapped to the secondary (in the case of a combo chart)\n\t\t// however area _cannot_ have multiple datasets that are mapped to _different_ ranges and domains so we can use the first data item\n\t\tconst domainAxisPosition = this.services.cartesianScales.getDomainAxisPosition({ datum })\n\t\tconst rangeAxisPosition = this.services.cartesianScales.getRangeAxisPosition({ datum })\n\t\tconst mainYScale = this.services.cartesianScales.getScaleByPosition(rangeAxisPosition)\n\n\t\tconst areas = svg\n\t\t\t.selectAll('path.area')\n\t\t\t.data(stackedData, (d: any) => getProperty(d, 0, groupMapsTo))\n\n\t\t// D3 area generator function\n\t\tthis.areaGenerator = area()\n\t\t\t.x((d: any) =>\n\t\t\t\tthis.services.cartesianScales.getValueThroughAxisPosition(\n\t\t\t\t\tdomainAxisPosition,\n\t\t\t\t\td.data.sharedStackKey\n\t\t\t\t)\n\t\t\t)\n\t\t\t.y0((d: any) => mainYScale(d[0]))\n\t\t\t.y1((d: any) => mainYScale(d[1]))\n\t\t\t.curve(this.services.curves.getD3Curve())\n\n\t\tareas.exit().attr('opacity', 0).remove()\n\n\t\tconst enteringAreas = areas.enter().append('path').attr('opacity', 0)\n\n\t\tenteringAreas\n\t\t\t.merge(areas as any)\n\t\t\t.data(stackedData, (d: any) => getProperty(d, 0, groupMapsTo))\n\t\t\t.attr('class', 'area')\n\t\t\t.attr('class', (d: any) =>\n\t\t\t\tthis.model.getColorClassName({\n\t\t\t\t\tclassNameTypes: [ColorClassNameTypes.FILL],\n\t\t\t\t\tdataGroupName: getProperty(d, 0, groupMapsTo),\n\t\t\t\t\toriginalClassName: 'area'\n\t\t\t\t})\n\t\t\t)\n\t\t\t.style('fill', (d: any) => self.model.getFillColor(getProperty(d, 0, groupMapsTo), null, d))\n\t\t\t.attr('role', Roles.GRAPHICS_SYMBOL)\n\t\t\t.attr('aria-roledescription', 'area')\n\t\t\t.attr('aria-label', (d: any) => getProperty(d, 0, groupMapsTo))\n\t\t\t.transition()\n\t\t\t.call((t: any) =>\n\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\ttransition: t,\n\t\t\t\t\tname: 'area-update-enter',\n\t\t\t\t\tanimate\n\t\t\t\t})\n\t\t\t)\n\t\t\t.attr('opacity', areaConfigs.opacity.selected)\n\t\t\t.attr('d', this.areaGenerator)\n\t}\n\n\thandleLegendOnHover = (event: CustomEvent) => {\n\t\tconst { hoveredElement } = event.detail\n\t\tconst options = this.getOptions()\n\t\tconst { groupMapsTo } = options.data\n\n\t\tthis.parent\n\t\t\t.selectAll('path.area')\n\t\t\t.transition('legend-hover-area')\n\t\t\t.call((t: any) =>\n\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\ttransition: t,\n\t\t\t\t\tname: 'legend-hover-area'\n\t\t\t\t})\n\t\t\t)\n\t\t\t.attr('opacity', (d: any) => {\n\t\t\t\tif (getProperty(d, 0, groupMapsTo) !== hoveredElement.datum().name) {\n\t\t\t\t\treturn areaConfigs.opacity.unselected\n\t\t\t\t}\n\n\t\t\t\treturn areaConfigs.opacity.selected\n\t\t\t})\n\t}\n\n\thandleLegendMouseOut = () => {\n\t\tthis.parent\n\t\t\t.selectAll('path.area')\n\t\t\t.transition('legend-mouseout-area')\n\t\t\t.call((t: any) =>\n\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\ttransition: t,\n\t\t\t\t\tname: 'legend-mouseout-area'\n\t\t\t\t})\n\t\t\t)\n\t\t\t.attr('opacity', areaConfigs.opacity.selected)\n\t}\n}\n","import { select } from 'd3'\nimport { generateSVGPathString, getProperty } from '@/tools'\nimport { Bar } from './bar'\nimport { Events, CartesianOrientations, ColorClassNameTypes, RenderTypes } from '@/interfaces/enums'\nimport { Roles } from '@/interfaces/a11y'\nimport { DOMUtils } from '@/services/essentials/dom-utils'\n\nexport class StackedBar extends Bar {\n\ttype = 'stacked-bar'\n\trenderType = RenderTypes.SVG\n\n\tinit() {\n\t\tconst eventsFragment = this.services.events\n\n\t\t// Highlight correct circle on legend item hovers\n\t\teventsFragment.addEventListener(Events.Legend.ITEM_HOVER, this.handleLegendOnHover)\n\n\t\t// Un-highlight circles on legend item mouseouts\n\t\teventsFragment.addEventListener(Events.Legend.ITEM_MOUSEOUT, this.handleLegendMouseOut)\n\t}\n\n\trender(animate: boolean) {\n\t\t// Grab container SVG\n\t\tconst svg = this.getComponentContainer({ ariaLabel: 'stacked bar graphs', withinChartClip: true })\n\n\t\t// Chart options mixed with the internal configurations\n\t\tconst options = this.getOptions()\n\t\tconst { groupMapsTo } = options.data\n\n\t\t// Create the data and keys that'll be used by the stack layout\n\t\tconst stackData = this.model.getStackedData({\n\t\t\tgroups: this.configs.groups,\n\t\t\tdivergent: true\n\t\t})\n\n\t\tconst activeDataGroupNames = this.model.getActiveDataGroupNames()\n\n\t\t// Update data on all bar groups\n\t\tconst barGroups = svg\n\t\t\t.selectAll('g.bars')\n\t\t\t.data(stackData, (d: any) => getProperty(d, 0, groupMapsTo))\n\n\t\t// Remove elements that need to be exited\n\t\t// We need exit at the top here to make sure that\n\t\t// Data filters are processed before entering new elements\n\t\t// Or updating existing ones\n\t\tbarGroups.exit().attr('opacity', 0).remove()\n\n\t\t// Add bar groups that need to be introduced\n\t\tbarGroups\n\t\t\t.enter()\n\t\t\t.append('g')\n\t\t\t.classed('bars', true)\n\t\t\t.attr('role', Roles.GROUP)\n\t\t\t.attr('data-name', 'bars')\n\n\t\t// Update data on all bars\n\t\tconst bars = svg\n\t\t\t.selectAll('g.bars')\n\t\t\t.selectAll('path.bar')\n\t\t\t.data(\n\t\t\t\t(d: any) => d,\n\t\t\t\t(d: any) => d.data.sharedStackKey\n\t\t\t)\n\n\t\t// Remove bars that need to be removed\n\t\tbars.exit().remove()\n\n\t\tbars\n\t\t\t.enter()\n\t\t\t.append('path')\n\t\t\t.merge(bars as any)\n\t\t\t.classed('bar', true)\n\t\t\t.transition()\n\t\t\t.call((t: any) =>\n\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\ttransition: t,\n\t\t\t\t\tname: 'bar-update-enter',\n\t\t\t\t\tanimate\n\t\t\t\t})\n\t\t\t)\n\t\t\t.attr('class', (d: any) =>\n\t\t\t\tthis.model.getColorClassName({\n\t\t\t\t\tclassNameTypes: [ColorClassNameTypes.FILL],\n\t\t\t\t\tdataGroupName: d[groupMapsTo],\n\t\t\t\t\toriginalClassName: 'bar'\n\t\t\t\t})\n\t\t\t)\n\t\t\t.style('fill', (d: any) =>\n\t\t\t\tthis.model.getFillColor(d[groupMapsTo], d.data.sharedStackKey, d.data)\n\t\t\t)\n\t\t\t.attr('d', (d: any) => {\n\t\t\t\tconst key = d.data.sharedStackKey as string\n\n\t\t\t\t/*\n\t\t\t\t * Orientation support for horizontal/vertical bar charts\n\t\t\t\t * Determine coordinates needed for a vertical set of paths\n\t\t\t\t * to draw the bars needed, and pass those coordinates down to\n\t\t\t\t * generateSVGPathString() to decide whether it needs to flip them\n\t\t\t\t */\n\t\t\t\tconst barWidth = this.getBarWidth()\n\t\t\t\tconst x0 = this.services.cartesianScales.getDomainValue(key) - barWidth / 2\n\t\t\t\tconst x1 = x0 + barWidth\n\t\t\t\tconst y0 = this.services.cartesianScales.getRangeValue(d[0])\n\t\t\t\tlet y1 = this.services.cartesianScales.getRangeValue(d[1])\n\n\t\t\t\t// don't show if part of bar is out of zoom domain\n\t\t\t\tif (this.isOutsideZoomedDomain(x0, x1)) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\n\t\t\t\t// Add the divider gap\n\t\t\t\tif (Math.abs(y1 - y0) > 0 && Math.abs(y1 - y0) > options.bars.dividerSize) {\n\t\t\t\t\tconst barIsNegative = d[0] < 0 && d[1] <= 0\n\t\t\t\t\tif (barIsNegative && activeDataGroupNames.length > 1) {\n\t\t\t\t\t\tif (this.services.cartesianScales.getOrientation() === CartesianOrientations.VERTICAL) {\n\t\t\t\t\t\t\ty1 += d[1] === 0 ? 2 : 1\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ty1 -= 1\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (!barIsNegative) {\n\t\t\t\t\t\tif (this.services.cartesianScales.getOrientation() === CartesianOrientations.VERTICAL) {\n\t\t\t\t\t\t\ty1 += 1\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ty1 -= 1\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn generateSVGPathString(\n\t\t\t\t\t{ x0, x1, y0, y1 },\n\t\t\t\t\tthis.services.cartesianScales.getOrientation()\n\t\t\t\t)\n\t\t\t})\n\t\t\t.attr('opacity', 1)\n\t\t\t// a11y\n\t\t\t.attr('role', Roles.GRAPHICS_SYMBOL)\n\t\t\t.attr('aria-roledescription', 'bar')\n\t\t\t.attr('aria-label', (d: any) => d[1] - d[0])\n\n\t\t// Add event listeners for the above elements\n\t\tthis.addEventListeners()\n\t}\n\n\t// Highlight elements that match the hovered legend item\n\thandleLegendOnHover = (event: CustomEvent) => {\n\t\tconst { hoveredElement } = event.detail\n\n\t\tconst { groupMapsTo } = this.model.getOptions().data\n\n\t\tthis.parent\n\t\t\t.selectAll('path.bar')\n\t\t\t.transition('legend-hover-bar')\n\t\t\t.call((t: any) =>\n\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\ttransition: t,\n\t\t\t\t\tname: 'legend-hover-bar'\n\t\t\t\t})\n\t\t\t)\n\t\t\t.attr('opacity', (d: any) => (d[groupMapsTo] !== hoveredElement.datum()['name'] ? 0.3 : 1))\n\t}\n\n\t// Un-highlight all elements\n\thandleLegendMouseOut = () => {\n\t\tthis.parent\n\t\t\t.selectAll('path.bar')\n\t\t\t.transition('legend-mouseout-bar')\n\t\t\t.call((t: any) =>\n\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\ttransition: t,\n\t\t\t\t\tname: 'legend-mouseout-bar'\n\t\t\t\t})\n\t\t\t)\n\t\t\t.attr('opacity', 1)\n\t}\n\n\taddEventListeners() {\n\t\tconst options = this.getOptions()\n\t\tconst { groupMapsTo } = options.data\n\n\t\tconst self = this\n\t\tthis.parent\n\t\t\t.selectAll('path.bar')\n\t\t\t.on('mouseover', function (event: MouseEvent, datum: any) {\n\t\t\t\tconst hoveredElement = select(this)\n\t\t\t\thoveredElement.classed('hovered', true)\n\n\t\t\t\t// Dispatch mouse event\n\t\t\t\tself.services.events.dispatchEvent(Events.Bar.BAR_MOUSEOVER, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: hoveredElement,\n\t\t\t\t\tdatum\n\t\t\t\t})\n\n\t\t\t\tconst displayData = self.model.getDisplayData(self.configs.groups)\n\n\t\t\t\tlet matchingDataPoint = displayData.find((d: any) => {\n\t\t\t\t\tconst domainIdentifier = self.services.cartesianScales.getDomainIdentifier(d)\n\t\t\t\t\tconst rangeIdentifier = self.services.cartesianScales.getRangeIdentifier(d)\n\t\t\t\t\treturn (\n\t\t\t\t\t\td[rangeIdentifier] === datum.data[datum[groupMapsTo]] &&\n\t\t\t\t\t\td[domainIdentifier].toString() === datum.data.sharedStackKey &&\n\t\t\t\t\t\td[groupMapsTo] === datum[groupMapsTo]\n\t\t\t\t\t)\n\t\t\t\t})\n\n\t\t\t\tif (matchingDataPoint === undefined) {\n\t\t\t\t\t// use the primary range and domain ids\n\t\t\t\t\tconst domainIdentifier = self.services.cartesianScales.getDomainIdentifier()\n\t\t\t\t\tconst rangeIdentifier = self.services.cartesianScales.getRangeIdentifier()\n\t\t\t\t\tmatchingDataPoint = {\n\t\t\t\t\t\t[domainIdentifier]: datum.data.sharedStackKey,\n\t\t\t\t\t\t[rangeIdentifier]: datum.data[datum[groupMapsTo]],\n\t\t\t\t\t\t[groupMapsTo]: datum[groupMapsTo]\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Show tooltip\n\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.SHOW, {\n\t\t\t\t\tevent,\n\t\t\t\t\thoveredElement,\n\t\t\t\t\tdata: [matchingDataPoint]\n\t\t\t\t})\n\t\t\t})\n\t\t\t.on('mousemove', function (event: MouseEvent, datum: any) {\n\t\t\t\tconst hoveredElement = select(this)\n\n\t\t\t\t// Dispatch mouse event\n\t\t\t\tself.services.events.dispatchEvent(Events.Bar.BAR_MOUSEMOVE, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: hoveredElement,\n\t\t\t\t\tdatum\n\t\t\t\t})\n\n\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.MOVE, {\n\t\t\t\t\tevent\n\t\t\t\t})\n\t\t\t})\n\t\t\t.on('click', function (event: MouseEvent, datum: any) {\n\t\t\t\t// Dispatch mouse event\n\t\t\t\tself.services.events.dispatchEvent(Events.Bar.BAR_CLICK, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: select(this),\n\t\t\t\t\tdatum\n\t\t\t\t})\n\t\t\t})\n\t\t\t.on('mouseout', function (event: MouseEvent, datum: any) {\n\t\t\t\tconst hoveredElement = select(this)\n\t\t\t\thoveredElement.classed('hovered', false)\n\n\t\t\t\t// Dispatch mouse event\n\t\t\t\tself.services.events.dispatchEvent(Events.Bar.BAR_MOUSEOUT, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: hoveredElement,\n\t\t\t\t\tdatum\n\t\t\t\t})\n\n\t\t\t\t// Hide tooltip\n\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.HIDE, {\n\t\t\t\t\thoveredElement\n\t\t\t\t})\n\t\t\t})\n\t}\n\n\tprotected getBarWidth() {\n\t\tconst options = this.getOptions()\n\t\tif (getProperty(options, 'bars', 'width')) {\n\t\t\treturn options.bars.width as number\n\t\t}\n\t\tconst mainXScale = this.services.cartesianScales.getMainXScale()\n\t\tconst chartWidth = DOMUtils.getSVGElementSize((this as any).parent, {\n\t\t\tuseAttrs: true\n\t\t}).width\n\n\t\tconst numberOfDomainValues = this.model.getStackKeys().length\n\n\t\tconst spacingFactor = getProperty(options, 'bars', 'spacingFactor')\n\n\t\tif (!(mainXScale as any).step) {\n\t\t\treturn Math.min(options.bars.maxWidth, (chartWidth * spacingFactor) / numberOfDomainValues)\n\t\t}\n\t\treturn Math.min(options.bars.maxWidth, (mainXScale as any).step() / 2)\n\t}\n\n\tdestroy() {\n\t\t// Remove event listeners\n\t\tthis.parent\n\t\t\t.selectAll('path.bar')\n\t\t\t.on('mouseover', null)\n\t\t\t.on('mousemove', null)\n\t\t\t.on('mouseout', null)\n\n\t\t// Remove legend listeners\n\t\tconst eventsFragment = this.services.events\n\t\teventsFragment.removeEventListener(Events.Legend.ITEM_HOVER, this.handleLegendOnHover)\n\t\teventsFragment.removeEventListener(Events.Legend.ITEM_MOUSEOUT, this.handleLegendMouseOut)\n\t}\n}\n","import { getProperty } from '@/tools'\nimport { Scatter } from './scatter'\nimport { RenderTypes } from '@/interfaces/enums'\nimport { Roles } from '@/interfaces/a11y'\n\nexport class StackedScatter extends Scatter {\n\ttype = 'scatter-stacked'\n\trenderType = RenderTypes.SVG\n\n\trender(animate: boolean) {\n\t\tconst isScatterEnabled = getProperty(this.getOptions(), 'points', 'enabled')\n\t\tif (!isScatterEnabled) {\n\t\t\treturn\n\t\t}\n\t\t// Grab container SVG\n\t\tconst svg = this.getComponentContainer({ ariaLabel: 'scatter points', withinChartClip: true })\n\n\t\tconst options = this.getOptions()\n\t\tconst { groupMapsTo } = options.data\n\n\t\tconst percentage = Object.keys(options.axes).some(axis => options.axes[axis].percentage)\n\t\tconst stackedData = this.model.getStackedData({\n\t\t\tgroups: this.configs.groups,\n\t\t\tpercentage\n\t\t})\n\n\t\t// Update data on dot groups\n\t\tconst circleGroups = svg\n\t\t\t.selectAll('g.dots')\n\t\t\t.data(stackedData, (d: any) => getProperty(d, 0, groupMapsTo))\n\n\t\t// Remove dot groups that need to be removed\n\t\tcircleGroups.exit().attr('opacity', 0).remove()\n\n\t\t// Add the dot groups that need to be introduced\n\t\tconst circleGroupsEnter = circleGroups\n\t\t\t.enter()\n\t\t\t.append('g')\n\t\t\t.classed('dots', true)\n\t\t\t.attr('role', Roles.GROUP)\n\n\t\t// Update data on all circles\n\t\tconst circles = circleGroupsEnter\n\t\t\t.merge(circleGroups as any)\n\t\t\t.selectAll('circle.dot')\n\t\t\t.data((d: any) => d)\n\n\t\t// Remove circles that need to be removed\n\t\tcircles.exit().attr('opacity', 0).remove()\n\n\t\t// Add the dot groups that need to be introduced\n\t\tconst enteringCircles = circles.enter().append('circle').classed('dot', true).attr('opacity', 0)\n\n\t\t// Apply styling & position\n\t\tconst circlesToStyle = enteringCircles.merge(circles as any).datum((d: any) => {\n\t\t\tconst group = d[groupMapsTo]\n\t\t\tconst domainIdentifier = this.services.cartesianScales.getDomainIdentifier(d)\n\t\t\tconst rangeIdentifier = this.services.cartesianScales.getRangeIdentifier(d)\n\n\t\t\treturn {\n\t\t\t\t[groupMapsTo]: group,\n\t\t\t\t[domainIdentifier]: d['data']['sharedStackKey'],\n\t\t\t\t[rangeIdentifier]: d[1]\n\t\t\t}\n\t\t})\n\t\tthis.styleCircles(circlesToStyle, animate)\n\n\t\t// Add event listeners to elements drawn\n\t\tthis.addEventListeners()\n\t}\n\n\tgetTooltipData(hoveredX: number, hoveredY: number) {\n\t\tconst options = this.getOptions()\n\t\tconst { groupMapsTo } = options.data\n\t\tconst percentage = Object.keys(options.axes).some(axis => options.axes[axis].percentage)\n\t\tconst stackedData = this.model.getStackedData({\n\t\t\tgroups: this.configs.groups,\n\t\t\tpercentage\n\t\t})\n\t\tconst tooltipData: any[] = []\n\t\tstackedData.forEach((groupData: any, groupDataIndex: any) => {\n\t\t\tgroupData.forEach((datum: any, dataIndex: number) => {\n\t\t\t\tconst group = datum[groupMapsTo]\n\t\t\t\tconst domainValue = datum['data']['sharedStackKey']\n\t\t\t\tlet rangeValue = datum['data'][group]\n\t\t\t\tconst stackedRangeValue = datum[1]\n\t\t\t\tconst domainIdentifier = this.services.cartesianScales.getDomainIdentifier(datum)\n\t\t\t\tconst rangeIdentifier = this.services.cartesianScales.getRangeIdentifier(datum)\n\n\t\t\t\tif (\n\t\t\t\t\trangeValue !== null &&\n\t\t\t\t\trangeValue !== undefined &&\n\t\t\t\t\thoveredX === this.services.cartesianScales.getDomainValue(domainValue) &&\n\t\t\t\t\thoveredY === this.services.cartesianScales.getRangeValue(stackedRangeValue)\n\t\t\t\t) {\n\t\t\t\t\tif (percentage) {\n\t\t\t\t\t\trangeValue = this.model.getStackedData({\n\t\t\t\t\t\t\tgroups: this.configs.groups\n\t\t\t\t\t\t})[groupDataIndex][dataIndex]['data'][group]\n\t\t\t\t\t}\n\n\t\t\t\t\tif (rangeValue !== null) {\n\t\t\t\t\t\ttooltipData.push({\n\t\t\t\t\t\t\t[groupMapsTo]: group,\n\t\t\t\t\t\t\t[domainIdentifier]: domainValue,\n\t\t\t\t\t\t\t[rangeIdentifier]: rangeValue\n\t\t\t\t\t\t})\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t})\n\t\t})\n\n\t\treturn this.model.getDisplayData(this.configs.groups).filter((datapoint: any) => {\n\t\t\tconst domainIdentifier = this.services.cartesianScales.getDomainIdentifier(datapoint)\n\t\t\tconst rangeIdentifier = this.services.cartesianScales.getRangeIdentifier(datapoint)\n\t\t\treturn (\n\t\t\t\ttooltipData.find(tooltipDatapoint => {\n\t\t\t\t\treturn (\n\t\t\t\t\t\ttooltipDatapoint[groupMapsTo] == datapoint[groupMapsTo] &&\n\t\t\t\t\t\ttooltipDatapoint[domainIdentifier] == datapoint[domainIdentifier] &&\n\t\t\t\t\t\ttooltipDatapoint[rangeIdentifier] == datapoint[rangeIdentifier]\n\t\t\t\t\t)\n\t\t\t\t}) !== undefined\n\t\t\t)\n\t\t})\n\t}\n}\n","import { cluster as d3Cluster, tree as d3Tree, hierarchy, linkHorizontal, select } from 'd3'\nimport { getProperty } from '@/tools'\nimport { Component } from '@/components/component'\nimport { DOMUtils } from '@/services/essentials/dom-utils'\nimport { Events, RenderTypes, TreeTypes } from '@/interfaces/enums'\nimport type { Coordinates } from '@/interfaces/layout'\n\nconst NODE_OFFSET = 6\n\nexport class Tree extends Component {\n\ttype = 'tree'\n\trenderType = RenderTypes.SVG\n\n\tgetLongestLabel(data: any) {\n\t\tlet longestLabel = ''\n\t\tdata.forEach((d: any) => {\n\t\t\tconst longestLabelInChildren = d.children ? this.getLongestLabel(d.children) : ''\n\t\t\tif (\n\t\t\t\tlongestLabelInChildren.length > longestLabel.length ||\n\t\t\t\td.name.length > longestLabel.length\n\t\t\t) {\n\t\t\t\tlongestLabel =\n\t\t\t\t\tlongestLabelInChildren.length > d.name.length ? longestLabelInChildren : d.name\n\t\t\t}\n\t\t})\n\n\t\treturn longestLabel\n\t}\n\n\tgetMockLabelWidth(svg: any, label: string) {\n\t\t// Add mock label to get dimensions\n\t\tconst mockLabel = svg\n\t\t\t.append('text')\n\t\t\t.attr('dy', '0.31em')\n\t\t\t.attr('x', 0)\n\t\t\t.attr('text-anchor', 'end')\n\t\t\t.text(label)\n\n\t\t// Get the mock label width\n\t\tconst { width: mockLabelWidth } = DOMUtils.getSVGElementSize(mockLabel.node(), {\n\t\t\tuseBBox: true\n\t\t})\n\n\t\t// Remove the mock title label\n\t\tmockLabel.remove()\n\n\t\treturn mockLabelWidth\n\t}\n\n\t// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n\t// @ts-ignore\n\t// eslint-disable-next-line @typescript-eslint/no-unused-vars\n\trender(animate = true) {\n\t\tconst svg = this.getComponentContainer({\n\t\t\tariaLabel: 'tree diagram'\n\t\t})\n\n\t\t// Empty out the svg before rendering the tree\n\t\tsvg.html('')\n\n\t\tconst { width, height } = DOMUtils.getSVGElementSize(this.parent as any, {\n\t\t\tuseAttrs: true\n\t\t})\n\n\t\tif (width < 1 || height < 1) {\n\t\t\treturn\n\t\t}\n\n\t\tconst options = this.model.getOptions()\n\t\tconst displayData = this.model.getDisplayData()\n\n\t\tconst rootTitle = getProperty(options, 'tree', 'rootTitle') || 'Tree'\n\n\t\tconst mockRootTitleWidth = this.getMockLabelWidth(svg, rootTitle)\n\n\t\tconst longestLabel = this.getLongestLabel(displayData)\n\t\tconst mockLongestLabelWidth = this.getMockLabelWidth(svg, longestLabel)\n\n\t\tconst margin = {\n\t\t\ttop: 0,\n\t\t\tright: 0,\n\t\t\tbottom: 0,\n\t\t\tleft: mockRootTitleWidth > 0 ? mockRootTitleWidth + NODE_OFFSET : 30 - NODE_OFFSET\n\t\t}\n\t\tconst root = hierarchy({\n\t\t\tname: rootTitle,\n\t\t\tchildren: displayData\n\t\t}) as any\n\n\t\tconst dx = 10\n\t\tconst dy = width / 6\n\n\t\tconst update = (source: Coordinates) => {\n\t\t\tconst nodes = root.descendants().reverse()\n\t\t\tconst links = root.links()\n\n\t\t\tlet left = root\n\t\t\tlet right = root\n\t\t\troot.eachBefore((node: Coordinates) => {\n\t\t\t\tif (node.x < left.x) left = node\n\t\t\t\tif (node.x > right.x) right = node\n\t\t\t})\n\n\t\t\tconst updateHeight = right.x - left.x\n\n\t\t\tconst transition = svg\n\t\t\t\t.transition()\n\t\t\t\t.call((t: any) =>\n\t\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\t\ttransition: t,\n\t\t\t\t\t\tname: 'tree-update-viewbox',\n\t\t\t\t\t\tanimate: true\n\t\t\t\t\t})\n\t\t\t\t)\n\t\t\t\t.attr('viewBox', [-margin.left, left.x, width, updateHeight].join(' ')) // viewBox expects a delimited string\n\n\t\t\t// Update data on nodes\n\t\t\tconst nodeGroups = nodeGroup.selectAll('g').data(nodes, (d: any) => d.id)\n\n\t\t\tconst self = this\n\t\t\t// Add any entering nodes\n\t\t\tconst nodeGroupsEnter = nodeGroups\n\t\t\t\t.enter()\n\t\t\t\t.append('g')\n\t\t\t\t.attr('transform', () => `translate(${source.y0},${source.x0})`)\n\t\t\t\t.attr('class', (d: any) =>\n\t\t\t\t\td.depth !== 0 && d.children && d.children.length > 0 ? 'clickable' : null\n\t\t\t\t)\n\t\t\t\t.on('mouseover', function (event: MouseEvent, d: any) {\n\t\t\t\t\t// Dispatch mouse event\n\t\t\t\t\tself.services.events.dispatchEvent(Events.Tree.NODE_MOUSEOVER, {\n\t\t\t\t\t\tevent,\n\t\t\t\t\t\telement: select(this),\n\t\t\t\t\t\tdatum: d\n\t\t\t\t\t})\n\t\t\t\t})\n\t\t\t\t.on('click', function (event: MouseEvent, d: any) {\n\t\t\t\t\tif (d.depth !== 0) {\n\t\t\t\t\t\td.children = d.children ? null : d._children\n\n\t\t\t\t\t\tupdate(d)\n\t\t\t\t\t}\n\n\t\t\t\t\t// Dispatch mouse event\n\t\t\t\t\tself.services.events.dispatchEvent(Events.Tree.NODE_CLICK, {\n\t\t\t\t\t\tevent,\n\t\t\t\t\t\telement: select(this),\n\t\t\t\t\t\tdatum: d\n\t\t\t\t\t})\n\t\t\t\t})\n\t\t\t\t.on('mouseout', function (event: MouseEvent, d: any) {\n\t\t\t\t\t// Dispatch mouse event\n\t\t\t\t\tself.services.events.dispatchEvent(Events.Tree.NODE_MOUSEOUT, {\n\t\t\t\t\t\tevent,\n\t\t\t\t\t\telement: select(this),\n\t\t\t\t\t\tdatum: d\n\t\t\t\t\t})\n\t\t\t\t})\n\n\t\t\t// Add node circles to entering nodes\n\t\t\tnodeGroupsEnter\n\t\t\t\t.append('circle')\n\t\t\t\t.attr('r', 2.5)\n\t\t\t\t.attr('class', (d: any) => (d._children ? 'parent' : 'child'))\n\t\t\t\t.attr('stroke-width', 10)\n\n\t\t\t// Add node labels\n\t\t\tnodeGroupsEnter\n\t\t\t\t.append('text')\n\t\t\t\t.attr('dy', '0.31em')\n\t\t\t\t.attr('x', (d: any) => (d._children ? -NODE_OFFSET : NODE_OFFSET))\n\t\t\t\t.attr('text-anchor', (d: any) => (d._children ? 'end' : 'start'))\n\t\t\t\t.text((d: any) => d.data.name)\n\t\t\t\t.clone(true)\n\t\t\t\t.attr('class', 'text-stroke')\n\t\t\t\t.lower()\n\n\t\t\t// Reposition nodes\n\t\t\tnodeGroups\n\t\t\t\t.merge(nodeGroupsEnter)\n\t\t\t\t.transition(transition)\n\t\t\t\t.attr('transform', (d: Coordinates) => `translate(${d.y},${d.x})`)\n\t\t\t\t.attr('fill-opacity', 1)\n\t\t\t\t.attr('stroke-opacity', 1)\n\n\t\t\t// Remove exiting nodes\n\t\t\tnodeGroups\n\t\t\t\t.exit()\n\t\t\t\t.transition(transition)\n\t\t\t\t.remove()\n\t\t\t\t.attr('transform', () => `translate(${source.y},${source.x})`)\n\t\t\t\t.attr('fill-opacity', 0)\n\t\t\t\t.attr('stroke-opacity', 0)\n\n\t\t\t// Update data on links\n\t\t\tconst linkPaths = linkGroup.selectAll('path').data(links, (d: any) => d.target.id)\n\n\t\t\t// Add any entering link paths\n\t\t\tconst linkPathsEnter = linkPaths\n\t\t\t\t.enter()\n\t\t\t\t.append('path')\n\t\t\t\t.attr('d', () => {\n\t\t\t\t\tconst o = { x: source.x0, y: source.y0 }\n\t\t\t\t\treturn diagonal({ source: o, target: o })\n\t\t\t\t})\n\n\t\t\t// Reposition updating link paths\n\t\t\tlinkPaths.merge(linkPathsEnter).transition(transition).attr('d', diagonal)\n\n\t\t\t// Remove any exiting link paths\n\t\t\tlinkPaths\n\t\t\t\t.exit()\n\t\t\t\t.transition(transition)\n\t\t\t\t.remove()\n\t\t\t\t.attr('d', () => {\n\t\t\t\t\tconst o = { x: source.x, y: source.y }\n\t\t\t\t\treturn diagonal({ source: o, target: o })\n\t\t\t\t})\n\n\t\t\t// Update position data for nodes\n\t\t\troot.eachBefore((d: Coordinates) => {\n\t\t\t\td.x0 = d.x\n\t\t\t\td.y0 = d.y\n\t\t\t})\n\t\t}\n\n\t\tconst descendants = root.descendants()\n\t\tconst maxDepth = descendants[descendants.length - 1].depth\n\n\t\tconst tree =\n\t\t\tgetProperty(options, 'tree', 'type') === TreeTypes.DENDROGRAM\n\t\t\t\t? d3Cluster().size([\n\t\t\t\t\t\theight,\n\t\t\t\t\t\twidth - mockLongestLabelWidth - maxDepth * NODE_OFFSET - mockRootTitleWidth\n\t\t\t\t\t])\n\t\t\t\t: d3Tree()\n\t\t\t\t\t\t.nodeSize([dx, dy])\n\t\t\t\t\t\t.size([\n\t\t\t\t\t\t\theight,\n\t\t\t\t\t\t\twidth - mockLongestLabelWidth - maxDepth * NODE_OFFSET - mockRootTitleWidth\n\t\t\t\t\t\t])\n\n\t\tconst diagonal = linkHorizontal()\n\t\t\t.x((d: any) => d.y)\n\t\t\t.y((d: any) => d.x) as any\n\n\t\troot.x0 = dy / 2\n\t\troot.y0 = 0\n\t\troot.descendants().forEach((d: any, i: number) => {\n\t\t\td.id = i\n\t\t\td._children = d.children\n\t\t})\n\n\t\ttree(root)\n\n\t\tsvg.attr('viewBox', [-margin.left, -margin.top, width, dx]).style('user-select', 'none')\n\n\t\tconst linkGroup = svg.append('g').attr('class', 'links')\n\t\tconst nodeGroup = svg.append('g').attr('class', 'nodes')\n\n\t\tupdate(root)\n\t}\n}\n","/**\n * Copyright IBM Corp. 2018, 2023\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nvar black = '#000000';\nvar black100 = black;\nvar blackHover = '#212121';\nvar white = '#ffffff';\nvar white0 = white;\nvar whiteHover = '#e8e8e8';\nvar yellow10 = '#fcf4d6';\nvar yellow20 = '#fddc69';\nvar yellow30 = '#f1c21b';\nvar yellow40 = '#d2a106';\nvar yellow50 = '#b28600';\nvar yellow60 = '#8e6a00';\nvar yellow70 = '#684e00';\nvar yellow80 = '#483700';\nvar yellow90 = '#302400';\nvar yellow100 = '#1c1500';\nvar yellow = {\n 10: yellow10,\n 20: yellow20,\n 30: yellow30,\n 40: yellow40,\n 50: yellow50,\n 60: yellow60,\n 70: yellow70,\n 80: yellow80,\n 90: yellow90,\n 100: yellow100\n};\nvar yellow10Hover = '#f8e6a0';\nvar yellow20Hover = '#fccd27';\nvar yellow30Hover = '#ddb00e';\nvar yellow40Hover = '#bc9005';\nvar yellow50Hover = '#9e7700';\nvar yellow60Hover = '#755800';\nvar yellow70Hover = '#806000';\nvar yellow80Hover = '#5c4600';\nvar yellow90Hover = '#3d2e00';\nvar yellow100Hover = '#332600';\nvar yellowHover = {\n 10: yellow10Hover,\n 20: yellow20Hover,\n 30: yellow30Hover,\n 40: yellow40Hover,\n 50: yellow50Hover,\n 60: yellow60Hover,\n 70: yellow70Hover,\n 80: yellow80Hover,\n 90: yellow90Hover,\n 100: yellow100Hover\n};\nvar orange10 = '#fff2e8';\nvar orange20 = '#ffd9be';\nvar orange30 = '#ffb784';\nvar orange40 = '#ff832b';\nvar orange50 = '#eb6200';\nvar orange60 = '#ba4e00';\nvar orange70 = '#8a3800';\nvar orange80 = '#5e2900';\nvar orange90 = '#3e1a00';\nvar orange100 = '#231000';\nvar orange = {\n 10: orange10,\n 20: orange20,\n 30: orange30,\n 40: orange40,\n 50: orange50,\n 60: orange60,\n 70: orange70,\n 80: orange80,\n 90: orange90,\n 100: orange100\n};\nvar orange10Hover = '#ffe2cc';\nvar orange20Hover = '#ffc69e';\nvar orange30Hover = '#ff9d57';\nvar orange40Hover = '#fa6800';\nvar orange50Hover = '#cc5500';\nvar orange60Hover = '#9e4200';\nvar orange70Hover = '#a84400';\nvar orange80Hover = '#753300';\nvar orange90Hover = '#522200';\nvar orange100Hover = '#421e00';\nvar orangeHover = {\n 10: orange10Hover,\n 20: orange20Hover,\n 30: orange30Hover,\n 40: orange40Hover,\n 50: orange50Hover,\n 60: orange60Hover,\n 70: orange70Hover,\n 80: orange80Hover,\n 90: orange90Hover,\n 100: orange100Hover\n};\nvar red10 = '#fff1f1';\nvar red20 = '#ffd7d9';\nvar red30 = '#ffb3b8';\nvar red40 = '#ff8389';\nvar red50 = '#fa4d56';\nvar red60 = '#da1e28';\nvar red70 = '#a2191f';\nvar red80 = '#750e13';\nvar red90 = '#520408';\nvar red100 = '#2d0709';\nvar red = {\n 10: red10,\n 20: red20,\n 30: red30,\n 40: red40,\n 50: red50,\n 60: red60,\n 70: red70,\n 80: red80,\n 90: red90,\n 100: red100\n};\nvar red100Hover = '#540d11';\nvar red90Hover = '#66050a';\nvar red80Hover = '#921118';\nvar red70Hover = '#c21e25';\nvar red60Hover = '#b81922';\nvar red50Hover = '#ee0713';\nvar red40Hover = '#ff6168';\nvar red30Hover = '#ff99a0';\nvar red20Hover = '#ffc2c5';\nvar red10Hover = '#ffe0e0';\nvar redHover = {\n 100: red100Hover,\n 90: red90Hover,\n 80: red80Hover,\n 70: red70Hover,\n 60: red60Hover,\n 50: red50Hover,\n 40: red40Hover,\n 30: red30Hover,\n 20: red20Hover,\n 10: red10Hover\n};\nvar magenta10 = '#fff0f7';\nvar magenta20 = '#ffd6e8';\nvar magenta30 = '#ffafd2';\nvar magenta40 = '#ff7eb6';\nvar magenta50 = '#ee5396';\nvar magenta60 = '#d02670';\nvar magenta70 = '#9f1853';\nvar magenta80 = '#740937';\nvar magenta90 = '#510224';\nvar magenta100 = '#2a0a18';\nvar magenta = {\n 10: magenta10,\n 20: magenta20,\n 30: magenta30,\n 40: magenta40,\n 50: magenta50,\n 60: magenta60,\n 70: magenta70,\n 80: magenta80,\n 90: magenta90,\n 100: magenta100\n};\nvar magenta100Hover = '#53142f';\nvar magenta90Hover = '#68032e';\nvar magenta80Hover = '#8e0b43';\nvar magenta70Hover = '#bf1d63';\nvar magenta60Hover = '#b0215f';\nvar magenta50Hover = '#e3176f';\nvar magenta40Hover = '#ff57a0';\nvar magenta30Hover = '#ff94c3';\nvar magenta20Hover = '#ffbdda';\nvar magenta10Hover = '#ffe0ef';\nvar magentaHover = {\n 100: magenta100Hover,\n 90: magenta90Hover,\n 80: magenta80Hover,\n 70: magenta70Hover,\n 60: magenta60Hover,\n 50: magenta50Hover,\n 40: magenta40Hover,\n 30: magenta30Hover,\n 20: magenta20Hover,\n 10: magenta10Hover\n};\nvar purple10 = '#f6f2ff';\nvar purple20 = '#e8daff';\nvar purple30 = '#d4bbff';\nvar purple40 = '#be95ff';\nvar purple50 = '#a56eff';\nvar purple60 = '#8a3ffc';\nvar purple70 = '#6929c4';\nvar purple80 = '#491d8b';\nvar purple90 = '#31135e';\nvar purple100 = '#1c0f30';\nvar purple = {\n 10: purple10,\n 20: purple20,\n 30: purple30,\n 40: purple40,\n 50: purple50,\n 60: purple60,\n 70: purple70,\n 80: purple80,\n 90: purple90,\n 100: purple100\n};\nvar purple100Hover = '#341c59';\nvar purple90Hover = '#40197b';\nvar purple80Hover = '#5b24ad';\nvar purple70Hover = '#7c3dd6';\nvar purple60Hover = '#7822fb';\nvar purple50Hover = '#9352ff';\nvar purple40Hover = '#ae7aff';\nvar purple30Hover = '#c5a3ff';\nvar purple20Hover = '#dcc7ff';\nvar purple10Hover = '#ede5ff';\nvar purpleHover = {\n 100: purple100Hover,\n 90: purple90Hover,\n 80: purple80Hover,\n 70: purple70Hover,\n 60: purple60Hover,\n 50: purple50Hover,\n 40: purple40Hover,\n 30: purple30Hover,\n 20: purple20Hover,\n 10: purple10Hover\n};\nvar blue10 = '#edf5ff';\nvar blue20 = '#d0e2ff';\nvar blue30 = '#a6c8ff';\nvar blue40 = '#78a9ff';\nvar blue50 = '#4589ff';\nvar blue60 = '#0f62fe';\nvar blue70 = '#0043ce';\nvar blue80 = '#002d9c';\nvar blue90 = '#001d6c';\nvar blue100 = '#001141';\nvar blue = {\n 10: blue10,\n 20: blue20,\n 30: blue30,\n 40: blue40,\n 50: blue50,\n 60: blue60,\n 70: blue70,\n 80: blue80,\n 90: blue90,\n 100: blue100\n};\nvar blue100Hover = '#001f75';\nvar blue90Hover = '#00258a';\nvar blue80Hover = '#0039c7';\nvar blue70Hover = '#0053ff';\nvar blue60Hover = '#0050e6';\nvar blue50Hover = '#1f70ff';\nvar blue40Hover = '#5c97ff';\nvar blue30Hover = '#8ab6ff';\nvar blue20Hover = '#b8d3ff';\nvar blue10Hover = '#dbebff';\nvar blueHover = {\n 100: blue100Hover,\n 90: blue90Hover,\n 80: blue80Hover,\n 70: blue70Hover,\n 60: blue60Hover,\n 50: blue50Hover,\n 40: blue40Hover,\n 30: blue30Hover,\n 20: blue20Hover,\n 10: blue10Hover\n};\nvar cyan10 = '#e5f6ff';\nvar cyan20 = '#bae6ff';\nvar cyan30 = '#82cfff';\nvar cyan40 = '#33b1ff';\nvar cyan50 = '#1192e8';\nvar cyan60 = '#0072c3';\nvar cyan70 = '#00539a';\nvar cyan80 = '#003a6d';\nvar cyan90 = '#012749';\nvar cyan100 = '#061727';\nvar cyan = {\n 10: cyan10,\n 20: cyan20,\n 30: cyan30,\n 40: cyan40,\n 50: cyan50,\n 60: cyan60,\n 70: cyan70,\n 80: cyan80,\n 90: cyan90,\n 100: cyan100\n};\nvar cyan10Hover = '#cceeff';\nvar cyan20Hover = '#99daff';\nvar cyan30Hover = '#57beff';\nvar cyan40Hover = '#059fff';\nvar cyan50Hover = '#0f7ec8';\nvar cyan60Hover = '#005fa3';\nvar cyan70Hover = '#0066bd';\nvar cyan80Hover = '#00498a';\nvar cyan90Hover = '#013360';\nvar cyan100Hover = '#0b2947';\nvar cyanHover = {\n 10: cyan10Hover,\n 20: cyan20Hover,\n 30: cyan30Hover,\n 40: cyan40Hover,\n 50: cyan50Hover,\n 60: cyan60Hover,\n 70: cyan70Hover,\n 80: cyan80Hover,\n 90: cyan90Hover,\n 100: cyan100Hover\n};\nvar teal10 = '#d9fbfb';\nvar teal20 = '#9ef0f0';\nvar teal30 = '#3ddbd9';\nvar teal40 = '#08bdba';\nvar teal50 = '#009d9a';\nvar teal60 = '#007d79';\nvar teal70 = '#005d5d';\nvar teal80 = '#004144';\nvar teal90 = '#022b30';\nvar teal100 = '#081a1c';\nvar teal = {\n 10: teal10,\n 20: teal20,\n 30: teal30,\n 40: teal40,\n 50: teal50,\n 60: teal60,\n 70: teal70,\n 80: teal80,\n 90: teal90,\n 100: teal100\n};\nvar teal10Hover = '#acf6f6';\nvar teal20Hover = '#57e5e5';\nvar teal30Hover = '#25cac8';\nvar teal40Hover = '#07aba9';\nvar teal50Hover = '#008a87';\nvar teal60Hover = '#006b68';\nvar teal70Hover = '#007070';\nvar teal80Hover = '#005357';\nvar teal90Hover = '#033940';\nvar teal100Hover = '#0f3034';\nvar tealHover = {\n 10: teal10Hover,\n 20: teal20Hover,\n 30: teal30Hover,\n 40: teal40Hover,\n 50: teal50Hover,\n 60: teal60Hover,\n 70: teal70Hover,\n 80: teal80Hover,\n 90: teal90Hover,\n 100: teal100Hover\n};\nvar green10 = '#defbe6';\nvar green20 = '#a7f0ba';\nvar green30 = '#6fdc8c';\nvar green40 = '#42be65';\nvar green50 = '#24a148';\nvar green60 = '#198038';\nvar green70 = '#0e6027';\nvar green80 = '#044317';\nvar green90 = '#022d0d';\nvar green100 = '#071908';\nvar green = {\n 10: green10,\n 20: green20,\n 30: green30,\n 40: green40,\n 50: green50,\n 60: green60,\n 70: green70,\n 80: green80,\n 90: green90,\n 100: green100\n};\nvar green10Hover = '#b6f6c8';\nvar green20Hover = '#74e792';\nvar green30Hover = '#36ce5e';\nvar green40Hover = '#3bab5a';\nvar green50Hover = '#208e3f';\nvar green60Hover = '#166f31';\nvar green70Hover = '#11742f';\nvar green80Hover = '#05521c';\nvar green90Hover = '#033b11';\nvar green100Hover = '#0d300f';\nvar greenHover = {\n 10: green10Hover,\n 20: green20Hover,\n 30: green30Hover,\n 40: green40Hover,\n 50: green50Hover,\n 60: green60Hover,\n 70: green70Hover,\n 80: green80Hover,\n 90: green90Hover,\n 100: green100Hover\n};\nvar coolGray10 = '#f2f4f8';\nvar coolGray20 = '#dde1e6';\nvar coolGray30 = '#c1c7cd';\nvar coolGray40 = '#a2a9b0';\nvar coolGray50 = '#878d96';\nvar coolGray60 = '#697077';\nvar coolGray70 = '#4d5358';\nvar coolGray80 = '#343a3f';\nvar coolGray90 = '#21272a';\nvar coolGray100 = '#121619';\nvar coolGray = {\n 10: coolGray10,\n 20: coolGray20,\n 30: coolGray30,\n 40: coolGray40,\n 50: coolGray50,\n 60: coolGray60,\n 70: coolGray70,\n 80: coolGray80,\n 90: coolGray90,\n 100: coolGray100\n};\nvar coolGray10Hover = '#e4e9f1';\nvar coolGray20Hover = '#cdd3da';\nvar coolGray30Hover = '#adb5bd';\nvar coolGray40Hover = '#9199a1';\nvar coolGray50Hover = '#757b85';\nvar coolGray60Hover = '#585e64';\nvar coolGray70Hover = '#5d646a';\nvar coolGray80Hover = '#434a51';\nvar coolGray90Hover = '#2b3236';\nvar coolGray100Hover = '#222a2f';\nvar coolGrayHover = {\n 10: coolGray10Hover,\n 20: coolGray20Hover,\n 30: coolGray30Hover,\n 40: coolGray40Hover,\n 50: coolGray50Hover,\n 60: coolGray60Hover,\n 70: coolGray70Hover,\n 80: coolGray80Hover,\n 90: coolGray90Hover,\n 100: coolGray100Hover\n};\nvar gray10 = '#f4f4f4';\nvar gray20 = '#e0e0e0';\nvar gray30 = '#c6c6c6';\nvar gray40 = '#a8a8a8';\nvar gray50 = '#8d8d8d';\nvar gray60 = '#6f6f6f';\nvar gray70 = '#525252';\nvar gray80 = '#393939';\nvar gray90 = '#262626';\nvar gray100 = '#161616';\nvar gray = {\n 10: gray10,\n 20: gray20,\n 30: gray30,\n 40: gray40,\n 50: gray50,\n 60: gray60,\n 70: gray70,\n 80: gray80,\n 90: gray90,\n 100: gray100\n};\nvar gray10Hover = '#e8e8e8';\nvar gray20Hover = '#d1d1d1';\nvar gray30Hover = '#b5b5b5';\nvar gray40Hover = '#999999';\nvar gray50Hover = '#7a7a7a';\nvar gray60Hover = '#5e5e5e';\nvar gray70Hover = '#636363';\nvar gray80Hover = '#474747';\nvar gray90Hover = '#333333';\nvar gray100Hover = '#292929';\nvar grayHover = {\n 10: gray10Hover,\n 20: gray20Hover,\n 30: gray30Hover,\n 40: gray40Hover,\n 50: gray50Hover,\n 60: gray60Hover,\n 70: gray70Hover,\n 80: gray80Hover,\n 90: gray90Hover,\n 100: gray100Hover\n};\nvar warmGray10 = '#f7f3f2';\nvar warmGray20 = '#e5e0df';\nvar warmGray30 = '#cac5c4';\nvar warmGray40 = '#ada8a8';\nvar warmGray50 = '#8f8b8b';\nvar warmGray60 = '#726e6e';\nvar warmGray70 = '#565151';\nvar warmGray80 = '#3c3838';\nvar warmGray90 = '#272525';\nvar warmGray100 = '#171414';\nvar warmGray = {\n 10: warmGray10,\n 20: warmGray20,\n 30: warmGray30,\n 40: warmGray40,\n 50: warmGray50,\n 60: warmGray60,\n 70: warmGray70,\n 80: warmGray80,\n 90: warmGray90,\n 100: warmGray100\n};\nvar warmGray10Hover = '#f0e8e6';\nvar warmGray20Hover = '#d8d0cf';\nvar warmGray30Hover = '#b9b3b1';\nvar warmGray40Hover = '#9c9696';\nvar warmGray50Hover = '#7f7b7b';\nvar warmGray60Hover = '#605d5d';\nvar warmGray70Hover = '#696363';\nvar warmGray80Hover = '#4c4848';\nvar warmGray90Hover = '#343232';\nvar warmGray100Hover = '#2c2626';\nvar warmGrayHover = {\n 10: warmGray10Hover,\n 20: warmGray20Hover,\n 30: warmGray30Hover,\n 40: warmGray40Hover,\n 50: warmGray50Hover,\n 60: warmGray60Hover,\n 70: warmGray70Hover,\n 80: warmGray80Hover,\n 90: warmGray90Hover,\n 100: warmGray100Hover\n};\nvar colors = {\n black: {\n 100: black\n },\n blue: blue,\n coolGray: coolGray,\n cyan: cyan,\n gray: gray,\n green: green,\n magenta: magenta,\n orange: orange,\n purple: purple,\n red: red,\n teal: teal,\n warmGray: warmGray,\n white: {\n 0: white\n },\n yellow: yellow\n};\nvar hoverColors = {\n whiteHover: whiteHover,\n blackHover: blackHover,\n blueHover: blueHover,\n coolGrayHover: coolGrayHover,\n cyanHover: cyanHover,\n grayHover: grayHover,\n greenHover: greenHover,\n magentaHover: magentaHover,\n orangeHover: orangeHover,\n purpleHover: purpleHover,\n redHover: redHover,\n tealHover: tealHover,\n warmGrayHover: warmGrayHover,\n yellowHover: yellowHover\n};\n\n/**\n * Copyright IBM Corp. 2018, 2023\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n/**\n * Parse a given hexcode string into an rgba statement with the given opacity\n * @param {string} hexcode\n * @param {number} opacity\n * @returns {string}\n */\nfunction rgba(hexcode, opacity) {\n var values = [hexcode.substring(1, 3), hexcode.substring(3, 5), hexcode.substring(5, 7)].map(function (string) {\n return parseInt(string, 16);\n });\n return \"rgba(\".concat(values[0], \", \").concat(values[1], \", \").concat(values[2], \", \").concat(opacity, \")\");\n}\n\nexport { black, black100, blackHover, blue, blue10, blue100, blue100Hover, blue10Hover, blue20, blue20Hover, blue30, blue30Hover, blue40, blue40Hover, blue50, blue50Hover, blue60, blue60Hover, blue70, blue70Hover, blue80, blue80Hover, blue90, blue90Hover, blueHover, colors, coolGray, coolGray10, coolGray100, coolGray100Hover, coolGray10Hover, coolGray20, coolGray20Hover, coolGray30, coolGray30Hover, coolGray40, coolGray40Hover, coolGray50, coolGray50Hover, coolGray60, coolGray60Hover, coolGray70, coolGray70Hover, coolGray80, coolGray80Hover, coolGray90, coolGray90Hover, coolGrayHover, cyan, cyan10, cyan100, cyan100Hover, cyan10Hover, cyan20, cyan20Hover, cyan30, cyan30Hover, cyan40, cyan40Hover, cyan50, cyan50Hover, cyan60, cyan60Hover, cyan70, cyan70Hover, cyan80, cyan80Hover, cyan90, cyan90Hover, cyanHover, gray, gray10, gray100, gray100Hover, gray10Hover, gray20, gray20Hover, gray30, gray30Hover, gray40, gray40Hover, gray50, gray50Hover, gray60, gray60Hover, gray70, gray70Hover, gray80, gray80Hover, gray90, gray90Hover, grayHover, green, green10, green100, green100Hover, green10Hover, green20, green20Hover, green30, green30Hover, green40, green40Hover, green50, green50Hover, green60, green60Hover, green70, green70Hover, green80, green80Hover, green90, green90Hover, greenHover, hoverColors, magenta, magenta10, magenta100, magenta100Hover, magenta10Hover, magenta20, magenta20Hover, magenta30, magenta30Hover, magenta40, magenta40Hover, magenta50, magenta50Hover, magenta60, magenta60Hover, magenta70, magenta70Hover, magenta80, magenta80Hover, magenta90, magenta90Hover, magentaHover, orange, orange10, orange100, orange100Hover, orange10Hover, orange20, orange20Hover, orange30, orange30Hover, orange40, orange40Hover, orange50, orange50Hover, orange60, orange60Hover, orange70, orange70Hover, orange80, orange80Hover, orange90, orange90Hover, orangeHover, purple, purple10, purple100, purple100Hover, purple10Hover, purple20, purple20Hover, purple30, purple30Hover, purple40, purple40Hover, purple50, purple50Hover, purple60, purple60Hover, purple70, purple70Hover, purple80, purple80Hover, purple90, purple90Hover, purpleHover, red, red10, red100, red100Hover, red10Hover, red20, red20Hover, red30, red30Hover, red40, red40Hover, red50, red50Hover, red60, red60Hover, red70, red70Hover, red80, red80Hover, red90, red90Hover, redHover, rgba, teal, teal10, teal100, teal100Hover, teal10Hover, teal20, teal20Hover, teal30, teal30Hover, teal40, teal40Hover, teal50, teal50Hover, teal60, teal60Hover, teal70, teal70Hover, teal80, teal80Hover, teal90, teal90Hover, tealHover, warmGray, warmGray10, warmGray100, warmGray100Hover, warmGray10Hover, warmGray20, warmGray20Hover, warmGray30, warmGray30Hover, warmGray40, warmGray40Hover, warmGray50, warmGray50Hover, warmGray60, warmGray60Hover, warmGray70, warmGray70Hover, warmGray80, warmGray80Hover, warmGray90, warmGray90Hover, warmGrayHover, white, white0, whiteHover, yellow, yellow10, yellow100, yellow100Hover, yellow10Hover, yellow20, yellow20Hover, yellow30, yellow30Hover, yellow40, yellow40Hover, yellow50, yellow50Hover, yellow60, yellow60Hover, yellow70, yellow70Hover, yellow80, yellow80Hover, yellow90, yellow90Hover, yellowHover };\n","import { color as d3Color, hierarchy as d3Hierarchy, hsl, treemap as d3Treemap, select } from 'd3'\nimport { colors } from '@carbon/colors'\nimport { getProperty } from '@/tools'\nimport { Component } from '@/components/component'\nimport { DOMUtils } from '@/services/essentials/dom-utils'\nimport { Events, ColorClassNameTypes, RenderTypes } from '@/interfaces/enums'\n\nconst findColorShade = (hex: string) => {\n\tif (!hex) {\n\t\treturn null\n\t}\n\n\tfor (const colorName of Object.keys(colors)) {\n\t\tconst colorShades = colors[colorName as keyof typeof colors]\n\n\t\tfor (const colorShadeLevel of Object.keys(colorShades)) {\n\t\t\tconst colorShade = colorShades[+colorShadeLevel]\n\n\t\t\tif (colorShade === hex) {\n\t\t\t\treturn colorShadeLevel\n\t\t\t}\n\t\t}\n\t}\n\n\treturn null\n}\n\nconst textFillColor = function (data) {\n\tconst correspondingLeaf = select(this.parentNode).select('rect.leaf')\n\tconst correspondingLeafFill: string =\n\t\tdata.backgroundColor ??\n\t\tgetComputedStyle(correspondingLeaf.node() as Element, null).getPropertyValue('fill')\n\tconst cl = d3Color(correspondingLeafFill)\n\n\tlet colorShade: any\n\n\tif (cl) {\n\t\tcolorShade = findColorShade(cl ? cl.hex() : null)\n\t}\n\n\tif (colorShade === null || colorShade === undefined) {\n\t\tconst lightness = hsl(cl).l\n\t\tcolorShade = Math.abs(lightness * 100 - 100)\n\t}\n\n\treturn colorShade > 50 ? 'white' : 'black'\n}\n\nlet uidCounter = 0\nexport class Treemap extends Component {\n\ttype = 'treemap'\n\trenderType = RenderTypes.SVG\n\n\tinit() {\n\t\tconst { events } = this.services\n\t\t// Highlight correct circle on legend item hovers\n\t\tevents.addEventListener(Events.Legend.ITEM_HOVER, this.handleLegendOnHover)\n\t\t// Un-highlight circles on legend item mouseouts\n\t\tevents.addEventListener(Events.Legend.ITEM_MOUSEOUT, this.handleLegendMouseOut)\n\t}\n\n\trender(animate = true) {\n\t\tconst svg = this.getComponentContainer({\n\t\t\tariaLabel: 'treemap',\n\t\t})\n\n\t\tthis.model.getData()\n\t\tconst displayData = this.model.getDisplayData()\n\t\tconst options = this.model.getOptions()\n\n\t\tconst windowLocation = getProperty(window, 'location')\n\n\t\tconst { width, height } = DOMUtils.getSVGElementSize(svg, {\n\t\t\tuseAttrs: true\n\t\t})\n\n\t\tconst hierarchy = d3Hierarchy({\n\t\t\tname: options.title || 'Treemap',\n\t\t\tchildren: displayData\n\t\t})\n\t\t\t.sum((d: any) => d.value)\n\t\t\t.sort((a, b) => b.value - a.value)\n\n\t\tconst root = d3Treemap().size([width, height]).paddingInner(1).paddingOuter(0).round(true)(\n\t\t\thierarchy\n\t\t)\n\n\t\tconst leafGroups = svg\n\t\t\t.selectAll(\"g[data-name='leaf']\")\n\t\t\t.data(root.leaves(), (leaf: any) => leaf.data.name)\n\n\t\t// Remove leaf groups that need to be removed\n\t\tleafGroups.exit().attr('opacity', 0).remove()\n\n\t\t// Add the leaf groups that need to be introduced\n\t\tconst enteringLeafGroups = leafGroups\n\t\t\t.enter()\n\t\t\t.append('g')\n\t\t\t.attr('data-name', 'leaf')\n\t\t\t.attr('data-uid', () => uidCounter++)\n\n\t\tconst allLeafGroups = enteringLeafGroups.merge(leafGroups as any)\n\n\t\tallLeafGroups\n\t\t\t.attr('data-name', 'leaf')\n\t\t\t.transition()\n\t\t\t.call((t: any) =>\n\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\ttransition: t,\n\t\t\t\t\tname: 'treemap-group-update',\n\t\t\t\t\tanimate\n\t\t\t\t})\n\t\t\t)\n\t\t\t.attr('transform', (d: any) => `translate(${d.x0},${d.y0})`)\n\n\t\tconst rects = allLeafGroups.selectAll('rect.leaf').data((d: any) => [d])\n\n\t\trects.exit().attr('width', 0).attr('height', 0).remove()\n\n\t\tconst enteringRects = rects.enter().append('rect').classed('leaf', true)\n\n\t\tenteringRects\n\t\t\t.merge(rects as any)\n\t\t\t.attr('width', 0)\n\t\t\t.attr('height', 0)\n\t\t\t.attr('id', function () {\n\t\t\t\tconst uid: any = select(this.parentNode as any).attr('data-uid')\n\t\t\t\treturn `${options.style.prefix}-leaf-${uid}`\n\t\t\t})\n\t\t\t.attr('class', (d: any) => {\n\t\t\t\twhile (d.depth > 1) d = d.parent\n\n\t\t\t\treturn this.model.getColorClassName({\n\t\t\t\t\tclassNameTypes: [ColorClassNameTypes.FILL],\n\t\t\t\t\tdataGroupName: d.data.name,\n\t\t\t\t\toriginalClassName: 'leaf'\n\t\t\t\t})\n\t\t\t})\n\t\t\t.transition()\n\t\t\t.call((t: any) =>\n\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\ttransition: t,\n\t\t\t\t\tname: 'treemap-leaf-update-enter',\n\t\t\t\t\tanimate\n\t\t\t\t})\n\t\t\t)\n\t\t\t.attr('width', (d: any) => d.x1 - d.x0)\n\t\t\t.attr('height', (d: any) => d.y1 - d.y0)\n\t\t\t.style('fill', (d: any) => {\n\t\t\t\twhile (d.depth > 1) d = d.parent\n\t\t\t\treturn this.model.getFillColor(d.data.name, null, d.data)\n\t\t\t})\n\n\t\t// Update all clip paths\n\t\tallLeafGroups\n\t\t\t.selectAll('clipPath')\n\t\t\t.data(\n\t\t\t\t(d: any) => {\n\t\t\t\t\tif (d.data.showLabel !== true) {\n\t\t\t\t\t\treturn []\n\t\t\t\t\t}\n\n\t\t\t\t\treturn [1]\n\t\t\t\t},\n\t\t\t\t(d: any) => d\n\t\t\t)\n\t\t\t.join(\n\t\t\t\t(enter: any) => {\n\t\t\t\t\treturn enter\n\t\t\t\t\t\t.append('clipPath')\n\t\t\t\t\t\t.attr('id', function () {\n\t\t\t\t\t\t\tconst uid = select(this.parentNode).attr('data-uid')\n\t\t\t\t\t\t\treturn `${options.style.prefix}-clip-${uid}`\n\t\t\t\t\t\t})\n\t\t\t\t\t\t.append('use')\n\t\t\t\t\t\t.attr('xlink:href', function () {\n\t\t\t\t\t\t\tconst uid = select(this.parentNode.parentNode).attr('data-uid')\n\t\t\t\t\t\t\tconst leafID = `${options.style.prefix}-leaf-${uid}`\n\n\t\t\t\t\t\t\treturn new URL(`#${leafID}`, windowLocation) + ''\n\t\t\t\t\t\t})\n\t\t\t\t},\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n\t\t\t\t// @ts-ignore\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-unused-vars\n\t\t\t\t(update: any) => null as any,\n\t\t\t\t(exit: any) => exit.remove()\n\t\t\t)\n\n\t\t// Update all titles\n\t\tallLeafGroups\n\t\t\t.selectAll('text')\n\t\t\t.data(\n\t\t\t\t(d: any) => {\n\t\t\t\t\tif (d.data.showLabel !== true) {\n\t\t\t\t\t\treturn []\n\t\t\t\t\t}\n\n\t\t\t\t\tlet parent = d\n\t\t\t\t\twhile (parent.depth > 1) parent = parent.parent\n\n\t\t\t\t\treturn [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttext: d.data.name,\n\t\t\t\t\t\t\tbackgroundColor: this.model.getFillColor(parent.data.name)\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t},\n\t\t\t\t(d: any) => d\n\t\t\t)\n\t\t\t.join(\n\t\t\t\t(enter: any) => {\n\t\t\t\t\tconst addedText = enter\n\t\t\t\t\t\t.append('text')\n\t\t\t\t\t\t.text((d: any) => d.text)\n\t\t\t\t\t\t.style('fill', textFillColor)\n\t\t\t\t\t\t.attr('x', 7)\n\t\t\t\t\t\t.attr('y', 18)\n\n\t\t\t\t\tif (windowLocation) {\n\t\t\t\t\t\taddedText.attr('clip-path', function () {\n\t\t\t\t\t\t\tconst uid = select(this.parentNode).attr('data-uid')\n\t\t\t\t\t\t\tconst clipPathID = `${options.style.prefix}-clip-${uid}`\n\n\t\t\t\t\t\t\treturn `url(${new URL(`#${clipPathID}`, windowLocation) + ''})`\n\t\t\t\t\t\t})\n\t\t\t\t\t}\n\t\t\t\t\treturn addedText\n\t\t\t\t},\n\t\t\t\t(update: any) => update.text((d: any) => d.text).style('fill', textFillColor),\n\t\t\t\t(exit: any) => exit.remove()\n\t\t\t)\n\n\t\t// Add event listeners to elements drawn\n\t\tthis.addEventListeners()\n\t}\n\n\taddEventListeners() {\n\t\tconst self = this\n\t\tthis.parent\n\t\t\t.selectAll('rect.leaf')\n\t\t\t.on('mouseover', function (event: MouseEvent, datum: any) {\n\t\t\t\tconst hoveredElement = select(this)\n\t\t\t\tlet fillColor = getComputedStyle(this as Element, null).getPropertyValue('fill')\n\n\t\t\t\tlet parent = datum\n\t\t\t\twhile (parent.depth > 1) parent = parent.parent\n\n\t\t\t\thoveredElement\n\t\t\t\t\t.transition('graph_element_mouseover_fill_update')\n\t\t\t\t\t.call((t: any) =>\n\t\t\t\t\t\tself.services.transitions.setupTransition({\n\t\t\t\t\t\t\ttransition: t,\n\t\t\t\t\t\t\tname: 'graph_element_mouseover_fill_update'\n\t\t\t\t\t\t})\n\t\t\t\t\t)\n\t\t\t\t\t.style('fill', (d: any) => {\n\t\t\t\t\t\tconst customColor = self.model.getFillColor(d.parent.data.name, null, d.data)\n\t\t\t\t\t\tif (customColor) {\n\t\t\t\t\t\t\tfillColor = customColor\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn d3Color(fillColor).darker(0.7).toString()\n\t\t\t\t\t})\n\n\t\t\t\t// Show tooltip\n\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.SHOW, {\n\t\t\t\t\tevent,\n\t\t\t\t\thoveredElement,\n\t\t\t\t\titems: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcolor: fillColor,\n\t\t\t\t\t\t\tlabel: parent.data.name,\n\t\t\t\t\t\t\tbold: true\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel: datum.data.name,\n\t\t\t\t\t\t\tvalue: datum.data.value\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t})\n\n\t\t\t\t// Dispatch mouse event\n\t\t\t\tself.services.events.dispatchEvent(Events.Treemap.LEAF_MOUSEOVER, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: hoveredElement,\n\t\t\t\t\tdatum\n\t\t\t\t})\n\t\t\t})\n\t\t\t.on('mousemove', function (event: MouseEvent, datum: any) {\n\t\t\t\tconst hoveredElement = select(this)\n\n\t\t\t\t// Dispatch mouse event\n\t\t\t\tself.services.events.dispatchEvent(Events.Treemap.LEAF_MOUSEMOVE, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: hoveredElement,\n\t\t\t\t\tdatum\n\t\t\t\t})\n\n\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.MOVE, {\n\t\t\t\t\tevent\n\t\t\t\t})\n\t\t\t})\n\t\t\t.on('click', function (event: MouseEvent, datum: any) {\n\t\t\t\t// Dispatch mouse event\n\t\t\t\tself.services.events.dispatchEvent(Events.Treemap.LEAF_CLICK, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: select(this),\n\t\t\t\t\tdatum\n\t\t\t\t})\n\t\t\t})\n\t\t\t.on('mouseout', function (event: MouseEvent, datum: any) {\n\t\t\t\tconst hoveredElement = select(this)\n\t\t\t\thoveredElement.classed('hovered', false)\n\n\t\t\t\tlet parent = datum\n\t\t\t\twhile (parent.depth > 1) parent = parent.parent\n\n\t\t\t\thoveredElement\n\t\t\t\t\t.transition()\n\t\t\t\t\t.call((t: any) =>\n\t\t\t\t\t\tself.services.transitions.setupTransition({\n\t\t\t\t\t\t\ttransition: t,\n\t\t\t\t\t\t\tname: 'graph_element_mouseout_fill_update'\n\t\t\t\t\t\t})\n\t\t\t\t\t)\n\t\t\t\t\t.style('fill', (d: any) => self.model.getFillColor(d.parent.data.name, null, d.data))\n\n\t\t\t\t// Dispatch mouse event\n\t\t\t\tself.services.events.dispatchEvent(Events.Treemap.LEAF_MOUSEOUT, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: hoveredElement,\n\t\t\t\t\tdatum\n\t\t\t\t})\n\n\t\t\t\t// Hide tooltip\n\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.HIDE, {\n\t\t\t\t\thoveredElement\n\t\t\t\t})\n\t\t\t})\n\t}\n\n\thandleLegendOnHover = (event: CustomEvent) => {\n\t\tconst { hoveredElement } = event.detail\n\n\t\tthis.parent\n\t\t\t.selectAll(\"g[data-name='leaf']\")\n\t\t\t.transition('legend-hover-treemap')\n\t\t\t.call((t: any) =>\n\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\ttransition: t,\n\t\t\t\t\tname: 'legend-hover-treemap'\n\t\t\t\t})\n\t\t\t)\n\t\t\t.attr('opacity', (d: any) =>\n\t\t\t\td.parent.data.name === hoveredElement.datum()['name'] ? 1 : 0.3\n\t\t\t)\n\t}\n\n\thandleLegendMouseOut = () => {\n\t\tthis.parent\n\t\t\t.selectAll(\"g[data-name='leaf']\")\n\t\t\t.transition('legend-mouseout-treemap')\n\t\t\t.call((t: any) =>\n\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\ttransition: t,\n\t\t\t\t\tname: 'legend-mouseout-treemap'\n\t\t\t\t})\n\t\t\t)\n\t\t\t.attr('opacity', 1)\n\t}\n}\n","var noop = {value: function() {}};\n\nfunction dispatch() {\n for (var i = 0, n = arguments.length, _ = {}, t; i < n; ++i) {\n if (!(t = arguments[i] + \"\") || (t in _) || /[\\s.]/.test(t)) throw new Error(\"illegal type: \" + t);\n _[t] = [];\n }\n return new Dispatch(_);\n}\n\nfunction Dispatch(_) {\n this._ = _;\n}\n\nfunction parseTypenames(typenames, types) {\n return typenames.trim().split(/^|\\s+/).map(function(t) {\n var name = \"\", i = t.indexOf(\".\");\n if (i >= 0) name = t.slice(i + 1), t = t.slice(0, i);\n if (t && !types.hasOwnProperty(t)) throw new Error(\"unknown type: \" + t);\n return {type: t, name: name};\n });\n}\n\nDispatch.prototype = dispatch.prototype = {\n constructor: Dispatch,\n on: function(typename, callback) {\n var _ = this._,\n T = parseTypenames(typename + \"\", _),\n t,\n i = -1,\n n = T.length;\n\n // If no callback was specified, return the callback of the given type and name.\n if (arguments.length < 2) {\n while (++i < n) if ((t = (typename = T[i]).type) && (t = get(_[t], typename.name))) return t;\n return;\n }\n\n // If a type was specified, set the callback for the given type and name.\n // Otherwise, if a null callback was specified, remove callbacks of the given name.\n if (callback != null && typeof callback !== \"function\") throw new Error(\"invalid callback: \" + callback);\n while (++i < n) {\n if (t = (typename = T[i]).type) _[t] = set(_[t], typename.name, callback);\n else if (callback == null) for (t in _) _[t] = set(_[t], typename.name, null);\n }\n\n return this;\n },\n copy: function() {\n var copy = {}, _ = this._;\n for (var t in _) copy[t] = _[t].slice();\n return new Dispatch(copy);\n },\n call: function(type, that) {\n if ((n = arguments.length - 2) > 0) for (var args = new Array(n), i = 0, n, t; i < n; ++i) args[i] = arguments[i + 2];\n if (!this._.hasOwnProperty(type)) throw new Error(\"unknown type: \" + type);\n for (t = this._[type], i = 0, n = t.length; i < n; ++i) t[i].value.apply(that, args);\n },\n apply: function(type, that, args) {\n if (!this._.hasOwnProperty(type)) throw new Error(\"unknown type: \" + type);\n for (var t = this._[type], i = 0, n = t.length; i < n; ++i) t[i].value.apply(that, args);\n }\n};\n\nfunction get(type, name) {\n for (var i = 0, n = type.length, c; i < n; ++i) {\n if ((c = type[i]).name === name) {\n return c.value;\n }\n }\n}\n\nfunction set(type, name, callback) {\n for (var i = 0, n = type.length; i < n; ++i) {\n if (type[i].name === name) {\n type[i] = noop, type = type.slice(0, i).concat(type.slice(i + 1));\n break;\n }\n }\n if (callback != null) type.push({name: name, value: callback});\n return type;\n}\n\nexport default dispatch;\n","// Word cloud layout by Jason Davies, https://www.jasondavies.com/wordcloud/\n// Algorithm due to Jonathan Feinberg, https://s3.amazonaws.com/static.mrfeinberg.com/bv_ch03.pdf\n\nconst dispatch = require(\"d3-dispatch\").dispatch;\n\nconst RADIANS = Math.PI / 180;\n\nconst SPIRALS = {\n archimedean: archimedeanSpiral,\n rectangular: rectangularSpiral\n};\n\nconst cw = 1 << 11 >> 5;\nconst ch = 1 << 11;\n\nmodule.exports = function() {\n var size = [256, 256],\n text = cloudText,\n font = cloudFont,\n fontSize = cloudFontSize,\n fontStyle = cloudFontNormal,\n fontWeight = cloudFontNormal,\n rotate = cloudRotate,\n padding = cloudPadding,\n spiral = archimedeanSpiral,\n words = [],\n timeInterval = Infinity,\n event = dispatch(\"word\", \"end\"),\n timer = null,\n random = Math.random,\n cloud = {},\n canvas = cloudCanvas;\n\n cloud.canvas = function(_) {\n return arguments.length ? (canvas = functor(_), cloud) : canvas;\n };\n\n cloud.start = function() {\n var contextAndRatio = getContext(canvas()),\n board = zeroArray((size[0] >> 5) * size[1]),\n bounds = null,\n n = words.length,\n i = -1,\n tags = [],\n data = words.map(function(d, i) {\n d.text = text.call(this, d, i);\n d.font = font.call(this, d, i);\n d.style = fontStyle.call(this, d, i);\n d.weight = fontWeight.call(this, d, i);\n d.rotate = rotate.call(this, d, i);\n d.size = ~~fontSize.call(this, d, i);\n d.padding = padding.call(this, d, i);\n return d;\n }).sort(function(a, b) { return b.size - a.size; });\n\n if (timer) clearInterval(timer);\n timer = setInterval(step, 0);\n step();\n\n return cloud;\n\n function step() {\n var start = Date.now();\n while (Date.now() - start < timeInterval && ++i < n && timer) {\n var d = data[i];\n d.x = (size[0] * (random() + .5)) >> 1;\n d.y = (size[1] * (random() + .5)) >> 1;\n cloudSprite(contextAndRatio, d, data, i);\n if (d.hasText && place(board, d, bounds)) {\n tags.push(d);\n event.call(\"word\", cloud, d);\n if (bounds) cloudBounds(bounds, d);\n else bounds = [{x: d.x + d.x0, y: d.y + d.y0}, {x: d.x + d.x1, y: d.y + d.y1}];\n // Temporary hack\n d.x -= size[0] >> 1;\n d.y -= size[1] >> 1;\n }\n }\n if (i >= n) {\n cloud.stop();\n event.call(\"end\", cloud, tags, bounds);\n }\n }\n }\n\n cloud.stop = function() {\n if (timer) {\n clearInterval(timer);\n timer = null;\n }\n for (const d of words) {\n delete d.sprite;\n }\n return cloud;\n };\n\n function getContext(canvas) {\n const context = canvas.getContext(\"2d\", {willReadFrequently: true});\n\n canvas.width = canvas.height = 1;\n const ratio = Math.sqrt(context.getImageData(0, 0, 1, 1).data.length >> 2);\n canvas.width = (cw << 5) / ratio;\n canvas.height = ch / ratio;\n\n context.fillStyle = context.strokeStyle = \"red\";\n\n return {context, ratio};\n }\n\n function place(board, tag, bounds) {\n var perimeter = [{x: 0, y: 0}, {x: size[0], y: size[1]}],\n startX = tag.x,\n startY = tag.y,\n maxDelta = Math.sqrt(size[0] * size[0] + size[1] * size[1]),\n s = spiral(size),\n dt = random() < .5 ? 1 : -1,\n t = -dt,\n dxdy,\n dx,\n dy;\n\n while (dxdy = s(t += dt)) {\n dx = ~~dxdy[0];\n dy = ~~dxdy[1];\n\n if (Math.min(Math.abs(dx), Math.abs(dy)) >= maxDelta) break;\n\n tag.x = startX + dx;\n tag.y = startY + dy;\n\n if (tag.x + tag.x0 < 0 || tag.y + tag.y0 < 0 ||\n tag.x + tag.x1 > size[0] || tag.y + tag.y1 > size[1]) continue;\n // TODO only check for collisions within current bounds.\n if (!bounds || collideRects(tag, bounds)) {\n if (!cloudCollide(tag, board, size[0])) {\n var sprite = tag.sprite,\n w = tag.width >> 5,\n sw = size[0] >> 5,\n lx = tag.x - (w << 4),\n sx = lx & 0x7f,\n msx = 32 - sx,\n h = tag.y1 - tag.y0,\n x = (tag.y + tag.y0) * sw + (lx >> 5),\n last;\n for (var j = 0; j < h; j++) {\n last = 0;\n for (var i = 0; i <= w; i++) {\n board[x + i] |= (last << msx) | (i < w ? (last = sprite[j * w + i]) >>> sx : 0);\n }\n x += sw;\n }\n return true;\n }\n }\n }\n return false;\n }\n\n cloud.timeInterval = function(_) {\n return arguments.length ? (timeInterval = _ == null ? Infinity : _, cloud) : timeInterval;\n };\n\n cloud.words = function(_) {\n return arguments.length ? (words = _, cloud) : words;\n };\n\n cloud.size = function(_) {\n return arguments.length ? (size = [+_[0], +_[1]], cloud) : size;\n };\n\n cloud.font = function(_) {\n return arguments.length ? (font = functor(_), cloud) : font;\n };\n\n cloud.fontStyle = function(_) {\n return arguments.length ? (fontStyle = functor(_), cloud) : fontStyle;\n };\n\n cloud.fontWeight = function(_) {\n return arguments.length ? (fontWeight = functor(_), cloud) : fontWeight;\n };\n\n cloud.rotate = function(_) {\n return arguments.length ? (rotate = functor(_), cloud) : rotate;\n };\n\n cloud.text = function(_) {\n return arguments.length ? (text = functor(_), cloud) : text;\n };\n\n cloud.spiral = function(_) {\n return arguments.length ? (spiral = SPIRALS[_] || _, cloud) : spiral;\n };\n\n cloud.fontSize = function(_) {\n return arguments.length ? (fontSize = functor(_), cloud) : fontSize;\n };\n\n cloud.padding = function(_) {\n return arguments.length ? (padding = functor(_), cloud) : padding;\n };\n\n cloud.random = function(_) {\n return arguments.length ? (random = _, cloud) : random;\n };\n\n cloud.on = function() {\n var value = event.on.apply(event, arguments);\n return value === event ? cloud : value;\n };\n\n return cloud;\n};\n\nfunction cloudText(d) {\n return d.text;\n}\n\nfunction cloudFont() {\n return \"serif\";\n}\n\nfunction cloudFontNormal() {\n return \"normal\";\n}\n\nfunction cloudFontSize(d) {\n return Math.sqrt(d.value);\n}\n\nfunction cloudRotate() {\n return (~~(random() * 6) - 3) * 30;\n}\n\nfunction cloudPadding() {\n return 1;\n}\n\n// Fetches a monochrome sprite bitmap for the specified text.\n// Load in batches for speed.\nfunction cloudSprite(contextAndRatio, d, data, di) {\n if (d.sprite) return;\n var c = contextAndRatio.context,\n ratio = contextAndRatio.ratio;\n\n c.clearRect(0, 0, (cw << 5) / ratio, ch / ratio);\n var x = 0,\n y = 0,\n maxh = 0,\n n = data.length;\n --di;\n while (++di < n) {\n d = data[di];\n c.save();\n c.font = d.style + \" \" + d.weight + \" \" + ~~((d.size + 1) / ratio) + \"px \" + d.font;\n const metrics = c.measureText(d.text);\n const anchor = -Math.floor(metrics.width / 2);\n let w = (metrics.width + 1) * ratio;\n let h = d.size << 1;\n if (d.rotate) {\n var sr = Math.sin(d.rotate * RADIANS),\n cr = Math.cos(d.rotate * RADIANS),\n wcr = w * cr,\n wsr = w * sr,\n hcr = h * cr,\n hsr = h * sr;\n w = (Math.max(Math.abs(wcr + hsr), Math.abs(wcr - hsr)) + 0x1f) >> 5 << 5;\n h = ~~Math.max(Math.abs(wsr + hcr), Math.abs(wsr - hcr));\n } else {\n w = (w + 0x1f) >> 5 << 5;\n }\n if (h > maxh) maxh = h;\n if (x + w >= (cw << 5)) {\n x = 0;\n y += maxh;\n maxh = 0;\n }\n if (y + h >= ch) break;\n c.translate((x + (w >> 1)) / ratio, (y + (h >> 1)) / ratio);\n if (d.rotate) c.rotate(d.rotate * RADIANS);\n c.fillText(d.text, anchor, 0);\n if (d.padding) c.lineWidth = 2 * d.padding, c.strokeText(d.text, anchor, 0);\n c.restore();\n d.width = w;\n d.height = h;\n d.xoff = x;\n d.yoff = y;\n d.x1 = w >> 1;\n d.y1 = h >> 1;\n d.x0 = -d.x1;\n d.y0 = -d.y1;\n d.hasText = true;\n x += w;\n }\n var pixels = c.getImageData(0, 0, (cw << 5) / ratio, ch / ratio).data,\n sprite = [];\n while (--di >= 0) {\n d = data[di];\n if (!d.hasText) continue;\n var w = d.width,\n w32 = w >> 5,\n h = d.y1 - d.y0;\n // Zero the buffer\n for (var i = 0; i < h * w32; i++) sprite[i] = 0;\n x = d.xoff;\n if (x == null) return;\n y = d.yoff;\n var seen = 0,\n seenRow = -1;\n for (var j = 0; j < h; j++) {\n for (var i = 0; i < w; i++) {\n var k = w32 * j + (i >> 5),\n m = pixels[((y + j) * (cw << 5) + (x + i)) << 2] ? 1 << (31 - (i % 32)) : 0;\n sprite[k] |= m;\n seen |= m;\n }\n if (seen) seenRow = j;\n else {\n d.y0++;\n h--;\n j--;\n y++;\n }\n }\n d.y1 = d.y0 + seenRow;\n d.sprite = sprite.slice(0, (d.y1 - d.y0) * w32);\n }\n}\n\n// Use mask-based collision detection.\nfunction cloudCollide(tag, board, sw) {\n sw >>= 5;\n var sprite = tag.sprite,\n w = tag.width >> 5,\n lx = tag.x - (w << 4),\n sx = lx & 0x7f,\n msx = 32 - sx,\n h = tag.y1 - tag.y0,\n x = (tag.y + tag.y0) * sw + (lx >> 5),\n last;\n for (var j = 0; j < h; j++) {\n last = 0;\n for (var i = 0; i <= w; i++) {\n if (((last << msx) | (i < w ? (last = sprite[j * w + i]) >>> sx : 0))\n & board[x + i]) return true;\n }\n x += sw;\n }\n return false;\n}\n\nfunction cloudBounds(bounds, d) {\n var b0 = bounds[0],\n b1 = bounds[1];\n if (d.x + d.x0 < b0.x) b0.x = d.x + d.x0;\n if (d.y + d.y0 < b0.y) b0.y = d.y + d.y0;\n if (d.x + d.x1 > b1.x) b1.x = d.x + d.x1;\n if (d.y + d.y1 > b1.y) b1.y = d.y + d.y1;\n}\n\nfunction collideRects(a, b) {\n return a.x + a.x1 > b[0].x && a.x + a.x0 < b[1].x && a.y + a.y1 > b[0].y && a.y + a.y0 < b[1].y;\n}\n\nfunction archimedeanSpiral(size) {\n var e = size[0] / size[1];\n return function(t) {\n return [e * (t *= .1) * Math.cos(t), t * Math.sin(t)];\n };\n}\n\nfunction rectangularSpiral(size) {\n var dy = 4,\n dx = dy * size[0] / size[1],\n x = 0,\n y = 0;\n return function(t) {\n var sign = t < 0 ? -1 : 1;\n // See triangular numbers: T_n = n * (n + 1) / 2.\n switch ((Math.sqrt(1 + 4 * sign * t) - sign) & 3) {\n case 0: x += dx; break;\n case 1: y += dy; break;\n case 2: x -= dx; break;\n default: y -= dy; break;\n }\n return [x, y];\n };\n}\n\n// TODO reuse arrays?\nfunction zeroArray(n) {\n var a = [],\n i = -1;\n while (++i < n) a[i] = 0;\n return a;\n}\n\nfunction cloudCanvas() {\n return document.createElement(\"canvas\");\n}\n\nfunction functor(d) {\n return typeof d === \"function\" ? d : function() { return d; };\n}\n","import { extent, scaleLinear, select } from 'd3'\nimport cloud from 'd3-cloud'\nimport { debounce, get } from 'lodash-es'\nimport { Component } from '@/components/component'\nimport { DOMUtils } from '@/services/essentials/dom-utils'\nimport { Events, ColorClassNameTypes, RenderTypes } from '@/interfaces/enums'\n\nexport class WordCloud extends Component {\n\ttype = 'wordcloud'\n\trenderType = RenderTypes.SVG\n\n\tinit() {\n\t\tconst eventsFragment = this.services.events\n\n\t\t// Highlight correct words on legend item hovers\n\t\teventsFragment.addEventListener(Events.Legend.ITEM_HOVER, this.handleLegendOnHover)\n\n\t\t// Un-highlight words on legend item mouseouts\n\t\teventsFragment.addEventListener(Events.Legend.ITEM_MOUSEOUT, this.handleLegendMouseOut)\n\t}\n\n\trender(animate = true) {\n\t\tconst self = this\n\t\tconst svg = this.getComponentContainer({\n\t\t\tariaLabel: 'word cloud'\n\t\t}).attr('width', '100%').attr('height', '100%')\n\n\t\tconst displayData = this.model.getDisplayData()\n\t\tconst fontSizeScale = this.getFontSizeScale(displayData)\n\n\t\tconst options = this.getOptions()\n\t\tconst { fontSizeMapsTo, wordMapsTo } = options.wordCloud\n\t\tconst { groupMapsTo } = options.data\n\n\t\tconst { width, height } = DOMUtils.getSVGElementSize(svg, {\n\t\t\tuseAttrs: true\n\t\t})\n\n\t\tif (width === 0 || height === 0) {\n\t\t\treturn\n\t\t}\n\n\t\tconst layout = cloud()\n\t\t\t.size([width, height])\n\t\t\t.words(\n\t\t\t\tdisplayData.map(function (d: any) {\n\t\t\t\t\tconst value = d[fontSizeMapsTo]\n\n\t\t\t\t\tif (typeof d[fontSizeMapsTo] !== 'number') {\n\t\t\t\t\t\tthrow Error(\n\t\t\t\t\t\t\t'Badly formatted WordCloud data. `value` should only be an integer or float'\n\t\t\t\t\t\t)\n\t\t\t\t\t}\n\n\t\t\t\t\treturn {\n\t\t\t\t\t\t[groupMapsTo]: d[groupMapsTo],\n\t\t\t\t\t\ttext: d[wordMapsTo],\n\t\t\t\t\t\tsize: value,\n\t\t\t\t\t\tvalue\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t)\n\t\t\t.padding(5)\n\t\t\t.rotate(0)\n\t\t\t.fontSize((d: any) => fontSizeScale(d.size))\n\t\t\t.on('end', draw)\n\n\t\tlayout.start()\n\n\t\tfunction draw(words: any) {\n\t\t\tconst textGroup = DOMUtils.appendOrSelect(svg, 'g.words')\n\t\t\ttextGroup.attr('transform', `translate(${layout.size()[0] / 2}, ${layout.size()[1] / 2})`)\n\n\t\t\tconst allText = textGroup\n\t\t\t\t.selectAll('text')\n\t\t\t\t.data(words, (d: any) => `${d[groupMapsTo]}-${d.text}`)\n\n\t\t\t// Remove texts that are no longer needed\n\t\t\tallText.exit().attr('opacity', 0).remove()\n\n\t\t\tconst enteringText = allText.enter().append('text').attr('opacity', 0)\n\n\t\t\tenteringText\n\t\t\t\t.merge(allText as any)\n\t\t\t\t.style('font-size', (d: any) => `${d.size}px`)\n\t\t\t\t.text(function (d: any) {\n\t\t\t\t\treturn d.text\n\t\t\t\t})\n\t\t\t\t.attr('class', (d: any) =>\n\t\t\t\t\tself.model.getColorClassName({\n\t\t\t\t\t\tclassNameTypes: [ColorClassNameTypes.FILL],\n\t\t\t\t\t\tdataGroupName: d[groupMapsTo],\n\t\t\t\t\t\toriginalClassName: `word ${d.size > 32 ? 'light' : ''}`\n\t\t\t\t\t})\n\t\t\t\t)\n\t\t\t\t.style('fill', (d: any) => {\n\t\t\t\t\treturn self.model.getFillColor(d[groupMapsTo], d.text, d)\n\t\t\t\t})\n\t\t\t\t.attr('text-anchor', 'middle')\n\t\t\t\t.transition()\n\t\t\t\t.call((t: any) =>\n\t\t\t\t\tself.services.transitions.setupTransition({\n\t\t\t\t\t\ttransition: t,\n\t\t\t\t\t\tname: 'wordcloud-text-update-enter',\n\t\t\t\t\t\tanimate\n\t\t\t\t\t})\n\t\t\t\t)\n\t\t\t\t.attr('transform', (d: any) => `translate(${d.x}, ${d.y})`)\n\t\t\t\t.attr('opacity', 1)\n\t\t}\n\n\t\t// Add event listeners\n\t\tthis.addEventListeners()\n\t}\n\n\tgetFontSizeScale(data: any) {\n\t\tconst options = this.getOptions()\n\t\tconst { fontSizeMapsTo } = options.wordCloud\n\n\t\t// Filter out any null/undefined values\n\t\tconst allOccurences = data.map((d: any) => d[fontSizeMapsTo]).filter((size: any) => size)\n\t\tconst chartSize = DOMUtils.getHTMLElementSize(this.services.domUtils.getMainContainer())\n\n\t\t// We need the ternary operator here in case the user\n\t\t// doesn't provide size values in data\n\t\tconst sizeDataIsValid = allOccurences.length > 0\n\t\tconst domain = sizeDataIsValid ? extent(allOccurences) : [1, 1]\n\n\t\treturn scaleLinear()\n\t\t\t.domain(domain as any)\n\t\t\t.range(sizeDataIsValid ? options.wordCloud.fontSizeRange(chartSize, data) : [4, 4])\n\t}\n\n\t// Highlight elements that match the hovered legend item\n\thandleLegendOnHover = (event: CustomEvent) => {\n\t\tconst { hoveredElement } = event.detail\n\t\tconst { groupMapsTo } = this.getOptions().data\n\n\t\tthis.parent\n\t\t\t.selectAll('text.word')\n\t\t\t.transition('legend-hover-wordcloud')\n\t\t\t.call((t: any) =>\n\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\ttransition: t,\n\t\t\t\t\tname: 'legend-hover-wordcloud'\n\t\t\t\t})\n\t\t\t)\n\t\t\t.attr('opacity', (d: any) => (d[groupMapsTo] !== hoveredElement.datum()['name'] ? 0.3 : 1))\n\t}\n\n\t// Un-highlight all elements\n\thandleLegendMouseOut = () => {\n\t\tthis.parent\n\t\t\t.selectAll('text.word')\n\t\t\t.transition('legend-mouseout-wordcloud')\n\t\t\t.call((t: any) =>\n\t\t\t\tthis.services.transitions.setupTransition({\n\t\t\t\t\ttransition: t,\n\t\t\t\t\tname: 'legend-mouseout-wordcloud'\n\t\t\t\t})\n\t\t\t)\n\t\t\t.attr('opacity', 1)\n\t}\n\n\taddEventListeners() {\n\t\tconst options = this.getOptions()\n\t\tconst { groupMapsTo } = options.data\n\t\tconst self = this\n\n\t\t// Highlights 1 word or unhighlights all\n\t\tconst debouncedHighlight = debounce((word: any) => {\n\t\t\tconst allWords = self.parent\n\t\t\t\t.selectAll('text.word')\n\t\t\t\t.transition('wordcloud-word-mouse-highlight')\n\t\t\t\t.call((t: any) =>\n\t\t\t\t\tself.services.transitions.setupTransition({\n\t\t\t\t\t\ttransition: t,\n\t\t\t\t\t\tname: 'wordcloud-word-mouse-highlight'\n\t\t\t\t\t})\n\t\t\t\t)\n\n\t\t\tif (word === null) {\n\t\t\t\tallWords.attr('opacity', 1)\n\t\t\t} else {\n\t\t\t\tallWords.attr('opacity', function () {\n\t\t\t\t\tif (word === this) {\n\t\t\t\t\t\treturn 1\n\t\t\t\t\t}\n\n\t\t\t\t\treturn 0.3\n\t\t\t\t})\n\t\t\t}\n\t\t}, 6)\n\n\t\tthis.parent\n\t\t\t.selectAll('text.word')\n\t\t\t.on('mouseover', function (event: MouseEvent, datum: any) {\n\t\t\t\tconst hoveredElement = this\n\t\t\t\tdebouncedHighlight(hoveredElement)\n\n\t\t\t\t// Dispatch mouse event\n\t\t\t\tself.services.events.dispatchEvent(Events.WordCloud.WORD_MOUSEOVER, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: select(this),\n\t\t\t\t\tdatum\n\t\t\t\t})\n\n\t\t\t\t// Show tooltip\n\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.SHOW, {\n\t\t\t\t\tevent,\n\t\t\t\t\thoveredElement,\n\t\t\t\t\titems: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel: options.tooltip.wordLabel,\n\t\t\t\t\t\t\tvalue: datum.text\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel: options.tooltip.valueLabel,\n\t\t\t\t\t\t\tvalue: datum.value\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel:\n\t\t\t\t\t\t\t\tget(options, 'locale.translations.group') ||\n\t\t\t\t\t\t\t\tget(options, 'tooltip.groupLabel') ||\n\t\t\t\t\t\t\t\t'Group',\n\t\t\t\t\t\t\tvalue: datum[groupMapsTo],\n\t\t\t\t\t\t\tclass: self.model.getColorClassName({\n\t\t\t\t\t\t\t\tclassNameTypes: [ColorClassNameTypes.TOOLTIP],\n\t\t\t\t\t\t\t\tdataGroupName: datum[groupMapsTo]\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t})\n\t\t\t})\n\t\t\t.on('mousemove', function (event: MouseEvent, datum: any) {\n\t\t\t\tconst hoveredElement = select(this)\n\n\t\t\t\t// Dispatch mouse event\n\t\t\t\tself.services.events.dispatchEvent(Events.WordCloud.WORD_MOUSEMOVE, {\n\t\t\t\t\telement: hoveredElement,\n\t\t\t\t\tdatum\n\t\t\t\t})\n\n\t\t\t\t// Show tooltip\n\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.MOVE, {\n\t\t\t\t\tevent\n\t\t\t\t})\n\t\t\t})\n\t\t\t.on('click', function (event: MouseEvent, datum: any) {\n\t\t\t\t// Dispatch mouse event\n\t\t\t\tself.services.events.dispatchEvent(Events.WordCloud.WORD_CLICK, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: select(this),\n\t\t\t\t\tdatum\n\t\t\t\t})\n\t\t\t})\n\t\t\t.on('mouseout', function (event: MouseEvent, datum: any) {\n\t\t\t\tconst hoveredElement = select(this)\n\t\t\t\tdebouncedHighlight(null)\n\n\t\t\t\t// Dispatch mouse event\n\t\t\t\tself.services.events.dispatchEvent(Events.WordCloud.WORD_MOUSEOUT, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: hoveredElement,\n\t\t\t\t\tdatum\n\t\t\t\t})\n\n\t\t\t\t// Hide tooltip\n\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.HIDE, {\n\t\t\t\t\thoveredElement\n\t\t\t\t})\n\t\t\t})\n\t}\n}\n","import {\n\tgeoPath,\n\tline,\n\t// Azimuthal Projections - project the sphere directly on to the plane\n\tgeoEqualEarth,\n\t// Conic projections - project the sphere onto a cone & unroll into the plane\n\tgeoAlbers,\n\tgeoConicEqualArea,\n\tgeoConicEquidistant,\n\t// Cylindrical projections - project the sphere onto a containing cylinder & unroll onto the plane\n\tgeoEquirectangular,\n\tgeoMercator,\n\tgeoNaturalEarth1\n} from 'd3'\nimport { feature, merge } from 'topojson-client'\nimport type { GeometryObject } from 'topojson-specification'\nimport { Component } from '@/components'\nimport { DOMUtils } from '@/services/essentials/dom-utils'\nimport { getProperty } from '@/tools'\nimport { RenderTypes, Projection } from '@/interfaces/enums'\nimport { ChoroplethModel } from '@/model'\n\nexport class GeoProjection extends Component {\n\ttype = 'geo'\n\trenderType = RenderTypes.SVG\n\n\trender() {\n\t\tconst svg = this.getComponentContainer({ withinChartClip: true })\n\t\tconst { width, height } = DOMUtils.getSVGElementSize(svg, {\n\t\t\tuseAttrs: true\n\t\t})\n\n\t\t// Because of a Firefox bug with regard to sizing & d3 packs,\n\t\t// rather than checking if height or width aren't 0,\n\t\t// we have to make sure they're not smaller than 1\n\t\tif (width < 1 || height < 1) {\n\t\t\treturn\n\t\t}\n\n\t\t// Get users projection\n\t\tconst projection = this.getProjection()\n\n\t\tconst geoData = getProperty(this.getOptions(), 'geoData')\n\n\t\tconst data = (this.model as ChoroplethModel).getCombinedData()\n\n\t\t// Separate countries that have data & countries with missing data\n\t\tconst withData = {}\n\t\tconst withoutData = {}\n\t\tObject.keys(data).forEach(element => {\n\t\t\tif (typeof data[element].value === 'number') {\n\t\t\t\twithData[element] = data[element]\n\t\t\t} else {\n\t\t\t\twithoutData[element] = data[element]\n\t\t\t}\n\t\t})\n\n\t\t// Merge all without data\n\t\tconst withoutDataMerge = merge(geoData, Object.values(withoutData))\n\n\t\t/**\n\t\t * @todo - Currently only topojson is supported\n\t\t *\n\t\t * Unlike geojson, topojson does not have a standard format\n\t\t * So data must be nested in the following format:\n\t\t * options : {\n\t\t * \tgeoData: {\n\t\t * \tobjects: {\n\t\t * \t\t\t...\n\t\t * \t\t}\n\t\t * }\n\t\t * }\n\t\t */\n\t\t// Convert from topojson to geojson\n\t\tconst json = feature(geoData, {\n\t\t\t// We need to specify that we are converting geometry collections\n\t\t\ttype: 'GeometryCollection',\n\t\t\tgeometries: Object.values(withData) as GeometryObject<{ [name: string]: any }>[]\n\t\t})\n\n\t\t// Depending on the projection selected, we will need to scale/translate accordingly\n\t\tconst projectionScale = projection.fitSize([width, height], json)\n\t\tconst geo = geoPath().projection(projectionScale)\n\n\t\tconst borders = DOMUtils.appendOrSelect(svg, 'g.geo')\n\t\tborders.selectAll('path').data(json.features).join('path').attr('d', geo)\n\n\t\tconst patternID = this.services.domUtils.generateElementIDString(`geo-pattern-stripes`)\n\n\t\t// Create a striped pattern for missing data\n\t\tconst defs = DOMUtils.appendOrSelect(svg, 'defs')\n\t\tDOMUtils.appendOrSelect(defs, 'pattern')\n\t\t\t.attr('id', patternID)\n\t\t\t.attr('width', 5)\n\t\t\t.attr('height', 10)\n\t\t\t.attr('patternUnits', 'userSpaceOnUse')\n\t\t\t.attr('patternTransform', 'rotate(45)')\n\t\t\t.append('path')\n\t\t\t.classed('pattern-fill', true)\n\t\t\t.attr(\n\t\t\t\t'd',\n\t\t\t\tline()([\n\t\t\t\t\t[0, 0],\n\t\t\t\t\t[0, 10]\n\t\t\t\t])\n\t\t\t)\n\n\t\tconst missingBorders = DOMUtils.appendOrSelect(svg, 'g.missing-data')\n\t\tDOMUtils.appendOrSelect(missingBorders, 'path')\n\t\t\t.datum(withoutDataMerge)\n\t\t\t.attr('d', geo)\n\t\t\t.style('fill', `url(#${patternID})`)\n\t}\n\n\t/**\n\t * Retrieves the D3 geographic projection based on the options provided.\n\t *\n\t * This method selects a geographic projection from the available D3 projections\n\t * based on the `projection` property in the `thematic` options. If the projection\n\t * is not supported or is missing, an error is thrown.\n\t *\n\t * @returns {d3.GeoProjection} - The D3 geographic projection corresponding to the selected option.\n\t * @throws {Error} If the projection is not supported or is missing.\n\t */\n\tgetProjection() {\n\t\tlet projection = null\n\t\tconst projectionSelected = getProperty(this.getOptions(), 'thematic', 'projection')\n\n\t\tswitch (projectionSelected) {\n\t\t\t// Azimuthal Projections\n\t\t\tcase Projection.geoEqualEarth:\n\t\t\t\tprojection = geoEqualEarth()\n\t\t\t\tbreak\n\t\t\t// Conic Projections\n\t\t\tcase Projection.geoAlbers:\n\t\t\t\tprojection = geoAlbers()\n\t\t\t\tbreak\n\t\t\tcase Projection.geoConicEqualArea:\n\t\t\t\tprojection = geoConicEqualArea()\n\t\t\t\tbreak\n\t\t\tcase Projection.geoConicEquidistant:\n\t\t\t\tprojection = geoConicEquidistant()\n\t\t\t\tbreak\n\t\t\t// Cyndrical projections\n\t\t\tcase Projection.geoEquirectangular:\n\t\t\t\tprojection = geoEquirectangular()\n\t\t\t\tbreak\n\t\t\tcase Projection.geoMercator:\n\t\t\t\tprojection = geoMercator()\n\t\t\t\tbreak\n\t\t\tcase Projection.geoNaturalEarth1:\n\t\t\t\tprojection = geoNaturalEarth1()\n\t\t\t\tbreak\n\t\t\tdefault:\n\t\t\t\t// Projection is missing or an unsupported projection value is passed\n\t\t\t\tthrow new Error('Projection is not supported.')\n\t\t\t\tbreak\n\t\t}\n\n\t\treturn projection\n\t}\n}\n","import { select } from 'd3'\nimport * as Events from '@/interfaces/events'\nimport { GeoProjection } from '@/components/essentials/geo-projection'\nimport { ChoroplethModel } from '@/model'\n\nexport class Choropleth extends GeoProjection {\n\ttype = 'choropleth'\n\n\t// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n\t// @ts-ignore\n\t// eslint-disable-next-line @typescript-eslint/no-unused-vars\n\trender(animate = true) {\n\t\tsuper.render()\n\t\tconst data = (this.model as ChoroplethModel).getCombinedData()\n\t\tconst svg = this.getComponentContainer({ ariaLabel: 'map', withinChartClip: true })\n\n\t\tconst geo = svg.select('g.geo')\n\t\tgeo\n\t\t\t.selectAll('path')\n\t\t\t.classed('border', true)\n\t\t\t.attr('class', (d: any) => {\n\t\t\t\treturn this.model.getColorClassName({\n\t\t\t\t\tvalue: data[d.properties.NAME].value,\n\t\t\t\t\toriginalClassName: `border`\n\t\t\t\t})\n\t\t\t})\n\n\t\tthis.addCountryAreaEventListener()\n\t}\n\n\taddCountryAreaEventListener() {\n\t\tconst self = this\n\t\tconst data = (this.model as ChoroplethModel).getCombinedData()\n\n\t\tthis.parent\n\t\t\t.selectAll('path.border')\n\t\t\t.on('mouseover', function (event: MouseEvent, datum: any) {\n\t\t\t\tconst hoveredElement = select(this)\n\n\t\t\t\t// Dispatch mouse over event\n\t\t\t\tself.services.events.dispatchEvent(Events.Choropleth.CHOROPLETH_MOUSEOVER, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: hoveredElement,\n\t\t\t\t\tdatum: data[datum.properties.NAME]\n\t\t\t\t})\n\n\t\t\t\t// Dispatch tooltip show event\n\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.SHOW, {\n\t\t\t\t\tevent,\n\t\t\t\t\thoveredElement,\n\t\t\t\t\titems: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel: datum.properties.NAME,\n\t\t\t\t\t\t\tvalue: data[datum.properties.NAME].value\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t})\n\t\t\t})\n\t\t\t.on('mousemove', function (event: MouseEvent, datum: any) {\n\t\t\t\t// Dispatch mouse move event\n\t\t\t\tself.services.events.dispatchEvent(Events.Choropleth.CHOROPLETH_MOUSEMOVE, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: select(this),\n\t\t\t\t\tdatum: data[datum.properties.NAME]\n\t\t\t\t})\n\t\t\t\t// Dispatch tooltip move event\n\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.MOVE, {\n\t\t\t\t\tevent\n\t\t\t\t})\n\t\t\t})\n\t\t\t.on('click', function (event: MouseEvent, datum: any) {\n\t\t\t\t// Dispatch mouse click event\n\t\t\t\tself.services.events.dispatchEvent(Events.Choropleth.CHOROPLETH_CLICK, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: select(this),\n\t\t\t\t\tdatum: data[datum.properties.NAME]\n\t\t\t\t})\n\t\t\t})\n\t\t\t.on('mouseout', function (event: MouseEvent, datum: any) {\n\t\t\t\tconst hoveredElement = select(this)\n\n\t\t\t\t// Dispatch mouse out event\n\t\t\t\tself.services.events.dispatchEvent(Events.Choropleth.CHOROPLETH_MOUSEOUT, {\n\t\t\t\t\tevent,\n\t\t\t\t\telement: hoveredElement,\n\t\t\t\t\tdatum: data[datum.properties.NAME]\n\t\t\t\t})\n\n\t\t\t\t// Dispatch hide tooltip event\n\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.HIDE, {\n\t\t\t\t\tevent,\n\t\t\t\t\thoveredElement\n\t\t\t\t})\n\t\t\t})\n\t}\n}\n"],"names":["arrayReduce","array","iteratee","accumulator","initAccum","index","length","basePropertyOf","object","key","deburredLetters","deburrLetter","reLatin","rsComboMarksRange","reComboHalfMarksRange","rsComboSymbolsRange","rsComboRange","rsCombo","reComboMark","deburr","string","toString","reAsciiWord","asciiWords","reHasUnicodeWord","hasUnicodeWord","rsAstralRange","rsDingbatRange","rsLowerRange","rsMathOpRange","rsNonCharRange","rsPunctuationRange","rsSpaceRange","rsUpperRange","rsVarRange","rsBreakRange","rsApos","rsBreak","rsDigits","rsDingbat","rsLower","rsMisc","rsFitz","rsModifier","rsNonAstral","rsRegional","rsSurrPair","rsUpper","rsZWJ","rsMiscLower","rsMiscUpper","rsOptContrLower","rsOptContrUpper","reOptMod","rsOptVar","rsOptJoin","rsOrdLower","rsOrdUpper","rsSeq","rsEmoji","reUnicodeWord","unicodeWords","words","pattern","guard","reApos","createCompounder","callback","baseClamp","number","lower","upper","clamp","toNumber","FUNC_ERROR_TEXT","baseDelay","func","wait","args","delay","baseRest","baseMap","collection","result","isArrayLike","baseEach","value","map","isArray","arrayMap","baseIteratee","INFINITY","flatMapDeep","baseFlatten","isEqual","other","baseIsEqual","kebabCase","word","baseSome","predicate","some","arraySome","Adder","x","p","i","j","y","hi","lo","n","flatten","arrays","merge","identity$3","top","right","bottom","left","epsilon","translateX","translateY","scale","d","center","offset","entering","axis","orient","tickArguments","tickValues","tickFormat","tickSizeInner","tickSizeOuter","tickPadding","k","transform","context","values","format","identity","spacing","range","range0","range1","position","selection","path","tick","tickExit","tickEnter","line","text","_","axisTop","axisRight","axisBottom","axisLeft","nonpassivecapture","noevent$1","event","dragDisable","view","root","select","noevent","yesdrag","noclick","quantize","interpolator","samples","linear","t","constant$3","BrushEvent","type","sourceEvent","target","mode","dispatch","nopropagation","MODE_DRAG","MODE_SPACE","MODE_HANDLE","MODE_CENTER","abs","max","min","number1","e","number2","X","xy","Y","cursors","flipX","flipY","signsX","signsY","defaultFilter","defaultExtent","svg","defaultTouchable","local","node","empty","extent","brushX","brush","dim","filter","touchable","keys","listeners","handleSize","touchending","group","overlay","initialize","handle","redraw","started","touchmoved","touchended","emitter","that","state","emit","selection0","selection1","interpolate","tween","interrupt","clean","Emitter","signX","signY","W","w0","w1","N","n0","n1","E","e0","e1","S","s0","s1","dx","dy","moving","shifting","lockX","lockY","points","pointer","pts","move","moved","ended","keydowned","keyupped","point","point0","dragEnable","constant","pi","tau","tauEpsilon","append","strings","appendRound","digits","Path$1","x1","y1","x2","y2","x0","y0","x21","y21","x01","y01","l01_2","x20","y20","l21_2","l20_2","l21","l01","l","t01","t21","r","a0","a1","ccw","cw","da","w","h","Path","epsilon2","halfPi","quarterPi","degrees","radians","atan","atan2","cos","exp","log","sin","sign","sqrt","tan","acos","asin","noop","streamGeometry","geometry","stream","streamGeometryType","streamObjectType","features","coordinates","streamLine","streamPolygon","geometries","closed","coordinate","geoStream","spherical","cartesian","lambda","phi","cosPhi","cartesianDot","a","b","cartesianCross","cartesianAddInPlace","cartesianScale","vector","cartesianNormalizeInPlace","compose","rotationIdentity","rotateRadians","deltaLambda","deltaPhi","deltaGamma","rotationLambda","rotationPhiGamma","forwardRotationLambda","rotation","cosDeltaPhi","sinDeltaPhi","cosDeltaGamma","sinDeltaGamma","z","rotate","forward","circleStream","radius","delta","direction","t0","t1","cosRadius","sinRadius","step","circleRadius","clipBuffer","lines","m","pointEqual","Intersection","entry","clipRejoin","segments","compareIntersection","startInside","subject","clip","segment","p0","p1","link","start","current","isSubject","longitude","polygonContains","polygon","sinPhi","normal","angle","winding","sum","ring","lambda0","phi0","sinPhi0","cosPhi0","lambda1","sinPhi1","cosPhi1","point1","phi1","absDelta","antimeridian","arc","intersection","phiArc","pointVisible","clipLine","sink","ringBuffer","ringSink","polygonStarted","lineStart","lineEnd","pointRing","ringStart","ringEnd","pointLine","ringSegments","validSegment","clipAntimeridian","clipAntimeridianLine","clipAntimeridianInterpolate","sign0","sign1","clipAntimeridianIntersect","sinLambda0Lambda1","from","to","clipCircle","cr","smallRadius","notHemisphere","visible","c0","v0","v00","point2","v","c","code","intersect","two","pa","pb","n2","n2n2","n1n2","determinant","c1","c2","n1xn2","A","B","u","uu","t2","q","polar","meridian","q1","ax","ay","bx","by","clipMax","clipMin","clipRectangle","corner","comparePoint","ca","cb","activeStream","bufferStream","x__","y__","v__","x_","y_","v_","first","clipStream","polygonStart","polygonEnd","polygonInside","b0","b1","cleanInside","linePoint","identity$2","areaSum","areaRingSum","x00","y00","areaStream","areaRingStart","areaRingEnd","area","areaPointFirst","areaPoint","boundsStream","boundsPoint","bounds","X0","Y0","Z0","X1","Y1","Z1","X2","Y2","Z2","centroidStream","centroidPoint","centroidLineStart","centroidLineEnd","centroidRingStart","centroidRingEnd","centroid","centroidPointFirstLine","centroidPointLine","centroidPointFirstRing","centroidPointRing","PathContext","lengthSum","lengthRing","lengthStream","lengthPointFirst","lengthPoint","cacheDigits","cacheAppend","cacheRadius","cacheCircle","PathString","s","geoPath","projection","pointRadius","projectionStream","contextStream","pathArea","pathMeasure","pathBounds","pathCentroid","transformer","methods","TransformStream","fit","fitBounds","fitExtent","fitSize","size","fitWidth","width","fitHeight","height","maxDepth","cosMinDistance","resample","project","delta2","resampleNone","resampleLineTo","depth","d2","phi2","lambda2","dx2","dy2","dz","lambda00","a00","b00","c00","resampleStream","ringPoint","transformRadians","transformRotate","scaleTranslate","sx","sy","scaleTranslateRotate","alpha","cosAlpha","sinAlpha","ai","bi","ci","fi","projectionMutator","projectAt","theta","preclip","postclip","projectResample","projectTransform","projectRotateTransform","cache","cacheStream","invert","reset","recenter","conicProjection","cylindricalEqualAreaRaw","conicEqualAreaRaw","sy0","r0","r0y","geoConicEqualArea","geoAlbers","conicEqualArea","mercatorRaw","geoMercator","mercatorProjection","translate","clipExtent","reclip","equirectangularRaw","geoEquirectangular","conicEquidistantRaw","cy0","g","gy","nx","geoConicEquidistant","A1","A2","A3","A4","M","iterations","equalEarthRaw","l2","l6","fy","fpy","geoEqualEarth","naturalEarth1Raw","phi4","geoNaturalEarth1","defaultSeparation","meanX","children","meanXReduce","maxY","maxYReduce","leafLeft","leafRight","d3Cluster","separation","nodeSize","cluster","previousNode","count","node_count","node_each","node_eachBefore","nodes","node_eachAfter","next","node_find","node_sum","node_sort","compare","node_path","end","ancestor","leastCommonAncestor","aNodes","bNodes","node_ancestors","node_descendants","node_leaves","leaves","node_links","links","node_iterator","hierarchy","data","mapChildren","objectChildren","Node","child","childs","computeHeight","node_copy","copyData","optional","f","required","constantZero","constant$2","lcg","shuffle","random","packEncloseRandom","circles","enclosesWeak","encloseBasis","extendBasis","enclosesWeakAll","enclosesNot","encloseBasis2","encloseBasis3","dr","encloseBasis1","r1","r2","r21","x3","y3","r3","a2","a3","b2","b3","c3","d1","d3","ab","xa","xb","ya","yb","C","place","intersects","score","circle","packSiblingsRandom","aa","sj","sk","pack","defaultRadius","D3Pack","padding","radiusLeaf","packChildrenRandom","translateChild","parent","roundNode","treemapDice","nextLeft","nextRight","moveSubtree","wm","wp","shift","change","executeShifts","nextAncestor","vim","TreeNode","treeRoot","tree","d3Tree","firstWalk","secondWalk","sizeNode","tx","kx","ky","siblings","midpoint","apportion","vip","vop","vom","sip","sop","sim","som","treemapSlice","squarifyRatio","ratio","rows","row","nodeValue","i0","i1","sumValue","minValue","maxValue","newRatio","minRatio","beta","squarify","custom","d3Treemap","tile","round","paddingStack","paddingInner","paddingTop","paddingRight","paddingBottom","paddingLeft","treemap","positionNode","withPath","shape","arcInnerRadius","arcOuterRadius","arcStartAngle","arcEndAngle","arcPadAngle","x10","y10","x32","y32","cornerTangents","rc","ox","oy","x11","y11","D","cx0","cx1","cy1","dx0","dy0","dx1","dy1","innerRadius","outerRadius","cornerRadius","padRadius","startAngle","endAngle","padAngle","buffer","a01","a11","a10","da0","da1","ap","rp","rc0","rc1","oc","kc","lc","defined","curve","curveLinear","output","pointX","pointY","defined0","x0z","y0z","arealine","descending","identity$1","pie","sortValues","sort","arcs","curveRadialLinear","curveRadial","Radial","radial","lineRadial","lineRadial$1","Bump","bumpX","linkSource","linkTarget","source","argv","slice","linkHorizontal","Component","model","services","configs","RenderTypes","chartprefix","getProperty","animate","newObj","oldParent","_a","carbonPrefix","idSelector","container","DOMUtils","chartClipId","chartClipRectSelection","entries","setPrototypeOf","isFrozen","getPrototypeOf","getOwnPropertyDescriptor","freeze","seal","create","apply","construct","fun","thisValue","Func","arrayForEach","unapply","arrayPop","arrayPush","stringToLowerCase","stringToString","stringMatch","stringReplace","stringIndexOf","stringTrim","objectHasOwnProperty","regExpTest","typeErrorCreate","unconstruct","thisArg","_len","_key","_len2","_key2","addToSet","set","transformCaseFunc","element","lcElement","cleanArray","clone","newObject","property","lookupGetter","prop","desc","fallbackValue","html$1","svg$1","svgFilters","svgDisallowed","mathMl$1","mathMlDisallowed","html","mathMl","xml","MUSTACHE_EXPR","ERB_EXPR","TMPLIT_EXPR","DATA_ATTR","ARIA_ATTR","IS_ALLOWED_URI","IS_SCRIPT_OR_DATA","ATTR_WHITESPACE","DOCTYPE_NAME","CUSTOM_ELEMENT","EXPRESSIONS","NODE_TYPE","getGlobal","_createTrustedTypesPolicy","trustedTypes","purifyHostElement","suffix","ATTR_NAME","policyName","scriptUrl","createDOMPurify","window","DOMPurify","document","originalDocument","currentScript","DocumentFragment","HTMLTemplateElement","Element","NodeFilter","NamedNodeMap","HTMLFormElement","DOMParser","ElementPrototype","cloneNode","remove","getNextSibling","getChildNodes","getParentNode","template","trustedTypesPolicy","emptyHTML","implementation","createNodeIterator","createDocumentFragment","getElementsByTagName","importNode","hooks","IS_ALLOWED_URI$1","ALLOWED_TAGS","DEFAULT_ALLOWED_TAGS","ALLOWED_ATTR","DEFAULT_ALLOWED_ATTR","CUSTOM_ELEMENT_HANDLING","FORBID_TAGS","FORBID_ATTR","ALLOW_ARIA_ATTR","ALLOW_DATA_ATTR","ALLOW_UNKNOWN_PROTOCOLS","ALLOW_SELF_CLOSE_IN_ATTR","SAFE_FOR_TEMPLATES","SAFE_FOR_XML","WHOLE_DOCUMENT","SET_CONFIG","FORCE_BODY","RETURN_DOM","RETURN_DOM_FRAGMENT","RETURN_TRUSTED_TYPE","SANITIZE_DOM","SANITIZE_NAMED_PROPS","SANITIZE_NAMED_PROPS_PREFIX","KEEP_CONTENT","IN_PLACE","USE_PROFILES","FORBID_CONTENTS","DEFAULT_FORBID_CONTENTS","DATA_URI_TAGS","DEFAULT_DATA_URI_TAGS","URI_SAFE_ATTRIBUTES","DEFAULT_URI_SAFE_ATTRIBUTES","MATHML_NAMESPACE","SVG_NAMESPACE","HTML_NAMESPACE","NAMESPACE","IS_EMPTY_INPUT","ALLOWED_NAMESPACES","DEFAULT_ALLOWED_NAMESPACES","PARSER_MEDIA_TYPE","SUPPORTED_PARSER_MEDIA_TYPES","DEFAULT_PARSER_MEDIA_TYPE","CONFIG","formElement","isRegexOrFunction","testValue","_parseConfig","cfg","MATHML_TEXT_INTEGRATION_POINTS","HTML_INTEGRATION_POINTS","COMMON_SVG_AND_HTML_ELEMENTS","ALL_SVG_TAGS","ALL_MATHML_TAGS","_checkValidNamespace","tagName","parentTagName","_forceRemove","_removeAttribute","name","_initDocument","dirty","doc","leadingWhitespace","matches","dirtyPayload","body","_createNodeIterator","_isClobbered","elm","_isNode","_executeHook","entryPoint","currentNode","hook","_sanitizeElements","content","_isBasicCustomElement","parentNode","childNodes","childCount","childClone","expr","_isValidAttribute","lcTag","lcName","_sanitizeAttributes","attributes","hookEvent","attr","namespaceURI","attrValue","_sanitizeShadowDOM","fragment","shadowNode","shadowIterator","importedNode","returnNode","nodeIterator","serializedHTML","tag","hookFunction","purify","sanitizeHtml","sanitizeSVG","svgContent","sanitizeText","_Toolbar","bodyOnClickHandler","Events","buttonList","overflowMenuItemList","toolbarControls","button","enteringToolbarControls","self","hoveredElement","overflowMenuControls","enteringOverflowMenuControls","show","currentItemIndex","previousItemIndex","previousItemNode","nextItemIndex","nextItemNode","overflowMenuItems","menuItem","keyEvent","control","numberOfIcons","controls","overflowSpecificControls","overflowList","controlConfig","ToolbarControlTypes","isFullScreenMode","moreOptions","controlType","isZoomBarEnabled","displayData","options","exportAsCSV","exportAsJPG","exportAsPNG","zoomIn","zoomOut","resetZoom","makeFullScreen","exitFullScreen","showAsTable","Toolbar","_LayoutComponent","component","growth","LayoutGrowth","horizontal","LayoutDirection","updatedBoxes","LayoutAlignItems","itemComponent","isRenderingSVG","matchingElementDimensions","matchingElementWidth","elementWidth","allUpdatedBoxes","LayoutComponent","Spacer","spacerConfigs","settings","settings_1","_createClass","Constructor","protoProps","staticProps","_classCallCheck","instance","_toConsumableArray","arr","_arrayWithoutHoles","_iterableToArray","_unsupportedIterableToArray","_nonIterableSpread","o","minLen","_arrayLikeToArray","iter","len","arr2","item","mixin","mixinfns","Class","mixinfn","_class","_typeof","obj","_defineProperties","props","descriptor","_inherits","subClass","superClass","_setPrototypeOf","_createSuper","Derived","hasNativeReflectConstruct","_isNativeReflectConstruct","Super","_getPrototypeOf","NewTarget","_possibleConstructorReturn","call","_assertThisInitialized","createComponent","ToMix","CreateComponent","_ToMix","_super","_this","_get","receiver","base","_superPropBase","handles","Handles","_this2","on","eventedState","EventedState","detail","eventNameSuffix","eventStart","fireOnNode","canceled","error","changeStateArgs","eventMatches","selector","currentTarget","closest","getLaunchingDetails","evt","launchingElement","launchingEvent","eventedShowHideState","EventedShowHideState","evtOrElem","exports","warning","condition","argIndex","message","browser","initComponentByLauncher","InitComponentByLauncher","effectiveOptions","launcher","elements","Modal","_mixin","focusWrapNode","handleTransitionEnd","transitionEnd","focusableItem","hasFocusin","focusinEventName","_this3","closeButton","prefix","id","CarbonModalComponent","title","downloadAsCSV","tableArray","get","heading","column","holder","Title","maxWidth","untruncatedTitle","tspanLength","titleString","substringIndex","mid","Legend","legendOptions","alignment","legendOrientation","dataGroups","DISABLED","legendConfigs","hasDeactivatedItems","dataGroup","userProvidedOrder","Alignments","Roles","legendItems","addedLegendItems","legendClickable","checkboxRadius","addedCheckboxes","allCheckboxes","status","ColorClassNameTypes","additionalItemsOption","additionalItems","addedAdditionalItems","previousType","indexOfItem","additionalItem","legendOrder","dataA","dataB","definedOrderIndex","itemConfig","LegendItemType","iconData","fill","stroke","lineConfig","color","zoomEnter","truncationOptions","truncationType","truncationThreshold","truncationNumCharacter","addedLegendItemsText","TruncationTypes","_sanitizedLabel","truncateLabel","truncation","hoveredItem","hoveredItemData","clickedItemData","ChartClip","cartesianScales","mainXScale","mainYScale","xScaleStart","xScaleEnd","yScaleEnd","yScaleStart","clipRect","CanvasChartClip","PLACEMENTS","defaultPositions","referenceOffset","referenceRect","windowRef","Position","positions","offsets","margins","computed","targetRect","relativeRect","reference","placement","offsetFunction","targetBottom","targetRight","placements","containerFunction","positionFunction","weightedPlacements","pos","box","hiddenHeight","hiddenWidth","hiddenArea","visibleArea","visiblePercent","positionAt","Tooltip","datum","defaultHTML","formattedItems","tooltipTextContainer","labelHTML","items","labelIconSize","label","valueFormatter","localeCode","numberFormatter","dateFormatter","newDate","isTooltipEnabled","newOffset","holderWidth","holderHeight","isTopZoomBarEnabled","noWrap","hasCustomPlacements","bestPlacementOption","horizontalOffset","tooltipConfigs","defaultOffset","hoveredPos","bestPos","mouseRelativePos","zoombarType","zoombarHeight","zoomBarConfigs","_ChartBrush","frontSelectionArea","backdrop","brushArea","d3Selection","mainXScaleType","frontSelection","ScaleTypes","zoomDomain","updateSelectionDash","selectionWidth","dashArray","dashCount","totalRightDash","brushEventHandler","updateZoomDomain","startPoint","endPoint","xScale","scaleTime","newDomain","brushed","zoomRatio","clickedX","leftPoint","rightPoint","ChartBrush","ZoomBar","definedZoomBarData","AxisPositions","isTopZoomBarLoading","isTopZoomBarLocked","highlight","axesLeftMargin","axesMargins","ZoomBarTypes","zoomBarData","isEmpty","defaultDomain","oldInitialZoomDomain","newInitialZoomDomain","startHighlight","endHighlight","labelMapTo","selected","domain","brushEventListener","zoomBarEventType","handleWidth","handleHeight","handleXDiff","handleBarWidth","handleBarHeight","handleBarXDiff","handleYBarDiff","handleBars","querySelector","clipId","mainXAxisPosition","mainYAxisPosition","mainYScaleType","accessorFunction","scaleType","axisPosition","xAccessor","yAccessor","areaGenerator","areaGraph","zoomBarClipPath","cloneDeep","domainIdentifier","rangeIdentifier","newDatum","startX","endX","skeletonClass","baselineGenerator","Threshold","axesOptions","thresholdData","axisOptions","thresholdAxisGroups","thresholdAxisGroupsMerge","thresholdGroups","threshold","thresholdGroupsEnter","yScale","isScaleTypeLabels","orientation","getDomainValue","getRangeValue","getXValue","getYValue","flipDomainAndRangeBasedOnOrientation","fillColor","isVertical","timeScaleOptions","timeInterval","computeTimeIntervalName","formatTick","formattedValue","Highlight","highlightData","highlightAxisGroups","highlightAxisGroupsMerge","highlightGroups","highlightGroupsEnter","highlightStartMapsTo","highlightEndMapsTo","labelMapsTo","AxisChartsTooltip","dualAxes","groupMapsTo","domainLabel","rangeLabel","domainValue","valueof","justify","ascendingSourceBreadth","ascendingBreadth","ascendingTargetBreadth","defaultId","defaultNodes","graph","defaultLinks","find","nodeById","computeLinkBreadths","Sankey","py","align","linkSort","sankey","computeNodeLinks","computeNodeValues","computeNodeDepths","computeNodeHeights","computeNodeBreadths","sourceLinks","targetLinks","computeNodeLayers","columns","initializeNodeBreadths","reorderLinks","relaxRightToLeft","relaxLeftToRight","targetTop","reorderNodeLinks","resolveCollisions","sourceTop","resolveCollisionsBottomToTop","resolveCollisionsTopToBottom","curveHorizontal","horizontalSource","horizontalTarget","sankeyLinkHorizontal","Alluvial","isGradientAllowed","nodePadding","alluvialConfigs","nodeAlignment","sankeyJustify","sankeyLeft","sankeyRight","d3Sankey","nodeCoordinates","elementID","textWidth","gradient","textNode","debouncedLineHighlight","debounce","allLinks","strokeColor","paths","nodeMatrix","getTransformOffsets","titleContainer","titleMatrix","visited","Grid","isXGridEnabled","isYGridEnabled","xGrid","mainXPosition","customDomain","numberOfTicks","yGrid","mainYPosition","mousePos","gridlinesX","getTranslationValues","floor","ceiling","line1","line2","lineSpacing","gridElement","userSpecifiedThreshold","translations","backdropRect","Area","areaConfigs","eventsFragment","groupedData","boundsEnabled","upperBoundRangeValue","includeZeroInRangeValue","_domain","upperBound","lowerBound","CartesianOrientations","isGradientEnabled","areas","chartMainContainer","strokePathElement","colorValue","sparklineColorObject","sparklineColorObjectKeys","GradientUtils","enteringAreas","Line","lineConfigs","events","curves","lineGenerator","percentage","groupData","THRESHOLD","pointIsWithinThreshold","Ruler","isRulerEnabled","tooltipData","rangeScale","mouseCoordinate","ruler","rulerLine","dataPointElements","pointsWithinLine","dataPointsMatchingRulerLine","accum","currentValue","sampleAccumValue","distanceToCurrentValue","distanceToAccumValue","domainValuesMatchingRulerLine","elementsToHighlight","sampleMatch","mouseMoveCallback","debounceThreshold","debounceWithD3MousePosition","mousePosition","Scatter","fadeInOnChartHolderMouseover","stacked","scatterData","circlesToStyle","handleThresholds","xThreshold","yThreshold","xValue","yValue","filled","fillOpacity","classNamesNeeded","_b","isFilled","_c","Axis","isAxisVisible","startPosition","endPosition","axisFunction","axisRefExists","axisRef","invisibleAxisRef","isTimeScaleType","isVerticalAxis","axisScaleType","isDataLoading","numberOfTicksProvided","userProvidedTickValues","isNumberOfTicksProvided","fakeTick","fakeTickText","tickHeight","axisConfigs","addSpaceOnEdges","tempScale","formatter","userProvidedFormatter","defaultFormattedValue","validTicks","userProvidedTickValue","tickTimestamp","discreteDomain","isDataEmpty","axisTitleRef","titleOrientation","titleHeight","AxisTitleOrientations","showDayName","axisRefSelection","isTickPrimary","shouldRotateTicks","tickRotation","TickRotations","mockTextPiece","averageLetterWidth","lastStartPosition","xTransformation","axisTickLabels","tick_html","tickSize","spaceRatio","numberOfTicksFit","HoverAxis","rectangle","boundingRect","TwoDimensionalAxes","axes","axisPositions","axisPositionKey","axisComponent","AxisFlavor","childKey","marginKey","Skeleton","showShimmerEffect","Skeletons","xRange","yRange","scaleLinear","ticksNumber","ticksValues","xGridG","update","yGridG","shimmer","optionName","arcPathGenerator","tcx","pieConfigs","tcy","skeletonAreaShape","gradientId","stopBgShimmerClass","stopShimmerClass","defs","linearGradient","stops","repeat","easeLinear","Boxplot","dataGroupNames","isInVerticalOrientation","gridSize","boxWidth","boxplotData","boxGroups","boxGroupsEnter","allBoxGroups","boxplotConfigs","generateSVGPathString","outlier","circlesEnter","ZeroLine","minDomainValue","maxDomainValue","drawZeroLine","yPosition","lineCoordinates","flipSVGCoordinatesBasedOnOrientation","Bubble","radiusMapsTo","allRadii","chartSize","radiusDataIsValid","radiusScale","bubbleOptions","Bullet","rangeScaleStart","rangeScaleEnd","rangeScaleDomainMax","renderRangeBoxes","rangeBoxData","rangeBoxes","renderBars","bars","renderTargetLines","renderTargetQuartiles","quartilesData","barValue","lineHeight","performanceAreaTitles","matchingRangeIndex","input","reverse","feature","topology","bbox","properties","transformPoint","stitch","stitchedArcs","fragmentByStart","fragmentByEnd","fragments","emptyIndex","ends","fg","gf","dp","flush","planarRingArea","mergeArcs","objects","polygonsByArc","polygons","groups","extract","neighbors","ki","BinnedRuler","domainScale","correspondingDomainValue","sampleMatchData","activeDataGroupNames","tooltipDataGroups","dataGroupName","rulerPosition","StackedRuler","buildStraightPathString","ty","d3Path","buildElbowPathString","percent","buildBezierPathString","cpx1","cpy1","cpx2","cpy2","arrowLeft","arrowRight","diamond","square","tee","ColorScaleLegend","xDimensions","availableSpace","customColors","colorScaleType","colorPairingOption","customColorsEnabled","getDomain","useDefaultBarWidth","barWidth","legendGroupElement","axisElement","legendTitleGroup","colorScheme","colorPairing","colorGroupingLength","ColorLegendType","interpolateNumber","quant","linearScale","legendAxis","rangeStart","stopLengthPercentage","colorScaleBand","scaleBand","MeterTitle","dataset","meterTitle","titleElement","datasetsTotal","total","unit","difference","breakdownFormatter","totalValue","totalFormatter","totalString","containerWidth","meterConfigs","statusGroup","icon","innerIcon","dataValue","tspan","proportional","totalWidth","percentageWidth","statusWidth","Statuses","Bar","numberOfDatapoints","chartWidth","spacingFactor","CirclePack","circlePackConfigs","hierarchyLevel","canvasZoomEnabled","d3Hierarchy","nodeData","enteringCircles","originalClass","canvasZoomSettings","childData","chartSvg","canvasSelection","disabled","zoomable","childrenData","parentValue","arcTween","arcFunc","Pie","valueMapsTo","pieLayoutData","convertValueToPercentage","renderLabels","labelData","labels","enteringLabels","calloutData","marginedRadius","deg","textLength","totalSlices","sliceAngleDeg","labelTranslateX","labelTranslateY","CalloutDirections","xOffset","yOffset","pieTranslateX","pieTranslateY","callouts","enteringCallouts","xPosition","Donut","donutTitle","d3Ref","donutCenterFigure","interpolateFunction","interpolateRound","localeNumberFormatter","ARROW_UP_PATH_STRING","ARROW_DOWN_PATH_STRING","Gauge","GaugeTypes","arcSize","ArrowDirections","valueRatio","rotationAngle","currentAngle","arcValue","gaugeTranslateX","arcType","valueFontSize","deltaFontSize","numberSpacing","showPercentageSymbol","numbersYPosition","numbersGroup","fontSize","valueNumberGroup","valueNumber","numericValue","valueNumberWidth","symbolFontSize","gaugeSymbol","symbol","symbolWidth","symbolHeight","arrowSize","deltaGroup","deltaNumber","deltaNumberWidth","arrowEnabled","deltaArrow","deltaArrowSelection","arcWidth","GroupedBar","allDataLabels","uniq","barGroups","allBarGroups","translateBy","rangeAxis","zoomx0","zoomx1","activeData","totalGroupPadding","ref","providedWidth","providedMaxWidth","numOfActiveDataGroups","Heatmap","ranges","domains","minimum","maximum","uniqueDomain","uniqueRange","matrixArray","patternID","rectangles","domainIdentifierFill","parentTag","xBandwidth","yBandwidth","dividerStatus","DividerStatus","heatmapConfigs","totalLabel","cell","nullState","Histogram","groupIdentifier","binnedStackedData","bin","rangeAxisPosition","rangeScaleLabel","Lollipop","allLines","Meter","prevX","domainMax","stackedData","userProvidedHeight","valued","className","peakValue","peakData","peak","Radar","tmpTick","tmpTickText","completeBlankData","radarConfigs","xLabelPadding","yLabelPadding","yTicksNumber","minRange","xAxisRectHeight","margin","centerPointMinValue","yTicks","colorScale","dataForColorScale","radialLineGenerator","curveLinearClosed","horizSpaceNeededByEachXLabel","tickWidth","distanceFromDiameter","distanceBetweenPointOnCircAndVerticalDiameter","yAxisUpdate","shapeData","enter","exit","polarToCartesianCoords","radialLabelPlacement","alignmentXOffset","selectionUpdate","radToDeg","svgDimensions","alignmentOffset","axisLine","dots","itemsToHighlight","SimpleBar","yScaleDomainStart","SkeletonLines","isSparkline","sparklineSkeleton","StackedArea","domainAxisPosition","StackedBar","stackData","barIsNegative","matchingDataPoint","numberOfDomainValues","StackedScatter","circleGroups","hoveredX","hoveredY","groupDataIndex","dataIndex","rangeValue","stackedRangeValue","datapoint","tooltipDatapoint","NODE_OFFSET","Tree","longestLabel","longestLabelInChildren","mockLabel","mockLabelWidth","rootTitle","mockRootTitleWidth","mockLongestLabelWidth","updateHeight","transition","nodeGroups","nodeGroup","nodeGroupsEnter","linkPaths","linkGroup","linkPathsEnter","diagonal","descendants","TreeTypes","black","white","yellow10","yellow20","yellow30","yellow40","yellow50","yellow60","yellow70","yellow80","yellow90","yellow100","yellow","orange10","orange20","orange30","orange40","orange50","orange60","orange70","orange80","orange90","orange100","orange","red10","red20","red30","red40","red50","red60","red70","red80","red90","red100","red","magenta10","magenta20","magenta30","magenta40","magenta50","magenta60","magenta70","magenta80","magenta90","magenta100","magenta","purple10","purple20","purple30","purple40","purple50","purple60","purple70","purple80","purple90","purple100","purple","blue10","blue20","blue30","blue40","blue50","blue60","blue70","blue80","blue90","blue100","blue","cyan10","cyan20","cyan30","cyan40","cyan50","cyan60","cyan70","cyan80","cyan90","cyan100","cyan","teal10","teal20","teal30","teal40","teal50","teal60","teal70","teal80","teal90","teal100","teal","green10","green20","green30","green40","green50","green60","green70","green80","green90","green100","green","coolGray10","coolGray20","coolGray30","coolGray40","coolGray50","coolGray60","coolGray70","coolGray80","coolGray90","coolGray100","coolGray","gray10","gray20","gray30","gray40","gray50","gray60","gray70","gray80","gray90","gray100","gray","warmGray10","warmGray20","warmGray30","warmGray40","warmGray50","warmGray60","warmGray70","warmGray80","warmGray90","warmGray100","warmGray","colors","findColorShade","hex","colorName","colorShades","colorShadeLevel","textFillColor","correspondingLeaf","correspondingLeafFill","cl","d3Color","colorShade","lightness","hsl","uidCounter","Treemap","windowLocation","leafGroups","leaf","allLeafGroups","rects","uid","leafID","addedText","clipPathID","customColor","Dispatch","parseTypenames","typenames","types","typename","T","copy","require$$0","RADIANS","SPIRALS","archimedeanSpiral","rectangularSpiral","ch","d3Cloud","cloudText","font","cloudFont","cloudFontSize","fontStyle","cloudFontNormal","fontWeight","cloudRotate","cloudPadding","spiral","timer","cloud","canvas","cloudCanvas","functor","contextAndRatio","getContext","board","zeroArray","tags","cloudSprite","cloudBounds","startY","maxDelta","dt","dxdy","collideRects","cloudCollide","sprite","sw","lx","msx","last","di","maxh","metrics","anchor","sr","wcr","wsr","hcr","hsr","pixels","w32","seen","seenRow","WordCloud","fontSizeScale","fontSizeMapsTo","wordMapsTo","layout","draw","textGroup","allText","allOccurences","sizeDataIsValid","debouncedHighlight","allWords","GeoProjection","geoData","withData","withoutData","withoutDataMerge","json","projectionScale","geo","missingBorders","Projection","Choropleth","Events.Choropleth","Events.Tooltip"],"mappings":";;;;;AAYA,SAASA,GAAYC,GAAOC,GAAUC,GAAaC,GAAW;AAO5D,WANIC,IAAQ,IACRC,IAASL,KAAS,OAAO,IAAIA,EAAM,QAKhC,EAAEI,IAAQC;AACf,IAAAH,IAAcD,EAASC,GAAaF,EAAMI,CAAK,GAAGA,GAAOJ,CAAK;AAEhE,SAAOE;AACT;AChBA,SAASI,GAAeC,GAAQ;AAC9B,SAAO,SAASC,GAAK;AACnB,WAAOD,KAAU,OAAO,SAAYA,EAAOC,CAAG;AAAA,EAClD;AACA;ACRA,IAAIC,KAAkB;AAAA;AAAA,EAEpB,GAAQ;AAAA,EAAM,GAAQ;AAAA,EAAK,GAAQ;AAAA,EAAK,GAAQ;AAAA,EAAK,GAAQ;AAAA,EAAK,GAAQ;AAAA,EAC1E,GAAQ;AAAA,EAAM,GAAQ;AAAA,EAAK,GAAQ;AAAA,EAAK,GAAQ;AAAA,EAAK,GAAQ;AAAA,EAAK,GAAQ;AAAA,EAC1E,GAAQ;AAAA,EAAM,GAAQ;AAAA,EACtB,GAAQ;AAAA,EAAM,GAAQ;AAAA,EACtB,GAAQ;AAAA,EAAM,GAAQ;AAAA,EAAK,GAAQ;AAAA,EAAK,GAAQ;AAAA,EAChD,GAAQ;AAAA,EAAM,GAAQ;AAAA,EAAK,GAAQ;AAAA,EAAK,GAAQ;AAAA,EAChD,GAAQ;AAAA,EAAM,GAAQ;AAAA,EAAK,GAAQ;AAAA,EAAK,GAAQ;AAAA,EAChD,GAAQ;AAAA,EAAM,GAAQ;AAAA,EAAK,GAAQ;AAAA,EAAK,GAAQ;AAAA,EAChD,GAAQ;AAAA,EAAM,GAAQ;AAAA,EACtB,GAAQ;AAAA,EAAM,GAAQ;AAAA,EAAK,GAAQ;AAAA,EAAK,GAAQ;AAAA,EAAK,GAAQ;AAA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;AAAA,QACzE,OAAA9pE;AAAA,QACA,SAAS+7B;AAAA,QACT,OAAO/a,EAAKkrB,EAAM,WAAW,IAAI;AAAA,MAAA,CACjC,GAGDpQ,EAAK,SAAS,OAAO,cAAciuC,GAAe,MAAM;AAAA,QACvD,OAAA/pE;AAAA,QACA,gBAAA+7B;AAAA,MAAA,CACA;AAAA,IAAA,CACD;AAAA,EACH;AACD;","x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,111,116,117,118,119,120,121,122,123,124,125,126,127,133,140,141,142,143,144,145,146,147,148,149,150,151,166,167,168,169,170,171,195,197,198]}