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.umd.bundle.umd.cjs.map Maven / Gradle / Ivy
{"version":3,"file":"bundle.umd.cjs","sources":["../../../../node_modules/d3-array/src/ascending.js","../../../../node_modules/d3-array/src/descending.js","../../../../node_modules/d3-array/src/bisector.js","../../../../node_modules/d3-array/src/number.js","../../../../node_modules/d3-array/src/bisect.js","../../../../node_modules/d3-array/src/count.js","../../../../node_modules/d3-array/src/extent.js","../../../../node_modules/d3-array/src/fsum.js","../../../../node_modules/d3-array/node_modules/internmap/src/index.js","../../../../node_modules/d3-array/src/identity.js","../../../../node_modules/d3-array/src/sort.js","../../../../node_modules/d3-array/src/array.js","../../../../node_modules/d3-array/src/constant.js","../../../../node_modules/d3-array/src/ticks.js","../../../../node_modules/d3-array/src/nice.js","../../../../node_modules/d3-array/src/threshold/sturges.js","../../../../node_modules/d3-array/src/bin.js","../../../../node_modules/d3-array/src/max.js","../../../../node_modules/d3-array/src/min.js","../../../../node_modules/d3-array/src/quickselect.js","../../../../node_modules/d3-array/src/quantile.js","../../../../node_modules/d3-array/src/merge.js","../../../../node_modules/d3-array/src/range.js","../../../../node_modules/d3-axis/src/identity.js","../../../../node_modules/d3-axis/src/axis.js","../../../../node_modules/d3-dispatch/src/dispatch.js","../../../../node_modules/d3-selection/src/namespaces.js","../../../../node_modules/d3-selection/src/namespace.js","../../../../node_modules/d3-selection/src/creator.js","../../../../node_modules/d3-selection/src/selector.js","../../../../node_modules/d3-selection/src/selection/select.js","../../../../node_modules/d3-selection/src/array.js","../../../../node_modules/d3-selection/src/selectorAll.js","../../../../node_modules/d3-selection/src/selection/selectAll.js","../../../../node_modules/d3-selection/src/matcher.js","../../../../node_modules/d3-selection/src/selection/selectChild.js","../../../../node_modules/d3-selection/src/selection/selectChildren.js","../../../../node_modules/d3-selection/src/selection/filter.js","../../../../node_modules/d3-selection/src/selection/sparse.js","../../../../node_modules/d3-selection/src/selection/enter.js","../../../../node_modules/d3-selection/src/constant.js","../../../../node_modules/d3-selection/src/selection/data.js","../../../../node_modules/d3-selection/src/selection/exit.js","../../../../node_modules/d3-selection/src/selection/join.js","../../../../node_modules/d3-selection/src/selection/merge.js","../../../../node_modules/d3-selection/src/selection/order.js","../../../../node_modules/d3-selection/src/selection/sort.js","../../../../node_modules/d3-selection/src/selection/call.js","../../../../node_modules/d3-selection/src/selection/nodes.js","../../../../node_modules/d3-selection/src/selection/node.js","../../../../node_modules/d3-selection/src/selection/size.js","../../../../node_modules/d3-selection/src/selection/empty.js","../../../../node_modules/d3-selection/src/selection/each.js","../../../../node_modules/d3-selection/src/selection/attr.js","../../../../node_modules/d3-selection/src/window.js","../../../../node_modules/d3-selection/src/selection/style.js","../../../../node_modules/d3-selection/src/selection/property.js","../../../../node_modules/d3-selection/src/selection/classed.js","../../../../node_modules/d3-selection/src/selection/text.js","../../../../node_modules/d3-selection/src/selection/html.js","../../../../node_modules/d3-selection/src/selection/raise.js","../../../../node_modules/d3-selection/src/selection/lower.js","../../../../node_modules/d3-selection/src/selection/append.js","../../../../node_modules/d3-selection/src/selection/insert.js","../../../../node_modules/d3-selection/src/selection/remove.js","../../../../node_modules/d3-selection/src/selection/clone.js","../../../../node_modules/d3-selection/src/selection/datum.js","../../../../node_modules/d3-selection/src/selection/on.js","../../../../node_modules/d3-selection/src/selection/dispatch.js","../../../../node_modules/d3-selection/src/selection/iterator.js","../../../../node_modules/d3-selection/src/selection/index.js","../../../../node_modules/d3-selection/src/select.js","../../../../node_modules/d3-selection/src/sourceEvent.js","../../../../node_modules/d3-selection/src/pointer.js","../../../../node_modules/d3-drag/src/noevent.js","../../../../node_modules/d3-drag/src/nodrag.js","../../../../node_modules/d3-color/src/define.js","../../../../node_modules/d3-color/src/color.js","../../../../node_modules/d3-interpolate/src/constant.js","../../../../node_modules/d3-interpolate/src/color.js","../../../../node_modules/d3-interpolate/src/rgb.js","../../../../node_modules/d3-interpolate/src/numberArray.js","../../../../node_modules/d3-interpolate/src/array.js","../../../../node_modules/d3-interpolate/src/date.js","../../../../node_modules/d3-interpolate/src/number.js","../../../../node_modules/d3-interpolate/src/object.js","../../../../node_modules/d3-interpolate/src/string.js","../../../../node_modules/d3-interpolate/src/value.js","../../../../node_modules/d3-interpolate/src/round.js","../../../../node_modules/d3-interpolate/src/transform/decompose.js","../../../../node_modules/d3-interpolate/src/transform/parse.js","../../../../node_modules/d3-interpolate/src/transform/index.js","../../../../node_modules/d3-interpolate/src/quantize.js","../../../../node_modules/d3-timer/src/timer.js","../../../../node_modules/d3-timer/src/timeout.js","../../../../node_modules/d3-transition/src/transition/schedule.js","../../../../node_modules/d3-transition/src/interrupt.js","../../../../node_modules/d3-transition/src/selection/interrupt.js","../../../../node_modules/d3-transition/src/transition/tween.js","../../../../node_modules/d3-transition/src/transition/interpolate.js","../../../../node_modules/d3-transition/src/transition/attr.js","../../../../node_modules/d3-transition/src/transition/attrTween.js","../../../../node_modules/d3-transition/src/transition/delay.js","../../../../node_modules/d3-transition/src/transition/duration.js","../../../../node_modules/d3-transition/src/transition/ease.js","../../../../node_modules/d3-transition/src/transition/easeVarying.js","../../../../node_modules/d3-transition/src/transition/filter.js","../../../../node_modules/d3-transition/src/transition/merge.js","../../../../node_modules/d3-transition/src/transition/on.js","../../../../node_modules/d3-transition/src/transition/remove.js","../../../../node_modules/d3-transition/src/transition/select.js","../../../../node_modules/d3-transition/src/transition/selectAll.js","../../../../node_modules/d3-transition/src/transition/selection.js","../../../../node_modules/d3-transition/src/transition/style.js","../../../../node_modules/d3-transition/src/transition/styleTween.js","../../../../node_modules/d3-transition/src/transition/text.js","../../../../node_modules/d3-transition/src/transition/textTween.js","../../../../node_modules/d3-transition/src/transition/transition.js","../../../../node_modules/d3-transition/src/transition/end.js","../../../../node_modules/d3-transition/src/transition/index.js","../../../../node_modules/d3-ease/src/linear.js","../../../../node_modules/d3-ease/src/cubic.js","../../../../node_modules/d3-transition/src/selection/transition.js","../../../../node_modules/d3-transition/src/selection/index.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-format/src/formatDecimal.js","../../../../node_modules/d3-format/src/exponent.js","../../../../node_modules/d3-format/src/formatGroup.js","../../../../node_modules/d3-format/src/formatNumerals.js","../../../../node_modules/d3-format/src/formatSpecifier.js","../../../../node_modules/d3-format/src/formatTrim.js","../../../../node_modules/d3-format/src/formatPrefixAuto.js","../../../../node_modules/d3-format/src/formatRounded.js","../../../../node_modules/d3-format/src/formatTypes.js","../../../../node_modules/d3-format/src/identity.js","../../../../node_modules/d3-format/src/locale.js","../../../../node_modules/d3-format/src/defaultLocale.js","../../../../node_modules/d3-format/src/precisionFixed.js","../../../../node_modules/d3-format/src/precisionPrefix.js","../../../../node_modules/d3-format/src/precisionRound.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-scale/src/init.js","../../../../node_modules/d3-scale/src/ordinal.js","../../../../node_modules/d3-scale/src/band.js","../../../../node_modules/d3-scale/src/constant.js","../../../../node_modules/d3-scale/src/number.js","../../../../node_modules/d3-scale/src/continuous.js","../../../../node_modules/d3-scale/src/tickFormat.js","../../../../node_modules/d3-scale/src/linear.js","../../../../node_modules/d3-scale/src/nice.js","../../../../node_modules/d3-scale/src/log.js","../../../../node_modules/d3-scale/src/quantize.js","../../../../node_modules/d3-time/src/interval.js","../../../../node_modules/d3-time/src/millisecond.js","../../../../node_modules/d3-time/src/duration.js","../../../../node_modules/d3-time/src/second.js","../../../../node_modules/d3-time/src/minute.js","../../../../node_modules/d3-time/src/hour.js","../../../../node_modules/d3-time/src/day.js","../../../../node_modules/d3-time/src/week.js","../../../../node_modules/d3-time/src/month.js","../../../../node_modules/d3-time/src/year.js","../../../../node_modules/d3-time/src/ticks.js","../../../../node_modules/d3-time-format/src/locale.js","../../../../node_modules/d3-time-format/src/defaultLocale.js","../../../../node_modules/d3-scale/src/time.js","../../../../node_modules/d3/node_modules/d3-shape/src/constant.js","../../../../node_modules/d3/node_modules/d3-shape/src/math.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/array.js","../../../../node_modules/d3/node_modules/d3-shape/src/curve/linear.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","../../../../node_modules/d3/node_modules/d3-shape/src/noop.js","../../../../node_modules/d3/node_modules/d3-shape/src/curve/basis.js","../../../../node_modules/d3/node_modules/d3-shape/src/curve/basisClosed.js","../../../../node_modules/d3/node_modules/d3-shape/src/curve/basisOpen.js","../../../../node_modules/d3/node_modules/d3-shape/src/curve/bundle.js","../../../../node_modules/d3/node_modules/d3-shape/src/curve/cardinal.js","../../../../node_modules/d3/node_modules/d3-shape/src/curve/cardinalClosed.js","../../../../node_modules/d3/node_modules/d3-shape/src/curve/cardinalOpen.js","../../../../node_modules/d3/node_modules/d3-shape/src/curve/catmullRom.js","../../../../node_modules/d3/node_modules/d3-shape/src/curve/catmullRomClosed.js","../../../../node_modules/d3/node_modules/d3-shape/src/curve/catmullRomOpen.js","../../../../node_modules/d3/node_modules/d3-shape/src/curve/linearClosed.js","../../../../node_modules/d3/node_modules/d3-shape/src/curve/monotone.js","../../../../node_modules/d3/node_modules/d3-shape/src/curve/natural.js","../../../../node_modules/d3/node_modules/d3-shape/src/curve/step.js","../../../../node_modules/d3/node_modules/d3-shape/src/offset/none.js","../../../../node_modules/d3/node_modules/d3-shape/src/order/none.js","../../../../node_modules/d3/node_modules/d3-shape/src/stack.js","../../../../node_modules/d3/node_modules/d3-shape/src/offset/diverging.js","../../../../node_modules/d3-zoom/src/transform.js","../../../../node_modules/lodash-es/_freeGlobal.js","../../../../node_modules/lodash-es/_root.js","../../../../node_modules/lodash-es/_Symbol.js","../../../../node_modules/lodash-es/_getRawTag.js","../../../../node_modules/lodash-es/_objectToString.js","../../../../node_modules/lodash-es/_baseGetTag.js","../../../../node_modules/lodash-es/isObjectLike.js","../../../../node_modules/lodash-es/isSymbol.js","../../../../node_modules/lodash-es/_arrayMap.js","../../../../node_modules/lodash-es/isArray.js","../../../../node_modules/lodash-es/_baseToString.js","../../../../node_modules/lodash-es/_trimmedEndIndex.js","../../../../node_modules/lodash-es/_baseTrim.js","../../../../node_modules/lodash-es/isObject.js","../../../../node_modules/lodash-es/toNumber.js","../../../../node_modules/lodash-es/identity.js","../../../../node_modules/lodash-es/isFunction.js","../../../../node_modules/lodash-es/_coreJsData.js","../../../../node_modules/lodash-es/_isMasked.js","../../../../node_modules/lodash-es/_toSource.js","../../../../node_modules/lodash-es/_baseIsNative.js","../../../../node_modules/lodash-es/_getValue.js","../../../../node_modules/lodash-es/_getNative.js","../../../../node_modules/lodash-es/_WeakMap.js","../../../../node_modules/lodash-es/_baseCreate.js","../../../../node_modules/lodash-es/_apply.js","../../../../node_modules/lodash-es/noop.js","../../../../node_modules/lodash-es/_copyArray.js","../../../../node_modules/lodash-es/_shortOut.js","../../../../node_modules/lodash-es/constant.js","../../../../node_modules/lodash-es/_defineProperty.js","../../../../node_modules/lodash-es/_baseSetToString.js","../../../../node_modules/lodash-es/_setToString.js","../../../../node_modules/lodash-es/_arrayEach.js","../../../../node_modules/lodash-es/_baseFindIndex.js","../../../../node_modules/lodash-es/_baseIsNaN.js","../../../../node_modules/lodash-es/_strictIndexOf.js","../../../../node_modules/lodash-es/_baseIndexOf.js","../../../../node_modules/lodash-es/_arrayIncludes.js","../../../../node_modules/lodash-es/_isIndex.js","../../../../node_modules/lodash-es/_baseAssignValue.js","../../../../node_modules/lodash-es/eq.js","../../../../node_modules/lodash-es/_assignValue.js","../../../../node_modules/lodash-es/_copyObject.js","../../../../node_modules/lodash-es/_overRest.js","../../../../node_modules/lodash-es/_baseRest.js","../../../../node_modules/lodash-es/isLength.js","../../../../node_modules/lodash-es/isArrayLike.js","../../../../node_modules/lodash-es/_isIterateeCall.js","../../../../node_modules/lodash-es/_createAssigner.js","../../../../node_modules/lodash-es/_isPrototype.js","../../../../node_modules/lodash-es/_baseTimes.js","../../../../node_modules/lodash-es/_baseIsArguments.js","../../../../node_modules/lodash-es/isArguments.js","../../../../node_modules/lodash-es/stubFalse.js","../../../../node_modules/lodash-es/isBuffer.js","../../../../node_modules/lodash-es/_baseIsTypedArray.js","../../../../node_modules/lodash-es/_baseUnary.js","../../../../node_modules/lodash-es/_nodeUtil.js","../../../../node_modules/lodash-es/isTypedArray.js","../../../../node_modules/lodash-es/_arrayLikeKeys.js","../../../../node_modules/lodash-es/_overArg.js","../../../../node_modules/lodash-es/_nativeKeys.js","../../../../node_modules/lodash-es/_baseKeys.js","../../../../node_modules/lodash-es/keys.js","../../../../node_modules/lodash-es/_nativeKeysIn.js","../../../../node_modules/lodash-es/_baseKeysIn.js","../../../../node_modules/lodash-es/keysIn.js","../../../../node_modules/lodash-es/_isKey.js","../../../../node_modules/lodash-es/_nativeCreate.js","../../../../node_modules/lodash-es/_hashClear.js","../../../../node_modules/lodash-es/_hashDelete.js","../../../../node_modules/lodash-es/_hashGet.js","../../../../node_modules/lodash-es/_hashHas.js","../../../../node_modules/lodash-es/_hashSet.js","../../../../node_modules/lodash-es/_Hash.js","../../../../node_modules/lodash-es/_listCacheClear.js","../../../../node_modules/lodash-es/_assocIndexOf.js","../../../../node_modules/lodash-es/_listCacheDelete.js","../../../../node_modules/lodash-es/_listCacheGet.js","../../../../node_modules/lodash-es/_listCacheHas.js","../../../../node_modules/lodash-es/_listCacheSet.js","../../../../node_modules/lodash-es/_ListCache.js","../../../../node_modules/lodash-es/_Map.js","../../../../node_modules/lodash-es/_mapCacheClear.js","../../../../node_modules/lodash-es/_isKeyable.js","../../../../node_modules/lodash-es/_getMapData.js","../../../../node_modules/lodash-es/_mapCacheDelete.js","../../../../node_modules/lodash-es/_mapCacheGet.js","../../../../node_modules/lodash-es/_mapCacheHas.js","../../../../node_modules/lodash-es/_mapCacheSet.js","../../../../node_modules/lodash-es/_MapCache.js","../../../../node_modules/lodash-es/memoize.js","../../../../node_modules/lodash-es/_memoizeCapped.js","../../../../node_modules/lodash-es/_stringToPath.js","../../../../node_modules/lodash-es/toString.js","../../../../node_modules/lodash-es/_castPath.js","../../../../node_modules/lodash-es/_toKey.js","../../../../node_modules/lodash-es/_baseGet.js","../../../../node_modules/lodash-es/get.js","../../../../node_modules/lodash-es/_arrayPush.js","../../../../node_modules/lodash-es/_isFlattenable.js","../../../../node_modules/lodash-es/_baseFlatten.js","../../../../node_modules/lodash-es/flatten.js","../../../../node_modules/lodash-es/_flatRest.js","../../../../node_modules/lodash-es/_getPrototype.js","../../../../node_modules/lodash-es/isPlainObject.js","../../../../node_modules/lodash-es/_baseSlice.js","../../../../node_modules/lodash-es/_castSlice.js","../../../../node_modules/lodash-es/_hasUnicode.js","../../../../node_modules/lodash-es/_asciiToArray.js","../../../../node_modules/lodash-es/_unicodeToArray.js","../../../../node_modules/lodash-es/_stringToArray.js","../../../../node_modules/lodash-es/_createCaseFirst.js","../../../../node_modules/lodash-es/upperFirst.js","../../../../node_modules/lodash-es/capitalize.js","../../../../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/camelCase.js","../../../../node_modules/lodash-es/_baseClamp.js","../../../../node_modules/lodash-es/clamp.js","../../../../node_modules/lodash-es/_stackClear.js","../../../../node_modules/lodash-es/_stackDelete.js","../../../../node_modules/lodash-es/_stackGet.js","../../../../node_modules/lodash-es/_stackHas.js","../../../../node_modules/lodash-es/_stackSet.js","../../../../node_modules/lodash-es/_Stack.js","../../../../node_modules/lodash-es/_baseAssign.js","../../../../node_modules/lodash-es/_baseAssignIn.js","../../../../node_modules/lodash-es/_cloneBuffer.js","../../../../node_modules/lodash-es/_arrayFilter.js","../../../../node_modules/lodash-es/stubArray.js","../../../../node_modules/lodash-es/_getSymbols.js","../../../../node_modules/lodash-es/_copySymbols.js","../../../../node_modules/lodash-es/_getSymbolsIn.js","../../../../node_modules/lodash-es/_copySymbolsIn.js","../../../../node_modules/lodash-es/_baseGetAllKeys.js","../../../../node_modules/lodash-es/_getAllKeys.js","../../../../node_modules/lodash-es/_getAllKeysIn.js","../../../../node_modules/lodash-es/_DataView.js","../../../../node_modules/lodash-es/_Promise.js","../../../../node_modules/lodash-es/_Set.js","../../../../node_modules/lodash-es/_getTag.js","../../../../node_modules/lodash-es/_initCloneArray.js","../../../../node_modules/lodash-es/_Uint8Array.js","../../../../node_modules/lodash-es/_cloneArrayBuffer.js","../../../../node_modules/lodash-es/_cloneDataView.js","../../../../node_modules/lodash-es/_cloneRegExp.js","../../../../node_modules/lodash-es/_cloneSymbol.js","../../../../node_modules/lodash-es/_cloneTypedArray.js","../../../../node_modules/lodash-es/_initCloneByTag.js","../../../../node_modules/lodash-es/_initCloneObject.js","../../../../node_modules/lodash-es/_baseIsMap.js","../../../../node_modules/lodash-es/isMap.js","../../../../node_modules/lodash-es/_baseIsSet.js","../../../../node_modules/lodash-es/isSet.js","../../../../node_modules/lodash-es/_baseClone.js","../../../../node_modules/lodash-es/cloneDeep.js","../../../../node_modules/lodash-es/_setCacheAdd.js","../../../../node_modules/lodash-es/_setCacheHas.js","../../../../node_modules/lodash-es/_SetCache.js","../../../../node_modules/lodash-es/_arraySome.js","../../../../node_modules/lodash-es/_cacheHas.js","../../../../node_modules/lodash-es/_equalArrays.js","../../../../node_modules/lodash-es/_mapToArray.js","../../../../node_modules/lodash-es/_setToArray.js","../../../../node_modules/lodash-es/_equalByTag.js","../../../../node_modules/lodash-es/_equalObjects.js","../../../../node_modules/lodash-es/_baseIsEqualDeep.js","../../../../node_modules/lodash-es/_baseIsEqual.js","../../../../node_modules/lodash-es/_baseIsMatch.js","../../../../node_modules/lodash-es/_isStrictComparable.js","../../../../node_modules/lodash-es/_getMatchData.js","../../../../node_modules/lodash-es/_matchesStrictComparable.js","../../../../node_modules/lodash-es/_baseMatches.js","../../../../node_modules/lodash-es/_baseHasIn.js","../../../../node_modules/lodash-es/_hasPath.js","../../../../node_modules/lodash-es/hasIn.js","../../../../node_modules/lodash-es/_baseMatchesProperty.js","../../../../node_modules/lodash-es/_baseProperty.js","../../../../node_modules/lodash-es/_basePropertyDeep.js","../../../../node_modules/lodash-es/property.js","../../../../node_modules/lodash-es/_baseIteratee.js","../../../../node_modules/lodash-es/_arrayAggregator.js","../../../../node_modules/lodash-es/_createBaseFor.js","../../../../node_modules/lodash-es/_baseFor.js","../../../../node_modules/lodash-es/_baseForOwn.js","../../../../node_modules/lodash-es/_createBaseEach.js","../../../../node_modules/lodash-es/_baseEach.js","../../../../node_modules/lodash-es/_baseAggregator.js","../../../../node_modules/lodash-es/_createAggregator.js","../../../../node_modules/lodash-es/now.js","../../../../node_modules/lodash-es/debounce.js","../../../../node_modules/lodash-es/_assignMergeValue.js","../../../../node_modules/lodash-es/isArrayLikeObject.js","../../../../node_modules/lodash-es/_safeGet.js","../../../../node_modules/lodash-es/toPlainObject.js","../../../../node_modules/lodash-es/_baseMergeDeep.js","../../../../node_modules/lodash-es/_baseMerge.js","../../../../node_modules/lodash-es/_baseDelay.js","../../../../node_modules/lodash-es/delay.js","../../../../node_modules/lodash-es/last.js","../../../../node_modules/lodash-es/_baseMap.js","../../../../node_modules/lodash-es/map.js","../../../../node_modules/lodash-es/flatMapDeep.js","../../../../node_modules/lodash-es/fromPairs.js","../../../../node_modules/lodash-es/groupBy.js","../../../../node_modules/lodash-es/_parent.js","../../../../node_modules/lodash-es/isEmpty.js","../../../../node_modules/lodash-es/isEqual.js","../../../../node_modules/lodash-es/kebabCase.js","../../../../node_modules/lodash-es/merge.js","../../../../node_modules/lodash-es/_baseUnset.js","../../../../node_modules/lodash-es/_customOmitClone.js","../../../../node_modules/lodash-es/omit.js","../../../../node_modules/lodash-es/_baseSome.js","../../../../node_modules/lodash-es/some.js","../../../../node_modules/lodash-es/_createSet.js","../../../../node_modules/lodash-es/_baseUniq.js","../../../../node_modules/lodash-es/unionBy.js","../../../../node_modules/lodash-es/uniq.js","../../src/interfaces/events.ts","../../src/interfaces/enums.ts","../../src/configuration-non-customizable.ts","../../src/tools.ts","../../../../node_modules/date-fns/locale/_lib/buildFormatLongFn.mjs","../../../../node_modules/date-fns/locale/_lib/buildLocalizeFn.mjs","../../../../node_modules/date-fns/locale/_lib/buildMatchFn.mjs","../../../../node_modules/date-fns/locale/_lib/buildMatchPatternFn.mjs","../../../../node_modules/date-fns/toDate.mjs","../../../../node_modules/date-fns/_lib/defaultOptions.mjs","../../../../node_modules/date-fns/startOfWeek.mjs","../../../../node_modules/date-fns/locale/en-US/_lib/formatDistance.mjs","../../../../node_modules/date-fns/locale/en-US/_lib/formatRelative.mjs","../../../../node_modules/date-fns/locale/en-US/_lib/localize.mjs","../../../../node_modules/date-fns/locale/en-US/_lib/match.mjs","../../../../node_modules/date-fns/locale/en-US/_lib/formatLong.mjs","../../../../node_modules/date-fns/locale/en-US.mjs","../../src/configuration.ts","../../../../node_modules/date-fns/constants.mjs","../../../../node_modules/date-fns/startOfDay.mjs","../../../../node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.mjs","../../../../node_modules/date-fns/differenceInCalendarDays.mjs","../../../../node_modules/date-fns/constructFrom.mjs","../../../../node_modules/date-fns/startOfYear.mjs","../../../../node_modules/date-fns/getDayOfYear.mjs","../../../../node_modules/date-fns/startOfISOWeek.mjs","../../../../node_modules/date-fns/getISOWeekYear.mjs","../../../../node_modules/date-fns/startOfISOWeekYear.mjs","../../../../node_modules/date-fns/getISOWeek.mjs","../../../../node_modules/date-fns/getWeekYear.mjs","../../../../node_modules/date-fns/startOfWeekYear.mjs","../../../../node_modules/date-fns/getWeek.mjs","../../../../node_modules/date-fns/_lib/addLeadingZeros.mjs","../../../../node_modules/date-fns/_lib/format/lightFormatters.mjs","../../../../node_modules/date-fns/_lib/format/formatters.mjs","../../../../node_modules/date-fns/_lib/format/longFormatters.mjs","../../../../node_modules/date-fns/_lib/protectedTokens.mjs","../../../../node_modules/date-fns/isDate.mjs","../../../../node_modules/date-fns/isValid.mjs","../../../../node_modules/date-fns/format.mjs","../../src/interfaces/axis-scales.ts","../../src/services/time-series.ts","../../src/model/model.ts","../../../../node_modules/html-to-image/es/util.js","../../../../node_modules/html-to-image/es/clone-pseudos.js","../../../../node_modules/html-to-image/es/mimes.js","../../../../node_modules/html-to-image/es/dataurl.js","../../../../node_modules/html-to-image/es/clone-node.js","../../../../node_modules/html-to-image/es/embed-resources.js","../../../../node_modules/html-to-image/es/embed-images.js","../../../../node_modules/html-to-image/es/apply-style.js","../../../../node_modules/html-to-image/es/embed-webfonts.js","../../../../node_modules/html-to-image/es/index.js","../../src/services/service.ts","../../src/services/essentials/dom-utils.ts","../../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/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/interfaces/a11y.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/services/canvas-zoom.ts","../../src/services/essentials/events.ts","../../src/services/essentials/files.ts","../../src/services/essentials/gradient-utils.ts","../../src/services/essentials/transitions.ts","../../src/chart.ts","../../src/model/cartesian-charts.ts","../../src/model/alluvial.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/charts/alluvial.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/date-fns/compareAsc.mjs","../../../../node_modules/date-fns/differenceInCalendarYears.mjs","../../../../node_modules/date-fns/differenceInYears.mjs","../../../../node_modules/date-fns/addMonths.mjs","../../../../node_modules/date-fns/addYears.mjs","../../../../node_modules/date-fns/subYears.mjs","../../../../node_modules/date-fns/differenceInCalendarMonths.mjs","../../../../node_modules/date-fns/endOfDay.mjs","../../../../node_modules/date-fns/endOfMonth.mjs","../../../../node_modules/date-fns/isLastDayOfMonth.mjs","../../../../node_modules/date-fns/differenceInMonths.mjs","../../../../node_modules/date-fns/subMonths.mjs","../../../../node_modules/date-fns/differenceInDays.mjs","../../../../node_modules/date-fns/addDays.mjs","../../../../node_modules/date-fns/subDays.mjs","../../../../node_modules/date-fns/_lib/getRoundingMethod.mjs","../../../../node_modules/date-fns/differenceInMilliseconds.mjs","../../../../node_modules/date-fns/differenceInHours.mjs","../../../../node_modules/date-fns/addMilliseconds.mjs","../../../../node_modules/date-fns/addHours.mjs","../../../../node_modules/date-fns/subHours.mjs","../../../../node_modules/date-fns/differenceInMinutes.mjs","../../../../node_modules/date-fns/addMinutes.mjs","../../../../node_modules/date-fns/subMinutes.mjs","../../../../node_modules/date-fns/differenceInSeconds.mjs","../../../../node_modules/date-fns/addSeconds.mjs","../../../../node_modules/date-fns/subSeconds.mjs","../../src/services/scales-cartesian.ts","../../src/services/curves.ts","../../src/services/zoom.ts","../../src/axis-chart.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/charts/area.ts","../../src/model/boxplot.ts","../../src/components/graphs/boxplot.ts","../../src/components/axes/zero-line.ts","../../src/charts/boxplot.ts","../../src/components/graphs/bubble.ts","../../src/charts/bubble.ts","../../src/model/bullet.ts","../../src/components/graphs/bullet.ts","../../src/charts/bullet.ts","../../src/services/color-scale-utils.ts","../../src/model/choropleth.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/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/services/angle-utils.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","../../src/charts/choropleth.ts","../../src/model/circle-pack.ts","../../src/charts/circle-pack.ts","../../src/charts/combo.ts","../../src/model/pie.ts","../../src/charts/pie.ts","../../src/charts/donut.ts","../../src/model/gauge.ts","../../src/charts/gauge.ts","../../src/charts/bar-grouped.ts","../../src/model/heatmap.ts","../../src/charts/heatmap.ts","../../src/model/binned-charts.ts","../../src/charts/histogram.ts","../../src/charts/line.ts","../../src/charts/lollipop.ts","../../src/model/meter.ts","../../src/charts/meter.ts","../../src/model/radar.ts","../../src/charts/radar.ts","../../src/charts/scatter.ts","../../src/model/tree.ts","../../src/charts/tree.ts","../../src/model/treemap.ts","../../src/charts/treemap.ts","../../src/charts/bar-simple.ts","../../src/charts/area-stacked.ts","../../src/charts/bar-stacked.ts","../../src/model/wordcloud.ts","../../src/charts/wordcloud.ts"],"sourcesContent":["export default function ascending(a, b) {\n return a == null || b == null ? NaN : a < b ? -1 : a > b ? 1 : a >= b ? 0 : NaN;\n}\n","export default function descending(a, b) {\n return a == null || b == null ? NaN\n : b < a ? -1\n : b > a ? 1\n : b >= a ? 0\n : NaN;\n}\n","import ascending from \"./ascending.js\";\nimport descending from \"./descending.js\";\n\nexport default function bisector(f) {\n let compare1, compare2, delta;\n\n // If an accessor is specified, promote it to a comparator. In this case we\n // can test whether the search value is (self-) comparable. We can’t do this\n // for a comparator (except for specific, known comparators) because we can’t\n // tell if the comparator is symmetric, and an asymmetric comparator can’t be\n // used to test whether a single value is comparable.\n if (f.length !== 2) {\n compare1 = ascending;\n compare2 = (d, x) => ascending(f(d), x);\n delta = (d, x) => f(d) - x;\n } else {\n compare1 = f === ascending || f === descending ? f : zero;\n compare2 = f;\n delta = f;\n }\n\n function left(a, x, lo = 0, hi = a.length) {\n if (lo < hi) {\n if (compare1(x, x) !== 0) return hi;\n do {\n const mid = (lo + hi) >>> 1;\n if (compare2(a[mid], x) < 0) lo = mid + 1;\n else hi = mid;\n } while (lo < hi);\n }\n return lo;\n }\n\n function right(a, x, lo = 0, hi = a.length) {\n if (lo < hi) {\n if (compare1(x, x) !== 0) return hi;\n do {\n const mid = (lo + hi) >>> 1;\n if (compare2(a[mid], x) <= 0) lo = mid + 1;\n else hi = mid;\n } while (lo < hi);\n }\n return lo;\n }\n\n function center(a, x, lo = 0, hi = a.length) {\n const i = left(a, x, lo, hi - 1);\n return i > lo && delta(a[i - 1], x) > -delta(a[i], x) ? i - 1 : i;\n }\n\n return {left, center, right};\n}\n\nfunction zero() {\n return 0;\n}\n","export default function number(x) {\n return x === null ? NaN : +x;\n}\n\nexport function* numbers(values, valueof) {\n if (valueof === undefined) {\n for (let value of values) {\n if (value != null && (value = +value) >= value) {\n yield value;\n }\n }\n } else {\n let index = -1;\n for (let value of values) {\n if ((value = valueof(value, ++index, values)) != null && (value = +value) >= value) {\n yield value;\n }\n }\n }\n}\n","import ascending from \"./ascending.js\";\nimport bisector from \"./bisector.js\";\nimport number from \"./number.js\";\n\nconst ascendingBisect = bisector(ascending);\nexport const bisectRight = ascendingBisect.right;\nexport const bisectLeft = ascendingBisect.left;\nexport const bisectCenter = bisector(number).center;\nexport default bisectRight;\n","export default function count(values, valueof) {\n let count = 0;\n if (valueof === undefined) {\n for (let value of values) {\n if (value != null && (value = +value) >= value) {\n ++count;\n }\n }\n } else {\n let index = -1;\n for (let value of values) {\n if ((value = valueof(value, ++index, values)) != null && (value = +value) >= value) {\n ++count;\n }\n }\n }\n return count;\n}\n","export default function extent(values, valueof) {\n let min;\n let max;\n if (valueof === undefined) {\n for (const value of values) {\n if (value != null) {\n if (min === undefined) {\n if (value >= value) min = max = value;\n } else {\n if (min > value) min = value;\n if (max < value) max = value;\n }\n }\n }\n } else {\n let index = -1;\n for (let value of values) {\n if ((value = valueof(value, ++index, values)) != null) {\n if (min === undefined) {\n if (value >= value) min = max = value;\n } else {\n if (min > value) min = value;\n if (max < value) max = value;\n }\n }\n }\n }\n return [min, max];\n}\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","export class InternMap extends Map {\n constructor(entries, key = keyof) {\n super();\n Object.defineProperties(this, {_intern: {value: new Map()}, _key: {value: key}});\n if (entries != null) for (const [key, value] of entries) this.set(key, value);\n }\n get(key) {\n return super.get(intern_get(this, key));\n }\n has(key) {\n return super.has(intern_get(this, key));\n }\n set(key, value) {\n return super.set(intern_set(this, key), value);\n }\n delete(key) {\n return super.delete(intern_delete(this, key));\n }\n}\n\nexport class InternSet extends Set {\n constructor(values, key = keyof) {\n super();\n Object.defineProperties(this, {_intern: {value: new Map()}, _key: {value: key}});\n if (values != null) for (const value of values) this.add(value);\n }\n has(value) {\n return super.has(intern_get(this, value));\n }\n add(value) {\n return super.add(intern_set(this, value));\n }\n delete(value) {\n return super.delete(intern_delete(this, value));\n }\n}\n\nfunction intern_get({_intern, _key}, value) {\n const key = _key(value);\n return _intern.has(key) ? _intern.get(key) : value;\n}\n\nfunction intern_set({_intern, _key}, value) {\n const key = _key(value);\n if (_intern.has(key)) return _intern.get(key);\n _intern.set(key, value);\n return value;\n}\n\nfunction intern_delete({_intern, _key}, value) {\n const key = _key(value);\n if (_intern.has(key)) {\n value = _intern.get(key);\n _intern.delete(key);\n }\n return value;\n}\n\nfunction keyof(value) {\n return value !== null && typeof value === \"object\" ? value.valueOf() : value;\n}\n","export default function identity(x) {\n return x;\n}\n","import ascending from \"./ascending.js\";\nimport permute from \"./permute.js\";\n\nexport default function sort(values, ...F) {\n if (typeof values[Symbol.iterator] !== \"function\") throw new TypeError(\"values is not iterable\");\n values = Array.from(values);\n let [f] = F;\n if ((f && f.length !== 2) || F.length > 1) {\n const index = Uint32Array.from(values, (d, i) => i);\n if (F.length > 1) {\n F = F.map(f => values.map(f));\n index.sort((i, j) => {\n for (const f of F) {\n const c = ascendingDefined(f[i], f[j]);\n if (c) return c;\n }\n });\n } else {\n f = values.map(f);\n index.sort((i, j) => ascendingDefined(f[i], f[j]));\n }\n return permute(values, index);\n }\n return values.sort(compareDefined(f));\n}\n\nexport function compareDefined(compare = ascending) {\n if (compare === ascending) return ascendingDefined;\n if (typeof compare !== \"function\") throw new TypeError(\"compare is not a function\");\n return (a, b) => {\n const x = compare(a, b);\n if (x || x === 0) return x;\n return (compare(b, b) === 0) - (compare(a, a) === 0);\n };\n}\n\nexport function ascendingDefined(a, b) {\n return (a == null || !(a >= a)) - (b == null || !(b >= b)) || (a < b ? -1 : a > b ? 1 : 0);\n}\n","var array = Array.prototype;\n\nexport var slice = array.slice;\nexport var map = array.map;\n","export default function constant(x) {\n return () => x;\n}\n","const e10 = Math.sqrt(50),\n e5 = Math.sqrt(10),\n e2 = Math.sqrt(2);\n\nfunction tickSpec(start, stop, count) {\n const step = (stop - start) / Math.max(0, count),\n power = Math.floor(Math.log10(step)),\n error = step / Math.pow(10, power),\n factor = error >= e10 ? 10 : error >= e5 ? 5 : error >= e2 ? 2 : 1;\n let i1, i2, inc;\n if (power < 0) {\n inc = Math.pow(10, -power) / factor;\n i1 = Math.round(start * inc);\n i2 = Math.round(stop * inc);\n if (i1 / inc < start) ++i1;\n if (i2 / inc > stop) --i2;\n inc = -inc;\n } else {\n inc = Math.pow(10, power) * factor;\n i1 = Math.round(start / inc);\n i2 = Math.round(stop / inc);\n if (i1 * inc < start) ++i1;\n if (i2 * inc > stop) --i2;\n }\n if (i2 < i1 && 0.5 <= count && count < 2) return tickSpec(start, stop, count * 2);\n return [i1, i2, inc];\n}\n\nexport default function ticks(start, stop, count) {\n stop = +stop, start = +start, count = +count;\n if (!(count > 0)) return [];\n if (start === stop) return [start];\n const reverse = stop < start, [i1, i2, inc] = reverse ? tickSpec(stop, start, count) : tickSpec(start, stop, count);\n if (!(i2 >= i1)) return [];\n const n = i2 - i1 + 1, ticks = new Array(n);\n if (reverse) {\n if (inc < 0) for (let i = 0; i < n; ++i) ticks[i] = (i2 - i) / -inc;\n else for (let i = 0; i < n; ++i) ticks[i] = (i2 - i) * inc;\n } else {\n if (inc < 0) for (let i = 0; i < n; ++i) ticks[i] = (i1 + i) / -inc;\n else for (let i = 0; i < n; ++i) ticks[i] = (i1 + i) * inc;\n }\n return ticks;\n}\n\nexport function tickIncrement(start, stop, count) {\n stop = +stop, start = +start, count = +count;\n return tickSpec(start, stop, count)[2];\n}\n\nexport function tickStep(start, stop, count) {\n stop = +stop, start = +start, count = +count;\n const reverse = stop < start, inc = reverse ? tickIncrement(stop, start, count) : tickIncrement(start, stop, count);\n return (reverse ? -1 : 1) * (inc < 0 ? 1 / -inc : inc);\n}\n","import {tickIncrement} from \"./ticks.js\";\n\nexport default function nice(start, stop, count) {\n let prestep;\n while (true) {\n const step = tickIncrement(start, stop, count);\n if (step === prestep || step === 0 || !isFinite(step)) {\n return [start, stop];\n } else if (step > 0) {\n start = Math.floor(start / step) * step;\n stop = Math.ceil(stop / step) * step;\n } else if (step < 0) {\n start = Math.ceil(start * step) / step;\n stop = Math.floor(stop * step) / step;\n }\n prestep = step;\n }\n}\n","import count from \"../count.js\";\n\nexport default function thresholdSturges(values) {\n return Math.max(1, Math.ceil(Math.log(count(values)) / Math.LN2) + 1);\n}\n","import {slice} from \"./array.js\";\nimport bisect from \"./bisect.js\";\nimport constant from \"./constant.js\";\nimport extent from \"./extent.js\";\nimport identity from \"./identity.js\";\nimport nice from \"./nice.js\";\nimport ticks, {tickIncrement} from \"./ticks.js\";\nimport sturges from \"./threshold/sturges.js\";\n\nexport default function bin() {\n var value = identity,\n domain = extent,\n threshold = sturges;\n\n function histogram(data) {\n if (!Array.isArray(data)) data = Array.from(data);\n\n var i,\n n = data.length,\n x,\n step,\n values = new Array(n);\n\n for (i = 0; i < n; ++i) {\n values[i] = value(data[i], i, data);\n }\n\n var xz = domain(values),\n x0 = xz[0],\n x1 = xz[1],\n tz = threshold(values, x0, x1);\n\n // Convert number of thresholds into uniform thresholds, and nice the\n // default domain accordingly.\n if (!Array.isArray(tz)) {\n const max = x1, tn = +tz;\n if (domain === extent) [x0, x1] = nice(x0, x1, tn);\n tz = ticks(x0, x1, tn);\n\n // If the domain is aligned with the first tick (which it will by\n // default), then we can use quantization rather than bisection to bin\n // values, which is substantially faster.\n if (tz[0] <= x0) step = tickIncrement(x0, x1, tn);\n\n // If the last threshold is coincident with the domain’s upper bound, the\n // last bin will be zero-width. If the default domain is used, and this\n // last threshold is coincident with the maximum input value, we can\n // extend the niced upper bound by one tick to ensure uniform bin widths;\n // otherwise, we simply remove the last threshold. Note that we don’t\n // coerce values or the domain to numbers, and thus must be careful to\n // compare order (>=) rather than strict equality (===)!\n if (tz[tz.length - 1] >= x1) {\n if (max >= x1 && domain === extent) {\n const step = tickIncrement(x0, x1, tn);\n if (isFinite(step)) {\n if (step > 0) {\n x1 = (Math.floor(x1 / step) + 1) * step;\n } else if (step < 0) {\n x1 = (Math.ceil(x1 * -step) + 1) / -step;\n }\n }\n } else {\n tz.pop();\n }\n }\n }\n\n // Remove any thresholds outside the domain.\n // Be careful not to mutate an array owned by the user!\n var m = tz.length, a = 0, b = m;\n while (tz[a] <= x0) ++a;\n while (tz[b - 1] > x1) --b;\n if (a || b < m) tz = tz.slice(a, b), m = b - a;\n\n var bins = new Array(m + 1),\n bin;\n\n // Initialize bins.\n for (i = 0; i <= m; ++i) {\n bin = bins[i] = [];\n bin.x0 = i > 0 ? tz[i - 1] : x0;\n bin.x1 = i < m ? tz[i] : x1;\n }\n\n // Assign data to bins by value, ignoring any outside the domain.\n if (isFinite(step)) {\n if (step > 0) {\n for (i = 0; i < n; ++i) {\n if ((x = values[i]) != null && x0 <= x && x <= x1) {\n bins[Math.min(m, Math.floor((x - x0) / step))].push(data[i]);\n }\n }\n } else if (step < 0) {\n for (i = 0; i < n; ++i) {\n if ((x = values[i]) != null && x0 <= x && x <= x1) {\n const j = Math.floor((x0 - x) * step);\n bins[Math.min(m, j + (tz[j] <= x))].push(data[i]); // handle off-by-one due to rounding\n }\n }\n }\n } else {\n for (i = 0; i < n; ++i) {\n if ((x = values[i]) != null && x0 <= x && x <= x1) {\n bins[bisect(tz, x, 0, m)].push(data[i]);\n }\n }\n }\n\n return bins;\n }\n\n histogram.value = function(_) {\n return arguments.length ? (value = typeof _ === \"function\" ? _ : constant(_), histogram) : value;\n };\n\n histogram.domain = function(_) {\n return arguments.length ? (domain = typeof _ === \"function\" ? _ : constant([_[0], _[1]]), histogram) : domain;\n };\n\n histogram.thresholds = function(_) {\n return arguments.length ? (threshold = typeof _ === \"function\" ? _ : constant(Array.isArray(_) ? slice.call(_) : _), histogram) : threshold;\n };\n\n return histogram;\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","import {ascendingDefined, compareDefined} from \"./sort.js\";\n\n// Based on https://github.com/mourner/quickselect\n// ISC license, Copyright 2018 Vladimir Agafonkin.\nexport default function quickselect(array, k, left = 0, right = Infinity, compare) {\n k = Math.floor(k);\n left = Math.floor(Math.max(0, left));\n right = Math.floor(Math.min(array.length - 1, right));\n\n if (!(left <= k && k <= right)) return array;\n\n compare = compare === undefined ? ascendingDefined : compareDefined(compare);\n\n while (right > left) {\n if (right - left > 600) {\n const n = right - left + 1;\n const m = k - left + 1;\n const z = Math.log(n);\n const s = 0.5 * Math.exp(2 * z / 3);\n const sd = 0.5 * Math.sqrt(z * s * (n - s) / n) * (m - n / 2 < 0 ? -1 : 1);\n const newLeft = Math.max(left, Math.floor(k - m * s / n + sd));\n const newRight = Math.min(right, Math.floor(k + (n - m) * s / n + sd));\n quickselect(array, k, newLeft, newRight, compare);\n }\n\n const t = array[k];\n let i = left;\n let j = right;\n\n swap(array, left, k);\n if (compare(array[right], t) > 0) swap(array, left, right);\n\n while (i < j) {\n swap(array, i, j), ++i, --j;\n while (compare(array[i], t) < 0) ++i;\n while (compare(array[j], t) > 0) --j;\n }\n\n if (compare(array[left], t) === 0) swap(array, left, j);\n else ++j, swap(array, j, right);\n\n if (j <= k) left = j + 1;\n if (k <= j) right = j - 1;\n }\n\n return array;\n}\n\nfunction swap(array, i, j) {\n const t = array[i];\n array[i] = array[j];\n array[j] = t;\n}\n","import max from \"./max.js\";\nimport maxIndex from \"./maxIndex.js\";\nimport min from \"./min.js\";\nimport minIndex from \"./minIndex.js\";\nimport quickselect from \"./quickselect.js\";\nimport number, {numbers} from \"./number.js\";\nimport {ascendingDefined} from \"./sort.js\";\nimport greatest from \"./greatest.js\";\n\nexport default function quantile(values, p, valueof) {\n values = Float64Array.from(numbers(values, valueof));\n if (!(n = values.length) || isNaN(p = +p)) return;\n if (p <= 0 || n < 2) return min(values);\n if (p >= 1) return max(values);\n var n,\n i = (n - 1) * p,\n i0 = Math.floor(i),\n value0 = max(quickselect(values, i0).subarray(0, i0 + 1)),\n value1 = min(values.subarray(i0 + 1));\n return value0 + (value1 - value0) * (i - i0);\n}\n\nexport function quantileSorted(values, p, valueof = number) {\n if (!(n = values.length) || isNaN(p = +p)) return;\n if (p <= 0 || n < 2) return +valueof(values[0], 0, values);\n if (p >= 1) return +valueof(values[n - 1], n - 1, values);\n var n,\n i = (n - 1) * p,\n i0 = Math.floor(i),\n value0 = +valueof(values[i0], i0, values),\n value1 = +valueof(values[i0 + 1], i0 + 1, values);\n return value0 + (value1 - value0) * (i - i0);\n}\n\nexport function quantileIndex(values, p, valueof = number) {\n if (isNaN(p = +p)) return;\n numbers = Float64Array.from(values, (_, i) => number(valueof(values[i], i, values)));\n if (p <= 0) return minIndex(numbers);\n if (p >= 1) return maxIndex(numbers);\n var numbers,\n index = Uint32Array.from(values, (_, i) => i),\n j = numbers.length - 1,\n i = Math.floor(j * p);\n quickselect(index, i, 0, j, (i, j) => ascendingDefined(numbers[i], numbers[j]));\n i = greatest(index.subarray(0, i + 1), (i) => numbers[i]);\n return i >= 0 ? i : -1;\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 range(start, stop, step) {\n start = +start, stop = +stop, step = (n = arguments.length) < 2 ? (stop = start, start = 0, 1) : n < 3 ? 1 : +step;\n\n var i = -1,\n n = Math.max(0, Math.ceil((stop - start) / step)) | 0,\n range = new Array(n);\n\n while (++i < n) {\n range[i] = start + i * step;\n }\n\n return range;\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","var noop = {value: () => {}};\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","export var xhtml = \"http://www.w3.org/1999/xhtml\";\n\nexport default {\n svg: \"http://www.w3.org/2000/svg\",\n xhtml: xhtml,\n xlink: \"http://www.w3.org/1999/xlink\",\n xml: \"http://www.w3.org/XML/1998/namespace\",\n xmlns: \"http://www.w3.org/2000/xmlns/\"\n};\n","import namespaces from \"./namespaces.js\";\n\nexport default function(name) {\n var prefix = name += \"\", i = prefix.indexOf(\":\");\n if (i >= 0 && (prefix = name.slice(0, i)) !== \"xmlns\") name = name.slice(i + 1);\n return namespaces.hasOwnProperty(prefix) ? {space: namespaces[prefix], local: name} : name; // eslint-disable-line no-prototype-builtins\n}\n","import namespace from \"./namespace.js\";\nimport {xhtml} from \"./namespaces.js\";\n\nfunction creatorInherit(name) {\n return function() {\n var document = this.ownerDocument,\n uri = this.namespaceURI;\n return uri === xhtml && document.documentElement.namespaceURI === xhtml\n ? document.createElement(name)\n : document.createElementNS(uri, name);\n };\n}\n\nfunction creatorFixed(fullname) {\n return function() {\n return this.ownerDocument.createElementNS(fullname.space, fullname.local);\n };\n}\n\nexport default function(name) {\n var fullname = namespace(name);\n return (fullname.local\n ? creatorFixed\n : creatorInherit)(fullname);\n}\n","function none() {}\n\nexport default function(selector) {\n return selector == null ? none : function() {\n return this.querySelector(selector);\n };\n}\n","import {Selection} from \"./index.js\";\nimport selector from \"../selector.js\";\n\nexport default function(select) {\n if (typeof select !== \"function\") select = selector(select);\n\n for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) {\n for (var group = groups[j], n = group.length, subgroup = subgroups[j] = new Array(n), node, subnode, i = 0; i < n; ++i) {\n if ((node = group[i]) && (subnode = select.call(node, node.__data__, i, group))) {\n if (\"__data__\" in node) subnode.__data__ = node.__data__;\n subgroup[i] = subnode;\n }\n }\n }\n\n return new Selection(subgroups, this._parents);\n}\n","// Given something array like (or null), returns something that is strictly an\n// array. This is used to ensure that array-like objects passed to d3.selectAll\n// or selection.selectAll are converted into proper arrays when creating a\n// selection; we don’t ever want to create a selection backed by a live\n// HTMLCollection or NodeList. However, note that selection.selectAll will use a\n// static NodeList as a group, since it safely derived from querySelectorAll.\nexport default function array(x) {\n return x == null ? [] : Array.isArray(x) ? x : Array.from(x);\n}\n","function empty() {\n return [];\n}\n\nexport default function(selector) {\n return selector == null ? empty : function() {\n return this.querySelectorAll(selector);\n };\n}\n","import {Selection} from \"./index.js\";\nimport array from \"../array.js\";\nimport selectorAll from \"../selectorAll.js\";\n\nfunction arrayAll(select) {\n return function() {\n return array(select.apply(this, arguments));\n };\n}\n\nexport default function(select) {\n if (typeof select === \"function\") select = arrayAll(select);\n else select = selectorAll(select);\n\n for (var groups = this._groups, m = groups.length, subgroups = [], parents = [], j = 0; j < m; ++j) {\n for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) {\n if (node = group[i]) {\n subgroups.push(select.call(node, node.__data__, i, group));\n parents.push(node);\n }\n }\n }\n\n return new Selection(subgroups, parents);\n}\n","export default function(selector) {\n return function() {\n return this.matches(selector);\n };\n}\n\nexport function childMatcher(selector) {\n return function(node) {\n return node.matches(selector);\n };\n}\n\n","import {childMatcher} from \"../matcher.js\";\n\nvar find = Array.prototype.find;\n\nfunction childFind(match) {\n return function() {\n return find.call(this.children, match);\n };\n}\n\nfunction childFirst() {\n return this.firstElementChild;\n}\n\nexport default function(match) {\n return this.select(match == null ? childFirst\n : childFind(typeof match === \"function\" ? match : childMatcher(match)));\n}\n","import {childMatcher} from \"../matcher.js\";\n\nvar filter = Array.prototype.filter;\n\nfunction children() {\n return Array.from(this.children);\n}\n\nfunction childrenFilter(match) {\n return function() {\n return filter.call(this.children, match);\n };\n}\n\nexport default function(match) {\n return this.selectAll(match == null ? children\n : childrenFilter(typeof match === \"function\" ? match : childMatcher(match)));\n}\n","import {Selection} from \"./index.js\";\nimport matcher from \"../matcher.js\";\n\nexport default function(match) {\n if (typeof match !== \"function\") match = matcher(match);\n\n for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) {\n for (var group = groups[j], n = group.length, subgroup = subgroups[j] = [], node, i = 0; i < n; ++i) {\n if ((node = group[i]) && match.call(node, node.__data__, i, group)) {\n subgroup.push(node);\n }\n }\n }\n\n return new Selection(subgroups, this._parents);\n}\n","export default function(update) {\n return new Array(update.length);\n}\n","import sparse from \"./sparse.js\";\nimport {Selection} from \"./index.js\";\n\nexport default function() {\n return new Selection(this._enter || this._groups.map(sparse), this._parents);\n}\n\nexport function EnterNode(parent, datum) {\n this.ownerDocument = parent.ownerDocument;\n this.namespaceURI = parent.namespaceURI;\n this._next = null;\n this._parent = parent;\n this.__data__ = datum;\n}\n\nEnterNode.prototype = {\n constructor: EnterNode,\n appendChild: function(child) { return this._parent.insertBefore(child, this._next); },\n insertBefore: function(child, next) { return this._parent.insertBefore(child, next); },\n querySelector: function(selector) { return this._parent.querySelector(selector); },\n querySelectorAll: function(selector) { return this._parent.querySelectorAll(selector); }\n};\n","export default function(x) {\n return function() {\n return x;\n };\n}\n","import {Selection} from \"./index.js\";\nimport {EnterNode} from \"./enter.js\";\nimport constant from \"../constant.js\";\n\nfunction bindIndex(parent, group, enter, update, exit, data) {\n var i = 0,\n node,\n groupLength = group.length,\n dataLength = data.length;\n\n // Put any non-null nodes that fit into update.\n // Put any null nodes into enter.\n // Put any remaining data into enter.\n for (; i < dataLength; ++i) {\n if (node = group[i]) {\n node.__data__ = data[i];\n update[i] = node;\n } else {\n enter[i] = new EnterNode(parent, data[i]);\n }\n }\n\n // Put any non-null nodes that don’t fit into exit.\n for (; i < groupLength; ++i) {\n if (node = group[i]) {\n exit[i] = node;\n }\n }\n}\n\nfunction bindKey(parent, group, enter, update, exit, data, key) {\n var i,\n node,\n nodeByKeyValue = new Map,\n groupLength = group.length,\n dataLength = data.length,\n keyValues = new Array(groupLength),\n keyValue;\n\n // Compute the key for each node.\n // If multiple nodes have the same key, the duplicates are added to exit.\n for (i = 0; i < groupLength; ++i) {\n if (node = group[i]) {\n keyValues[i] = keyValue = key.call(node, node.__data__, i, group) + \"\";\n if (nodeByKeyValue.has(keyValue)) {\n exit[i] = node;\n } else {\n nodeByKeyValue.set(keyValue, node);\n }\n }\n }\n\n // Compute the key for each datum.\n // If there a node associated with this key, join and add it to update.\n // If there is not (or the key is a duplicate), add it to enter.\n for (i = 0; i < dataLength; ++i) {\n keyValue = key.call(parent, data[i], i, data) + \"\";\n if (node = nodeByKeyValue.get(keyValue)) {\n update[i] = node;\n node.__data__ = data[i];\n nodeByKeyValue.delete(keyValue);\n } else {\n enter[i] = new EnterNode(parent, data[i]);\n }\n }\n\n // Add any remaining nodes that were not bound to data to exit.\n for (i = 0; i < groupLength; ++i) {\n if ((node = group[i]) && (nodeByKeyValue.get(keyValues[i]) === node)) {\n exit[i] = node;\n }\n }\n}\n\nfunction datum(node) {\n return node.__data__;\n}\n\nexport default function(value, key) {\n if (!arguments.length) return Array.from(this, datum);\n\n var bind = key ? bindKey : bindIndex,\n parents = this._parents,\n groups = this._groups;\n\n if (typeof value !== \"function\") value = constant(value);\n\n for (var m = groups.length, update = new Array(m), enter = new Array(m), exit = new Array(m), j = 0; j < m; ++j) {\n var parent = parents[j],\n group = groups[j],\n groupLength = group.length,\n data = arraylike(value.call(parent, parent && parent.__data__, j, parents)),\n dataLength = data.length,\n enterGroup = enter[j] = new Array(dataLength),\n updateGroup = update[j] = new Array(dataLength),\n exitGroup = exit[j] = new Array(groupLength);\n\n bind(parent, group, enterGroup, updateGroup, exitGroup, data, key);\n\n // Now connect the enter nodes to their following update node, such that\n // appendChild can insert the materialized enter node before this node,\n // rather than at the end of the parent node.\n for (var i0 = 0, i1 = 0, previous, next; i0 < dataLength; ++i0) {\n if (previous = enterGroup[i0]) {\n if (i0 >= i1) i1 = i0 + 1;\n while (!(next = updateGroup[i1]) && ++i1 < dataLength);\n previous._next = next || null;\n }\n }\n }\n\n update = new Selection(update, parents);\n update._enter = enter;\n update._exit = exit;\n return update;\n}\n\n// Given some data, this returns an array-like view of it: an object that\n// exposes a length property and allows numeric indexing. Note that unlike\n// selectAll, this isn’t worried about “live” collections because the resulting\n// array will only be used briefly while data is being bound. (It is possible to\n// cause the data to change while iterating by using a key function, but please\n// don’t; we’d rather avoid a gratuitous copy.)\nfunction arraylike(data) {\n return typeof data === \"object\" && \"length\" in data\n ? data // Array, TypedArray, NodeList, array-like\n : Array.from(data); // Map, Set, iterable, string, or anything else\n}\n","import sparse from \"./sparse.js\";\nimport {Selection} from \"./index.js\";\n\nexport default function() {\n return new Selection(this._exit || this._groups.map(sparse), this._parents);\n}\n","export default function(onenter, onupdate, onexit) {\n var enter = this.enter(), update = this, exit = this.exit();\n if (typeof onenter === \"function\") {\n enter = onenter(enter);\n if (enter) enter = enter.selection();\n } else {\n enter = enter.append(onenter + \"\");\n }\n if (onupdate != null) {\n update = onupdate(update);\n if (update) update = update.selection();\n }\n if (onexit == null) exit.remove(); else onexit(exit);\n return enter && update ? enter.merge(update).order() : update;\n}\n","import {Selection} from \"./index.js\";\n\nexport default function(context) {\n var selection = context.selection ? context.selection() : context;\n\n for (var groups0 = this._groups, groups1 = selection._groups, m0 = groups0.length, m1 = groups1.length, m = Math.min(m0, m1), merges = new Array(m0), j = 0; j < m; ++j) {\n for (var group0 = groups0[j], group1 = groups1[j], n = group0.length, merge = merges[j] = new Array(n), node, i = 0; i < n; ++i) {\n if (node = group0[i] || group1[i]) {\n merge[i] = node;\n }\n }\n }\n\n for (; j < m0; ++j) {\n merges[j] = groups0[j];\n }\n\n return new Selection(merges, this._parents);\n}\n","export default function() {\n\n for (var groups = this._groups, j = -1, m = groups.length; ++j < m;) {\n for (var group = groups[j], i = group.length - 1, next = group[i], node; --i >= 0;) {\n if (node = group[i]) {\n if (next && node.compareDocumentPosition(next) ^ 4) next.parentNode.insertBefore(node, next);\n next = node;\n }\n }\n }\n\n return this;\n}\n","import {Selection} from \"./index.js\";\n\nexport default function(compare) {\n if (!compare) compare = ascending;\n\n function compareNode(a, b) {\n return a && b ? compare(a.__data__, b.__data__) : !a - !b;\n }\n\n for (var groups = this._groups, m = groups.length, sortgroups = new Array(m), j = 0; j < m; ++j) {\n for (var group = groups[j], n = group.length, sortgroup = sortgroups[j] = new Array(n), node, i = 0; i < n; ++i) {\n if (node = group[i]) {\n sortgroup[i] = node;\n }\n }\n sortgroup.sort(compareNode);\n }\n\n return new Selection(sortgroups, this._parents).order();\n}\n\nfunction ascending(a, b) {\n return a < b ? -1 : a > b ? 1 : a >= b ? 0 : NaN;\n}\n","export default function() {\n var callback = arguments[0];\n arguments[0] = this;\n callback.apply(null, arguments);\n return this;\n}\n","export default function() {\n return Array.from(this);\n}\n","export default function() {\n\n for (var groups = this._groups, j = 0, m = groups.length; j < m; ++j) {\n for (var group = groups[j], i = 0, n = group.length; i < n; ++i) {\n var node = group[i];\n if (node) return node;\n }\n }\n\n return null;\n}\n","export default function() {\n let size = 0;\n for (const node of this) ++size; // eslint-disable-line no-unused-vars\n return size;\n}\n","export default function() {\n return !this.node();\n}\n","export default function(callback) {\n\n for (var groups = this._groups, j = 0, m = groups.length; j < m; ++j) {\n for (var group = groups[j], i = 0, n = group.length, node; i < n; ++i) {\n if (node = group[i]) callback.call(node, node.__data__, i, group);\n }\n }\n\n return this;\n}\n","import namespace from \"../namespace.js\";\n\nfunction attrRemove(name) {\n return function() {\n this.removeAttribute(name);\n };\n}\n\nfunction attrRemoveNS(fullname) {\n return function() {\n this.removeAttributeNS(fullname.space, fullname.local);\n };\n}\n\nfunction attrConstant(name, value) {\n return function() {\n this.setAttribute(name, value);\n };\n}\n\nfunction attrConstantNS(fullname, value) {\n return function() {\n this.setAttributeNS(fullname.space, fullname.local, value);\n };\n}\n\nfunction attrFunction(name, value) {\n return function() {\n var v = value.apply(this, arguments);\n if (v == null) this.removeAttribute(name);\n else this.setAttribute(name, v);\n };\n}\n\nfunction attrFunctionNS(fullname, value) {\n return function() {\n var v = value.apply(this, arguments);\n if (v == null) this.removeAttributeNS(fullname.space, fullname.local);\n else this.setAttributeNS(fullname.space, fullname.local, v);\n };\n}\n\nexport default function(name, value) {\n var fullname = namespace(name);\n\n if (arguments.length < 2) {\n var node = this.node();\n return fullname.local\n ? node.getAttributeNS(fullname.space, fullname.local)\n : node.getAttribute(fullname);\n }\n\n return this.each((value == null\n ? (fullname.local ? attrRemoveNS : attrRemove) : (typeof value === \"function\"\n ? (fullname.local ? attrFunctionNS : attrFunction)\n : (fullname.local ? attrConstantNS : attrConstant)))(fullname, value));\n}\n","export default function(node) {\n return (node.ownerDocument && node.ownerDocument.defaultView) // node is a Node\n || (node.document && node) // node is a Window\n || node.defaultView; // node is a Document\n}\n","import defaultView from \"../window.js\";\n\nfunction styleRemove(name) {\n return function() {\n this.style.removeProperty(name);\n };\n}\n\nfunction styleConstant(name, value, priority) {\n return function() {\n this.style.setProperty(name, value, priority);\n };\n}\n\nfunction styleFunction(name, value, priority) {\n return function() {\n var v = value.apply(this, arguments);\n if (v == null) this.style.removeProperty(name);\n else this.style.setProperty(name, v, priority);\n };\n}\n\nexport default function(name, value, priority) {\n return arguments.length > 1\n ? this.each((value == null\n ? styleRemove : typeof value === \"function\"\n ? styleFunction\n : styleConstant)(name, value, priority == null ? \"\" : priority))\n : styleValue(this.node(), name);\n}\n\nexport function styleValue(node, name) {\n return node.style.getPropertyValue(name)\n || defaultView(node).getComputedStyle(node, null).getPropertyValue(name);\n}\n","function propertyRemove(name) {\n return function() {\n delete this[name];\n };\n}\n\nfunction propertyConstant(name, value) {\n return function() {\n this[name] = value;\n };\n}\n\nfunction propertyFunction(name, value) {\n return function() {\n var v = value.apply(this, arguments);\n if (v == null) delete this[name];\n else this[name] = v;\n };\n}\n\nexport default function(name, value) {\n return arguments.length > 1\n ? this.each((value == null\n ? propertyRemove : typeof value === \"function\"\n ? propertyFunction\n : propertyConstant)(name, value))\n : this.node()[name];\n}\n","function classArray(string) {\n return string.trim().split(/^|\\s+/);\n}\n\nfunction classList(node) {\n return node.classList || new ClassList(node);\n}\n\nfunction ClassList(node) {\n this._node = node;\n this._names = classArray(node.getAttribute(\"class\") || \"\");\n}\n\nClassList.prototype = {\n add: function(name) {\n var i = this._names.indexOf(name);\n if (i < 0) {\n this._names.push(name);\n this._node.setAttribute(\"class\", this._names.join(\" \"));\n }\n },\n remove: function(name) {\n var i = this._names.indexOf(name);\n if (i >= 0) {\n this._names.splice(i, 1);\n this._node.setAttribute(\"class\", this._names.join(\" \"));\n }\n },\n contains: function(name) {\n return this._names.indexOf(name) >= 0;\n }\n};\n\nfunction classedAdd(node, names) {\n var list = classList(node), i = -1, n = names.length;\n while (++i < n) list.add(names[i]);\n}\n\nfunction classedRemove(node, names) {\n var list = classList(node), i = -1, n = names.length;\n while (++i < n) list.remove(names[i]);\n}\n\nfunction classedTrue(names) {\n return function() {\n classedAdd(this, names);\n };\n}\n\nfunction classedFalse(names) {\n return function() {\n classedRemove(this, names);\n };\n}\n\nfunction classedFunction(names, value) {\n return function() {\n (value.apply(this, arguments) ? classedAdd : classedRemove)(this, names);\n };\n}\n\nexport default function(name, value) {\n var names = classArray(name + \"\");\n\n if (arguments.length < 2) {\n var list = classList(this.node()), i = -1, n = names.length;\n while (++i < n) if (!list.contains(names[i])) return false;\n return true;\n }\n\n return this.each((typeof value === \"function\"\n ? classedFunction : value\n ? classedTrue\n : classedFalse)(names, value));\n}\n","function textRemove() {\n this.textContent = \"\";\n}\n\nfunction textConstant(value) {\n return function() {\n this.textContent = value;\n };\n}\n\nfunction textFunction(value) {\n return function() {\n var v = value.apply(this, arguments);\n this.textContent = v == null ? \"\" : v;\n };\n}\n\nexport default function(value) {\n return arguments.length\n ? this.each(value == null\n ? textRemove : (typeof value === \"function\"\n ? textFunction\n : textConstant)(value))\n : this.node().textContent;\n}\n","function htmlRemove() {\n this.innerHTML = \"\";\n}\n\nfunction htmlConstant(value) {\n return function() {\n this.innerHTML = value;\n };\n}\n\nfunction htmlFunction(value) {\n return function() {\n var v = value.apply(this, arguments);\n this.innerHTML = v == null ? \"\" : v;\n };\n}\n\nexport default function(value) {\n return arguments.length\n ? this.each(value == null\n ? htmlRemove : (typeof value === \"function\"\n ? htmlFunction\n : htmlConstant)(value))\n : this.node().innerHTML;\n}\n","function raise() {\n if (this.nextSibling) this.parentNode.appendChild(this);\n}\n\nexport default function() {\n return this.each(raise);\n}\n","function lower() {\n if (this.previousSibling) this.parentNode.insertBefore(this, this.parentNode.firstChild);\n}\n\nexport default function() {\n return this.each(lower);\n}\n","import creator from \"../creator.js\";\n\nexport default function(name) {\n var create = typeof name === \"function\" ? name : creator(name);\n return this.select(function() {\n return this.appendChild(create.apply(this, arguments));\n });\n}\n","import creator from \"../creator.js\";\nimport selector from \"../selector.js\";\n\nfunction constantNull() {\n return null;\n}\n\nexport default function(name, before) {\n var create = typeof name === \"function\" ? name : creator(name),\n select = before == null ? constantNull : typeof before === \"function\" ? before : selector(before);\n return this.select(function() {\n return this.insertBefore(create.apply(this, arguments), select.apply(this, arguments) || null);\n });\n}\n","function remove() {\n var parent = this.parentNode;\n if (parent) parent.removeChild(this);\n}\n\nexport default function() {\n return this.each(remove);\n}\n","function selection_cloneShallow() {\n var clone = this.cloneNode(false), parent = this.parentNode;\n return parent ? parent.insertBefore(clone, this.nextSibling) : clone;\n}\n\nfunction selection_cloneDeep() {\n var clone = this.cloneNode(true), parent = this.parentNode;\n return parent ? parent.insertBefore(clone, this.nextSibling) : clone;\n}\n\nexport default function(deep) {\n return this.select(deep ? selection_cloneDeep : selection_cloneShallow);\n}\n","export default function(value) {\n return arguments.length\n ? this.property(\"__data__\", value)\n : this.node().__data__;\n}\n","function contextListener(listener) {\n return function(event) {\n listener.call(this, event, this.__data__);\n };\n}\n\nfunction parseTypenames(typenames) {\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 return {type: t, name: name};\n });\n}\n\nfunction onRemove(typename) {\n return function() {\n var on = this.__on;\n if (!on) return;\n for (var j = 0, i = -1, m = on.length, o; j < m; ++j) {\n if (o = on[j], (!typename.type || o.type === typename.type) && o.name === typename.name) {\n this.removeEventListener(o.type, o.listener, o.options);\n } else {\n on[++i] = o;\n }\n }\n if (++i) on.length = i;\n else delete this.__on;\n };\n}\n\nfunction onAdd(typename, value, options) {\n return function() {\n var on = this.__on, o, listener = contextListener(value);\n if (on) for (var j = 0, m = on.length; j < m; ++j) {\n if ((o = on[j]).type === typename.type && o.name === typename.name) {\n this.removeEventListener(o.type, o.listener, o.options);\n this.addEventListener(o.type, o.listener = listener, o.options = options);\n o.value = value;\n return;\n }\n }\n this.addEventListener(typename.type, listener, options);\n o = {type: typename.type, name: typename.name, value: value, listener: listener, options: options};\n if (!on) this.__on = [o];\n else on.push(o);\n };\n}\n\nexport default function(typename, value, options) {\n var typenames = parseTypenames(typename + \"\"), i, n = typenames.length, t;\n\n if (arguments.length < 2) {\n var on = this.node().__on;\n if (on) for (var j = 0, m = on.length, o; j < m; ++j) {\n for (i = 0, o = on[j]; i < n; ++i) {\n if ((t = typenames[i]).type === o.type && t.name === o.name) {\n return o.value;\n }\n }\n }\n return;\n }\n\n on = value ? onAdd : onRemove;\n for (i = 0; i < n; ++i) this.each(on(typenames[i], value, options));\n return this;\n}\n","import defaultView from \"../window.js\";\n\nfunction dispatchEvent(node, type, params) {\n var window = defaultView(node),\n event = window.CustomEvent;\n\n if (typeof event === \"function\") {\n event = new event(type, params);\n } else {\n event = window.document.createEvent(\"Event\");\n if (params) event.initEvent(type, params.bubbles, params.cancelable), event.detail = params.detail;\n else event.initEvent(type, false, false);\n }\n\n node.dispatchEvent(event);\n}\n\nfunction dispatchConstant(type, params) {\n return function() {\n return dispatchEvent(this, type, params);\n };\n}\n\nfunction dispatchFunction(type, params) {\n return function() {\n return dispatchEvent(this, type, params.apply(this, arguments));\n };\n}\n\nexport default function(type, params) {\n return this.each((typeof params === \"function\"\n ? dispatchFunction\n : dispatchConstant)(type, params));\n}\n","export default function*() {\n for (var groups = this._groups, j = 0, m = groups.length; j < m; ++j) {\n for (var group = groups[j], i = 0, n = group.length, node; i < n; ++i) {\n if (node = group[i]) yield node;\n }\n }\n}\n","import selection_select from \"./select.js\";\nimport selection_selectAll from \"./selectAll.js\";\nimport selection_selectChild from \"./selectChild.js\";\nimport selection_selectChildren from \"./selectChildren.js\";\nimport selection_filter from \"./filter.js\";\nimport selection_data from \"./data.js\";\nimport selection_enter from \"./enter.js\";\nimport selection_exit from \"./exit.js\";\nimport selection_join from \"./join.js\";\nimport selection_merge from \"./merge.js\";\nimport selection_order from \"./order.js\";\nimport selection_sort from \"./sort.js\";\nimport selection_call from \"./call.js\";\nimport selection_nodes from \"./nodes.js\";\nimport selection_node from \"./node.js\";\nimport selection_size from \"./size.js\";\nimport selection_empty from \"./empty.js\";\nimport selection_each from \"./each.js\";\nimport selection_attr from \"./attr.js\";\nimport selection_style from \"./style.js\";\nimport selection_property from \"./property.js\";\nimport selection_classed from \"./classed.js\";\nimport selection_text from \"./text.js\";\nimport selection_html from \"./html.js\";\nimport selection_raise from \"./raise.js\";\nimport selection_lower from \"./lower.js\";\nimport selection_append from \"./append.js\";\nimport selection_insert from \"./insert.js\";\nimport selection_remove from \"./remove.js\";\nimport selection_clone from \"./clone.js\";\nimport selection_datum from \"./datum.js\";\nimport selection_on from \"./on.js\";\nimport selection_dispatch from \"./dispatch.js\";\nimport selection_iterator from \"./iterator.js\";\n\nexport var root = [null];\n\nexport function Selection(groups, parents) {\n this._groups = groups;\n this._parents = parents;\n}\n\nfunction selection() {\n return new Selection([[document.documentElement]], root);\n}\n\nfunction selection_selection() {\n return this;\n}\n\nSelection.prototype = selection.prototype = {\n constructor: Selection,\n select: selection_select,\n selectAll: selection_selectAll,\n selectChild: selection_selectChild,\n selectChildren: selection_selectChildren,\n filter: selection_filter,\n data: selection_data,\n enter: selection_enter,\n exit: selection_exit,\n join: selection_join,\n merge: selection_merge,\n selection: selection_selection,\n order: selection_order,\n sort: selection_sort,\n call: selection_call,\n nodes: selection_nodes,\n node: selection_node,\n size: selection_size,\n empty: selection_empty,\n each: selection_each,\n attr: selection_attr,\n style: selection_style,\n property: selection_property,\n classed: selection_classed,\n text: selection_text,\n html: selection_html,\n raise: selection_raise,\n lower: selection_lower,\n append: selection_append,\n insert: selection_insert,\n remove: selection_remove,\n clone: selection_clone,\n datum: selection_datum,\n on: selection_on,\n dispatch: selection_dispatch,\n [Symbol.iterator]: selection_iterator\n};\n\nexport default selection;\n","import {Selection, root} from \"./selection/index.js\";\n\nexport default function(selector) {\n return typeof selector === \"string\"\n ? new Selection([[document.querySelector(selector)]], [document.documentElement])\n : new Selection([[selector]], root);\n}\n","export default function(event) {\n let sourceEvent;\n while (sourceEvent = event.sourceEvent) event = sourceEvent;\n return event;\n}\n","import sourceEvent from \"./sourceEvent.js\";\n\nexport default function(event, node) {\n event = sourceEvent(event);\n if (node === undefined) node = event.currentTarget;\n if (node) {\n var svg = node.ownerSVGElement || node;\n if (svg.createSVGPoint) {\n var point = svg.createSVGPoint();\n point.x = event.clientX, point.y = event.clientY;\n point = point.matrixTransform(node.getScreenCTM().inverse());\n return [point.x, point.y];\n }\n if (node.getBoundingClientRect) {\n var rect = node.getBoundingClientRect();\n return [event.clientX - rect.left - node.clientLeft, event.clientY - rect.top - node.clientTop];\n }\n }\n return [event.pageX, event.pageY];\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(constructor, factory, prototype) {\n constructor.prototype = factory.prototype = prototype;\n prototype.constructor = constructor;\n}\n\nexport function extend(parent, definition) {\n var prototype = Object.create(parent.prototype);\n for (var key in definition) prototype[key] = definition[key];\n return prototype;\n}\n","import define, {extend} from \"./define.js\";\n\nexport function Color() {}\n\nexport var darker = 0.7;\nexport var brighter = 1 / darker;\n\nvar reI = \"\\\\s*([+-]?\\\\d+)\\\\s*\",\n reN = \"\\\\s*([+-]?(?:\\\\d*\\\\.)?\\\\d+(?:[eE][+-]?\\\\d+)?)\\\\s*\",\n reP = \"\\\\s*([+-]?(?:\\\\d*\\\\.)?\\\\d+(?:[eE][+-]?\\\\d+)?)%\\\\s*\",\n reHex = /^#([0-9a-f]{3,8})$/,\n reRgbInteger = new RegExp(`^rgb\\\\(${reI},${reI},${reI}\\\\)$`),\n reRgbPercent = new RegExp(`^rgb\\\\(${reP},${reP},${reP}\\\\)$`),\n reRgbaInteger = new RegExp(`^rgba\\\\(${reI},${reI},${reI},${reN}\\\\)$`),\n reRgbaPercent = new RegExp(`^rgba\\\\(${reP},${reP},${reP},${reN}\\\\)$`),\n reHslPercent = new RegExp(`^hsl\\\\(${reN},${reP},${reP}\\\\)$`),\n reHslaPercent = new RegExp(`^hsla\\\\(${reN},${reP},${reP},${reN}\\\\)$`);\n\nvar named = {\n aliceblue: 0xf0f8ff,\n antiquewhite: 0xfaebd7,\n aqua: 0x00ffff,\n aquamarine: 0x7fffd4,\n azure: 0xf0ffff,\n beige: 0xf5f5dc,\n bisque: 0xffe4c4,\n black: 0x000000,\n blanchedalmond: 0xffebcd,\n blue: 0x0000ff,\n blueviolet: 0x8a2be2,\n brown: 0xa52a2a,\n burlywood: 0xdeb887,\n cadetblue: 0x5f9ea0,\n chartreuse: 0x7fff00,\n chocolate: 0xd2691e,\n coral: 0xff7f50,\n cornflowerblue: 0x6495ed,\n cornsilk: 0xfff8dc,\n crimson: 0xdc143c,\n cyan: 0x00ffff,\n darkblue: 0x00008b,\n darkcyan: 0x008b8b,\n darkgoldenrod: 0xb8860b,\n darkgray: 0xa9a9a9,\n darkgreen: 0x006400,\n darkgrey: 0xa9a9a9,\n darkkhaki: 0xbdb76b,\n darkmagenta: 0x8b008b,\n darkolivegreen: 0x556b2f,\n darkorange: 0xff8c00,\n darkorchid: 0x9932cc,\n darkred: 0x8b0000,\n darksalmon: 0xe9967a,\n darkseagreen: 0x8fbc8f,\n darkslateblue: 0x483d8b,\n darkslategray: 0x2f4f4f,\n darkslategrey: 0x2f4f4f,\n darkturquoise: 0x00ced1,\n darkviolet: 0x9400d3,\n deeppink: 0xff1493,\n deepskyblue: 0x00bfff,\n dimgray: 0x696969,\n dimgrey: 0x696969,\n dodgerblue: 0x1e90ff,\n firebrick: 0xb22222,\n floralwhite: 0xfffaf0,\n forestgreen: 0x228b22,\n fuchsia: 0xff00ff,\n gainsboro: 0xdcdcdc,\n ghostwhite: 0xf8f8ff,\n gold: 0xffd700,\n goldenrod: 0xdaa520,\n gray: 0x808080,\n green: 0x008000,\n greenyellow: 0xadff2f,\n grey: 0x808080,\n honeydew: 0xf0fff0,\n hotpink: 0xff69b4,\n indianred: 0xcd5c5c,\n indigo: 0x4b0082,\n ivory: 0xfffff0,\n khaki: 0xf0e68c,\n lavender: 0xe6e6fa,\n lavenderblush: 0xfff0f5,\n lawngreen: 0x7cfc00,\n lemonchiffon: 0xfffacd,\n lightblue: 0xadd8e6,\n lightcoral: 0xf08080,\n lightcyan: 0xe0ffff,\n lightgoldenrodyellow: 0xfafad2,\n lightgray: 0xd3d3d3,\n lightgreen: 0x90ee90,\n lightgrey: 0xd3d3d3,\n lightpink: 0xffb6c1,\n lightsalmon: 0xffa07a,\n lightseagreen: 0x20b2aa,\n lightskyblue: 0x87cefa,\n lightslategray: 0x778899,\n lightslategrey: 0x778899,\n lightsteelblue: 0xb0c4de,\n lightyellow: 0xffffe0,\n lime: 0x00ff00,\n limegreen: 0x32cd32,\n linen: 0xfaf0e6,\n magenta: 0xff00ff,\n maroon: 0x800000,\n mediumaquamarine: 0x66cdaa,\n mediumblue: 0x0000cd,\n mediumorchid: 0xba55d3,\n mediumpurple: 0x9370db,\n mediumseagreen: 0x3cb371,\n mediumslateblue: 0x7b68ee,\n mediumspringgreen: 0x00fa9a,\n mediumturquoise: 0x48d1cc,\n mediumvioletred: 0xc71585,\n midnightblue: 0x191970,\n mintcream: 0xf5fffa,\n mistyrose: 0xffe4e1,\n moccasin: 0xffe4b5,\n navajowhite: 0xffdead,\n navy: 0x000080,\n oldlace: 0xfdf5e6,\n olive: 0x808000,\n olivedrab: 0x6b8e23,\n orange: 0xffa500,\n orangered: 0xff4500,\n orchid: 0xda70d6,\n palegoldenrod: 0xeee8aa,\n palegreen: 0x98fb98,\n paleturquoise: 0xafeeee,\n palevioletred: 0xdb7093,\n papayawhip: 0xffefd5,\n peachpuff: 0xffdab9,\n peru: 0xcd853f,\n pink: 0xffc0cb,\n plum: 0xdda0dd,\n powderblue: 0xb0e0e6,\n purple: 0x800080,\n rebeccapurple: 0x663399,\n red: 0xff0000,\n rosybrown: 0xbc8f8f,\n royalblue: 0x4169e1,\n saddlebrown: 0x8b4513,\n salmon: 0xfa8072,\n sandybrown: 0xf4a460,\n seagreen: 0x2e8b57,\n seashell: 0xfff5ee,\n sienna: 0xa0522d,\n silver: 0xc0c0c0,\n skyblue: 0x87ceeb,\n slateblue: 0x6a5acd,\n slategray: 0x708090,\n slategrey: 0x708090,\n snow: 0xfffafa,\n springgreen: 0x00ff7f,\n steelblue: 0x4682b4,\n tan: 0xd2b48c,\n teal: 0x008080,\n thistle: 0xd8bfd8,\n tomato: 0xff6347,\n turquoise: 0x40e0d0,\n violet: 0xee82ee,\n wheat: 0xf5deb3,\n white: 0xffffff,\n whitesmoke: 0xf5f5f5,\n yellow: 0xffff00,\n yellowgreen: 0x9acd32\n};\n\ndefine(Color, color, {\n copy(channels) {\n return Object.assign(new this.constructor, this, channels);\n },\n displayable() {\n return this.rgb().displayable();\n },\n hex: color_formatHex, // Deprecated! Use color.formatHex.\n formatHex: color_formatHex,\n formatHex8: color_formatHex8,\n formatHsl: color_formatHsl,\n formatRgb: color_formatRgb,\n toString: color_formatRgb\n});\n\nfunction color_formatHex() {\n return this.rgb().formatHex();\n}\n\nfunction color_formatHex8() {\n return this.rgb().formatHex8();\n}\n\nfunction color_formatHsl() {\n return hslConvert(this).formatHsl();\n}\n\nfunction color_formatRgb() {\n return this.rgb().formatRgb();\n}\n\nexport default function color(format) {\n var m, l;\n format = (format + \"\").trim().toLowerCase();\n return (m = reHex.exec(format)) ? (l = m[1].length, m = parseInt(m[1], 16), l === 6 ? rgbn(m) // #ff0000\n : l === 3 ? new Rgb((m >> 8 & 0xf) | (m >> 4 & 0xf0), (m >> 4 & 0xf) | (m & 0xf0), ((m & 0xf) << 4) | (m & 0xf), 1) // #f00\n : l === 8 ? rgba(m >> 24 & 0xff, m >> 16 & 0xff, m >> 8 & 0xff, (m & 0xff) / 0xff) // #ff000000\n : l === 4 ? rgba((m >> 12 & 0xf) | (m >> 8 & 0xf0), (m >> 8 & 0xf) | (m >> 4 & 0xf0), (m >> 4 & 0xf) | (m & 0xf0), (((m & 0xf) << 4) | (m & 0xf)) / 0xff) // #f000\n : null) // invalid hex\n : (m = reRgbInteger.exec(format)) ? new Rgb(m[1], m[2], m[3], 1) // rgb(255, 0, 0)\n : (m = reRgbPercent.exec(format)) ? new Rgb(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, 1) // rgb(100%, 0%, 0%)\n : (m = reRgbaInteger.exec(format)) ? rgba(m[1], m[2], m[3], m[4]) // rgba(255, 0, 0, 1)\n : (m = reRgbaPercent.exec(format)) ? rgba(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, m[4]) // rgb(100%, 0%, 0%, 1)\n : (m = reHslPercent.exec(format)) ? hsla(m[1], m[2] / 100, m[3] / 100, 1) // hsl(120, 50%, 50%)\n : (m = reHslaPercent.exec(format)) ? hsla(m[1], m[2] / 100, m[3] / 100, m[4]) // hsla(120, 50%, 50%, 1)\n : named.hasOwnProperty(format) ? rgbn(named[format]) // eslint-disable-line no-prototype-builtins\n : format === \"transparent\" ? new Rgb(NaN, NaN, NaN, 0)\n : null;\n}\n\nfunction rgbn(n) {\n return new Rgb(n >> 16 & 0xff, n >> 8 & 0xff, n & 0xff, 1);\n}\n\nfunction rgba(r, g, b, a) {\n if (a <= 0) r = g = b = NaN;\n return new Rgb(r, g, b, a);\n}\n\nexport function rgbConvert(o) {\n if (!(o instanceof Color)) o = color(o);\n if (!o) return new Rgb;\n o = o.rgb();\n return new Rgb(o.r, o.g, o.b, o.opacity);\n}\n\nexport function rgb(r, g, b, opacity) {\n return arguments.length === 1 ? rgbConvert(r) : new Rgb(r, g, b, opacity == null ? 1 : opacity);\n}\n\nexport function Rgb(r, g, b, opacity) {\n this.r = +r;\n this.g = +g;\n this.b = +b;\n this.opacity = +opacity;\n}\n\ndefine(Rgb, rgb, extend(Color, {\n brighter(k) {\n k = k == null ? brighter : Math.pow(brighter, k);\n return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity);\n },\n darker(k) {\n k = k == null ? darker : Math.pow(darker, k);\n return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity);\n },\n rgb() {\n return this;\n },\n clamp() {\n return new Rgb(clampi(this.r), clampi(this.g), clampi(this.b), clampa(this.opacity));\n },\n displayable() {\n return (-0.5 <= this.r && this.r < 255.5)\n && (-0.5 <= this.g && this.g < 255.5)\n && (-0.5 <= this.b && this.b < 255.5)\n && (0 <= this.opacity && this.opacity <= 1);\n },\n hex: rgb_formatHex, // Deprecated! Use color.formatHex.\n formatHex: rgb_formatHex,\n formatHex8: rgb_formatHex8,\n formatRgb: rgb_formatRgb,\n toString: rgb_formatRgb\n}));\n\nfunction rgb_formatHex() {\n return `#${hex(this.r)}${hex(this.g)}${hex(this.b)}`;\n}\n\nfunction rgb_formatHex8() {\n return `#${hex(this.r)}${hex(this.g)}${hex(this.b)}${hex((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`;\n}\n\nfunction rgb_formatRgb() {\n const a = clampa(this.opacity);\n return `${a === 1 ? \"rgb(\" : \"rgba(\"}${clampi(this.r)}, ${clampi(this.g)}, ${clampi(this.b)}${a === 1 ? \")\" : `, ${a})`}`;\n}\n\nfunction clampa(opacity) {\n return isNaN(opacity) ? 1 : Math.max(0, Math.min(1, opacity));\n}\n\nfunction clampi(value) {\n return Math.max(0, Math.min(255, Math.round(value) || 0));\n}\n\nfunction hex(value) {\n value = clampi(value);\n return (value < 16 ? \"0\" : \"\") + value.toString(16);\n}\n\nfunction hsla(h, s, l, a) {\n if (a <= 0) h = s = l = NaN;\n else if (l <= 0 || l >= 1) h = s = NaN;\n else if (s <= 0) h = NaN;\n return new Hsl(h, s, l, a);\n}\n\nexport function hslConvert(o) {\n if (o instanceof Hsl) return new Hsl(o.h, o.s, o.l, o.opacity);\n if (!(o instanceof Color)) o = color(o);\n if (!o) return new Hsl;\n if (o instanceof Hsl) return o;\n o = o.rgb();\n var r = o.r / 255,\n g = o.g / 255,\n b = o.b / 255,\n min = Math.min(r, g, b),\n max = Math.max(r, g, b),\n h = NaN,\n s = max - min,\n l = (max + min) / 2;\n if (s) {\n if (r === max) h = (g - b) / s + (g < b) * 6;\n else if (g === max) h = (b - r) / s + 2;\n else h = (r - g) / s + 4;\n s /= l < 0.5 ? max + min : 2 - max - min;\n h *= 60;\n } else {\n s = l > 0 && l < 1 ? 0 : h;\n }\n return new Hsl(h, s, l, o.opacity);\n}\n\nexport function hsl(h, s, l, opacity) {\n return arguments.length === 1 ? hslConvert(h) : new Hsl(h, s, l, opacity == null ? 1 : opacity);\n}\n\nfunction Hsl(h, s, l, opacity) {\n this.h = +h;\n this.s = +s;\n this.l = +l;\n this.opacity = +opacity;\n}\n\ndefine(Hsl, hsl, extend(Color, {\n brighter(k) {\n k = k == null ? brighter : Math.pow(brighter, k);\n return new Hsl(this.h, this.s, this.l * k, this.opacity);\n },\n darker(k) {\n k = k == null ? darker : Math.pow(darker, k);\n return new Hsl(this.h, this.s, this.l * k, this.opacity);\n },\n rgb() {\n var h = this.h % 360 + (this.h < 0) * 360,\n s = isNaN(h) || isNaN(this.s) ? 0 : this.s,\n l = this.l,\n m2 = l + (l < 0.5 ? l : 1 - l) * s,\n m1 = 2 * l - m2;\n return new Rgb(\n hsl2rgb(h >= 240 ? h - 240 : h + 120, m1, m2),\n hsl2rgb(h, m1, m2),\n hsl2rgb(h < 120 ? h + 240 : h - 120, m1, m2),\n this.opacity\n );\n },\n clamp() {\n return new Hsl(clamph(this.h), clampt(this.s), clampt(this.l), clampa(this.opacity));\n },\n displayable() {\n return (0 <= this.s && this.s <= 1 || isNaN(this.s))\n && (0 <= this.l && this.l <= 1)\n && (0 <= this.opacity && this.opacity <= 1);\n },\n formatHsl() {\n const a = clampa(this.opacity);\n return `${a === 1 ? \"hsl(\" : \"hsla(\"}${clamph(this.h)}, ${clampt(this.s) * 100}%, ${clampt(this.l) * 100}%${a === 1 ? \")\" : `, ${a})`}`;\n }\n}));\n\nfunction clamph(value) {\n value = (value || 0) % 360;\n return value < 0 ? value + 360 : value;\n}\n\nfunction clampt(value) {\n return Math.max(0, Math.min(1, value || 0));\n}\n\n/* From FvD 13.37, CSS Color Module Level 3 */\nfunction hsl2rgb(h, m1, m2) {\n return (h < 60 ? m1 + (m2 - m1) * h / 60\n : h < 180 ? m2\n : h < 240 ? m1 + (m2 - m1) * (240 - h) / 60\n : m1) * 255;\n}\n","export default x => () => x;\n","import constant from \"./constant.js\";\n\nfunction linear(a, d) {\n return function(t) {\n return a + t * d;\n };\n}\n\nfunction exponential(a, b, y) {\n return a = Math.pow(a, y), b = Math.pow(b, y) - a, y = 1 / y, function(t) {\n return Math.pow(a + t * b, y);\n };\n}\n\nexport function hue(a, b) {\n var d = b - a;\n return d ? linear(a, d > 180 || d < -180 ? d - 360 * Math.round(d / 360) : d) : constant(isNaN(a) ? b : a);\n}\n\nexport function gamma(y) {\n return (y = +y) === 1 ? nogamma : function(a, b) {\n return b - a ? exponential(a, b, y) : constant(isNaN(a) ? b : a);\n };\n}\n\nexport default function nogamma(a, b) {\n var d = b - a;\n return d ? linear(a, d) : constant(isNaN(a) ? b : a);\n}\n","import {rgb as colorRgb} from \"d3-color\";\nimport basis from \"./basis.js\";\nimport basisClosed from \"./basisClosed.js\";\nimport nogamma, {gamma} from \"./color.js\";\n\nexport default (function rgbGamma(y) {\n var color = gamma(y);\n\n function rgb(start, end) {\n var r = color((start = colorRgb(start)).r, (end = colorRgb(end)).r),\n g = color(start.g, end.g),\n b = color(start.b, end.b),\n opacity = nogamma(start.opacity, end.opacity);\n return function(t) {\n start.r = r(t);\n start.g = g(t);\n start.b = b(t);\n start.opacity = opacity(t);\n return start + \"\";\n };\n }\n\n rgb.gamma = rgbGamma;\n\n return rgb;\n})(1);\n\nfunction rgbSpline(spline) {\n return function(colors) {\n var n = colors.length,\n r = new Array(n),\n g = new Array(n),\n b = new Array(n),\n i, color;\n for (i = 0; i < n; ++i) {\n color = colorRgb(colors[i]);\n r[i] = color.r || 0;\n g[i] = color.g || 0;\n b[i] = color.b || 0;\n }\n r = spline(r);\n g = spline(g);\n b = spline(b);\n color.opacity = 1;\n return function(t) {\n color.r = r(t);\n color.g = g(t);\n color.b = b(t);\n return color + \"\";\n };\n };\n}\n\nexport var rgbBasis = rgbSpline(basis);\nexport var rgbBasisClosed = rgbSpline(basisClosed);\n","export default function(a, b) {\n if (!b) b = [];\n var n = a ? Math.min(b.length, a.length) : 0,\n c = b.slice(),\n i;\n return function(t) {\n for (i = 0; i < n; ++i) c[i] = a[i] * (1 - t) + b[i] * t;\n return c;\n };\n}\n\nexport function isNumberArray(x) {\n return ArrayBuffer.isView(x) && !(x instanceof DataView);\n}\n","import value from \"./value.js\";\nimport numberArray, {isNumberArray} from \"./numberArray.js\";\n\nexport default function(a, b) {\n return (isNumberArray(b) ? numberArray : genericArray)(a, b);\n}\n\nexport function genericArray(a, b) {\n var nb = b ? b.length : 0,\n na = a ? Math.min(nb, a.length) : 0,\n x = new Array(na),\n c = new Array(nb),\n i;\n\n for (i = 0; i < na; ++i) x[i] = value(a[i], b[i]);\n for (; i < nb; ++i) c[i] = b[i];\n\n return function(t) {\n for (i = 0; i < na; ++i) c[i] = x[i](t);\n return c;\n };\n}\n","export default function(a, b) {\n var d = new Date;\n return a = +a, b = +b, function(t) {\n return d.setTime(a * (1 - t) + b * t), d;\n };\n}\n","export default function(a, b) {\n return a = +a, b = +b, function(t) {\n return a * (1 - t) + b * t;\n };\n}\n","import value from \"./value.js\";\n\nexport default function(a, b) {\n var i = {},\n c = {},\n k;\n\n if (a === null || typeof a !== \"object\") a = {};\n if (b === null || typeof b !== \"object\") b = {};\n\n for (k in b) {\n if (k in a) {\n i[k] = value(a[k], b[k]);\n } else {\n c[k] = b[k];\n }\n }\n\n return function(t) {\n for (k in i) c[k] = i[k](t);\n return c;\n };\n}\n","import number from \"./number.js\";\n\nvar reA = /[-+]?(?:\\d+\\.?\\d*|\\.?\\d+)(?:[eE][-+]?\\d+)?/g,\n reB = new RegExp(reA.source, \"g\");\n\nfunction zero(b) {\n return function() {\n return b;\n };\n}\n\nfunction one(b) {\n return function(t) {\n return b(t) + \"\";\n };\n}\n\nexport default function(a, b) {\n var bi = reA.lastIndex = reB.lastIndex = 0, // scan index for next number in b\n am, // current match in a\n bm, // current match in b\n bs, // string preceding current number in b, if any\n i = -1, // index in s\n s = [], // string constants and placeholders\n q = []; // number interpolators\n\n // Coerce inputs to strings.\n a = a + \"\", b = b + \"\";\n\n // Interpolate pairs of numbers in a & b.\n while ((am = reA.exec(a))\n && (bm = reB.exec(b))) {\n if ((bs = bm.index) > bi) { // a string precedes the next number in b\n bs = b.slice(bi, bs);\n if (s[i]) s[i] += bs; // coalesce with previous string\n else s[++i] = bs;\n }\n if ((am = am[0]) === (bm = bm[0])) { // numbers in a & b match\n if (s[i]) s[i] += bm; // coalesce with previous string\n else s[++i] = bm;\n } else { // interpolate non-matching numbers\n s[++i] = null;\n q.push({i: i, x: number(am, bm)});\n }\n bi = reB.lastIndex;\n }\n\n // Add remains of b.\n if (bi < b.length) {\n bs = b.slice(bi);\n if (s[i]) s[i] += bs; // coalesce with previous string\n else s[++i] = bs;\n }\n\n // Special optimization for only a single match.\n // Otherwise, interpolate each of the numbers and rejoin the string.\n return s.length < 2 ? (q[0]\n ? one(q[0].x)\n : zero(b))\n : (b = q.length, function(t) {\n for (var i = 0, o; i < b; ++i) s[(o = q[i]).i] = o.x(t);\n return s.join(\"\");\n });\n}\n","import {color} from \"d3-color\";\nimport rgb from \"./rgb.js\";\nimport {genericArray} from \"./array.js\";\nimport date from \"./date.js\";\nimport number from \"./number.js\";\nimport object from \"./object.js\";\nimport string from \"./string.js\";\nimport constant from \"./constant.js\";\nimport numberArray, {isNumberArray} from \"./numberArray.js\";\n\nexport default function(a, b) {\n var t = typeof b, c;\n return b == null || t === \"boolean\" ? constant(b)\n : (t === \"number\" ? number\n : t === \"string\" ? ((c = color(b)) ? (b = c, rgb) : string)\n : b instanceof color ? rgb\n : b instanceof Date ? date\n : isNumberArray(b) ? numberArray\n : Array.isArray(b) ? genericArray\n : typeof b.valueOf !== \"function\" && typeof b.toString !== \"function\" || isNaN(b) ? object\n : number)(a, b);\n}\n","export default function(a, b) {\n return a = +a, b = +b, function(t) {\n return Math.round(a * (1 - t) + b * t);\n };\n}\n","var degrees = 180 / Math.PI;\n\nexport var identity = {\n translateX: 0,\n translateY: 0,\n rotate: 0,\n skewX: 0,\n scaleX: 1,\n scaleY: 1\n};\n\nexport default function(a, b, c, d, e, f) {\n var scaleX, scaleY, skewX;\n if (scaleX = Math.sqrt(a * a + b * b)) a /= scaleX, b /= scaleX;\n if (skewX = a * c + b * d) c -= a * skewX, d -= b * skewX;\n if (scaleY = Math.sqrt(c * c + d * d)) c /= scaleY, d /= scaleY, skewX /= scaleY;\n if (a * d < b * c) a = -a, b = -b, skewX = -skewX, scaleX = -scaleX;\n return {\n translateX: e,\n translateY: f,\n rotate: Math.atan2(b, a) * degrees,\n skewX: Math.atan(skewX) * degrees,\n scaleX: scaleX,\n scaleY: scaleY\n };\n}\n","import decompose, {identity} from \"./decompose.js\";\n\nvar svgNode;\n\n/* eslint-disable no-undef */\nexport function parseCss(value) {\n const m = new (typeof DOMMatrix === \"function\" ? DOMMatrix : WebKitCSSMatrix)(value + \"\");\n return m.isIdentity ? identity : decompose(m.a, m.b, m.c, m.d, m.e, m.f);\n}\n\nexport function parseSvg(value) {\n if (value == null) return identity;\n if (!svgNode) svgNode = document.createElementNS(\"http://www.w3.org/2000/svg\", \"g\");\n svgNode.setAttribute(\"transform\", value);\n if (!(value = svgNode.transform.baseVal.consolidate())) return identity;\n value = value.matrix;\n return decompose(value.a, value.b, value.c, value.d, value.e, value.f);\n}\n","import number from \"../number.js\";\nimport {parseCss, parseSvg} from \"./parse.js\";\n\nfunction interpolateTransform(parse, pxComma, pxParen, degParen) {\n\n function pop(s) {\n return s.length ? s.pop() + \" \" : \"\";\n }\n\n function translate(xa, ya, xb, yb, s, q) {\n if (xa !== xb || ya !== yb) {\n var i = s.push(\"translate(\", null, pxComma, null, pxParen);\n q.push({i: i - 4, x: number(xa, xb)}, {i: i - 2, x: number(ya, yb)});\n } else if (xb || yb) {\n s.push(\"translate(\" + xb + pxComma + yb + pxParen);\n }\n }\n\n function rotate(a, b, s, q) {\n if (a !== b) {\n if (a - b > 180) b += 360; else if (b - a > 180) a += 360; // shortest path\n q.push({i: s.push(pop(s) + \"rotate(\", null, degParen) - 2, x: number(a, b)});\n } else if (b) {\n s.push(pop(s) + \"rotate(\" + b + degParen);\n }\n }\n\n function skewX(a, b, s, q) {\n if (a !== b) {\n q.push({i: s.push(pop(s) + \"skewX(\", null, degParen) - 2, x: number(a, b)});\n } else if (b) {\n s.push(pop(s) + \"skewX(\" + b + degParen);\n }\n }\n\n function scale(xa, ya, xb, yb, s, q) {\n if (xa !== xb || ya !== yb) {\n var i = s.push(pop(s) + \"scale(\", null, \",\", null, \")\");\n q.push({i: i - 4, x: number(xa, xb)}, {i: i - 2, x: number(ya, yb)});\n } else if (xb !== 1 || yb !== 1) {\n s.push(pop(s) + \"scale(\" + xb + \",\" + yb + \")\");\n }\n }\n\n return function(a, b) {\n var s = [], // string constants and placeholders\n q = []; // number interpolators\n a = parse(a), b = parse(b);\n translate(a.translateX, a.translateY, b.translateX, b.translateY, s, q);\n rotate(a.rotate, b.rotate, s, q);\n skewX(a.skewX, b.skewX, s, q);\n scale(a.scaleX, a.scaleY, b.scaleX, b.scaleY, s, q);\n a = b = null; // gc\n return function(t) {\n var i = -1, n = q.length, o;\n while (++i < n) s[(o = q[i]).i] = o.x(t);\n return s.join(\"\");\n };\n };\n}\n\nexport var interpolateTransformCss = interpolateTransform(parseCss, \"px, \", \"px)\", \"deg)\");\nexport var interpolateTransformSvg = interpolateTransform(parseSvg, \", \", \")\", \")\");\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","var frame = 0, // is an animation frame pending?\n timeout = 0, // is a timeout pending?\n interval = 0, // are any timers active?\n pokeDelay = 1000, // how frequently we check for clock skew\n taskHead,\n taskTail,\n clockLast = 0,\n clockNow = 0,\n clockSkew = 0,\n clock = typeof performance === \"object\" && performance.now ? performance : Date,\n setFrame = typeof window === \"object\" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(f) { setTimeout(f, 17); };\n\nexport function now() {\n return clockNow || (setFrame(clearNow), clockNow = clock.now() + clockSkew);\n}\n\nfunction clearNow() {\n clockNow = 0;\n}\n\nexport function Timer() {\n this._call =\n this._time =\n this._next = null;\n}\n\nTimer.prototype = timer.prototype = {\n constructor: Timer,\n restart: function(callback, delay, time) {\n if (typeof callback !== \"function\") throw new TypeError(\"callback is not a function\");\n time = (time == null ? now() : +time) + (delay == null ? 0 : +delay);\n if (!this._next && taskTail !== this) {\n if (taskTail) taskTail._next = this;\n else taskHead = this;\n taskTail = this;\n }\n this._call = callback;\n this._time = time;\n sleep();\n },\n stop: function() {\n if (this._call) {\n this._call = null;\n this._time = Infinity;\n sleep();\n }\n }\n};\n\nexport function timer(callback, delay, time) {\n var t = new Timer;\n t.restart(callback, delay, time);\n return t;\n}\n\nexport function timerFlush() {\n now(); // Get the current time, if not already set.\n ++frame; // Pretend we’ve set an alarm, if we haven’t already.\n var t = taskHead, e;\n while (t) {\n if ((e = clockNow - t._time) >= 0) t._call.call(undefined, e);\n t = t._next;\n }\n --frame;\n}\n\nfunction wake() {\n clockNow = (clockLast = clock.now()) + clockSkew;\n frame = timeout = 0;\n try {\n timerFlush();\n } finally {\n frame = 0;\n nap();\n clockNow = 0;\n }\n}\n\nfunction poke() {\n var now = clock.now(), delay = now - clockLast;\n if (delay > pokeDelay) clockSkew -= delay, clockLast = now;\n}\n\nfunction nap() {\n var t0, t1 = taskHead, t2, time = Infinity;\n while (t1) {\n if (t1._call) {\n if (time > t1._time) time = t1._time;\n t0 = t1, t1 = t1._next;\n } else {\n t2 = t1._next, t1._next = null;\n t1 = t0 ? t0._next = t2 : taskHead = t2;\n }\n }\n taskTail = t0;\n sleep(time);\n}\n\nfunction sleep(time) {\n if (frame) return; // Soonest alarm already set, or will be.\n if (timeout) timeout = clearTimeout(timeout);\n var delay = time - clockNow; // Strictly less than if we recomputed clockNow.\n if (delay > 24) {\n if (time < Infinity) timeout = setTimeout(wake, time - clock.now() - clockSkew);\n if (interval) interval = clearInterval(interval);\n } else {\n if (!interval) clockLast = clock.now(), interval = setInterval(poke, pokeDelay);\n frame = 1, setFrame(wake);\n }\n}\n","import {Timer} from \"./timer.js\";\n\nexport default function(callback, delay, time) {\n var t = new Timer;\n delay = delay == null ? 0 : +delay;\n t.restart(elapsed => {\n t.stop();\n callback(elapsed + delay);\n }, delay, time);\n return t;\n}\n","import {dispatch} from \"d3-dispatch\";\nimport {timer, timeout} from \"d3-timer\";\n\nvar emptyOn = dispatch(\"start\", \"end\", \"cancel\", \"interrupt\");\nvar emptyTween = [];\n\nexport var CREATED = 0;\nexport var SCHEDULED = 1;\nexport var STARTING = 2;\nexport var STARTED = 3;\nexport var RUNNING = 4;\nexport var ENDING = 5;\nexport var ENDED = 6;\n\nexport default function(node, name, id, index, group, timing) {\n var schedules = node.__transition;\n if (!schedules) node.__transition = {};\n else if (id in schedules) return;\n create(node, id, {\n name: name,\n index: index, // For context during callback.\n group: group, // For context during callback.\n on: emptyOn,\n tween: emptyTween,\n time: timing.time,\n delay: timing.delay,\n duration: timing.duration,\n ease: timing.ease,\n timer: null,\n state: CREATED\n });\n}\n\nexport function init(node, id) {\n var schedule = get(node, id);\n if (schedule.state > CREATED) throw new Error(\"too late; already scheduled\");\n return schedule;\n}\n\nexport function set(node, id) {\n var schedule = get(node, id);\n if (schedule.state > STARTED) throw new Error(\"too late; already running\");\n return schedule;\n}\n\nexport function get(node, id) {\n var schedule = node.__transition;\n if (!schedule || !(schedule = schedule[id])) throw new Error(\"transition not found\");\n return schedule;\n}\n\nfunction create(node, id, self) {\n var schedules = node.__transition,\n tween;\n\n // Initialize the self timer when the transition is created.\n // Note the actual delay is not known until the first callback!\n schedules[id] = self;\n self.timer = timer(schedule, 0, self.time);\n\n function schedule(elapsed) {\n self.state = SCHEDULED;\n self.timer.restart(start, self.delay, self.time);\n\n // If the elapsed delay is less than our first sleep, start immediately.\n if (self.delay <= elapsed) start(elapsed - self.delay);\n }\n\n function start(elapsed) {\n var i, j, n, o;\n\n // If the state is not SCHEDULED, then we previously errored on start.\n if (self.state !== SCHEDULED) return stop();\n\n for (i in schedules) {\n o = schedules[i];\n if (o.name !== self.name) continue;\n\n // While this element already has a starting transition during this frame,\n // defer starting an interrupting transition until that transition has a\n // chance to tick (and possibly end); see d3/d3-transition#54!\n if (o.state === STARTED) return timeout(start);\n\n // Interrupt the active transition, if any.\n if (o.state === RUNNING) {\n o.state = ENDED;\n o.timer.stop();\n o.on.call(\"interrupt\", node, node.__data__, o.index, o.group);\n delete schedules[i];\n }\n\n // Cancel any pre-empted transitions.\n else if (+i < id) {\n o.state = ENDED;\n o.timer.stop();\n o.on.call(\"cancel\", node, node.__data__, o.index, o.group);\n delete schedules[i];\n }\n }\n\n // Defer the first tick to end of the current frame; see d3/d3#1576.\n // Note the transition may be canceled after start and before the first tick!\n // Note this must be scheduled before the start event; see d3/d3-transition#16!\n // Assuming this is successful, subsequent callbacks go straight to tick.\n timeout(function() {\n if (self.state === STARTED) {\n self.state = RUNNING;\n self.timer.restart(tick, self.delay, self.time);\n tick(elapsed);\n }\n });\n\n // Dispatch the start event.\n // Note this must be done before the tween are initialized.\n self.state = STARTING;\n self.on.call(\"start\", node, node.__data__, self.index, self.group);\n if (self.state !== STARTING) return; // interrupted\n self.state = STARTED;\n\n // Initialize the tween, deleting null tween.\n tween = new Array(n = self.tween.length);\n for (i = 0, j = -1; i < n; ++i) {\n if (o = self.tween[i].value.call(node, node.__data__, self.index, self.group)) {\n tween[++j] = o;\n }\n }\n tween.length = j + 1;\n }\n\n function tick(elapsed) {\n var t = elapsed < self.duration ? self.ease.call(null, elapsed / self.duration) : (self.timer.restart(stop), self.state = ENDING, 1),\n i = -1,\n n = tween.length;\n\n while (++i < n) {\n tween[i].call(node, t);\n }\n\n // Dispatch the end event.\n if (self.state === ENDING) {\n self.on.call(\"end\", node, node.__data__, self.index, self.group);\n stop();\n }\n }\n\n function stop() {\n self.state = ENDED;\n self.timer.stop();\n delete schedules[id];\n for (var i in schedules) return; // eslint-disable-line no-unused-vars\n delete node.__transition;\n }\n}\n","import {STARTING, ENDING, ENDED} from \"./transition/schedule.js\";\n\nexport default function(node, name) {\n var schedules = node.__transition,\n schedule,\n active,\n empty = true,\n i;\n\n if (!schedules) return;\n\n name = name == null ? null : name + \"\";\n\n for (i in schedules) {\n if ((schedule = schedules[i]).name !== name) { empty = false; continue; }\n active = schedule.state > STARTING && schedule.state < ENDING;\n schedule.state = ENDED;\n schedule.timer.stop();\n schedule.on.call(active ? \"interrupt\" : \"cancel\", node, node.__data__, schedule.index, schedule.group);\n delete schedules[i];\n }\n\n if (empty) delete node.__transition;\n}\n","import interrupt from \"../interrupt.js\";\n\nexport default function(name) {\n return this.each(function() {\n interrupt(this, name);\n });\n}\n","import {get, set} from \"./schedule.js\";\n\nfunction tweenRemove(id, name) {\n var tween0, tween1;\n return function() {\n var schedule = set(this, id),\n tween = schedule.tween;\n\n // If this node shared tween with the previous node,\n // just assign the updated shared tween and we’re done!\n // Otherwise, copy-on-write.\n if (tween !== tween0) {\n tween1 = tween0 = tween;\n for (var i = 0, n = tween1.length; i < n; ++i) {\n if (tween1[i].name === name) {\n tween1 = tween1.slice();\n tween1.splice(i, 1);\n break;\n }\n }\n }\n\n schedule.tween = tween1;\n };\n}\n\nfunction tweenFunction(id, name, value) {\n var tween0, tween1;\n if (typeof value !== \"function\") throw new Error;\n return function() {\n var schedule = set(this, id),\n tween = schedule.tween;\n\n // If this node shared tween with the previous node,\n // just assign the updated shared tween and we’re done!\n // Otherwise, copy-on-write.\n if (tween !== tween0) {\n tween1 = (tween0 = tween).slice();\n for (var t = {name: name, value: value}, i = 0, n = tween1.length; i < n; ++i) {\n if (tween1[i].name === name) {\n tween1[i] = t;\n break;\n }\n }\n if (i === n) tween1.push(t);\n }\n\n schedule.tween = tween1;\n };\n}\n\nexport default function(name, value) {\n var id = this._id;\n\n name += \"\";\n\n if (arguments.length < 2) {\n var tween = get(this.node(), id).tween;\n for (var i = 0, n = tween.length, t; i < n; ++i) {\n if ((t = tween[i]).name === name) {\n return t.value;\n }\n }\n return null;\n }\n\n return this.each((value == null ? tweenRemove : tweenFunction)(id, name, value));\n}\n\nexport function tweenValue(transition, name, value) {\n var id = transition._id;\n\n transition.each(function() {\n var schedule = set(this, id);\n (schedule.value || (schedule.value = {}))[name] = value.apply(this, arguments);\n });\n\n return function(node) {\n return get(node, id).value[name];\n };\n}\n","import {color} from \"d3-color\";\nimport {interpolateNumber, interpolateRgb, interpolateString} from \"d3-interpolate\";\n\nexport default function(a, b) {\n var c;\n return (typeof b === \"number\" ? interpolateNumber\n : b instanceof color ? interpolateRgb\n : (c = color(b)) ? (b = c, interpolateRgb)\n : interpolateString)(a, b);\n}\n","import {interpolateTransformSvg as interpolateTransform} from \"d3-interpolate\";\nimport {namespace} from \"d3-selection\";\nimport {tweenValue} from \"./tween.js\";\nimport interpolate from \"./interpolate.js\";\n\nfunction attrRemove(name) {\n return function() {\n this.removeAttribute(name);\n };\n}\n\nfunction attrRemoveNS(fullname) {\n return function() {\n this.removeAttributeNS(fullname.space, fullname.local);\n };\n}\n\nfunction attrConstant(name, interpolate, value1) {\n var string00,\n string1 = value1 + \"\",\n interpolate0;\n return function() {\n var string0 = this.getAttribute(name);\n return string0 === string1 ? null\n : string0 === string00 ? interpolate0\n : interpolate0 = interpolate(string00 = string0, value1);\n };\n}\n\nfunction attrConstantNS(fullname, interpolate, value1) {\n var string00,\n string1 = value1 + \"\",\n interpolate0;\n return function() {\n var string0 = this.getAttributeNS(fullname.space, fullname.local);\n return string0 === string1 ? null\n : string0 === string00 ? interpolate0\n : interpolate0 = interpolate(string00 = string0, value1);\n };\n}\n\nfunction attrFunction(name, interpolate, value) {\n var string00,\n string10,\n interpolate0;\n return function() {\n var string0, value1 = value(this), string1;\n if (value1 == null) return void this.removeAttribute(name);\n string0 = this.getAttribute(name);\n string1 = value1 + \"\";\n return string0 === string1 ? null\n : string0 === string00 && string1 === string10 ? interpolate0\n : (string10 = string1, interpolate0 = interpolate(string00 = string0, value1));\n };\n}\n\nfunction attrFunctionNS(fullname, interpolate, value) {\n var string00,\n string10,\n interpolate0;\n return function() {\n var string0, value1 = value(this), string1;\n if (value1 == null) return void this.removeAttributeNS(fullname.space, fullname.local);\n string0 = this.getAttributeNS(fullname.space, fullname.local);\n string1 = value1 + \"\";\n return string0 === string1 ? null\n : string0 === string00 && string1 === string10 ? interpolate0\n : (string10 = string1, interpolate0 = interpolate(string00 = string0, value1));\n };\n}\n\nexport default function(name, value) {\n var fullname = namespace(name), i = fullname === \"transform\" ? interpolateTransform : interpolate;\n return this.attrTween(name, typeof value === \"function\"\n ? (fullname.local ? attrFunctionNS : attrFunction)(fullname, i, tweenValue(this, \"attr.\" + name, value))\n : value == null ? (fullname.local ? attrRemoveNS : attrRemove)(fullname)\n : (fullname.local ? attrConstantNS : attrConstant)(fullname, i, value));\n}\n","import {namespace} from \"d3-selection\";\n\nfunction attrInterpolate(name, i) {\n return function(t) {\n this.setAttribute(name, i.call(this, t));\n };\n}\n\nfunction attrInterpolateNS(fullname, i) {\n return function(t) {\n this.setAttributeNS(fullname.space, fullname.local, i.call(this, t));\n };\n}\n\nfunction attrTweenNS(fullname, value) {\n var t0, i0;\n function tween() {\n var i = value.apply(this, arguments);\n if (i !== i0) t0 = (i0 = i) && attrInterpolateNS(fullname, i);\n return t0;\n }\n tween._value = value;\n return tween;\n}\n\nfunction attrTween(name, value) {\n var t0, i0;\n function tween() {\n var i = value.apply(this, arguments);\n if (i !== i0) t0 = (i0 = i) && attrInterpolate(name, i);\n return t0;\n }\n tween._value = value;\n return tween;\n}\n\nexport default function(name, value) {\n var key = \"attr.\" + name;\n if (arguments.length < 2) return (key = this.tween(key)) && key._value;\n if (value == null) return this.tween(key, null);\n if (typeof value !== \"function\") throw new Error;\n var fullname = namespace(name);\n return this.tween(key, (fullname.local ? attrTweenNS : attrTween)(fullname, value));\n}\n","import {get, init} from \"./schedule.js\";\n\nfunction delayFunction(id, value) {\n return function() {\n init(this, id).delay = +value.apply(this, arguments);\n };\n}\n\nfunction delayConstant(id, value) {\n return value = +value, function() {\n init(this, id).delay = value;\n };\n}\n\nexport default function(value) {\n var id = this._id;\n\n return arguments.length\n ? this.each((typeof value === \"function\"\n ? delayFunction\n : delayConstant)(id, value))\n : get(this.node(), id).delay;\n}\n","import {get, set} from \"./schedule.js\";\n\nfunction durationFunction(id, value) {\n return function() {\n set(this, id).duration = +value.apply(this, arguments);\n };\n}\n\nfunction durationConstant(id, value) {\n return value = +value, function() {\n set(this, id).duration = value;\n };\n}\n\nexport default function(value) {\n var id = this._id;\n\n return arguments.length\n ? this.each((typeof value === \"function\"\n ? durationFunction\n : durationConstant)(id, value))\n : get(this.node(), id).duration;\n}\n","import {get, set} from \"./schedule.js\";\n\nfunction easeConstant(id, value) {\n if (typeof value !== \"function\") throw new Error;\n return function() {\n set(this, id).ease = value;\n };\n}\n\nexport default function(value) {\n var id = this._id;\n\n return arguments.length\n ? this.each(easeConstant(id, value))\n : get(this.node(), id).ease;\n}\n","import {set} from \"./schedule.js\";\n\nfunction easeVarying(id, value) {\n return function() {\n var v = value.apply(this, arguments);\n if (typeof v !== \"function\") throw new Error;\n set(this, id).ease = v;\n };\n}\n\nexport default function(value) {\n if (typeof value !== \"function\") throw new Error;\n return this.each(easeVarying(this._id, value));\n}\n","import {matcher} from \"d3-selection\";\nimport {Transition} from \"./index.js\";\n\nexport default function(match) {\n if (typeof match !== \"function\") match = matcher(match);\n\n for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) {\n for (var group = groups[j], n = group.length, subgroup = subgroups[j] = [], node, i = 0; i < n; ++i) {\n if ((node = group[i]) && match.call(node, node.__data__, i, group)) {\n subgroup.push(node);\n }\n }\n }\n\n return new Transition(subgroups, this._parents, this._name, this._id);\n}\n","import {Transition} from \"./index.js\";\n\nexport default function(transition) {\n if (transition._id !== this._id) throw new Error;\n\n for (var groups0 = this._groups, groups1 = transition._groups, m0 = groups0.length, m1 = groups1.length, m = Math.min(m0, m1), merges = new Array(m0), j = 0; j < m; ++j) {\n for (var group0 = groups0[j], group1 = groups1[j], n = group0.length, merge = merges[j] = new Array(n), node, i = 0; i < n; ++i) {\n if (node = group0[i] || group1[i]) {\n merge[i] = node;\n }\n }\n }\n\n for (; j < m0; ++j) {\n merges[j] = groups0[j];\n }\n\n return new Transition(merges, this._parents, this._name, this._id);\n}\n","import {get, set, init} from \"./schedule.js\";\n\nfunction start(name) {\n return (name + \"\").trim().split(/^|\\s+/).every(function(t) {\n var i = t.indexOf(\".\");\n if (i >= 0) t = t.slice(0, i);\n return !t || t === \"start\";\n });\n}\n\nfunction onFunction(id, name, listener) {\n var on0, on1, sit = start(name) ? init : set;\n return function() {\n var schedule = sit(this, id),\n on = schedule.on;\n\n // If this node shared a dispatch with the previous node,\n // just assign the updated shared dispatch and we’re done!\n // Otherwise, copy-on-write.\n if (on !== on0) (on1 = (on0 = on).copy()).on(name, listener);\n\n schedule.on = on1;\n };\n}\n\nexport default function(name, listener) {\n var id = this._id;\n\n return arguments.length < 2\n ? get(this.node(), id).on.on(name)\n : this.each(onFunction(id, name, listener));\n}\n","function removeFunction(id) {\n return function() {\n var parent = this.parentNode;\n for (var i in this.__transition) if (+i !== id) return;\n if (parent) parent.removeChild(this);\n };\n}\n\nexport default function() {\n return this.on(\"end.remove\", removeFunction(this._id));\n}\n","import {selector} from \"d3-selection\";\nimport {Transition} from \"./index.js\";\nimport schedule, {get} from \"./schedule.js\";\n\nexport default function(select) {\n var name = this._name,\n id = this._id;\n\n if (typeof select !== \"function\") select = selector(select);\n\n for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) {\n for (var group = groups[j], n = group.length, subgroup = subgroups[j] = new Array(n), node, subnode, i = 0; i < n; ++i) {\n if ((node = group[i]) && (subnode = select.call(node, node.__data__, i, group))) {\n if (\"__data__\" in node) subnode.__data__ = node.__data__;\n subgroup[i] = subnode;\n schedule(subgroup[i], name, id, i, subgroup, get(node, id));\n }\n }\n }\n\n return new Transition(subgroups, this._parents, name, id);\n}\n","import {selectorAll} from \"d3-selection\";\nimport {Transition} from \"./index.js\";\nimport schedule, {get} from \"./schedule.js\";\n\nexport default function(select) {\n var name = this._name,\n id = this._id;\n\n if (typeof select !== \"function\") select = selectorAll(select);\n\n for (var groups = this._groups, m = groups.length, subgroups = [], parents = [], j = 0; j < m; ++j) {\n for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) {\n if (node = group[i]) {\n for (var children = select.call(node, node.__data__, i, group), child, inherit = get(node, id), k = 0, l = children.length; k < l; ++k) {\n if (child = children[k]) {\n schedule(child, name, id, k, children, inherit);\n }\n }\n subgroups.push(children);\n parents.push(node);\n }\n }\n }\n\n return new Transition(subgroups, parents, name, id);\n}\n","import {selection} from \"d3-selection\";\n\nvar Selection = selection.prototype.constructor;\n\nexport default function() {\n return new Selection(this._groups, this._parents);\n}\n","import {interpolateTransformCss as interpolateTransform} from \"d3-interpolate\";\nimport {style} from \"d3-selection\";\nimport {set} from \"./schedule.js\";\nimport {tweenValue} from \"./tween.js\";\nimport interpolate from \"./interpolate.js\";\n\nfunction styleNull(name, interpolate) {\n var string00,\n string10,\n interpolate0;\n return function() {\n var string0 = style(this, name),\n string1 = (this.style.removeProperty(name), style(this, name));\n return string0 === string1 ? null\n : string0 === string00 && string1 === string10 ? interpolate0\n : interpolate0 = interpolate(string00 = string0, string10 = string1);\n };\n}\n\nfunction styleRemove(name) {\n return function() {\n this.style.removeProperty(name);\n };\n}\n\nfunction styleConstant(name, interpolate, value1) {\n var string00,\n string1 = value1 + \"\",\n interpolate0;\n return function() {\n var string0 = style(this, name);\n return string0 === string1 ? null\n : string0 === string00 ? interpolate0\n : interpolate0 = interpolate(string00 = string0, value1);\n };\n}\n\nfunction styleFunction(name, interpolate, value) {\n var string00,\n string10,\n interpolate0;\n return function() {\n var string0 = style(this, name),\n value1 = value(this),\n string1 = value1 + \"\";\n if (value1 == null) string1 = value1 = (this.style.removeProperty(name), style(this, name));\n return string0 === string1 ? null\n : string0 === string00 && string1 === string10 ? interpolate0\n : (string10 = string1, interpolate0 = interpolate(string00 = string0, value1));\n };\n}\n\nfunction styleMaybeRemove(id, name) {\n var on0, on1, listener0, key = \"style.\" + name, event = \"end.\" + key, remove;\n return function() {\n var schedule = set(this, id),\n on = schedule.on,\n listener = schedule.value[key] == null ? remove || (remove = styleRemove(name)) : undefined;\n\n // If this node shared a dispatch with the previous node,\n // just assign the updated shared dispatch and we’re done!\n // Otherwise, copy-on-write.\n if (on !== on0 || listener0 !== listener) (on1 = (on0 = on).copy()).on(event, listener0 = listener);\n\n schedule.on = on1;\n };\n}\n\nexport default function(name, value, priority) {\n var i = (name += \"\") === \"transform\" ? interpolateTransform : interpolate;\n return value == null ? this\n .styleTween(name, styleNull(name, i))\n .on(\"end.style.\" + name, styleRemove(name))\n : typeof value === \"function\" ? this\n .styleTween(name, styleFunction(name, i, tweenValue(this, \"style.\" + name, value)))\n .each(styleMaybeRemove(this._id, name))\n : this\n .styleTween(name, styleConstant(name, i, value), priority)\n .on(\"end.style.\" + name, null);\n}\n","function styleInterpolate(name, i, priority) {\n return function(t) {\n this.style.setProperty(name, i.call(this, t), priority);\n };\n}\n\nfunction styleTween(name, value, priority) {\n var t, i0;\n function tween() {\n var i = value.apply(this, arguments);\n if (i !== i0) t = (i0 = i) && styleInterpolate(name, i, priority);\n return t;\n }\n tween._value = value;\n return tween;\n}\n\nexport default function(name, value, priority) {\n var key = \"style.\" + (name += \"\");\n if (arguments.length < 2) return (key = this.tween(key)) && key._value;\n if (value == null) return this.tween(key, null);\n if (typeof value !== \"function\") throw new Error;\n return this.tween(key, styleTween(name, value, priority == null ? \"\" : priority));\n}\n","import {tweenValue} from \"./tween.js\";\n\nfunction textConstant(value) {\n return function() {\n this.textContent = value;\n };\n}\n\nfunction textFunction(value) {\n return function() {\n var value1 = value(this);\n this.textContent = value1 == null ? \"\" : value1;\n };\n}\n\nexport default function(value) {\n return this.tween(\"text\", typeof value === \"function\"\n ? textFunction(tweenValue(this, \"text\", value))\n : textConstant(value == null ? \"\" : value + \"\"));\n}\n","function textInterpolate(i) {\n return function(t) {\n this.textContent = i.call(this, t);\n };\n}\n\nfunction textTween(value) {\n var t0, i0;\n function tween() {\n var i = value.apply(this, arguments);\n if (i !== i0) t0 = (i0 = i) && textInterpolate(i);\n return t0;\n }\n tween._value = value;\n return tween;\n}\n\nexport default function(value) {\n var key = \"text\";\n if (arguments.length < 1) return (key = this.tween(key)) && key._value;\n if (value == null) return this.tween(key, null);\n if (typeof value !== \"function\") throw new Error;\n return this.tween(key, textTween(value));\n}\n","import {Transition, newId} from \"./index.js\";\nimport schedule, {get} from \"./schedule.js\";\n\nexport default function() {\n var name = this._name,\n id0 = this._id,\n id1 = newId();\n\n for (var groups = this._groups, m = groups.length, j = 0; j < m; ++j) {\n for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) {\n if (node = group[i]) {\n var inherit = get(node, id0);\n schedule(node, name, id1, i, group, {\n time: inherit.time + inherit.delay + inherit.duration,\n delay: 0,\n duration: inherit.duration,\n ease: inherit.ease\n });\n }\n }\n }\n\n return new Transition(groups, this._parents, name, id1);\n}\n","import {set} from \"./schedule.js\";\n\nexport default function() {\n var on0, on1, that = this, id = that._id, size = that.size();\n return new Promise(function(resolve, reject) {\n var cancel = {value: reject},\n end = {value: function() { if (--size === 0) resolve(); }};\n\n that.each(function() {\n var schedule = set(this, id),\n on = schedule.on;\n\n // If this node shared a dispatch with the previous node,\n // just assign the updated shared dispatch and we’re done!\n // Otherwise, copy-on-write.\n if (on !== on0) {\n on1 = (on0 = on).copy();\n on1._.cancel.push(cancel);\n on1._.interrupt.push(cancel);\n on1._.end.push(end);\n }\n\n schedule.on = on1;\n });\n\n // The selection was empty, resolve end immediately\n if (size === 0) resolve();\n });\n}\n","import {selection} from \"d3-selection\";\nimport transition_attr from \"./attr.js\";\nimport transition_attrTween from \"./attrTween.js\";\nimport transition_delay from \"./delay.js\";\nimport transition_duration from \"./duration.js\";\nimport transition_ease from \"./ease.js\";\nimport transition_easeVarying from \"./easeVarying.js\";\nimport transition_filter from \"./filter.js\";\nimport transition_merge from \"./merge.js\";\nimport transition_on from \"./on.js\";\nimport transition_remove from \"./remove.js\";\nimport transition_select from \"./select.js\";\nimport transition_selectAll from \"./selectAll.js\";\nimport transition_selection from \"./selection.js\";\nimport transition_style from \"./style.js\";\nimport transition_styleTween from \"./styleTween.js\";\nimport transition_text from \"./text.js\";\nimport transition_textTween from \"./textTween.js\";\nimport transition_transition from \"./transition.js\";\nimport transition_tween from \"./tween.js\";\nimport transition_end from \"./end.js\";\n\nvar id = 0;\n\nexport function Transition(groups, parents, name, id) {\n this._groups = groups;\n this._parents = parents;\n this._name = name;\n this._id = id;\n}\n\nexport default function transition(name) {\n return selection().transition(name);\n}\n\nexport function newId() {\n return ++id;\n}\n\nvar selection_prototype = selection.prototype;\n\nTransition.prototype = transition.prototype = {\n constructor: Transition,\n select: transition_select,\n selectAll: transition_selectAll,\n selectChild: selection_prototype.selectChild,\n selectChildren: selection_prototype.selectChildren,\n filter: transition_filter,\n merge: transition_merge,\n selection: transition_selection,\n transition: transition_transition,\n call: selection_prototype.call,\n nodes: selection_prototype.nodes,\n node: selection_prototype.node,\n size: selection_prototype.size,\n empty: selection_prototype.empty,\n each: selection_prototype.each,\n on: transition_on,\n attr: transition_attr,\n attrTween: transition_attrTween,\n style: transition_style,\n styleTween: transition_styleTween,\n text: transition_text,\n textTween: transition_textTween,\n remove: transition_remove,\n tween: transition_tween,\n delay: transition_delay,\n duration: transition_duration,\n ease: transition_ease,\n easeVarying: transition_easeVarying,\n end: transition_end,\n [Symbol.iterator]: selection_prototype[Symbol.iterator]\n};\n","export const linear = t => +t;\n","export function cubicIn(t) {\n return t * t * t;\n}\n\nexport function cubicOut(t) {\n return --t * t * t + 1;\n}\n\nexport function cubicInOut(t) {\n return ((t *= 2) <= 1 ? t * t * t : (t -= 2) * t * t + 2) / 2;\n}\n","import {Transition, newId} from \"../transition/index.js\";\nimport schedule from \"../transition/schedule.js\";\nimport {easeCubicInOut} from \"d3-ease\";\nimport {now} from \"d3-timer\";\n\nvar defaultTiming = {\n time: null, // Set on use.\n delay: 0,\n duration: 250,\n ease: easeCubicInOut\n};\n\nfunction inherit(node, id) {\n var timing;\n while (!(timing = node.__transition) || !(timing = timing[id])) {\n if (!(node = node.parentNode)) {\n throw new Error(`transition ${id} not found`);\n }\n }\n return timing;\n}\n\nexport default function(name) {\n var id,\n timing;\n\n if (name instanceof Transition) {\n id = name._id, name = name._name;\n } else {\n id = newId(), (timing = defaultTiming).time = now(), name = name == null ? null : name + \"\";\n }\n\n for (var groups = this._groups, m = groups.length, j = 0; j < m; ++j) {\n for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) {\n if (node = group[i]) {\n schedule(node, name, id, i, group, timing || inherit(node, id));\n }\n }\n }\n\n return new Transition(groups, this._parents, name, id);\n}\n","import {selection} from \"d3-selection\";\nimport selection_interrupt from \"./interrupt.js\";\nimport selection_transition from \"./transition.js\";\n\nselection.prototype.interrupt = selection_interrupt;\nselection.prototype.transition = selection_transition;\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 default function(x) {\n return Math.abs(x = Math.round(x)) >= 1e21\n ? x.toLocaleString(\"en\").replace(/,/g, \"\")\n : x.toString(10);\n}\n\n// Computes the decimal coefficient and exponent of the specified number x with\n// significant digits p, where x is positive and p is in [1, 21] or undefined.\n// For example, formatDecimalParts(1.23) returns [\"123\", 0].\nexport function formatDecimalParts(x, p) {\n if ((i = (x = p ? x.toExponential(p - 1) : x.toExponential()).indexOf(\"e\")) < 0) return null; // NaN, ±Infinity\n var i, coefficient = x.slice(0, i);\n\n // The string returned by toExponential either has the form \\d\\.\\d+e[-+]\\d+\n // (e.g., 1.2e+3) or the form \\de[-+]\\d+ (e.g., 1e+3).\n return [\n coefficient.length > 1 ? coefficient[0] + coefficient.slice(2) : coefficient,\n +x.slice(i + 1)\n ];\n}\n","import {formatDecimalParts} from \"./formatDecimal.js\";\n\nexport default function(x) {\n return x = formatDecimalParts(Math.abs(x)), x ? x[1] : NaN;\n}\n","export default function(grouping, thousands) {\n return function(value, width) {\n var i = value.length,\n t = [],\n j = 0,\n g = grouping[0],\n length = 0;\n\n while (i > 0 && g > 0) {\n if (length + g + 1 > width) g = Math.max(1, width - length);\n t.push(value.substring(i -= g, i + g));\n if ((length += g + 1) > width) break;\n g = grouping[j = (j + 1) % grouping.length];\n }\n\n return t.reverse().join(thousands);\n };\n}\n","export default function(numerals) {\n return function(value) {\n return value.replace(/[0-9]/g, function(i) {\n return numerals[+i];\n });\n };\n}\n","// [[fill]align][sign][symbol][0][width][,][.precision][~][type]\nvar re = /^(?:(.)?([<>=^]))?([+\\-( ])?([$#])?(0)?(\\d+)?(,)?(\\.\\d+)?(~)?([a-z%])?$/i;\n\nexport default function formatSpecifier(specifier) {\n if (!(match = re.exec(specifier))) throw new Error(\"invalid format: \" + specifier);\n var match;\n return new FormatSpecifier({\n fill: match[1],\n align: match[2],\n sign: match[3],\n symbol: match[4],\n zero: match[5],\n width: match[6],\n comma: match[7],\n precision: match[8] && match[8].slice(1),\n trim: match[9],\n type: match[10]\n });\n}\n\nformatSpecifier.prototype = FormatSpecifier.prototype; // instanceof\n\nexport function FormatSpecifier(specifier) {\n this.fill = specifier.fill === undefined ? \" \" : specifier.fill + \"\";\n this.align = specifier.align === undefined ? \">\" : specifier.align + \"\";\n this.sign = specifier.sign === undefined ? \"-\" : specifier.sign + \"\";\n this.symbol = specifier.symbol === undefined ? \"\" : specifier.symbol + \"\";\n this.zero = !!specifier.zero;\n this.width = specifier.width === undefined ? undefined : +specifier.width;\n this.comma = !!specifier.comma;\n this.precision = specifier.precision === undefined ? undefined : +specifier.precision;\n this.trim = !!specifier.trim;\n this.type = specifier.type === undefined ? \"\" : specifier.type + \"\";\n}\n\nFormatSpecifier.prototype.toString = function() {\n return this.fill\n + this.align\n + this.sign\n + this.symbol\n + (this.zero ? \"0\" : \"\")\n + (this.width === undefined ? \"\" : Math.max(1, this.width | 0))\n + (this.comma ? \",\" : \"\")\n + (this.precision === undefined ? \"\" : \".\" + Math.max(0, this.precision | 0))\n + (this.trim ? \"~\" : \"\")\n + this.type;\n};\n","// Trims insignificant zeros, e.g., replaces 1.2000k with 1.2k.\nexport default function(s) {\n out: for (var n = s.length, i = 1, i0 = -1, i1; i < n; ++i) {\n switch (s[i]) {\n case \".\": i0 = i1 = i; break;\n case \"0\": if (i0 === 0) i0 = i; i1 = i; break;\n default: if (!+s[i]) break out; if (i0 > 0) i0 = 0; break;\n }\n }\n return i0 > 0 ? s.slice(0, i0) + s.slice(i1 + 1) : s;\n}\n","import {formatDecimalParts} from \"./formatDecimal.js\";\n\nexport var prefixExponent;\n\nexport default function(x, p) {\n var d = formatDecimalParts(x, p);\n if (!d) return x + \"\";\n var coefficient = d[0],\n exponent = d[1],\n i = exponent - (prefixExponent = Math.max(-8, Math.min(8, Math.floor(exponent / 3))) * 3) + 1,\n n = coefficient.length;\n return i === n ? coefficient\n : i > n ? coefficient + new Array(i - n + 1).join(\"0\")\n : i > 0 ? coefficient.slice(0, i) + \".\" + coefficient.slice(i)\n : \"0.\" + new Array(1 - i).join(\"0\") + formatDecimalParts(x, Math.max(0, p + i - 1))[0]; // less than 1y!\n}\n","import {formatDecimalParts} from \"./formatDecimal.js\";\n\nexport default function(x, p) {\n var d = formatDecimalParts(x, p);\n if (!d) return x + \"\";\n var coefficient = d[0],\n exponent = d[1];\n return exponent < 0 ? \"0.\" + new Array(-exponent).join(\"0\") + coefficient\n : coefficient.length > exponent + 1 ? coefficient.slice(0, exponent + 1) + \".\" + coefficient.slice(exponent + 1)\n : coefficient + new Array(exponent - coefficient.length + 2).join(\"0\");\n}\n","import formatDecimal from \"./formatDecimal.js\";\nimport formatPrefixAuto from \"./formatPrefixAuto.js\";\nimport formatRounded from \"./formatRounded.js\";\n\nexport default {\n \"%\": (x, p) => (x * 100).toFixed(p),\n \"b\": (x) => Math.round(x).toString(2),\n \"c\": (x) => x + \"\",\n \"d\": formatDecimal,\n \"e\": (x, p) => x.toExponential(p),\n \"f\": (x, p) => x.toFixed(p),\n \"g\": (x, p) => x.toPrecision(p),\n \"o\": (x) => Math.round(x).toString(8),\n \"p\": (x, p) => formatRounded(x * 100, p),\n \"r\": formatRounded,\n \"s\": formatPrefixAuto,\n \"X\": (x) => Math.round(x).toString(16).toUpperCase(),\n \"x\": (x) => Math.round(x).toString(16)\n};\n","export default function(x) {\n return x;\n}\n","import exponent from \"./exponent.js\";\nimport formatGroup from \"./formatGroup.js\";\nimport formatNumerals from \"./formatNumerals.js\";\nimport formatSpecifier from \"./formatSpecifier.js\";\nimport formatTrim from \"./formatTrim.js\";\nimport formatTypes from \"./formatTypes.js\";\nimport {prefixExponent} from \"./formatPrefixAuto.js\";\nimport identity from \"./identity.js\";\n\nvar map = Array.prototype.map,\n prefixes = [\"y\",\"z\",\"a\",\"f\",\"p\",\"n\",\"µ\",\"m\",\"\",\"k\",\"M\",\"G\",\"T\",\"P\",\"E\",\"Z\",\"Y\"];\n\nexport default function(locale) {\n var group = locale.grouping === undefined || locale.thousands === undefined ? identity : formatGroup(map.call(locale.grouping, Number), locale.thousands + \"\"),\n currencyPrefix = locale.currency === undefined ? \"\" : locale.currency[0] + \"\",\n currencySuffix = locale.currency === undefined ? \"\" : locale.currency[1] + \"\",\n decimal = locale.decimal === undefined ? \".\" : locale.decimal + \"\",\n numerals = locale.numerals === undefined ? identity : formatNumerals(map.call(locale.numerals, String)),\n percent = locale.percent === undefined ? \"%\" : locale.percent + \"\",\n minus = locale.minus === undefined ? \"−\" : locale.minus + \"\",\n nan = locale.nan === undefined ? \"NaN\" : locale.nan + \"\";\n\n function newFormat(specifier) {\n specifier = formatSpecifier(specifier);\n\n var fill = specifier.fill,\n align = specifier.align,\n sign = specifier.sign,\n symbol = specifier.symbol,\n zero = specifier.zero,\n width = specifier.width,\n comma = specifier.comma,\n precision = specifier.precision,\n trim = specifier.trim,\n type = specifier.type;\n\n // The \"n\" type is an alias for \",g\".\n if (type === \"n\") comma = true, type = \"g\";\n\n // The \"\" type, and any invalid type, is an alias for \".12~g\".\n else if (!formatTypes[type]) precision === undefined && (precision = 12), trim = true, type = \"g\";\n\n // If zero fill is specified, padding goes after sign and before digits.\n if (zero || (fill === \"0\" && align === \"=\")) zero = true, fill = \"0\", align = \"=\";\n\n // Compute the prefix and suffix.\n // For SI-prefix, the suffix is lazily computed.\n var prefix = symbol === \"$\" ? currencyPrefix : symbol === \"#\" && /[boxX]/.test(type) ? \"0\" + type.toLowerCase() : \"\",\n suffix = symbol === \"$\" ? currencySuffix : /[%p]/.test(type) ? percent : \"\";\n\n // What format function should we use?\n // Is this an integer type?\n // Can this type generate exponential notation?\n var formatType = formatTypes[type],\n maybeSuffix = /[defgprs%]/.test(type);\n\n // Set the default precision if not specified,\n // or clamp the specified precision to the supported range.\n // For significant precision, it must be in [1, 21].\n // For fixed precision, it must be in [0, 20].\n precision = precision === undefined ? 6\n : /[gprs]/.test(type) ? Math.max(1, Math.min(21, precision))\n : Math.max(0, Math.min(20, precision));\n\n function format(value) {\n var valuePrefix = prefix,\n valueSuffix = suffix,\n i, n, c;\n\n if (type === \"c\") {\n valueSuffix = formatType(value) + valueSuffix;\n value = \"\";\n } else {\n value = +value;\n\n // Determine the sign. -0 is not less than 0, but 1 / -0 is!\n var valueNegative = value < 0 || 1 / value < 0;\n\n // Perform the initial formatting.\n value = isNaN(value) ? nan : formatType(Math.abs(value), precision);\n\n // Trim insignificant zeros.\n if (trim) value = formatTrim(value);\n\n // If a negative value rounds to zero after formatting, and no explicit positive sign is requested, hide the sign.\n if (valueNegative && +value === 0 && sign !== \"+\") valueNegative = false;\n\n // Compute the prefix and suffix.\n valuePrefix = (valueNegative ? (sign === \"(\" ? sign : minus) : sign === \"-\" || sign === \"(\" ? \"\" : sign) + valuePrefix;\n valueSuffix = (type === \"s\" ? prefixes[8 + prefixExponent / 3] : \"\") + valueSuffix + (valueNegative && sign === \"(\" ? \")\" : \"\");\n\n // Break the formatted value into the integer “value” part that can be\n // grouped, and fractional or exponential “suffix” part that is not.\n if (maybeSuffix) {\n i = -1, n = value.length;\n while (++i < n) {\n if (c = value.charCodeAt(i), 48 > c || c > 57) {\n valueSuffix = (c === 46 ? decimal + value.slice(i + 1) : value.slice(i)) + valueSuffix;\n value = value.slice(0, i);\n break;\n }\n }\n }\n }\n\n // If the fill character is not \"0\", grouping is applied before padding.\n if (comma && !zero) value = group(value, Infinity);\n\n // Compute the padding.\n var length = valuePrefix.length + value.length + valueSuffix.length,\n padding = length < width ? new Array(width - length + 1).join(fill) : \"\";\n\n // If the fill character is \"0\", grouping is applied after padding.\n if (comma && zero) value = group(padding + value, padding.length ? width - valueSuffix.length : Infinity), padding = \"\";\n\n // Reconstruct the final output based on the desired alignment.\n switch (align) {\n case \"<\": value = valuePrefix + value + valueSuffix + padding; break;\n case \"=\": value = valuePrefix + padding + value + valueSuffix; break;\n case \"^\": value = padding.slice(0, length = padding.length >> 1) + valuePrefix + value + valueSuffix + padding.slice(length); break;\n default: value = padding + valuePrefix + value + valueSuffix; break;\n }\n\n return numerals(value);\n }\n\n format.toString = function() {\n return specifier + \"\";\n };\n\n return format;\n }\n\n function formatPrefix(specifier, value) {\n var f = newFormat((specifier = formatSpecifier(specifier), specifier.type = \"f\", specifier)),\n e = Math.max(-8, Math.min(8, Math.floor(exponent(value) / 3))) * 3,\n k = Math.pow(10, -e),\n prefix = prefixes[8 + e / 3];\n return function(value) {\n return f(k * value) + prefix;\n };\n }\n\n return {\n format: newFormat,\n formatPrefix: formatPrefix\n };\n}\n","import formatLocale from \"./locale.js\";\n\nvar locale;\nexport var format;\nexport var formatPrefix;\n\ndefaultLocale({\n thousands: \",\",\n grouping: [3],\n currency: [\"$\", \"\"]\n});\n\nexport default function defaultLocale(definition) {\n locale = formatLocale(definition);\n format = locale.format;\n formatPrefix = locale.formatPrefix;\n return locale;\n}\n","import exponent from \"./exponent.js\";\n\nexport default function(step) {\n return Math.max(0, -exponent(Math.abs(step)));\n}\n","import exponent from \"./exponent.js\";\n\nexport default function(step, value) {\n return Math.max(0, Math.max(-8, Math.min(8, Math.floor(exponent(value) / 3))) * 3 - exponent(Math.abs(step)));\n}\n","import exponent from \"./exponent.js\";\n\nexport default function(step, max) {\n step = Math.abs(step), max = Math.abs(max) - step;\n return Math.max(0, exponent(max) - exponent(step)) + 1;\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","export function initRange(domain, range) {\n switch (arguments.length) {\n case 0: break;\n case 1: this.range(domain); break;\n default: this.range(range).domain(domain); break;\n }\n return this;\n}\n\nexport function initInterpolator(domain, interpolator) {\n switch (arguments.length) {\n case 0: break;\n case 1: {\n if (typeof domain === \"function\") this.interpolator(domain);\n else this.range(domain);\n break;\n }\n default: {\n this.domain(domain);\n if (typeof interpolator === \"function\") this.interpolator(interpolator);\n else this.range(interpolator);\n break;\n }\n }\n return this;\n}\n","import {InternMap} from \"d3-array\";\nimport {initRange} from \"./init.js\";\n\nexport const implicit = Symbol(\"implicit\");\n\nexport default function ordinal() {\n var index = new InternMap(),\n domain = [],\n range = [],\n unknown = implicit;\n\n function scale(d) {\n let i = index.get(d);\n if (i === undefined) {\n if (unknown !== implicit) return unknown;\n index.set(d, i = domain.push(d) - 1);\n }\n return range[i % range.length];\n }\n\n scale.domain = function(_) {\n if (!arguments.length) return domain.slice();\n domain = [], index = new InternMap();\n for (const value of _) {\n if (index.has(value)) continue;\n index.set(value, domain.push(value) - 1);\n }\n return scale;\n };\n\n scale.range = function(_) {\n return arguments.length ? (range = Array.from(_), scale) : range.slice();\n };\n\n scale.unknown = function(_) {\n return arguments.length ? (unknown = _, scale) : unknown;\n };\n\n scale.copy = function() {\n return ordinal(domain, range).unknown(unknown);\n };\n\n initRange.apply(scale, arguments);\n\n return scale;\n}\n","import {range as sequence} from \"d3-array\";\nimport {initRange} from \"./init.js\";\nimport ordinal from \"./ordinal.js\";\n\nexport default function band() {\n var scale = ordinal().unknown(undefined),\n domain = scale.domain,\n ordinalRange = scale.range,\n r0 = 0,\n r1 = 1,\n step,\n bandwidth,\n round = false,\n paddingInner = 0,\n paddingOuter = 0,\n align = 0.5;\n\n delete scale.unknown;\n\n function rescale() {\n var n = domain().length,\n reverse = r1 < r0,\n start = reverse ? r1 : r0,\n stop = reverse ? r0 : r1;\n step = (stop - start) / Math.max(1, n - paddingInner + paddingOuter * 2);\n if (round) step = Math.floor(step);\n start += (stop - start - step * (n - paddingInner)) * align;\n bandwidth = step * (1 - paddingInner);\n if (round) start = Math.round(start), bandwidth = Math.round(bandwidth);\n var values = sequence(n).map(function(i) { return start + step * i; });\n return ordinalRange(reverse ? values.reverse() : values);\n }\n\n scale.domain = function(_) {\n return arguments.length ? (domain(_), rescale()) : domain();\n };\n\n scale.range = function(_) {\n return arguments.length ? ([r0, r1] = _, r0 = +r0, r1 = +r1, rescale()) : [r0, r1];\n };\n\n scale.rangeRound = function(_) {\n return [r0, r1] = _, r0 = +r0, r1 = +r1, round = true, rescale();\n };\n\n scale.bandwidth = function() {\n return bandwidth;\n };\n\n scale.step = function() {\n return step;\n };\n\n scale.round = function(_) {\n return arguments.length ? (round = !!_, rescale()) : round;\n };\n\n scale.padding = function(_) {\n return arguments.length ? (paddingInner = Math.min(1, paddingOuter = +_), rescale()) : paddingInner;\n };\n\n scale.paddingInner = function(_) {\n return arguments.length ? (paddingInner = Math.min(1, _), rescale()) : paddingInner;\n };\n\n scale.paddingOuter = function(_) {\n return arguments.length ? (paddingOuter = +_, rescale()) : paddingOuter;\n };\n\n scale.align = function(_) {\n return arguments.length ? (align = Math.max(0, Math.min(1, _)), rescale()) : align;\n };\n\n scale.copy = function() {\n return band(domain(), [r0, r1])\n .round(round)\n .paddingInner(paddingInner)\n .paddingOuter(paddingOuter)\n .align(align);\n };\n\n return initRange.apply(rescale(), arguments);\n}\n\nfunction pointish(scale) {\n var copy = scale.copy;\n\n scale.padding = scale.paddingOuter;\n delete scale.paddingInner;\n delete scale.paddingOuter;\n\n scale.copy = function() {\n return pointish(copy());\n };\n\n return scale;\n}\n\nexport function point() {\n return pointish(band.apply(null, arguments).paddingInner(1));\n}\n","export default function constants(x) {\n return function() {\n return x;\n };\n}\n","export default function number(x) {\n return +x;\n}\n","import {bisect} from \"d3-array\";\nimport {interpolate as interpolateValue, interpolateNumber, interpolateRound} from \"d3-interpolate\";\nimport constant from \"./constant.js\";\nimport number from \"./number.js\";\n\nvar unit = [0, 1];\n\nexport function identity(x) {\n return x;\n}\n\nfunction normalize(a, b) {\n return (b -= (a = +a))\n ? function(x) { return (x - a) / b; }\n : constant(isNaN(b) ? NaN : 0.5);\n}\n\nfunction clamper(a, b) {\n var t;\n if (a > b) t = a, a = b, b = t;\n return function(x) { return Math.max(a, Math.min(b, x)); };\n}\n\n// normalize(a, b)(x) takes a domain value x in [a,b] and returns the corresponding parameter t in [0,1].\n// interpolate(a, b)(t) takes a parameter t in [0,1] and returns the corresponding range value x in [a,b].\nfunction bimap(domain, range, interpolate) {\n var d0 = domain[0], d1 = domain[1], r0 = range[0], r1 = range[1];\n if (d1 < d0) d0 = normalize(d1, d0), r0 = interpolate(r1, r0);\n else d0 = normalize(d0, d1), r0 = interpolate(r0, r1);\n return function(x) { return r0(d0(x)); };\n}\n\nfunction polymap(domain, range, interpolate) {\n var j = Math.min(domain.length, range.length) - 1,\n d = new Array(j),\n r = new Array(j),\n i = -1;\n\n // Reverse descending domains.\n if (domain[j] < domain[0]) {\n domain = domain.slice().reverse();\n range = range.slice().reverse();\n }\n\n while (++i < j) {\n d[i] = normalize(domain[i], domain[i + 1]);\n r[i] = interpolate(range[i], range[i + 1]);\n }\n\n return function(x) {\n var i = bisect(domain, x, 1, j) - 1;\n return r[i](d[i](x));\n };\n}\n\nexport function copy(source, target) {\n return target\n .domain(source.domain())\n .range(source.range())\n .interpolate(source.interpolate())\n .clamp(source.clamp())\n .unknown(source.unknown());\n}\n\nexport function transformer() {\n var domain = unit,\n range = unit,\n interpolate = interpolateValue,\n transform,\n untransform,\n unknown,\n clamp = identity,\n piecewise,\n output,\n input;\n\n function rescale() {\n var n = Math.min(domain.length, range.length);\n if (clamp !== identity) clamp = clamper(domain[0], domain[n - 1]);\n piecewise = n > 2 ? polymap : bimap;\n output = input = null;\n return scale;\n }\n\n function scale(x) {\n return x == null || isNaN(x = +x) ? unknown : (output || (output = piecewise(domain.map(transform), range, interpolate)))(transform(clamp(x)));\n }\n\n scale.invert = function(y) {\n return clamp(untransform((input || (input = piecewise(range, domain.map(transform), interpolateNumber)))(y)));\n };\n\n scale.domain = function(_) {\n return arguments.length ? (domain = Array.from(_, number), rescale()) : domain.slice();\n };\n\n scale.range = function(_) {\n return arguments.length ? (range = Array.from(_), rescale()) : range.slice();\n };\n\n scale.rangeRound = function(_) {\n return range = Array.from(_), interpolate = interpolateRound, rescale();\n };\n\n scale.clamp = function(_) {\n return arguments.length ? (clamp = _ ? true : identity, rescale()) : clamp !== identity;\n };\n\n scale.interpolate = function(_) {\n return arguments.length ? (interpolate = _, rescale()) : interpolate;\n };\n\n scale.unknown = function(_) {\n return arguments.length ? (unknown = _, scale) : unknown;\n };\n\n return function(t, u) {\n transform = t, untransform = u;\n return rescale();\n };\n}\n\nexport default function continuous() {\n return transformer()(identity, identity);\n}\n","import {tickStep} from \"d3-array\";\nimport {format, formatPrefix, formatSpecifier, precisionFixed, precisionPrefix, precisionRound} from \"d3-format\";\n\nexport default function tickFormat(start, stop, count, specifier) {\n var step = tickStep(start, stop, count),\n precision;\n specifier = formatSpecifier(specifier == null ? \",f\" : specifier);\n switch (specifier.type) {\n case \"s\": {\n var value = Math.max(Math.abs(start), Math.abs(stop));\n if (specifier.precision == null && !isNaN(precision = precisionPrefix(step, value))) specifier.precision = precision;\n return formatPrefix(specifier, value);\n }\n case \"\":\n case \"e\":\n case \"g\":\n case \"p\":\n case \"r\": {\n if (specifier.precision == null && !isNaN(precision = precisionRound(step, Math.max(Math.abs(start), Math.abs(stop))))) specifier.precision = precision - (specifier.type === \"e\");\n break;\n }\n case \"f\":\n case \"%\": {\n if (specifier.precision == null && !isNaN(precision = precisionFixed(step))) specifier.precision = precision - (specifier.type === \"%\") * 2;\n break;\n }\n }\n return format(specifier);\n}\n","import {ticks, tickIncrement} from \"d3-array\";\nimport continuous, {copy} from \"./continuous.js\";\nimport {initRange} from \"./init.js\";\nimport tickFormat from \"./tickFormat.js\";\n\nexport function linearish(scale) {\n var domain = scale.domain;\n\n scale.ticks = function(count) {\n var d = domain();\n return ticks(d[0], d[d.length - 1], count == null ? 10 : count);\n };\n\n scale.tickFormat = function(count, specifier) {\n var d = domain();\n return tickFormat(d[0], d[d.length - 1], count == null ? 10 : count, specifier);\n };\n\n scale.nice = function(count) {\n if (count == null) count = 10;\n\n var d = domain();\n var i0 = 0;\n var i1 = d.length - 1;\n var start = d[i0];\n var stop = d[i1];\n var prestep;\n var step;\n var maxIter = 10;\n\n if (stop < start) {\n step = start, start = stop, stop = step;\n step = i0, i0 = i1, i1 = step;\n }\n \n while (maxIter-- > 0) {\n step = tickIncrement(start, stop, count);\n if (step === prestep) {\n d[i0] = start\n d[i1] = stop\n return domain(d);\n } else if (step > 0) {\n start = Math.floor(start / step) * step;\n stop = Math.ceil(stop / step) * step;\n } else if (step < 0) {\n start = Math.ceil(start * step) / step;\n stop = Math.floor(stop * step) / step;\n } else {\n break;\n }\n prestep = step;\n }\n\n return scale;\n };\n\n return scale;\n}\n\nexport default function linear() {\n var scale = continuous();\n\n scale.copy = function() {\n return copy(scale, linear());\n };\n\n initRange.apply(scale, arguments);\n\n return linearish(scale);\n}\n","export default function nice(domain, interval) {\n domain = domain.slice();\n\n var i0 = 0,\n i1 = domain.length - 1,\n x0 = domain[i0],\n x1 = domain[i1],\n t;\n\n if (x1 < x0) {\n t = i0, i0 = i1, i1 = t;\n t = x0, x0 = x1, x1 = t;\n }\n\n domain[i0] = interval.floor(x0);\n domain[i1] = interval.ceil(x1);\n return domain;\n}\n","import {ticks} from \"d3-array\";\nimport {format, formatSpecifier} from \"d3-format\";\nimport nice from \"./nice.js\";\nimport {copy, transformer} from \"./continuous.js\";\nimport {initRange} from \"./init.js\";\n\nfunction transformLog(x) {\n return Math.log(x);\n}\n\nfunction transformExp(x) {\n return Math.exp(x);\n}\n\nfunction transformLogn(x) {\n return -Math.log(-x);\n}\n\nfunction transformExpn(x) {\n return -Math.exp(-x);\n}\n\nfunction pow10(x) {\n return isFinite(x) ? +(\"1e\" + x) : x < 0 ? 0 : x;\n}\n\nfunction powp(base) {\n return base === 10 ? pow10\n : base === Math.E ? Math.exp\n : x => Math.pow(base, x);\n}\n\nfunction logp(base) {\n return base === Math.E ? Math.log\n : base === 10 && Math.log10\n || base === 2 && Math.log2\n || (base = Math.log(base), x => Math.log(x) / base);\n}\n\nfunction reflect(f) {\n return (x, k) => -f(-x, k);\n}\n\nexport function loggish(transform) {\n const scale = transform(transformLog, transformExp);\n const domain = scale.domain;\n let base = 10;\n let logs;\n let pows;\n\n function rescale() {\n logs = logp(base), pows = powp(base);\n if (domain()[0] < 0) {\n logs = reflect(logs), pows = reflect(pows);\n transform(transformLogn, transformExpn);\n } else {\n transform(transformLog, transformExp);\n }\n return scale;\n }\n\n scale.base = function(_) {\n return arguments.length ? (base = +_, rescale()) : base;\n };\n\n scale.domain = function(_) {\n return arguments.length ? (domain(_), rescale()) : domain();\n };\n\n scale.ticks = count => {\n const d = domain();\n let u = d[0];\n let v = d[d.length - 1];\n const r = v < u;\n\n if (r) ([u, v] = [v, u]);\n\n let i = logs(u);\n let j = logs(v);\n let k;\n let t;\n const n = count == null ? 10 : +count;\n let z = [];\n\n if (!(base % 1) && j - i < n) {\n i = Math.floor(i), j = Math.ceil(j);\n if (u > 0) for (; i <= j; ++i) {\n for (k = 1; k < base; ++k) {\n t = i < 0 ? k / pows(-i) : k * pows(i);\n if (t < u) continue;\n if (t > v) break;\n z.push(t);\n }\n } else for (; i <= j; ++i) {\n for (k = base - 1; k >= 1; --k) {\n t = i > 0 ? k / pows(-i) : k * pows(i);\n if (t < u) continue;\n if (t > v) break;\n z.push(t);\n }\n }\n if (z.length * 2 < n) z = ticks(u, v, n);\n } else {\n z = ticks(i, j, Math.min(j - i, n)).map(pows);\n }\n return r ? z.reverse() : z;\n };\n\n scale.tickFormat = (count, specifier) => {\n if (count == null) count = 10;\n if (specifier == null) specifier = base === 10 ? \"s\" : \",\";\n if (typeof specifier !== \"function\") {\n if (!(base % 1) && (specifier = formatSpecifier(specifier)).precision == null) specifier.trim = true;\n specifier = format(specifier);\n }\n if (count === Infinity) return specifier;\n const k = Math.max(1, base * count / scale.ticks().length); // TODO fast estimate?\n return d => {\n let i = d / pows(Math.round(logs(d)));\n if (i * base < base - 0.5) i *= base;\n return i <= k ? specifier(d) : \"\";\n };\n };\n\n scale.nice = () => {\n return domain(nice(domain(), {\n floor: x => pows(Math.floor(logs(x))),\n ceil: x => pows(Math.ceil(logs(x)))\n }));\n };\n\n return scale;\n}\n\nexport default function log() {\n const scale = loggish(transformer()).domain([1, 10]);\n scale.copy = () => copy(scale, log()).base(scale.base());\n initRange.apply(scale, arguments);\n return scale;\n}\n","import {bisect} from \"d3-array\";\nimport {linearish} from \"./linear.js\";\nimport {initRange} from \"./init.js\";\n\nexport default function quantize() {\n var x0 = 0,\n x1 = 1,\n n = 1,\n domain = [0.5],\n range = [0, 1],\n unknown;\n\n function scale(x) {\n return x != null && x <= x ? range[bisect(domain, x, 0, n)] : unknown;\n }\n\n function rescale() {\n var i = -1;\n domain = new Array(n);\n while (++i < n) domain[i] = ((i + 1) * x1 - (i - n) * x0) / (n + 1);\n return scale;\n }\n\n scale.domain = function(_) {\n return arguments.length ? ([x0, x1] = _, x0 = +x0, x1 = +x1, rescale()) : [x0, x1];\n };\n\n scale.range = function(_) {\n return arguments.length ? (n = (range = Array.from(_)).length - 1, rescale()) : range.slice();\n };\n\n scale.invertExtent = function(y) {\n var i = range.indexOf(y);\n return i < 0 ? [NaN, NaN]\n : i < 1 ? [x0, domain[0]]\n : i >= n ? [domain[n - 1], x1]\n : [domain[i - 1], domain[i]];\n };\n\n scale.unknown = function(_) {\n return arguments.length ? (unknown = _, scale) : scale;\n };\n\n scale.thresholds = function() {\n return domain.slice();\n };\n\n scale.copy = function() {\n return quantize()\n .domain([x0, x1])\n .range(range)\n .unknown(unknown);\n };\n\n return initRange.apply(linearish(scale), arguments);\n}\n","const t0 = new Date, t1 = new Date;\n\nexport function timeInterval(floori, offseti, count, field) {\n\n function interval(date) {\n return floori(date = arguments.length === 0 ? new Date : new Date(+date)), date;\n }\n\n interval.floor = (date) => {\n return floori(date = new Date(+date)), date;\n };\n\n interval.ceil = (date) => {\n return floori(date = new Date(date - 1)), offseti(date, 1), floori(date), date;\n };\n\n interval.round = (date) => {\n const d0 = interval(date), d1 = interval.ceil(date);\n return date - d0 < d1 - date ? d0 : d1;\n };\n\n interval.offset = (date, step) => {\n return offseti(date = new Date(+date), step == null ? 1 : Math.floor(step)), date;\n };\n\n interval.range = (start, stop, step) => {\n const range = [];\n start = interval.ceil(start);\n step = step == null ? 1 : Math.floor(step);\n if (!(start < stop) || !(step > 0)) return range; // also handles Invalid Date\n let previous;\n do range.push(previous = new Date(+start)), offseti(start, step), floori(start);\n while (previous < start && start < stop);\n return range;\n };\n\n interval.filter = (test) => {\n return timeInterval((date) => {\n if (date >= date) while (floori(date), !test(date)) date.setTime(date - 1);\n }, (date, step) => {\n if (date >= date) {\n if (step < 0) while (++step <= 0) {\n while (offseti(date, -1), !test(date)) {} // eslint-disable-line no-empty\n } else while (--step >= 0) {\n while (offseti(date, +1), !test(date)) {} // eslint-disable-line no-empty\n }\n }\n });\n };\n\n if (count) {\n interval.count = (start, end) => {\n t0.setTime(+start), t1.setTime(+end);\n floori(t0), floori(t1);\n return Math.floor(count(t0, t1));\n };\n\n interval.every = (step) => {\n step = Math.floor(step);\n return !isFinite(step) || !(step > 0) ? null\n : !(step > 1) ? interval\n : interval.filter(field\n ? (d) => field(d) % step === 0\n : (d) => interval.count(0, d) % step === 0);\n };\n }\n\n return interval;\n}\n","import {timeInterval} from \"./interval.js\";\n\nexport const millisecond = timeInterval(() => {\n // noop\n}, (date, step) => {\n date.setTime(+date + step);\n}, (start, end) => {\n return end - start;\n});\n\n// An optimized implementation for this simple case.\nmillisecond.every = (k) => {\n k = Math.floor(k);\n if (!isFinite(k) || !(k > 0)) return null;\n if (!(k > 1)) return millisecond;\n return timeInterval((date) => {\n date.setTime(Math.floor(date / k) * k);\n }, (date, step) => {\n date.setTime(+date + step * k);\n }, (start, end) => {\n return (end - start) / k;\n });\n};\n\nexport const milliseconds = millisecond.range;\n","export const durationSecond = 1000;\nexport const durationMinute = durationSecond * 60;\nexport const durationHour = durationMinute * 60;\nexport const durationDay = durationHour * 24;\nexport const durationWeek = durationDay * 7;\nexport const durationMonth = durationDay * 30;\nexport const durationYear = durationDay * 365;\n","import {timeInterval} from \"./interval.js\";\nimport {durationSecond} from \"./duration.js\";\n\nexport const second = timeInterval((date) => {\n date.setTime(date - date.getMilliseconds());\n}, (date, step) => {\n date.setTime(+date + step * durationSecond);\n}, (start, end) => {\n return (end - start) / durationSecond;\n}, (date) => {\n return date.getUTCSeconds();\n});\n\nexport const seconds = second.range;\n","import {timeInterval} from \"./interval.js\";\nimport {durationMinute, durationSecond} from \"./duration.js\";\n\nexport const timeMinute = timeInterval((date) => {\n date.setTime(date - date.getMilliseconds() - date.getSeconds() * durationSecond);\n}, (date, step) => {\n date.setTime(+date + step * durationMinute);\n}, (start, end) => {\n return (end - start) / durationMinute;\n}, (date) => {\n return date.getMinutes();\n});\n\nexport const timeMinutes = timeMinute.range;\n\nexport const utcMinute = timeInterval((date) => {\n date.setUTCSeconds(0, 0);\n}, (date, step) => {\n date.setTime(+date + step * durationMinute);\n}, (start, end) => {\n return (end - start) / durationMinute;\n}, (date) => {\n return date.getUTCMinutes();\n});\n\nexport const utcMinutes = utcMinute.range;\n","import {timeInterval} from \"./interval.js\";\nimport {durationHour, durationMinute, durationSecond} from \"./duration.js\";\n\nexport const timeHour = timeInterval((date) => {\n date.setTime(date - date.getMilliseconds() - date.getSeconds() * durationSecond - date.getMinutes() * durationMinute);\n}, (date, step) => {\n date.setTime(+date + step * durationHour);\n}, (start, end) => {\n return (end - start) / durationHour;\n}, (date) => {\n return date.getHours();\n});\n\nexport const timeHours = timeHour.range;\n\nexport const utcHour = timeInterval((date) => {\n date.setUTCMinutes(0, 0, 0);\n}, (date, step) => {\n date.setTime(+date + step * durationHour);\n}, (start, end) => {\n return (end - start) / durationHour;\n}, (date) => {\n return date.getUTCHours();\n});\n\nexport const utcHours = utcHour.range;\n","import {timeInterval} from \"./interval.js\";\nimport {durationDay, durationMinute} from \"./duration.js\";\n\nexport const timeDay = timeInterval(\n date => date.setHours(0, 0, 0, 0),\n (date, step) => date.setDate(date.getDate() + step),\n (start, end) => (end - start - (end.getTimezoneOffset() - start.getTimezoneOffset()) * durationMinute) / durationDay,\n date => date.getDate() - 1\n);\n\nexport const timeDays = timeDay.range;\n\nexport const utcDay = timeInterval((date) => {\n date.setUTCHours(0, 0, 0, 0);\n}, (date, step) => {\n date.setUTCDate(date.getUTCDate() + step);\n}, (start, end) => {\n return (end - start) / durationDay;\n}, (date) => {\n return date.getUTCDate() - 1;\n});\n\nexport const utcDays = utcDay.range;\n\nexport const unixDay = timeInterval((date) => {\n date.setUTCHours(0, 0, 0, 0);\n}, (date, step) => {\n date.setUTCDate(date.getUTCDate() + step);\n}, (start, end) => {\n return (end - start) / durationDay;\n}, (date) => {\n return Math.floor(date / durationDay);\n});\n\nexport const unixDays = unixDay.range;\n","import {timeInterval} from \"./interval.js\";\nimport {durationMinute, durationWeek} from \"./duration.js\";\n\nfunction timeWeekday(i) {\n return timeInterval((date) => {\n date.setDate(date.getDate() - (date.getDay() + 7 - i) % 7);\n date.setHours(0, 0, 0, 0);\n }, (date, step) => {\n date.setDate(date.getDate() + step * 7);\n }, (start, end) => {\n return (end - start - (end.getTimezoneOffset() - start.getTimezoneOffset()) * durationMinute) / durationWeek;\n });\n}\n\nexport const timeSunday = timeWeekday(0);\nexport const timeMonday = timeWeekday(1);\nexport const timeTuesday = timeWeekday(2);\nexport const timeWednesday = timeWeekday(3);\nexport const timeThursday = timeWeekday(4);\nexport const timeFriday = timeWeekday(5);\nexport const timeSaturday = timeWeekday(6);\n\nexport const timeSundays = timeSunday.range;\nexport const timeMondays = timeMonday.range;\nexport const timeTuesdays = timeTuesday.range;\nexport const timeWednesdays = timeWednesday.range;\nexport const timeThursdays = timeThursday.range;\nexport const timeFridays = timeFriday.range;\nexport const timeSaturdays = timeSaturday.range;\n\nfunction utcWeekday(i) {\n return timeInterval((date) => {\n date.setUTCDate(date.getUTCDate() - (date.getUTCDay() + 7 - i) % 7);\n date.setUTCHours(0, 0, 0, 0);\n }, (date, step) => {\n date.setUTCDate(date.getUTCDate() + step * 7);\n }, (start, end) => {\n return (end - start) / durationWeek;\n });\n}\n\nexport const utcSunday = utcWeekday(0);\nexport const utcMonday = utcWeekday(1);\nexport const utcTuesday = utcWeekday(2);\nexport const utcWednesday = utcWeekday(3);\nexport const utcThursday = utcWeekday(4);\nexport const utcFriday = utcWeekday(5);\nexport const utcSaturday = utcWeekday(6);\n\nexport const utcSundays = utcSunday.range;\nexport const utcMondays = utcMonday.range;\nexport const utcTuesdays = utcTuesday.range;\nexport const utcWednesdays = utcWednesday.range;\nexport const utcThursdays = utcThursday.range;\nexport const utcFridays = utcFriday.range;\nexport const utcSaturdays = utcSaturday.range;\n","import {timeInterval} from \"./interval.js\";\n\nexport const timeMonth = timeInterval((date) => {\n date.setDate(1);\n date.setHours(0, 0, 0, 0);\n}, (date, step) => {\n date.setMonth(date.getMonth() + step);\n}, (start, end) => {\n return end.getMonth() - start.getMonth() + (end.getFullYear() - start.getFullYear()) * 12;\n}, (date) => {\n return date.getMonth();\n});\n\nexport const timeMonths = timeMonth.range;\n\nexport const utcMonth = timeInterval((date) => {\n date.setUTCDate(1);\n date.setUTCHours(0, 0, 0, 0);\n}, (date, step) => {\n date.setUTCMonth(date.getUTCMonth() + step);\n}, (start, end) => {\n return end.getUTCMonth() - start.getUTCMonth() + (end.getUTCFullYear() - start.getUTCFullYear()) * 12;\n}, (date) => {\n return date.getUTCMonth();\n});\n\nexport const utcMonths = utcMonth.range;\n","import {timeInterval} from \"./interval.js\";\n\nexport const timeYear = timeInterval((date) => {\n date.setMonth(0, 1);\n date.setHours(0, 0, 0, 0);\n}, (date, step) => {\n date.setFullYear(date.getFullYear() + step);\n}, (start, end) => {\n return end.getFullYear() - start.getFullYear();\n}, (date) => {\n return date.getFullYear();\n});\n\n// An optimized implementation for this simple case.\ntimeYear.every = (k) => {\n return !isFinite(k = Math.floor(k)) || !(k > 0) ? null : timeInterval((date) => {\n date.setFullYear(Math.floor(date.getFullYear() / k) * k);\n date.setMonth(0, 1);\n date.setHours(0, 0, 0, 0);\n }, (date, step) => {\n date.setFullYear(date.getFullYear() + step * k);\n });\n};\n\nexport const timeYears = timeYear.range;\n\nexport const utcYear = timeInterval((date) => {\n date.setUTCMonth(0, 1);\n date.setUTCHours(0, 0, 0, 0);\n}, (date, step) => {\n date.setUTCFullYear(date.getUTCFullYear() + step);\n}, (start, end) => {\n return end.getUTCFullYear() - start.getUTCFullYear();\n}, (date) => {\n return date.getUTCFullYear();\n});\n\n// An optimized implementation for this simple case.\nutcYear.every = (k) => {\n return !isFinite(k = Math.floor(k)) || !(k > 0) ? null : timeInterval((date) => {\n date.setUTCFullYear(Math.floor(date.getUTCFullYear() / k) * k);\n date.setUTCMonth(0, 1);\n date.setUTCHours(0, 0, 0, 0);\n }, (date, step) => {\n date.setUTCFullYear(date.getUTCFullYear() + step * k);\n });\n};\n\nexport const utcYears = utcYear.range;\n","import {bisector, tickStep} from \"d3-array\";\nimport {durationDay, durationHour, durationMinute, durationMonth, durationSecond, durationWeek, durationYear} from \"./duration.js\";\nimport {millisecond} from \"./millisecond.js\";\nimport {second} from \"./second.js\";\nimport {timeMinute, utcMinute} from \"./minute.js\";\nimport {timeHour, utcHour} from \"./hour.js\";\nimport {timeDay, unixDay} from \"./day.js\";\nimport {timeSunday, utcSunday} from \"./week.js\";\nimport {timeMonth, utcMonth} from \"./month.js\";\nimport {timeYear, utcYear} from \"./year.js\";\n\nfunction ticker(year, month, week, day, hour, minute) {\n\n const tickIntervals = [\n [second, 1, durationSecond],\n [second, 5, 5 * durationSecond],\n [second, 15, 15 * durationSecond],\n [second, 30, 30 * durationSecond],\n [minute, 1, durationMinute],\n [minute, 5, 5 * durationMinute],\n [minute, 15, 15 * durationMinute],\n [minute, 30, 30 * durationMinute],\n [ hour, 1, durationHour ],\n [ hour, 3, 3 * durationHour ],\n [ hour, 6, 6 * durationHour ],\n [ hour, 12, 12 * durationHour ],\n [ day, 1, durationDay ],\n [ day, 2, 2 * durationDay ],\n [ week, 1, durationWeek ],\n [ month, 1, durationMonth ],\n [ month, 3, 3 * durationMonth ],\n [ year, 1, durationYear ]\n ];\n\n function ticks(start, stop, count) {\n const reverse = stop < start;\n if (reverse) [start, stop] = [stop, start];\n const interval = count && typeof count.range === \"function\" ? count : tickInterval(start, stop, count);\n const ticks = interval ? interval.range(start, +stop + 1) : []; // inclusive stop\n return reverse ? ticks.reverse() : ticks;\n }\n\n function tickInterval(start, stop, count) {\n const target = Math.abs(stop - start) / count;\n const i = bisector(([,, step]) => step).right(tickIntervals, target);\n if (i === tickIntervals.length) return year.every(tickStep(start / durationYear, stop / durationYear, count));\n if (i === 0) return millisecond.every(Math.max(tickStep(start, stop, count), 1));\n const [t, step] = tickIntervals[target / tickIntervals[i - 1][2] < tickIntervals[i][2] / target ? i - 1 : i];\n return t.every(step);\n }\n\n return [ticks, tickInterval];\n}\n\nconst [utcTicks, utcTickInterval] = ticker(utcYear, utcMonth, utcSunday, unixDay, utcHour, utcMinute);\nconst [timeTicks, timeTickInterval] = ticker(timeYear, timeMonth, timeSunday, timeDay, timeHour, timeMinute);\n\nexport {utcTicks, utcTickInterval, timeTicks, timeTickInterval};\n","import {\n timeDay,\n timeSunday,\n timeMonday,\n timeThursday,\n timeYear,\n utcDay,\n utcSunday,\n utcMonday,\n utcThursday,\n utcYear\n} from \"d3-time\";\n\nfunction localDate(d) {\n if (0 <= d.y && d.y < 100) {\n var date = new Date(-1, d.m, d.d, d.H, d.M, d.S, d.L);\n date.setFullYear(d.y);\n return date;\n }\n return new Date(d.y, d.m, d.d, d.H, d.M, d.S, d.L);\n}\n\nfunction utcDate(d) {\n if (0 <= d.y && d.y < 100) {\n var date = new Date(Date.UTC(-1, d.m, d.d, d.H, d.M, d.S, d.L));\n date.setUTCFullYear(d.y);\n return date;\n }\n return new Date(Date.UTC(d.y, d.m, d.d, d.H, d.M, d.S, d.L));\n}\n\nfunction newDate(y, m, d) {\n return {y: y, m: m, d: d, H: 0, M: 0, S: 0, L: 0};\n}\n\nexport default function formatLocale(locale) {\n var locale_dateTime = locale.dateTime,\n locale_date = locale.date,\n locale_time = locale.time,\n locale_periods = locale.periods,\n locale_weekdays = locale.days,\n locale_shortWeekdays = locale.shortDays,\n locale_months = locale.months,\n locale_shortMonths = locale.shortMonths;\n\n var periodRe = formatRe(locale_periods),\n periodLookup = formatLookup(locale_periods),\n weekdayRe = formatRe(locale_weekdays),\n weekdayLookup = formatLookup(locale_weekdays),\n shortWeekdayRe = formatRe(locale_shortWeekdays),\n shortWeekdayLookup = formatLookup(locale_shortWeekdays),\n monthRe = formatRe(locale_months),\n monthLookup = formatLookup(locale_months),\n shortMonthRe = formatRe(locale_shortMonths),\n shortMonthLookup = formatLookup(locale_shortMonths);\n\n var formats = {\n \"a\": formatShortWeekday,\n \"A\": formatWeekday,\n \"b\": formatShortMonth,\n \"B\": formatMonth,\n \"c\": null,\n \"d\": formatDayOfMonth,\n \"e\": formatDayOfMonth,\n \"f\": formatMicroseconds,\n \"g\": formatYearISO,\n \"G\": formatFullYearISO,\n \"H\": formatHour24,\n \"I\": formatHour12,\n \"j\": formatDayOfYear,\n \"L\": formatMilliseconds,\n \"m\": formatMonthNumber,\n \"M\": formatMinutes,\n \"p\": formatPeriod,\n \"q\": formatQuarter,\n \"Q\": formatUnixTimestamp,\n \"s\": formatUnixTimestampSeconds,\n \"S\": formatSeconds,\n \"u\": formatWeekdayNumberMonday,\n \"U\": formatWeekNumberSunday,\n \"V\": formatWeekNumberISO,\n \"w\": formatWeekdayNumberSunday,\n \"W\": formatWeekNumberMonday,\n \"x\": null,\n \"X\": null,\n \"y\": formatYear,\n \"Y\": formatFullYear,\n \"Z\": formatZone,\n \"%\": formatLiteralPercent\n };\n\n var utcFormats = {\n \"a\": formatUTCShortWeekday,\n \"A\": formatUTCWeekday,\n \"b\": formatUTCShortMonth,\n \"B\": formatUTCMonth,\n \"c\": null,\n \"d\": formatUTCDayOfMonth,\n \"e\": formatUTCDayOfMonth,\n \"f\": formatUTCMicroseconds,\n \"g\": formatUTCYearISO,\n \"G\": formatUTCFullYearISO,\n \"H\": formatUTCHour24,\n \"I\": formatUTCHour12,\n \"j\": formatUTCDayOfYear,\n \"L\": formatUTCMilliseconds,\n \"m\": formatUTCMonthNumber,\n \"M\": formatUTCMinutes,\n \"p\": formatUTCPeriod,\n \"q\": formatUTCQuarter,\n \"Q\": formatUnixTimestamp,\n \"s\": formatUnixTimestampSeconds,\n \"S\": formatUTCSeconds,\n \"u\": formatUTCWeekdayNumberMonday,\n \"U\": formatUTCWeekNumberSunday,\n \"V\": formatUTCWeekNumberISO,\n \"w\": formatUTCWeekdayNumberSunday,\n \"W\": formatUTCWeekNumberMonday,\n \"x\": null,\n \"X\": null,\n \"y\": formatUTCYear,\n \"Y\": formatUTCFullYear,\n \"Z\": formatUTCZone,\n \"%\": formatLiteralPercent\n };\n\n var parses = {\n \"a\": parseShortWeekday,\n \"A\": parseWeekday,\n \"b\": parseShortMonth,\n \"B\": parseMonth,\n \"c\": parseLocaleDateTime,\n \"d\": parseDayOfMonth,\n \"e\": parseDayOfMonth,\n \"f\": parseMicroseconds,\n \"g\": parseYear,\n \"G\": parseFullYear,\n \"H\": parseHour24,\n \"I\": parseHour24,\n \"j\": parseDayOfYear,\n \"L\": parseMilliseconds,\n \"m\": parseMonthNumber,\n \"M\": parseMinutes,\n \"p\": parsePeriod,\n \"q\": parseQuarter,\n \"Q\": parseUnixTimestamp,\n \"s\": parseUnixTimestampSeconds,\n \"S\": parseSeconds,\n \"u\": parseWeekdayNumberMonday,\n \"U\": parseWeekNumberSunday,\n \"V\": parseWeekNumberISO,\n \"w\": parseWeekdayNumberSunday,\n \"W\": parseWeekNumberMonday,\n \"x\": parseLocaleDate,\n \"X\": parseLocaleTime,\n \"y\": parseYear,\n \"Y\": parseFullYear,\n \"Z\": parseZone,\n \"%\": parseLiteralPercent\n };\n\n // These recursive directive definitions must be deferred.\n formats.x = newFormat(locale_date, formats);\n formats.X = newFormat(locale_time, formats);\n formats.c = newFormat(locale_dateTime, formats);\n utcFormats.x = newFormat(locale_date, utcFormats);\n utcFormats.X = newFormat(locale_time, utcFormats);\n utcFormats.c = newFormat(locale_dateTime, utcFormats);\n\n function newFormat(specifier, formats) {\n return function(date) {\n var string = [],\n i = -1,\n j = 0,\n n = specifier.length,\n c,\n pad,\n format;\n\n if (!(date instanceof Date)) date = new Date(+date);\n\n while (++i < n) {\n if (specifier.charCodeAt(i) === 37) {\n string.push(specifier.slice(j, i));\n if ((pad = pads[c = specifier.charAt(++i)]) != null) c = specifier.charAt(++i);\n else pad = c === \"e\" ? \" \" : \"0\";\n if (format = formats[c]) c = format(date, pad);\n string.push(c);\n j = i + 1;\n }\n }\n\n string.push(specifier.slice(j, i));\n return string.join(\"\");\n };\n }\n\n function newParse(specifier, Z) {\n return function(string) {\n var d = newDate(1900, undefined, 1),\n i = parseSpecifier(d, specifier, string += \"\", 0),\n week, day;\n if (i != string.length) return null;\n\n // If a UNIX timestamp is specified, return it.\n if (\"Q\" in d) return new Date(d.Q);\n if (\"s\" in d) return new Date(d.s * 1000 + (\"L\" in d ? d.L : 0));\n\n // If this is utcParse, never use the local timezone.\n if (Z && !(\"Z\" in d)) d.Z = 0;\n\n // The am-pm flag is 0 for AM, and 1 for PM.\n if (\"p\" in d) d.H = d.H % 12 + d.p * 12;\n\n // If the month was not specified, inherit from the quarter.\n if (d.m === undefined) d.m = \"q\" in d ? d.q : 0;\n\n // Convert day-of-week and week-of-year to day-of-year.\n if (\"V\" in d) {\n if (d.V < 1 || d.V > 53) return null;\n if (!(\"w\" in d)) d.w = 1;\n if (\"Z\" in d) {\n week = utcDate(newDate(d.y, 0, 1)), day = week.getUTCDay();\n week = day > 4 || day === 0 ? utcMonday.ceil(week) : utcMonday(week);\n week = utcDay.offset(week, (d.V - 1) * 7);\n d.y = week.getUTCFullYear();\n d.m = week.getUTCMonth();\n d.d = week.getUTCDate() + (d.w + 6) % 7;\n } else {\n week = localDate(newDate(d.y, 0, 1)), day = week.getDay();\n week = day > 4 || day === 0 ? timeMonday.ceil(week) : timeMonday(week);\n week = timeDay.offset(week, (d.V - 1) * 7);\n d.y = week.getFullYear();\n d.m = week.getMonth();\n d.d = week.getDate() + (d.w + 6) % 7;\n }\n } else if (\"W\" in d || \"U\" in d) {\n if (!(\"w\" in d)) d.w = \"u\" in d ? d.u % 7 : \"W\" in d ? 1 : 0;\n day = \"Z\" in d ? utcDate(newDate(d.y, 0, 1)).getUTCDay() : localDate(newDate(d.y, 0, 1)).getDay();\n d.m = 0;\n d.d = \"W\" in d ? (d.w + 6) % 7 + d.W * 7 - (day + 5) % 7 : d.w + d.U * 7 - (day + 6) % 7;\n }\n\n // If a time zone is specified, all fields are interpreted as UTC and then\n // offset according to the specified time zone.\n if (\"Z\" in d) {\n d.H += d.Z / 100 | 0;\n d.M += d.Z % 100;\n return utcDate(d);\n }\n\n // Otherwise, all fields are in local time.\n return localDate(d);\n };\n }\n\n function parseSpecifier(d, specifier, string, j) {\n var i = 0,\n n = specifier.length,\n m = string.length,\n c,\n parse;\n\n while (i < n) {\n if (j >= m) return -1;\n c = specifier.charCodeAt(i++);\n if (c === 37) {\n c = specifier.charAt(i++);\n parse = parses[c in pads ? specifier.charAt(i++) : c];\n if (!parse || ((j = parse(d, string, j)) < 0)) return -1;\n } else if (c != string.charCodeAt(j++)) {\n return -1;\n }\n }\n\n return j;\n }\n\n function parsePeriod(d, string, i) {\n var n = periodRe.exec(string.slice(i));\n return n ? (d.p = periodLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;\n }\n\n function parseShortWeekday(d, string, i) {\n var n = shortWeekdayRe.exec(string.slice(i));\n return n ? (d.w = shortWeekdayLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;\n }\n\n function parseWeekday(d, string, i) {\n var n = weekdayRe.exec(string.slice(i));\n return n ? (d.w = weekdayLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;\n }\n\n function parseShortMonth(d, string, i) {\n var n = shortMonthRe.exec(string.slice(i));\n return n ? (d.m = shortMonthLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;\n }\n\n function parseMonth(d, string, i) {\n var n = monthRe.exec(string.slice(i));\n return n ? (d.m = monthLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;\n }\n\n function parseLocaleDateTime(d, string, i) {\n return parseSpecifier(d, locale_dateTime, string, i);\n }\n\n function parseLocaleDate(d, string, i) {\n return parseSpecifier(d, locale_date, string, i);\n }\n\n function parseLocaleTime(d, string, i) {\n return parseSpecifier(d, locale_time, string, i);\n }\n\n function formatShortWeekday(d) {\n return locale_shortWeekdays[d.getDay()];\n }\n\n function formatWeekday(d) {\n return locale_weekdays[d.getDay()];\n }\n\n function formatShortMonth(d) {\n return locale_shortMonths[d.getMonth()];\n }\n\n function formatMonth(d) {\n return locale_months[d.getMonth()];\n }\n\n function formatPeriod(d) {\n return locale_periods[+(d.getHours() >= 12)];\n }\n\n function formatQuarter(d) {\n return 1 + ~~(d.getMonth() / 3);\n }\n\n function formatUTCShortWeekday(d) {\n return locale_shortWeekdays[d.getUTCDay()];\n }\n\n function formatUTCWeekday(d) {\n return locale_weekdays[d.getUTCDay()];\n }\n\n function formatUTCShortMonth(d) {\n return locale_shortMonths[d.getUTCMonth()];\n }\n\n function formatUTCMonth(d) {\n return locale_months[d.getUTCMonth()];\n }\n\n function formatUTCPeriod(d) {\n return locale_periods[+(d.getUTCHours() >= 12)];\n }\n\n function formatUTCQuarter(d) {\n return 1 + ~~(d.getUTCMonth() / 3);\n }\n\n return {\n format: function(specifier) {\n var f = newFormat(specifier += \"\", formats);\n f.toString = function() { return specifier; };\n return f;\n },\n parse: function(specifier) {\n var p = newParse(specifier += \"\", false);\n p.toString = function() { return specifier; };\n return p;\n },\n utcFormat: function(specifier) {\n var f = newFormat(specifier += \"\", utcFormats);\n f.toString = function() { return specifier; };\n return f;\n },\n utcParse: function(specifier) {\n var p = newParse(specifier += \"\", true);\n p.toString = function() { return specifier; };\n return p;\n }\n };\n}\n\nvar pads = {\"-\": \"\", \"_\": \" \", \"0\": \"0\"},\n numberRe = /^\\s*\\d+/, // note: ignores next directive\n percentRe = /^%/,\n requoteRe = /[\\\\^$*+?|[\\]().{}]/g;\n\nfunction pad(value, fill, width) {\n var sign = value < 0 ? \"-\" : \"\",\n string = (sign ? -value : value) + \"\",\n length = string.length;\n return sign + (length < width ? new Array(width - length + 1).join(fill) + string : string);\n}\n\nfunction requote(s) {\n return s.replace(requoteRe, \"\\\\$&\");\n}\n\nfunction formatRe(names) {\n return new RegExp(\"^(?:\" + names.map(requote).join(\"|\") + \")\", \"i\");\n}\n\nfunction formatLookup(names) {\n return new Map(names.map((name, i) => [name.toLowerCase(), i]));\n}\n\nfunction parseWeekdayNumberSunday(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 1));\n return n ? (d.w = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseWeekdayNumberMonday(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 1));\n return n ? (d.u = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseWeekNumberSunday(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.U = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseWeekNumberISO(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.V = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseWeekNumberMonday(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.W = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseFullYear(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 4));\n return n ? (d.y = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseYear(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.y = +n[0] + (+n[0] > 68 ? 1900 : 2000), i + n[0].length) : -1;\n}\n\nfunction parseZone(d, string, i) {\n var n = /^(Z)|([+-]\\d\\d)(?::?(\\d\\d))?/.exec(string.slice(i, i + 6));\n return n ? (d.Z = n[1] ? 0 : -(n[2] + (n[3] || \"00\")), i + n[0].length) : -1;\n}\n\nfunction parseQuarter(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 1));\n return n ? (d.q = n[0] * 3 - 3, i + n[0].length) : -1;\n}\n\nfunction parseMonthNumber(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.m = n[0] - 1, i + n[0].length) : -1;\n}\n\nfunction parseDayOfMonth(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.d = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseDayOfYear(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 3));\n return n ? (d.m = 0, d.d = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseHour24(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.H = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseMinutes(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.M = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseSeconds(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.S = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseMilliseconds(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 3));\n return n ? (d.L = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseMicroseconds(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 6));\n return n ? (d.L = Math.floor(n[0] / 1000), i + n[0].length) : -1;\n}\n\nfunction parseLiteralPercent(d, string, i) {\n var n = percentRe.exec(string.slice(i, i + 1));\n return n ? i + n[0].length : -1;\n}\n\nfunction parseUnixTimestamp(d, string, i) {\n var n = numberRe.exec(string.slice(i));\n return n ? (d.Q = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseUnixTimestampSeconds(d, string, i) {\n var n = numberRe.exec(string.slice(i));\n return n ? (d.s = +n[0], i + n[0].length) : -1;\n}\n\nfunction formatDayOfMonth(d, p) {\n return pad(d.getDate(), p, 2);\n}\n\nfunction formatHour24(d, p) {\n return pad(d.getHours(), p, 2);\n}\n\nfunction formatHour12(d, p) {\n return pad(d.getHours() % 12 || 12, p, 2);\n}\n\nfunction formatDayOfYear(d, p) {\n return pad(1 + timeDay.count(timeYear(d), d), p, 3);\n}\n\nfunction formatMilliseconds(d, p) {\n return pad(d.getMilliseconds(), p, 3);\n}\n\nfunction formatMicroseconds(d, p) {\n return formatMilliseconds(d, p) + \"000\";\n}\n\nfunction formatMonthNumber(d, p) {\n return pad(d.getMonth() + 1, p, 2);\n}\n\nfunction formatMinutes(d, p) {\n return pad(d.getMinutes(), p, 2);\n}\n\nfunction formatSeconds(d, p) {\n return pad(d.getSeconds(), p, 2);\n}\n\nfunction formatWeekdayNumberMonday(d) {\n var day = d.getDay();\n return day === 0 ? 7 : day;\n}\n\nfunction formatWeekNumberSunday(d, p) {\n return pad(timeSunday.count(timeYear(d) - 1, d), p, 2);\n}\n\nfunction dISO(d) {\n var day = d.getDay();\n return (day >= 4 || day === 0) ? timeThursday(d) : timeThursday.ceil(d);\n}\n\nfunction formatWeekNumberISO(d, p) {\n d = dISO(d);\n return pad(timeThursday.count(timeYear(d), d) + (timeYear(d).getDay() === 4), p, 2);\n}\n\nfunction formatWeekdayNumberSunday(d) {\n return d.getDay();\n}\n\nfunction formatWeekNumberMonday(d, p) {\n return pad(timeMonday.count(timeYear(d) - 1, d), p, 2);\n}\n\nfunction formatYear(d, p) {\n return pad(d.getFullYear() % 100, p, 2);\n}\n\nfunction formatYearISO(d, p) {\n d = dISO(d);\n return pad(d.getFullYear() % 100, p, 2);\n}\n\nfunction formatFullYear(d, p) {\n return pad(d.getFullYear() % 10000, p, 4);\n}\n\nfunction formatFullYearISO(d, p) {\n var day = d.getDay();\n d = (day >= 4 || day === 0) ? timeThursday(d) : timeThursday.ceil(d);\n return pad(d.getFullYear() % 10000, p, 4);\n}\n\nfunction formatZone(d) {\n var z = d.getTimezoneOffset();\n return (z > 0 ? \"-\" : (z *= -1, \"+\"))\n + pad(z / 60 | 0, \"0\", 2)\n + pad(z % 60, \"0\", 2);\n}\n\nfunction formatUTCDayOfMonth(d, p) {\n return pad(d.getUTCDate(), p, 2);\n}\n\nfunction formatUTCHour24(d, p) {\n return pad(d.getUTCHours(), p, 2);\n}\n\nfunction formatUTCHour12(d, p) {\n return pad(d.getUTCHours() % 12 || 12, p, 2);\n}\n\nfunction formatUTCDayOfYear(d, p) {\n return pad(1 + utcDay.count(utcYear(d), d), p, 3);\n}\n\nfunction formatUTCMilliseconds(d, p) {\n return pad(d.getUTCMilliseconds(), p, 3);\n}\n\nfunction formatUTCMicroseconds(d, p) {\n return formatUTCMilliseconds(d, p) + \"000\";\n}\n\nfunction formatUTCMonthNumber(d, p) {\n return pad(d.getUTCMonth() + 1, p, 2);\n}\n\nfunction formatUTCMinutes(d, p) {\n return pad(d.getUTCMinutes(), p, 2);\n}\n\nfunction formatUTCSeconds(d, p) {\n return pad(d.getUTCSeconds(), p, 2);\n}\n\nfunction formatUTCWeekdayNumberMonday(d) {\n var dow = d.getUTCDay();\n return dow === 0 ? 7 : dow;\n}\n\nfunction formatUTCWeekNumberSunday(d, p) {\n return pad(utcSunday.count(utcYear(d) - 1, d), p, 2);\n}\n\nfunction UTCdISO(d) {\n var day = d.getUTCDay();\n return (day >= 4 || day === 0) ? utcThursday(d) : utcThursday.ceil(d);\n}\n\nfunction formatUTCWeekNumberISO(d, p) {\n d = UTCdISO(d);\n return pad(utcThursday.count(utcYear(d), d) + (utcYear(d).getUTCDay() === 4), p, 2);\n}\n\nfunction formatUTCWeekdayNumberSunday(d) {\n return d.getUTCDay();\n}\n\nfunction formatUTCWeekNumberMonday(d, p) {\n return pad(utcMonday.count(utcYear(d) - 1, d), p, 2);\n}\n\nfunction formatUTCYear(d, p) {\n return pad(d.getUTCFullYear() % 100, p, 2);\n}\n\nfunction formatUTCYearISO(d, p) {\n d = UTCdISO(d);\n return pad(d.getUTCFullYear() % 100, p, 2);\n}\n\nfunction formatUTCFullYear(d, p) {\n return pad(d.getUTCFullYear() % 10000, p, 4);\n}\n\nfunction formatUTCFullYearISO(d, p) {\n var day = d.getUTCDay();\n d = (day >= 4 || day === 0) ? utcThursday(d) : utcThursday.ceil(d);\n return pad(d.getUTCFullYear() % 10000, p, 4);\n}\n\nfunction formatUTCZone() {\n return \"+0000\";\n}\n\nfunction formatLiteralPercent() {\n return \"%\";\n}\n\nfunction formatUnixTimestamp(d) {\n return +d;\n}\n\nfunction formatUnixTimestampSeconds(d) {\n return Math.floor(+d / 1000);\n}\n","import formatLocale from \"./locale.js\";\n\nvar locale;\nexport var timeFormat;\nexport var timeParse;\nexport var utcFormat;\nexport var utcParse;\n\ndefaultLocale({\n dateTime: \"%x, %X\",\n date: \"%-m/%-d/%Y\",\n time: \"%-I:%M:%S %p\",\n periods: [\"AM\", \"PM\"],\n days: [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"],\n shortDays: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"],\n months: [\"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"],\n shortMonths: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"]\n});\n\nexport default function defaultLocale(definition) {\n locale = formatLocale(definition);\n timeFormat = locale.format;\n timeParse = locale.parse;\n utcFormat = locale.utcFormat;\n utcParse = locale.utcParse;\n return locale;\n}\n","import {timeYear, timeMonth, timeWeek, timeDay, timeHour, timeMinute, timeSecond, timeTicks, timeTickInterval} from \"d3-time\";\nimport {timeFormat} from \"d3-time-format\";\nimport continuous, {copy} from \"./continuous.js\";\nimport {initRange} from \"./init.js\";\nimport nice from \"./nice.js\";\n\nfunction date(t) {\n return new Date(t);\n}\n\nfunction number(t) {\n return t instanceof Date ? +t : +new Date(+t);\n}\n\nexport function calendar(ticks, tickInterval, year, month, week, day, hour, minute, second, format) {\n var scale = continuous(),\n invert = scale.invert,\n domain = scale.domain;\n\n var formatMillisecond = format(\".%L\"),\n formatSecond = format(\":%S\"),\n formatMinute = format(\"%I:%M\"),\n formatHour = format(\"%I %p\"),\n formatDay = format(\"%a %d\"),\n formatWeek = format(\"%b %d\"),\n formatMonth = format(\"%B\"),\n formatYear = format(\"%Y\");\n\n function tickFormat(date) {\n return (second(date) < date ? formatMillisecond\n : minute(date) < date ? formatSecond\n : hour(date) < date ? formatMinute\n : day(date) < date ? formatHour\n : month(date) < date ? (week(date) < date ? formatDay : formatWeek)\n : year(date) < date ? formatMonth\n : formatYear)(date);\n }\n\n scale.invert = function(y) {\n return new Date(invert(y));\n };\n\n scale.domain = function(_) {\n return arguments.length ? domain(Array.from(_, number)) : domain().map(date);\n };\n\n scale.ticks = function(interval) {\n var d = domain();\n return ticks(d[0], d[d.length - 1], interval == null ? 10 : interval);\n };\n\n scale.tickFormat = function(count, specifier) {\n return specifier == null ? tickFormat : format(specifier);\n };\n\n scale.nice = function(interval) {\n var d = domain();\n if (!interval || typeof interval.range !== \"function\") interval = tickInterval(d[0], d[d.length - 1], interval == null ? 10 : interval);\n return interval ? domain(nice(d, interval)) : scale;\n };\n\n scale.copy = function() {\n return copy(scale, calendar(ticks, tickInterval, year, month, week, day, hour, minute, second, format));\n };\n\n return scale;\n}\n\nexport default function time() {\n return initRange.apply(calendar(timeTicks, timeTickInterval, timeYear, timeMonth, timeWeek, timeDay, timeHour, timeMinute, timeSecond, timeFormat).domain([new Date(2000, 0, 1), new Date(2000, 0, 2)]), arguments);\n}\n","export default function(x) {\n return function constant() {\n return x;\n };\n}\n","export const abs = Math.abs;\nexport const atan2 = Math.atan2;\nexport const cos = Math.cos;\nexport const max = Math.max;\nexport const min = Math.min;\nexport const sin = Math.sin;\nexport const sqrt = Math.sqrt;\n\nexport const epsilon = 1e-12;\nexport const pi = Math.PI;\nexport const halfPi = pi / 2;\nexport const tau = 2 * pi;\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","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 var slice = Array.prototype.slice;\n\nexport 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","function Linear(context) {\n this._context = context;\n}\n\nLinear.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._point = 0;\n },\n lineEnd: function() {\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; // falls through\n default: this._context.lineTo(x, y); break;\n }\n }\n};\n\nexport default function(context) {\n return new Linear(context);\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","export default function() {}\n","export function point(that, x, y) {\n that._context.bezierCurveTo(\n (2 * that._x0 + that._x1) / 3,\n (2 * that._y0 + that._y1) / 3,\n (that._x0 + 2 * that._x1) / 3,\n (that._y0 + 2 * that._y1) / 3,\n (that._x0 + 4 * that._x1 + x) / 6,\n (that._y0 + 4 * that._y1 + y) / 6\n );\n}\n\nexport function Basis(context) {\n this._context = context;\n}\n\nBasis.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 =\n this._y0 = this._y1 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 3: point(this, this._x1, this._y1); // falls through\n case 2: this._context.lineTo(this._x1, this._y1); break;\n }\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; break;\n case 2: this._point = 3; this._context.lineTo((5 * this._x0 + this._x1) / 6, (5 * this._y0 + this._y1) / 6); // falls through\n default: point(this, x, y); break;\n }\n this._x0 = this._x1, this._x1 = x;\n this._y0 = this._y1, this._y1 = y;\n }\n};\n\nexport default function(context) {\n return new Basis(context);\n}\n","import noop from \"../noop.js\";\nimport {point} from \"./basis.js\";\n\nfunction BasisClosed(context) {\n this._context = context;\n}\n\nBasisClosed.prototype = {\n areaStart: noop,\n areaEnd: noop,\n lineStart: function() {\n this._x0 = this._x1 = this._x2 = this._x3 = this._x4 =\n this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 1: {\n this._context.moveTo(this._x2, this._y2);\n this._context.closePath();\n break;\n }\n case 2: {\n this._context.moveTo((this._x2 + 2 * this._x3) / 3, (this._y2 + 2 * this._y3) / 3);\n this._context.lineTo((this._x3 + 2 * this._x2) / 3, (this._y3 + 2 * this._y2) / 3);\n this._context.closePath();\n break;\n }\n case 3: {\n this.point(this._x2, this._y2);\n this.point(this._x3, this._y3);\n this.point(this._x4, this._y4);\n break;\n }\n }\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; this._x2 = x, this._y2 = y; break;\n case 1: this._point = 2; this._x3 = x, this._y3 = y; break;\n case 2: this._point = 3; this._x4 = x, this._y4 = y; this._context.moveTo((this._x0 + 4 * this._x1 + x) / 6, (this._y0 + 4 * this._y1 + y) / 6); break;\n default: point(this, x, y); break;\n }\n this._x0 = this._x1, this._x1 = x;\n this._y0 = this._y1, this._y1 = y;\n }\n};\n\nexport default function(context) {\n return new BasisClosed(context);\n}\n","import {point} from \"./basis.js\";\n\nfunction BasisOpen(context) {\n this._context = context;\n}\n\nBasisOpen.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 =\n this._y0 = this._y1 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n if (this._line || (this._line !== 0 && this._point === 3)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; break;\n case 1: this._point = 2; break;\n case 2: this._point = 3; var x0 = (this._x0 + 4 * this._x1 + x) / 6, y0 = (this._y0 + 4 * this._y1 + y) / 6; this._line ? this._context.lineTo(x0, y0) : this._context.moveTo(x0, y0); break;\n case 3: this._point = 4; // falls through\n default: point(this, x, y); break;\n }\n this._x0 = this._x1, this._x1 = x;\n this._y0 = this._y1, this._y1 = y;\n }\n};\n\nexport default function(context) {\n return new BasisOpen(context);\n}\n","import {Basis} from \"./basis.js\";\n\nfunction Bundle(context, beta) {\n this._basis = new Basis(context);\n this._beta = beta;\n}\n\nBundle.prototype = {\n lineStart: function() {\n this._x = [];\n this._y = [];\n this._basis.lineStart();\n },\n lineEnd: function() {\n var x = this._x,\n y = this._y,\n j = x.length - 1;\n\n if (j > 0) {\n var x0 = x[0],\n y0 = y[0],\n dx = x[j] - x0,\n dy = y[j] - y0,\n i = -1,\n t;\n\n while (++i <= j) {\n t = i / j;\n this._basis.point(\n this._beta * x[i] + (1 - this._beta) * (x0 + t * dx),\n this._beta * y[i] + (1 - this._beta) * (y0 + t * dy)\n );\n }\n }\n\n this._x = this._y = null;\n this._basis.lineEnd();\n },\n point: function(x, y) {\n this._x.push(+x);\n this._y.push(+y);\n }\n};\n\nexport default (function custom(beta) {\n\n function bundle(context) {\n return beta === 1 ? new Basis(context) : new Bundle(context, beta);\n }\n\n bundle.beta = function(beta) {\n return custom(+beta);\n };\n\n return bundle;\n})(0.85);\n","export function point(that, x, y) {\n that._context.bezierCurveTo(\n that._x1 + that._k * (that._x2 - that._x0),\n that._y1 + that._k * (that._y2 - that._y0),\n that._x2 + that._k * (that._x1 - x),\n that._y2 + that._k * (that._y1 - y),\n that._x2,\n that._y2\n );\n}\n\nexport function Cardinal(context, tension) {\n this._context = context;\n this._k = (1 - tension) / 6;\n}\n\nCardinal.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 = this._x2 =\n this._y0 = this._y1 = this._y2 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 2: this._context.lineTo(this._x2, this._y2); break;\n case 3: point(this, this._x1, this._y1); break;\n }\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; this._x1 = x, this._y1 = y; break;\n case 2: this._point = 3; // falls through\n default: point(this, x, y); break;\n }\n this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;\n this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;\n }\n};\n\nexport default (function custom(tension) {\n\n function cardinal(context) {\n return new Cardinal(context, tension);\n }\n\n cardinal.tension = function(tension) {\n return custom(+tension);\n };\n\n return cardinal;\n})(0);\n","import noop from \"../noop.js\";\nimport {point} from \"./cardinal.js\";\n\nexport function CardinalClosed(context, tension) {\n this._context = context;\n this._k = (1 - tension) / 6;\n}\n\nCardinalClosed.prototype = {\n areaStart: noop,\n areaEnd: noop,\n lineStart: function() {\n this._x0 = this._x1 = this._x2 = this._x3 = this._x4 = this._x5 =\n this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = this._y5 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 1: {\n this._context.moveTo(this._x3, this._y3);\n this._context.closePath();\n break;\n }\n case 2: {\n this._context.lineTo(this._x3, this._y3);\n this._context.closePath();\n break;\n }\n case 3: {\n this.point(this._x3, this._y3);\n this.point(this._x4, this._y4);\n this.point(this._x5, this._y5);\n break;\n }\n }\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; this._x3 = x, this._y3 = y; break;\n case 1: this._point = 2; this._context.moveTo(this._x4 = x, this._y4 = y); break;\n case 2: this._point = 3; this._x5 = x, this._y5 = y; break;\n default: point(this, x, y); break;\n }\n this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;\n this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;\n }\n};\n\nexport default (function custom(tension) {\n\n function cardinal(context) {\n return new CardinalClosed(context, tension);\n }\n\n cardinal.tension = function(tension) {\n return custom(+tension);\n };\n\n return cardinal;\n})(0);\n","import {point} from \"./cardinal.js\";\n\nexport function CardinalOpen(context, tension) {\n this._context = context;\n this._k = (1 - tension) / 6;\n}\n\nCardinalOpen.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 = this._x2 =\n this._y0 = this._y1 = this._y2 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n if (this._line || (this._line !== 0 && this._point === 3)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; break;\n case 1: this._point = 2; break;\n case 2: this._point = 3; this._line ? this._context.lineTo(this._x2, this._y2) : this._context.moveTo(this._x2, this._y2); break;\n case 3: this._point = 4; // falls through\n default: point(this, x, y); break;\n }\n this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;\n this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;\n }\n};\n\nexport default (function custom(tension) {\n\n function cardinal(context) {\n return new CardinalOpen(context, tension);\n }\n\n cardinal.tension = function(tension) {\n return custom(+tension);\n };\n\n return cardinal;\n})(0);\n","import {epsilon} from \"../math.js\";\nimport {Cardinal} from \"./cardinal.js\";\n\nexport function point(that, x, y) {\n var x1 = that._x1,\n y1 = that._y1,\n x2 = that._x2,\n y2 = that._y2;\n\n if (that._l01_a > epsilon) {\n var a = 2 * that._l01_2a + 3 * that._l01_a * that._l12_a + that._l12_2a,\n n = 3 * that._l01_a * (that._l01_a + that._l12_a);\n x1 = (x1 * a - that._x0 * that._l12_2a + that._x2 * that._l01_2a) / n;\n y1 = (y1 * a - that._y0 * that._l12_2a + that._y2 * that._l01_2a) / n;\n }\n\n if (that._l23_a > epsilon) {\n var b = 2 * that._l23_2a + 3 * that._l23_a * that._l12_a + that._l12_2a,\n m = 3 * that._l23_a * (that._l23_a + that._l12_a);\n x2 = (x2 * b + that._x1 * that._l23_2a - x * that._l12_2a) / m;\n y2 = (y2 * b + that._y1 * that._l23_2a - y * that._l12_2a) / m;\n }\n\n that._context.bezierCurveTo(x1, y1, x2, y2, that._x2, that._y2);\n}\n\nfunction CatmullRom(context, alpha) {\n this._context = context;\n this._alpha = alpha;\n}\n\nCatmullRom.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 = this._x2 =\n this._y0 = this._y1 = this._y2 = NaN;\n this._l01_a = this._l12_a = this._l23_a =\n this._l01_2a = this._l12_2a = this._l23_2a =\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 2: this._context.lineTo(this._x2, this._y2); break;\n case 3: this.point(this._x2, this._y2); break;\n }\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n\n if (this._point) {\n var x23 = this._x2 - x,\n y23 = this._y2 - y;\n this._l23_a = Math.sqrt(this._l23_2a = Math.pow(x23 * x23 + y23 * y23, this._alpha));\n }\n\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; break;\n case 2: this._point = 3; // falls through\n default: point(this, x, y); break;\n }\n\n this._l01_a = this._l12_a, this._l12_a = this._l23_a;\n this._l01_2a = this._l12_2a, this._l12_2a = this._l23_2a;\n this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;\n this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;\n }\n};\n\nexport default (function custom(alpha) {\n\n function catmullRom(context) {\n return alpha ? new CatmullRom(context, alpha) : new Cardinal(context, 0);\n }\n\n catmullRom.alpha = function(alpha) {\n return custom(+alpha);\n };\n\n return catmullRom;\n})(0.5);\n","import {CardinalClosed} from \"./cardinalClosed.js\";\nimport noop from \"../noop.js\";\nimport {point} from \"./catmullRom.js\";\n\nfunction CatmullRomClosed(context, alpha) {\n this._context = context;\n this._alpha = alpha;\n}\n\nCatmullRomClosed.prototype = {\n areaStart: noop,\n areaEnd: noop,\n lineStart: function() {\n this._x0 = this._x1 = this._x2 = this._x3 = this._x4 = this._x5 =\n this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = this._y5 = NaN;\n this._l01_a = this._l12_a = this._l23_a =\n this._l01_2a = this._l12_2a = this._l23_2a =\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 1: {\n this._context.moveTo(this._x3, this._y3);\n this._context.closePath();\n break;\n }\n case 2: {\n this._context.lineTo(this._x3, this._y3);\n this._context.closePath();\n break;\n }\n case 3: {\n this.point(this._x3, this._y3);\n this.point(this._x4, this._y4);\n this.point(this._x5, this._y5);\n break;\n }\n }\n },\n point: function(x, y) {\n x = +x, y = +y;\n\n if (this._point) {\n var x23 = this._x2 - x,\n y23 = this._y2 - y;\n this._l23_a = Math.sqrt(this._l23_2a = Math.pow(x23 * x23 + y23 * y23, this._alpha));\n }\n\n switch (this._point) {\n case 0: this._point = 1; this._x3 = x, this._y3 = y; break;\n case 1: this._point = 2; this._context.moveTo(this._x4 = x, this._y4 = y); break;\n case 2: this._point = 3; this._x5 = x, this._y5 = y; break;\n default: point(this, x, y); break;\n }\n\n this._l01_a = this._l12_a, this._l12_a = this._l23_a;\n this._l01_2a = this._l12_2a, this._l12_2a = this._l23_2a;\n this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;\n this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;\n }\n};\n\nexport default (function custom(alpha) {\n\n function catmullRom(context) {\n return alpha ? new CatmullRomClosed(context, alpha) : new CardinalClosed(context, 0);\n }\n\n catmullRom.alpha = function(alpha) {\n return custom(+alpha);\n };\n\n return catmullRom;\n})(0.5);\n","import {CardinalOpen} from \"./cardinalOpen.js\";\nimport {point} from \"./catmullRom.js\";\n\nfunction CatmullRomOpen(context, alpha) {\n this._context = context;\n this._alpha = alpha;\n}\n\nCatmullRomOpen.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 = this._x2 =\n this._y0 = this._y1 = this._y2 = NaN;\n this._l01_a = this._l12_a = this._l23_a =\n this._l01_2a = this._l12_2a = this._l23_2a =\n this._point = 0;\n },\n lineEnd: function() {\n if (this._line || (this._line !== 0 && this._point === 3)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n\n if (this._point) {\n var x23 = this._x2 - x,\n y23 = this._y2 - y;\n this._l23_a = Math.sqrt(this._l23_2a = Math.pow(x23 * x23 + y23 * y23, this._alpha));\n }\n\n switch (this._point) {\n case 0: this._point = 1; break;\n case 1: this._point = 2; break;\n case 2: this._point = 3; this._line ? this._context.lineTo(this._x2, this._y2) : this._context.moveTo(this._x2, this._y2); break;\n case 3: this._point = 4; // falls through\n default: point(this, x, y); break;\n }\n\n this._l01_a = this._l12_a, this._l12_a = this._l23_a;\n this._l01_2a = this._l12_2a, this._l12_2a = this._l23_2a;\n this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;\n this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;\n }\n};\n\nexport default (function custom(alpha) {\n\n function catmullRom(context) {\n return alpha ? new CatmullRomOpen(context, alpha) : new CardinalOpen(context, 0);\n }\n\n catmullRom.alpha = function(alpha) {\n return custom(+alpha);\n };\n\n return catmullRom;\n})(0.5);\n","import noop from \"../noop.js\";\n\nfunction LinearClosed(context) {\n this._context = context;\n}\n\nLinearClosed.prototype = {\n areaStart: noop,\n areaEnd: noop,\n lineStart: function() {\n this._point = 0;\n },\n lineEnd: function() {\n if (this._point) this._context.closePath();\n },\n point: function(x, y) {\n x = +x, y = +y;\n if (this._point) this._context.lineTo(x, y);\n else this._point = 1, this._context.moveTo(x, y);\n }\n};\n\nexport default function(context) {\n return new LinearClosed(context);\n}\n","function sign(x) {\n return x < 0 ? -1 : 1;\n}\n\n// Calculate the slopes of the tangents (Hermite-type interpolation) based on\n// the following paper: Steffen, M. 1990. A Simple Method for Monotonic\n// Interpolation in One Dimension. Astronomy and Astrophysics, Vol. 239, NO.\n// NOV(II), P. 443, 1990.\nfunction slope3(that, x2, y2) {\n var h0 = that._x1 - that._x0,\n h1 = x2 - that._x1,\n s0 = (that._y1 - that._y0) / (h0 || h1 < 0 && -0),\n s1 = (y2 - that._y1) / (h1 || h0 < 0 && -0),\n p = (s0 * h1 + s1 * h0) / (h0 + h1);\n return (sign(s0) + sign(s1)) * Math.min(Math.abs(s0), Math.abs(s1), 0.5 * Math.abs(p)) || 0;\n}\n\n// Calculate a one-sided slope.\nfunction slope2(that, t) {\n var h = that._x1 - that._x0;\n return h ? (3 * (that._y1 - that._y0) / h - t) / 2 : t;\n}\n\n// According to https://en.wikipedia.org/wiki/Cubic_Hermite_spline#Representations\n// \"you can express cubic Hermite interpolation in terms of cubic Bézier curves\n// with respect to the four values p0, p0 + m0 / 3, p1 - m1 / 3, p1\".\nfunction point(that, t0, t1) {\n var x0 = that._x0,\n y0 = that._y0,\n x1 = that._x1,\n y1 = that._y1,\n dx = (x1 - x0) / 3;\n that._context.bezierCurveTo(x0 + dx, y0 + dx * t0, x1 - dx, y1 - dx * t1, x1, y1);\n}\n\nfunction MonotoneX(context) {\n this._context = context;\n}\n\nMonotoneX.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 =\n this._y0 = this._y1 =\n this._t0 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 2: this._context.lineTo(this._x1, this._y1); break;\n case 3: point(this, this._t0, slope2(this, this._t0)); break;\n }\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n var t1 = NaN;\n\n x = +x, y = +y;\n if (x === this._x1 && y === this._y1) return; // Ignore coincident points.\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; break;\n case 2: this._point = 3; point(this, slope2(this, t1 = slope3(this, x, y)), t1); break;\n default: point(this, this._t0, t1 = slope3(this, x, y)); break;\n }\n\n this._x0 = this._x1, this._x1 = x;\n this._y0 = this._y1, this._y1 = y;\n this._t0 = t1;\n }\n}\n\nfunction MonotoneY(context) {\n this._context = new ReflectContext(context);\n}\n\n(MonotoneY.prototype = Object.create(MonotoneX.prototype)).point = function(x, y) {\n MonotoneX.prototype.point.call(this, y, x);\n};\n\nfunction ReflectContext(context) {\n this._context = context;\n}\n\nReflectContext.prototype = {\n moveTo: function(x, y) { this._context.moveTo(y, x); },\n closePath: function() { this._context.closePath(); },\n lineTo: function(x, y) { this._context.lineTo(y, x); },\n bezierCurveTo: function(x1, y1, x2, y2, x, y) { this._context.bezierCurveTo(y1, x1, y2, x2, y, x); }\n};\n\nexport function monotoneX(context) {\n return new MonotoneX(context);\n}\n\nexport function monotoneY(context) {\n return new MonotoneY(context);\n}\n","function Natural(context) {\n this._context = context;\n}\n\nNatural.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x = [];\n this._y = [];\n },\n lineEnd: function() {\n var x = this._x,\n y = this._y,\n n = x.length;\n\n if (n) {\n this._line ? this._context.lineTo(x[0], y[0]) : this._context.moveTo(x[0], y[0]);\n if (n === 2) {\n this._context.lineTo(x[1], y[1]);\n } else {\n var px = controlPoints(x),\n py = controlPoints(y);\n for (var i0 = 0, i1 = 1; i1 < n; ++i0, ++i1) {\n this._context.bezierCurveTo(px[0][i0], py[0][i0], px[1][i0], py[1][i0], x[i1], y[i1]);\n }\n }\n }\n\n if (this._line || (this._line !== 0 && n === 1)) this._context.closePath();\n this._line = 1 - this._line;\n this._x = this._y = null;\n },\n point: function(x, y) {\n this._x.push(+x);\n this._y.push(+y);\n }\n};\n\n// See https://www.particleincell.com/2012/bezier-splines/ for derivation.\nfunction controlPoints(x) {\n var i,\n n = x.length - 1,\n m,\n a = new Array(n),\n b = new Array(n),\n r = new Array(n);\n a[0] = 0, b[0] = 2, r[0] = x[0] + 2 * x[1];\n for (i = 1; i < n - 1; ++i) a[i] = 1, b[i] = 4, r[i] = 4 * x[i] + 2 * x[i + 1];\n a[n - 1] = 2, b[n - 1] = 7, r[n - 1] = 8 * x[n - 1] + x[n];\n for (i = 1; i < n; ++i) m = a[i] / b[i - 1], b[i] -= m, r[i] -= m * r[i - 1];\n a[n - 1] = r[n - 1] / b[n - 1];\n for (i = n - 2; i >= 0; --i) a[i] = (r[i] - a[i + 1]) / b[i];\n b[n - 1] = (x[n] + a[n - 1]) / 2;\n for (i = 0; i < n - 1; ++i) b[i] = 2 * x[i + 1] - a[i + 1];\n return [a, b];\n}\n\nexport default function(context) {\n return new Natural(context);\n}\n","function Step(context, t) {\n this._context = context;\n this._t = t;\n}\n\nStep.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x = this._y = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n if (0 < this._t && this._t < 1 && this._point === 2) this._context.lineTo(this._x, this._y);\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n if (this._line >= 0) this._t = 1 - this._t, this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; // falls through\n default: {\n if (this._t <= 0) {\n this._context.lineTo(this._x, y);\n this._context.lineTo(x, y);\n } else {\n var x1 = this._x * (1 - this._t) + x * this._t;\n this._context.lineTo(x1, this._y);\n this._context.lineTo(x1, y);\n }\n break;\n }\n }\n this._x = x, this._y = y;\n }\n};\n\nexport default function(context) {\n return new Step(context, 0.5);\n}\n\nexport function stepBefore(context) {\n return new Step(context, 0);\n}\n\nexport function stepAfter(context) {\n return new Step(context, 1);\n}\n","export default function(series, order) {\n if (!((n = series.length) > 1)) return;\n for (var i = 1, j, s0, s1 = series[order[0]], n, m = s1.length; i < n; ++i) {\n s0 = s1, s1 = series[order[i]];\n for (j = 0; j < m; ++j) {\n s1[j][1] += s1[j][0] = isNaN(s0[j][1]) ? s0[j][0] : s0[j][1];\n }\n }\n}\n","export default function(series) {\n var n = series.length, o = new Array(n);\n while (--n >= 0) o[n] = n;\n return o;\n}\n","import array from \"./array.js\";\nimport constant from \"./constant.js\";\nimport offsetNone from \"./offset/none.js\";\nimport orderNone from \"./order/none.js\";\n\nfunction stackValue(d, key) {\n return d[key];\n}\n\nfunction stackSeries(key) {\n const series = [];\n series.key = key;\n return series;\n}\n\nexport default function() {\n var keys = constant([]),\n order = orderNone,\n offset = offsetNone,\n value = stackValue;\n\n function stack(data) {\n var sz = Array.from(keys.apply(this, arguments), stackSeries),\n i, n = sz.length, j = -1,\n oz;\n\n for (const d of data) {\n for (i = 0, ++j; i < n; ++i) {\n (sz[i][j] = [0, +value(d, sz[i].key, j, data)]).data = d;\n }\n }\n\n for (i = 0, oz = array(order(sz)); i < n; ++i) {\n sz[oz[i]].index = i;\n }\n\n offset(sz, oz);\n return sz;\n }\n\n stack.keys = function(_) {\n return arguments.length ? (keys = typeof _ === \"function\" ? _ : constant(Array.from(_)), stack) : keys;\n };\n\n stack.value = function(_) {\n return arguments.length ? (value = typeof _ === \"function\" ? _ : constant(+_), stack) : value;\n };\n\n stack.order = function(_) {\n return arguments.length ? (order = _ == null ? orderNone : typeof _ === \"function\" ? _ : constant(Array.from(_)), stack) : order;\n };\n\n stack.offset = function(_) {\n return arguments.length ? (offset = _ == null ? offsetNone : _, stack) : offset;\n };\n\n return stack;\n}\n","export default function(series, order) {\n if (!((n = series.length) > 0)) return;\n for (var i, j = 0, d, dy, yp, yn, n, m = series[order[0]].length; j < m; ++j) {\n for (yp = yn = 0, i = 0; i < n; ++i) {\n if ((dy = (d = series[order[i]][j])[1] - d[0]) > 0) {\n d[0] = yp, d[1] = yp += dy;\n } else if (dy < 0) {\n d[1] = yn, d[0] = yn += dy;\n } else {\n d[0] = 0, d[1] = dy;\n }\n }\n }\n}\n","export function Transform(k, x, y) {\n this.k = k;\n this.x = x;\n this.y = y;\n}\n\nTransform.prototype = {\n constructor: Transform,\n scale: function(k) {\n return k === 1 ? this : new Transform(this.k * k, this.x, this.y);\n },\n translate: function(x, y) {\n return x === 0 & y === 0 ? this : new Transform(this.k, this.x + this.k * x, this.y + this.k * y);\n },\n apply: function(point) {\n return [point[0] * this.k + this.x, point[1] * this.k + this.y];\n },\n applyX: function(x) {\n return x * this.k + this.x;\n },\n applyY: function(y) {\n return y * this.k + this.y;\n },\n invert: function(location) {\n return [(location[0] - this.x) / this.k, (location[1] - this.y) / this.k];\n },\n invertX: function(x) {\n return (x - this.x) / this.k;\n },\n invertY: function(y) {\n return (y - this.y) / this.k;\n },\n rescaleX: function(x) {\n return x.copy().domain(x.range().map(this.invertX, this).map(x.invert, x));\n },\n rescaleY: function(y) {\n return y.copy().domain(y.range().map(this.invertY, this).map(y.invert, y));\n },\n toString: function() {\n return \"translate(\" + this.x + \",\" + this.y + \") scale(\" + this.k + \")\";\n }\n};\n\nexport var identity = new Transform(1, 0, 0);\n\ntransform.prototype = Transform.prototype;\n\nexport default function transform(node) {\n while (!node.__zoom) if (!(node = node.parentNode)) return identity;\n return node.__zoom;\n}\n","/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\nexport default freeGlobal;\n","import freeGlobal from './_freeGlobal.js';\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\nexport default root;\n","import root from './_root.js';\n\n/** Built-in value references. */\nvar Symbol = root.Symbol;\n\nexport default Symbol;\n","import Symbol from './_Symbol.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n}\n\nexport default getRawTag;\n","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n return nativeObjectToString.call(value);\n}\n\nexport default objectToString;\n","import Symbol from './_Symbol.js';\nimport getRawTag from './_getRawTag.js';\nimport objectToString from './_objectToString.js';\n\n/** `Object#toString` result references. */\nvar nullTag = '[object Null]',\n undefinedTag = '[object Undefined]';\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n}\n\nexport default baseGetTag;\n","/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return value != null && typeof value == 'object';\n}\n\nexport default isObjectLike;\n","import baseGetTag from './_baseGetTag.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** `Object#toString` result references. */\nvar symbolTag = '[object Symbol]';\n\n/**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\nfunction isSymbol(value) {\n return typeof value == 'symbol' ||\n (isObjectLike(value) && baseGetTag(value) == symbolTag);\n}\n\nexport default isSymbol;\n","/**\n * A specialized version of `_.map` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n */\nfunction arrayMap(array, iteratee) {\n var index = -1,\n length = array == null ? 0 : array.length,\n result = Array(length);\n\n while (++index < length) {\n result[index] = iteratee(array[index], index, array);\n }\n return result;\n}\n\nexport default arrayMap;\n","/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\nexport default isArray;\n","import Symbol from './_Symbol.js';\nimport arrayMap from './_arrayMap.js';\nimport isArray from './isArray.js';\nimport isSymbol from './isSymbol.js';\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0;\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolToString = symbolProto ? symbolProto.toString : undefined;\n\n/**\n * The base implementation of `_.toString` which doesn't convert nullish\n * values to empty strings.\n *\n * @private\n * @param {*} value The value to process.\n * @returns {string} Returns the string.\n */\nfunction baseToString(value) {\n // Exit early for strings to avoid a performance hit in some environments.\n if (typeof value == 'string') {\n return value;\n }\n if (isArray(value)) {\n // Recursively convert values (susceptible to call stack limits).\n return arrayMap(value, baseToString) + '';\n }\n if (isSymbol(value)) {\n return symbolToString ? symbolToString.call(value) : '';\n }\n var result = (value + '');\n return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n}\n\nexport default baseToString;\n","/** Used to match a single whitespace character. */\nvar reWhitespace = /\\s/;\n\n/**\n * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace\n * character of `string`.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {number} Returns the index of the last non-whitespace character.\n */\nfunction trimmedEndIndex(string) {\n var index = string.length;\n\n while (index-- && reWhitespace.test(string.charAt(index))) {}\n return index;\n}\n\nexport default trimmedEndIndex;\n","import trimmedEndIndex from './_trimmedEndIndex.js';\n\n/** Used to match leading whitespace. */\nvar reTrimStart = /^\\s+/;\n\n/**\n * The base implementation of `_.trim`.\n *\n * @private\n * @param {string} string The string to trim.\n * @returns {string} Returns the trimmed string.\n */\nfunction baseTrim(string) {\n return string\n ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')\n : string;\n}\n\nexport default baseTrim;\n","/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return value != null && (type == 'object' || type == 'function');\n}\n\nexport default isObject;\n","import baseTrim from './_baseTrim.js';\nimport isObject from './isObject.js';\nimport isSymbol from './isSymbol.js';\n\n/** Used as references for various `Number` constants. */\nvar NAN = 0 / 0;\n\n/** Used to detect bad signed hexadecimal string values. */\nvar reIsBadHex = /^[-+]0x[0-9a-f]+$/i;\n\n/** Used to detect binary string values. */\nvar reIsBinary = /^0b[01]+$/i;\n\n/** Used to detect octal string values. */\nvar reIsOctal = /^0o[0-7]+$/i;\n\n/** Built-in method references without a dependency on `root`. */\nvar freeParseInt = parseInt;\n\n/**\n * Converts `value` to a number.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to process.\n * @returns {number} Returns the number.\n * @example\n *\n * _.toNumber(3.2);\n * // => 3.2\n *\n * _.toNumber(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toNumber(Infinity);\n * // => Infinity\n *\n * _.toNumber('3.2');\n * // => 3.2\n */\nfunction toNumber(value) {\n if (typeof value == 'number') {\n return value;\n }\n if (isSymbol(value)) {\n return NAN;\n }\n if (isObject(value)) {\n var other = typeof value.valueOf == 'function' ? value.valueOf() : value;\n value = isObject(other) ? (other + '') : other;\n }\n if (typeof value != 'string') {\n return value === 0 ? value : +value;\n }\n value = baseTrim(value);\n var isBinary = reIsBinary.test(value);\n return (isBinary || reIsOctal.test(value))\n ? freeParseInt(value.slice(2), isBinary ? 2 : 8)\n : (reIsBadHex.test(value) ? NAN : +value);\n}\n\nexport default toNumber;\n","/**\n * This method returns the first argument it receives.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Util\n * @param {*} value Any value.\n * @returns {*} Returns `value`.\n * @example\n *\n * var object = { 'a': 1 };\n *\n * console.log(_.identity(object) === object);\n * // => true\n */\nfunction identity(value) {\n return value;\n}\n\nexport default identity;\n","import baseGetTag from './_baseGetTag.js';\nimport isObject from './isObject.js';\n\n/** `Object#toString` result references. */\nvar asyncTag = '[object AsyncFunction]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n proxyTag = '[object Proxy]';\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n if (!isObject(value)) {\n return false;\n }\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 9 which returns 'object' for typed arrays and other constructors.\n var tag = baseGetTag(value);\n return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;\n}\n\nexport default isFunction;\n","import root from './_root.js';\n\n/** Used to detect overreaching core-js shims. */\nvar coreJsData = root['__core-js_shared__'];\n\nexport default coreJsData;\n","import coreJsData from './_coreJsData.js';\n\n/** Used to detect methods masquerading as native. */\nvar maskSrcKey = (function() {\n var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n return uid ? ('Symbol(src)_1.' + uid) : '';\n}());\n\n/**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\nfunction isMasked(func) {\n return !!maskSrcKey && (maskSrcKey in func);\n}\n\nexport default isMasked;\n","/** Used for built-in method references. */\nvar funcProto = Function.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to convert.\n * @returns {string} Returns the source code.\n */\nfunction toSource(func) {\n if (func != null) {\n try {\n return funcToString.call(func);\n } catch (e) {}\n try {\n return (func + '');\n } catch (e) {}\n }\n return '';\n}\n\nexport default toSource;\n","import isFunction from './isFunction.js';\nimport isMasked from './_isMasked.js';\nimport isObject from './isObject.js';\nimport toSource from './_toSource.js';\n\n/**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\nvar reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n\n/** Used to detect host constructors (Safari). */\nvar reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n/** Used for built-in method references. */\nvar funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Used to detect if a method is native. */\nvar reIsNative = RegExp('^' +\n funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n);\n\n/**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n */\nfunction baseIsNative(value) {\n if (!isObject(value) || isMasked(value)) {\n return false;\n }\n var pattern = isFunction(value) ? reIsNative : reIsHostCtor;\n return pattern.test(toSource(value));\n}\n\nexport default baseIsNative;\n","/**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction getValue(object, key) {\n return object == null ? undefined : object[key];\n}\n\nexport default getValue;\n","import baseIsNative from './_baseIsNative.js';\nimport getValue from './_getValue.js';\n\n/**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\nfunction getNative(object, key) {\n var value = getValue(object, key);\n return baseIsNative(value) ? value : undefined;\n}\n\nexport default getNative;\n","import getNative from './_getNative.js';\nimport root from './_root.js';\n\n/* Built-in method references that are verified to be native. */\nvar WeakMap = getNative(root, 'WeakMap');\n\nexport default WeakMap;\n","import isObject from './isObject.js';\n\n/** Built-in value references. */\nvar objectCreate = Object.create;\n\n/**\n * The base implementation of `_.create` without support for assigning\n * properties to the created object.\n *\n * @private\n * @param {Object} proto The object to inherit from.\n * @returns {Object} Returns the new object.\n */\nvar baseCreate = (function() {\n function object() {}\n return function(proto) {\n if (!isObject(proto)) {\n return {};\n }\n if (objectCreate) {\n return objectCreate(proto);\n }\n object.prototype = proto;\n var result = new object;\n object.prototype = undefined;\n return result;\n };\n}());\n\nexport default baseCreate;\n","/**\n * A faster alternative to `Function#apply`, this function invokes `func`\n * with the `this` binding of `thisArg` and the arguments of `args`.\n *\n * @private\n * @param {Function} func The function to invoke.\n * @param {*} thisArg The `this` binding of `func`.\n * @param {Array} args The arguments to invoke `func` with.\n * @returns {*} Returns the result of `func`.\n */\nfunction apply(func, thisArg, args) {\n switch (args.length) {\n case 0: return func.call(thisArg);\n case 1: return func.call(thisArg, args[0]);\n case 2: return func.call(thisArg, args[0], args[1]);\n case 3: return func.call(thisArg, args[0], args[1], args[2]);\n }\n return func.apply(thisArg, args);\n}\n\nexport default apply;\n","/**\n * This method returns `undefined`.\n *\n * @static\n * @memberOf _\n * @since 2.3.0\n * @category Util\n * @example\n *\n * _.times(2, _.noop);\n * // => [undefined, undefined]\n */\nfunction noop() {\n // No operation performed.\n}\n\nexport default noop;\n","/**\n * Copies the values of `source` to `array`.\n *\n * @private\n * @param {Array} source The array to copy values from.\n * @param {Array} [array=[]] The array to copy values to.\n * @returns {Array} Returns `array`.\n */\nfunction copyArray(source, array) {\n var index = -1,\n length = source.length;\n\n array || (array = Array(length));\n while (++index < length) {\n array[index] = source[index];\n }\n return array;\n}\n\nexport default copyArray;\n","/** Used to detect hot functions by number of calls within a span of milliseconds. */\nvar HOT_COUNT = 800,\n HOT_SPAN = 16;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeNow = Date.now;\n\n/**\n * Creates a function that'll short out and invoke `identity` instead\n * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`\n * milliseconds.\n *\n * @private\n * @param {Function} func The function to restrict.\n * @returns {Function} Returns the new shortable function.\n */\nfunction shortOut(func) {\n var count = 0,\n lastCalled = 0;\n\n return function() {\n var stamp = nativeNow(),\n remaining = HOT_SPAN - (stamp - lastCalled);\n\n lastCalled = stamp;\n if (remaining > 0) {\n if (++count >= HOT_COUNT) {\n return arguments[0];\n }\n } else {\n count = 0;\n }\n return func.apply(undefined, arguments);\n };\n}\n\nexport default shortOut;\n","/**\n * Creates a function that returns `value`.\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Util\n * @param {*} value The value to return from the new function.\n * @returns {Function} Returns the new constant function.\n * @example\n *\n * var objects = _.times(2, _.constant({ 'a': 1 }));\n *\n * console.log(objects);\n * // => [{ 'a': 1 }, { 'a': 1 }]\n *\n * console.log(objects[0] === objects[1]);\n * // => true\n */\nfunction constant(value) {\n return function() {\n return value;\n };\n}\n\nexport default constant;\n","import getNative from './_getNative.js';\n\nvar defineProperty = (function() {\n try {\n var func = getNative(Object, 'defineProperty');\n func({}, '', {});\n return func;\n } catch (e) {}\n}());\n\nexport default defineProperty;\n","import constant from './constant.js';\nimport defineProperty from './_defineProperty.js';\nimport identity from './identity.js';\n\n/**\n * The base implementation of `setToString` without support for hot loop shorting.\n *\n * @private\n * @param {Function} func The function to modify.\n * @param {Function} string The `toString` result.\n * @returns {Function} Returns `func`.\n */\nvar baseSetToString = !defineProperty ? identity : function(func, string) {\n return defineProperty(func, 'toString', {\n 'configurable': true,\n 'enumerable': false,\n 'value': constant(string),\n 'writable': true\n });\n};\n\nexport default baseSetToString;\n","import baseSetToString from './_baseSetToString.js';\nimport shortOut from './_shortOut.js';\n\n/**\n * Sets the `toString` method of `func` to return `string`.\n *\n * @private\n * @param {Function} func The function to modify.\n * @param {Function} string The `toString` result.\n * @returns {Function} Returns `func`.\n */\nvar setToString = shortOut(baseSetToString);\n\nexport default setToString;\n","/**\n * A specialized version of `_.forEach` 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 * @returns {Array} Returns `array`.\n */\nfunction arrayEach(array, iteratee) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (iteratee(array[index], index, array) === false) {\n break;\n }\n }\n return array;\n}\n\nexport default arrayEach;\n","/**\n * The base implementation of `_.findIndex` and `_.findLastIndex` without\n * support for iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Function} predicate The function invoked per iteration.\n * @param {number} fromIndex The index to search from.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction baseFindIndex(array, predicate, fromIndex, fromRight) {\n var length = array.length,\n index = fromIndex + (fromRight ? 1 : -1);\n\n while ((fromRight ? index-- : ++index < length)) {\n if (predicate(array[index], index, array)) {\n return index;\n }\n }\n return -1;\n}\n\nexport default baseFindIndex;\n","/**\n * The base implementation of `_.isNaN` without support for number objects.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.\n */\nfunction baseIsNaN(value) {\n return value !== value;\n}\n\nexport default baseIsNaN;\n","/**\n * A specialized version of `_.indexOf` which performs strict equality\n * comparisons of values, i.e. `===`.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction strictIndexOf(array, value, fromIndex) {\n var index = fromIndex - 1,\n length = array.length;\n\n while (++index < length) {\n if (array[index] === value) {\n return index;\n }\n }\n return -1;\n}\n\nexport default strictIndexOf;\n","import baseFindIndex from './_baseFindIndex.js';\nimport baseIsNaN from './_baseIsNaN.js';\nimport strictIndexOf from './_strictIndexOf.js';\n\n/**\n * The base implementation of `_.indexOf` without `fromIndex` bounds checks.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction baseIndexOf(array, value, fromIndex) {\n return value === value\n ? strictIndexOf(array, value, fromIndex)\n : baseFindIndex(array, baseIsNaN, fromIndex);\n}\n\nexport default baseIndexOf;\n","import baseIndexOf from './_baseIndexOf.js';\n\n/**\n * A specialized version of `_.includes` for arrays without support for\n * specifying an index to search from.\n *\n * @private\n * @param {Array} [array] The array to inspect.\n * @param {*} target The value to search for.\n * @returns {boolean} Returns `true` if `target` is found, else `false`.\n */\nfunction arrayIncludes(array, value) {\n var length = array == null ? 0 : array.length;\n return !!length && baseIndexOf(array, value, 0) > -1;\n}\n\nexport default arrayIncludes;\n","/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/** Used to detect unsigned integer values. */\nvar reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n/**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\nfunction isIndex(value, length) {\n var type = typeof value;\n length = length == null ? MAX_SAFE_INTEGER : length;\n\n return !!length &&\n (type == 'number' ||\n (type != 'symbol' && reIsUint.test(value))) &&\n (value > -1 && value % 1 == 0 && value < length);\n}\n\nexport default isIndex;\n","import defineProperty from './_defineProperty.js';\n\n/**\n * The base implementation of `assignValue` and `assignMergeValue` without\n * value checks.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction baseAssignValue(object, key, value) {\n if (key == '__proto__' && defineProperty) {\n defineProperty(object, key, {\n 'configurable': true,\n 'enumerable': true,\n 'value': value,\n 'writable': true\n });\n } else {\n object[key] = value;\n }\n}\n\nexport default baseAssignValue;\n","/**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.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 * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\nfunction eq(value, other) {\n return value === other || (value !== value && other !== other);\n}\n\nexport default eq;\n","import baseAssignValue from './_baseAssignValue.js';\nimport eq from './eq.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Assigns `value` to `key` of `object` if the existing value is not equivalent\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction assignValue(object, key, value) {\n var objValue = object[key];\n if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||\n (value === undefined && !(key in object))) {\n baseAssignValue(object, key, value);\n }\n}\n\nexport default assignValue;\n","import assignValue from './_assignValue.js';\nimport baseAssignValue from './_baseAssignValue.js';\n\n/**\n * Copies properties of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy properties from.\n * @param {Array} props The property identifiers to copy.\n * @param {Object} [object={}] The object to copy properties to.\n * @param {Function} [customizer] The function to customize copied values.\n * @returns {Object} Returns `object`.\n */\nfunction copyObject(source, props, object, customizer) {\n var isNew = !object;\n object || (object = {});\n\n var index = -1,\n length = props.length;\n\n while (++index < length) {\n var key = props[index];\n\n var newValue = customizer\n ? customizer(object[key], source[key], key, object, source)\n : undefined;\n\n if (newValue === undefined) {\n newValue = source[key];\n }\n if (isNew) {\n baseAssignValue(object, key, newValue);\n } else {\n assignValue(object, key, newValue);\n }\n }\n return object;\n}\n\nexport default copyObject;\n","import apply from './_apply.js';\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max;\n\n/**\n * A specialized version of `baseRest` which transforms the rest array.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @param {Function} transform The rest array transform.\n * @returns {Function} Returns the new function.\n */\nfunction overRest(func, start, transform) {\n start = nativeMax(start === undefined ? (func.length - 1) : start, 0);\n return function() {\n var args = arguments,\n index = -1,\n length = nativeMax(args.length - start, 0),\n array = Array(length);\n\n while (++index < length) {\n array[index] = args[start + index];\n }\n index = -1;\n var otherArgs = Array(start + 1);\n while (++index < start) {\n otherArgs[index] = args[index];\n }\n otherArgs[start] = transform(array);\n return apply(func, this, otherArgs);\n };\n}\n\nexport default overRest;\n","import identity from './identity.js';\nimport overRest from './_overRest.js';\nimport setToString from './_setToString.js';\n\n/**\n * The base implementation of `_.rest` which doesn't validate or coerce arguments.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @returns {Function} Returns the new function.\n */\nfunction baseRest(func, start) {\n return setToString(overRest(func, start, identity), func + '');\n}\n\nexport default baseRest;\n","/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\nfunction isLength(value) {\n return typeof value == 'number' &&\n value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\nexport default isLength;\n","import isFunction from './isFunction.js';\nimport isLength from './isLength.js';\n\n/**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\nfunction isArrayLike(value) {\n return value != null && isLength(value.length) && !isFunction(value);\n}\n\nexport default isArrayLike;\n","import eq from './eq.js';\nimport isArrayLike from './isArrayLike.js';\nimport isIndex from './_isIndex.js';\nimport isObject from './isObject.js';\n\n/**\n * Checks if the given arguments are from an iteratee call.\n *\n * @private\n * @param {*} value The potential iteratee value argument.\n * @param {*} index The potential iteratee index or key argument.\n * @param {*} object The potential iteratee object argument.\n * @returns {boolean} Returns `true` if the arguments are from an iteratee call,\n * else `false`.\n */\nfunction isIterateeCall(value, index, object) {\n if (!isObject(object)) {\n return false;\n }\n var type = typeof index;\n if (type == 'number'\n ? (isArrayLike(object) && isIndex(index, object.length))\n : (type == 'string' && index in object)\n ) {\n return eq(object[index], value);\n }\n return false;\n}\n\nexport default isIterateeCall;\n","import baseRest from './_baseRest.js';\nimport isIterateeCall from './_isIterateeCall.js';\n\n/**\n * Creates a function like `_.assign`.\n *\n * @private\n * @param {Function} assigner The function to assign values.\n * @returns {Function} Returns the new assigner function.\n */\nfunction createAssigner(assigner) {\n return baseRest(function(object, sources) {\n var index = -1,\n length = sources.length,\n customizer = length > 1 ? sources[length - 1] : undefined,\n guard = length > 2 ? sources[2] : undefined;\n\n customizer = (assigner.length > 3 && typeof customizer == 'function')\n ? (length--, customizer)\n : undefined;\n\n if (guard && isIterateeCall(sources[0], sources[1], guard)) {\n customizer = length < 3 ? undefined : customizer;\n length = 1;\n }\n object = Object(object);\n while (++index < length) {\n var source = sources[index];\n if (source) {\n assigner(object, source, index, customizer);\n }\n }\n return object;\n });\n}\n\nexport default createAssigner;\n","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\nfunction isPrototype(value) {\n var Ctor = value && value.constructor,\n proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n return value === proto;\n}\n\nexport default isPrototype;\n","/**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\nfunction baseTimes(n, iteratee) {\n var index = -1,\n result = Array(n);\n\n while (++index < n) {\n result[index] = iteratee(index);\n }\n return result;\n}\n\nexport default baseTimes;\n","import baseGetTag from './_baseGetTag.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]';\n\n/**\n * The base implementation of `_.isArguments`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n */\nfunction baseIsArguments(value) {\n return isObjectLike(value) && baseGetTag(value) == argsTag;\n}\n\nexport default baseIsArguments;\n","import baseIsArguments from './_baseIsArguments.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Built-in value references. */\nvar propertyIsEnumerable = objectProto.propertyIsEnumerable;\n\n/**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n * else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nvar isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {\n return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&\n !propertyIsEnumerable.call(value, 'callee');\n};\n\nexport default isArguments;\n","/**\n * This method returns `false`.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {boolean} Returns `false`.\n * @example\n *\n * _.times(2, _.stubFalse);\n * // => [false, false]\n */\nfunction stubFalse() {\n return false;\n}\n\nexport default stubFalse;\n","import root from './_root.js';\nimport stubFalse from './stubFalse.js';\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Built-in value references. */\nvar Buffer = moduleExports ? root.Buffer : undefined;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;\n\n/**\n * Checks if `value` is a buffer.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.\n * @example\n *\n * _.isBuffer(new Buffer(2));\n * // => true\n *\n * _.isBuffer(new Uint8Array(2));\n * // => false\n */\nvar isBuffer = nativeIsBuffer || stubFalse;\n\nexport default isBuffer;\n","import baseGetTag from './_baseGetTag.js';\nimport isLength from './isLength.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n objectTag = '[object Object]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/** Used to identify `toStringTag` values of typed arrays. */\nvar typedArrayTags = {};\ntypedArrayTags[float32Tag] = typedArrayTags[float64Tag] =\ntypedArrayTags[int8Tag] = typedArrayTags[int16Tag] =\ntypedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =\ntypedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =\ntypedArrayTags[uint32Tag] = true;\ntypedArrayTags[argsTag] = typedArrayTags[arrayTag] =\ntypedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =\ntypedArrayTags[dataViewTag] = typedArrayTags[dateTag] =\ntypedArrayTags[errorTag] = typedArrayTags[funcTag] =\ntypedArrayTags[mapTag] = typedArrayTags[numberTag] =\ntypedArrayTags[objectTag] = typedArrayTags[regexpTag] =\ntypedArrayTags[setTag] = typedArrayTags[stringTag] =\ntypedArrayTags[weakMapTag] = false;\n\n/**\n * The base implementation of `_.isTypedArray` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n */\nfunction baseIsTypedArray(value) {\n return isObjectLike(value) &&\n isLength(value.length) && !!typedArrayTags[baseGetTag(value)];\n}\n\nexport default baseIsTypedArray;\n","/**\n * The base implementation of `_.unary` without support for storing metadata.\n *\n * @private\n * @param {Function} func The function to cap arguments for.\n * @returns {Function} Returns the new capped function.\n */\nfunction baseUnary(func) {\n return function(value) {\n return func(value);\n };\n}\n\nexport default baseUnary;\n","import freeGlobal from './_freeGlobal.js';\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Detect free variable `process` from Node.js. */\nvar freeProcess = moduleExports && freeGlobal.process;\n\n/** Used to access faster Node.js helpers. */\nvar nodeUtil = (function() {\n try {\n // Use `util.types` for Node.js 10+.\n var types = freeModule && freeModule.require && freeModule.require('util').types;\n\n if (types) {\n return types;\n }\n\n // Legacy `process.binding('util')` for Node.js < 10.\n return freeProcess && freeProcess.binding && freeProcess.binding('util');\n } catch (e) {}\n}());\n\nexport default nodeUtil;\n","import baseIsTypedArray from './_baseIsTypedArray.js';\nimport baseUnary from './_baseUnary.js';\nimport nodeUtil from './_nodeUtil.js';\n\n/* Node.js helper references. */\nvar nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;\n\n/**\n * Checks if `value` is classified as a typed array.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n * @example\n *\n * _.isTypedArray(new Uint8Array);\n * // => true\n *\n * _.isTypedArray([]);\n * // => false\n */\nvar isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;\n\nexport default isTypedArray;\n","import baseTimes from './_baseTimes.js';\nimport isArguments from './isArguments.js';\nimport isArray from './isArray.js';\nimport isBuffer from './isBuffer.js';\nimport isIndex from './_isIndex.js';\nimport isTypedArray from './isTypedArray.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\nfunction arrayLikeKeys(value, inherited) {\n var isArr = isArray(value),\n isArg = !isArr && isArguments(value),\n isBuff = !isArr && !isArg && isBuffer(value),\n isType = !isArr && !isArg && !isBuff && isTypedArray(value),\n skipIndexes = isArr || isArg || isBuff || isType,\n result = skipIndexes ? baseTimes(value.length, String) : [],\n length = result.length;\n\n for (var key in value) {\n if ((inherited || hasOwnProperty.call(value, key)) &&\n !(skipIndexes && (\n // Safari 9 has enumerable `arguments.length` in strict mode.\n key == 'length' ||\n // Node.js 0.10 has enumerable non-index properties on buffers.\n (isBuff && (key == 'offset' || key == 'parent')) ||\n // PhantomJS 2 has enumerable non-index properties on typed arrays.\n (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||\n // Skip index properties.\n isIndex(key, length)\n ))) {\n result.push(key);\n }\n }\n return result;\n}\n\nexport default arrayLikeKeys;\n","/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\nfunction overArg(func, transform) {\n return function(arg) {\n return func(transform(arg));\n };\n}\n\nexport default overArg;\n","import overArg from './_overArg.js';\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeKeys = overArg(Object.keys, Object);\n\nexport default nativeKeys;\n","import isPrototype from './_isPrototype.js';\nimport nativeKeys from './_nativeKeys.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeys(object) {\n if (!isPrototype(object)) {\n return nativeKeys(object);\n }\n var result = [];\n for (var key in Object(object)) {\n if (hasOwnProperty.call(object, key) && key != 'constructor') {\n result.push(key);\n }\n }\n return result;\n}\n\nexport default baseKeys;\n","import arrayLikeKeys from './_arrayLikeKeys.js';\nimport baseKeys from './_baseKeys.js';\nimport isArrayLike from './isArrayLike.js';\n\n/**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\nfunction keys(object) {\n return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);\n}\n\nexport default keys;\n","/**\n * This function is like\n * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * except that it includes inherited enumerable properties.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction nativeKeysIn(object) {\n var result = [];\n if (object != null) {\n for (var key in Object(object)) {\n result.push(key);\n }\n }\n return result;\n}\n\nexport default nativeKeysIn;\n","import isObject from './isObject.js';\nimport isPrototype from './_isPrototype.js';\nimport nativeKeysIn from './_nativeKeysIn.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeysIn(object) {\n if (!isObject(object)) {\n return nativeKeysIn(object);\n }\n var isProto = isPrototype(object),\n result = [];\n\n for (var key in object) {\n if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {\n result.push(key);\n }\n }\n return result;\n}\n\nexport default baseKeysIn;\n","import arrayLikeKeys from './_arrayLikeKeys.js';\nimport baseKeysIn from './_baseKeysIn.js';\nimport isArrayLike from './isArrayLike.js';\n\n/**\n * Creates an array of the own and inherited enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keysIn(new Foo);\n * // => ['a', 'b', 'c'] (iteration order is not guaranteed)\n */\nfunction keysIn(object) {\n return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);\n}\n\nexport default keysIn;\n","import isArray from './isArray.js';\nimport isSymbol from './isSymbol.js';\n\n/** Used to match property names within property paths. */\nvar reIsDeepProp = /\\.|\\[(?:[^[\\]]*|([\"'])(?:(?!\\1)[^\\\\]|\\\\.)*?\\1)\\]/,\n reIsPlainProp = /^\\w*$/;\n\n/**\n * Checks if `value` is a property name and not a property path.\n *\n * @private\n * @param {*} value The value to check.\n * @param {Object} [object] The object to query keys on.\n * @returns {boolean} Returns `true` if `value` is a property name, else `false`.\n */\nfunction isKey(value, object) {\n if (isArray(value)) {\n return false;\n }\n var type = typeof value;\n if (type == 'number' || type == 'symbol' || type == 'boolean' ||\n value == null || isSymbol(value)) {\n return true;\n }\n return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||\n (object != null && value in Object(object));\n}\n\nexport default isKey;\n","import getNative from './_getNative.js';\n\n/* Built-in method references that are verified to be native. */\nvar nativeCreate = getNative(Object, 'create');\n\nexport default nativeCreate;\n","import nativeCreate from './_nativeCreate.js';\n\n/**\n * Removes all key-value entries from the hash.\n *\n * @private\n * @name clear\n * @memberOf Hash\n */\nfunction hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n}\n\nexport default hashClear;\n","/**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @name delete\n * @memberOf Hash\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction hashDelete(key) {\n var result = this.has(key) && delete this.__data__[key];\n this.size -= result ? 1 : 0;\n return result;\n}\n\nexport default hashDelete;\n","import nativeCreate from './_nativeCreate.js';\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Gets the hash value for `key`.\n *\n * @private\n * @name get\n * @memberOf Hash\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction hashGet(key) {\n var data = this.__data__;\n if (nativeCreate) {\n var result = data[key];\n return result === HASH_UNDEFINED ? undefined : result;\n }\n return hasOwnProperty.call(data, key) ? data[key] : undefined;\n}\n\nexport default hashGet;\n","import nativeCreate from './_nativeCreate.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Hash\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction hashHas(key) {\n var data = this.__data__;\n return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);\n}\n\nexport default hashHas;\n","import nativeCreate from './_nativeCreate.js';\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Hash\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the hash instance.\n */\nfunction hashSet(key, value) {\n var data = this.__data__;\n this.size += this.has(key) ? 0 : 1;\n data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n return this;\n}\n\nexport default hashSet;\n","import hashClear from './_hashClear.js';\nimport hashDelete from './_hashDelete.js';\nimport hashGet from './_hashGet.js';\nimport hashHas from './_hashHas.js';\nimport hashSet from './_hashSet.js';\n\n/**\n * Creates a hash object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Hash(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n// Add methods to `Hash`.\nHash.prototype.clear = hashClear;\nHash.prototype['delete'] = hashDelete;\nHash.prototype.get = hashGet;\nHash.prototype.has = hashHas;\nHash.prototype.set = hashSet;\n\nexport default Hash;\n","/**\n * Removes all key-value entries from the list cache.\n *\n * @private\n * @name clear\n * @memberOf ListCache\n */\nfunction listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n}\n\nexport default listCacheClear;\n","import eq from './eq.js';\n\n/**\n * Gets the index at which the `key` is found in `array` of key-value pairs.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction assocIndexOf(array, key) {\n var length = array.length;\n while (length--) {\n if (eq(array[length][0], key)) {\n return length;\n }\n }\n return -1;\n}\n\nexport default assocIndexOf;\n","import assocIndexOf from './_assocIndexOf.js';\n\n/** Used for built-in method references. */\nvar arrayProto = Array.prototype;\n\n/** Built-in value references. */\nvar splice = arrayProto.splice;\n\n/**\n * Removes `key` and its value from the list cache.\n *\n * @private\n * @name delete\n * @memberOf ListCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction listCacheDelete(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n return false;\n }\n var lastIndex = data.length - 1;\n if (index == lastIndex) {\n data.pop();\n } else {\n splice.call(data, index, 1);\n }\n --this.size;\n return true;\n}\n\nexport default listCacheDelete;\n","import assocIndexOf from './_assocIndexOf.js';\n\n/**\n * Gets the list cache value for `key`.\n *\n * @private\n * @name get\n * @memberOf ListCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction listCacheGet(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n return index < 0 ? undefined : data[index][1];\n}\n\nexport default listCacheGet;\n","import assocIndexOf from './_assocIndexOf.js';\n\n/**\n * Checks if a list cache value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf ListCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction listCacheHas(key) {\n return assocIndexOf(this.__data__, key) > -1;\n}\n\nexport default listCacheHas;\n","import assocIndexOf from './_assocIndexOf.js';\n\n/**\n * Sets the list cache `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf ListCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the list cache instance.\n */\nfunction listCacheSet(key, value) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n ++this.size;\n data.push([key, value]);\n } else {\n data[index][1] = value;\n }\n return this;\n}\n\nexport default listCacheSet;\n","import listCacheClear from './_listCacheClear.js';\nimport listCacheDelete from './_listCacheDelete.js';\nimport listCacheGet from './_listCacheGet.js';\nimport listCacheHas from './_listCacheHas.js';\nimport listCacheSet from './_listCacheSet.js';\n\n/**\n * Creates an list cache object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction ListCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n// Add methods to `ListCache`.\nListCache.prototype.clear = listCacheClear;\nListCache.prototype['delete'] = listCacheDelete;\nListCache.prototype.get = listCacheGet;\nListCache.prototype.has = listCacheHas;\nListCache.prototype.set = listCacheSet;\n\nexport default ListCache;\n","import getNative from './_getNative.js';\nimport root from './_root.js';\n\n/* Built-in method references that are verified to be native. */\nvar Map = getNative(root, 'Map');\n\nexport default Map;\n","import Hash from './_Hash.js';\nimport ListCache from './_ListCache.js';\nimport Map from './_Map.js';\n\n/**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\nfunction mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n}\n\nexport default mapCacheClear;\n","/**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\nfunction isKeyable(value) {\n var type = typeof value;\n return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')\n ? (value !== '__proto__')\n : (value === null);\n}\n\nexport default isKeyable;\n","import isKeyable from './_isKeyable.js';\n\n/**\n * Gets the data for `map`.\n *\n * @private\n * @param {Object} map The map to query.\n * @param {string} key The reference key.\n * @returns {*} Returns the map data.\n */\nfunction getMapData(map, key) {\n var data = map.__data__;\n return isKeyable(key)\n ? data[typeof key == 'string' ? 'string' : 'hash']\n : data.map;\n}\n\nexport default getMapData;\n","import getMapData from './_getMapData.js';\n\n/**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction mapCacheDelete(key) {\n var result = getMapData(this, key)['delete'](key);\n this.size -= result ? 1 : 0;\n return result;\n}\n\nexport default mapCacheDelete;\n","import getMapData from './_getMapData.js';\n\n/**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction mapCacheGet(key) {\n return getMapData(this, key).get(key);\n}\n\nexport default mapCacheGet;\n","import getMapData from './_getMapData.js';\n\n/**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction mapCacheHas(key) {\n return getMapData(this, key).has(key);\n}\n\nexport default mapCacheHas;\n","import getMapData from './_getMapData.js';\n\n/**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache instance.\n */\nfunction mapCacheSet(key, value) {\n var data = getMapData(this, key),\n size = data.size;\n\n data.set(key, value);\n this.size += data.size == size ? 0 : 1;\n return this;\n}\n\nexport default mapCacheSet;\n","import mapCacheClear from './_mapCacheClear.js';\nimport mapCacheDelete from './_mapCacheDelete.js';\nimport mapCacheGet from './_mapCacheGet.js';\nimport mapCacheHas from './_mapCacheHas.js';\nimport mapCacheSet from './_mapCacheSet.js';\n\n/**\n * Creates a map cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction MapCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n// Add methods to `MapCache`.\nMapCache.prototype.clear = mapCacheClear;\nMapCache.prototype['delete'] = mapCacheDelete;\nMapCache.prototype.get = mapCacheGet;\nMapCache.prototype.has = mapCacheHas;\nMapCache.prototype.set = mapCacheSet;\n\nexport default MapCache;\n","import MapCache from './_MapCache.js';\n\n/** Error message constants. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/**\n * Creates a function that memoizes the result of `func`. If `resolver` is\n * provided, it determines the cache key for storing the result based on the\n * arguments provided to the memoized function. By default, the first argument\n * provided to the memoized function is used as the map cache key. The `func`\n * is invoked with the `this` binding of the memoized function.\n *\n * **Note:** The cache is exposed as the `cache` property on the memoized\n * function. Its creation may be customized by replacing the `_.memoize.Cache`\n * constructor with one whose instances implement the\n * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)\n * method interface of `clear`, `delete`, `get`, `has`, and `set`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to have its output memoized.\n * @param {Function} [resolver] The function to resolve the cache key.\n * @returns {Function} Returns the new memoized function.\n * @example\n *\n * var object = { 'a': 1, 'b': 2 };\n * var other = { 'c': 3, 'd': 4 };\n *\n * var values = _.memoize(_.values);\n * values(object);\n * // => [1, 2]\n *\n * values(other);\n * // => [3, 4]\n *\n * object.a = 2;\n * values(object);\n * // => [1, 2]\n *\n * // Modify the result cache.\n * values.cache.set(object, ['a', 'b']);\n * values(object);\n * // => ['a', 'b']\n *\n * // Replace `_.memoize.Cache`.\n * _.memoize.Cache = WeakMap;\n */\nfunction memoize(func, resolver) {\n if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n var memoized = function() {\n var args = arguments,\n key = resolver ? resolver.apply(this, args) : args[0],\n cache = memoized.cache;\n\n if (cache.has(key)) {\n return cache.get(key);\n }\n var result = func.apply(this, args);\n memoized.cache = cache.set(key, result) || cache;\n return result;\n };\n memoized.cache = new (memoize.Cache || MapCache);\n return memoized;\n}\n\n// Expose `MapCache`.\nmemoize.Cache = MapCache;\n\nexport default memoize;\n","import memoize from './memoize.js';\n\n/** Used as the maximum memoize cache size. */\nvar MAX_MEMOIZE_SIZE = 500;\n\n/**\n * A specialized version of `_.memoize` which clears the memoized function's\n * cache when it exceeds `MAX_MEMOIZE_SIZE`.\n *\n * @private\n * @param {Function} func The function to have its output memoized.\n * @returns {Function} Returns the new memoized function.\n */\nfunction memoizeCapped(func) {\n var result = memoize(func, function(key) {\n if (cache.size === MAX_MEMOIZE_SIZE) {\n cache.clear();\n }\n return key;\n });\n\n var cache = result.cache;\n return result;\n}\n\nexport default memoizeCapped;\n","import memoizeCapped from './_memoizeCapped.js';\n\n/** Used to match property names within property paths. */\nvar rePropName = /[^.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))/g;\n\n/** Used to match backslashes in property paths. */\nvar reEscapeChar = /\\\\(\\\\)?/g;\n\n/**\n * Converts `string` to a property path array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the property path array.\n */\nvar stringToPath = memoizeCapped(function(string) {\n var result = [];\n if (string.charCodeAt(0) === 46 /* . */) {\n result.push('');\n }\n string.replace(rePropName, function(match, number, quote, subString) {\n result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));\n });\n return result;\n});\n\nexport default stringToPath;\n","import baseToString from './_baseToString.js';\n\n/**\n * Converts `value` to a string. An empty string is returned for `null`\n * and `undefined` values. The sign of `-0` is preserved.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n * @example\n *\n * _.toString(null);\n * // => ''\n *\n * _.toString(-0);\n * // => '-0'\n *\n * _.toString([1, 2, 3]);\n * // => '1,2,3'\n */\nfunction toString(value) {\n return value == null ? '' : baseToString(value);\n}\n\nexport default toString;\n","import isArray from './isArray.js';\nimport isKey from './_isKey.js';\nimport stringToPath from './_stringToPath.js';\nimport toString from './toString.js';\n\n/**\n * Casts `value` to a path array if it's not one.\n *\n * @private\n * @param {*} value The value to inspect.\n * @param {Object} [object] The object to query keys on.\n * @returns {Array} Returns the cast property path array.\n */\nfunction castPath(value, object) {\n if (isArray(value)) {\n return value;\n }\n return isKey(value, object) ? [value] : stringToPath(toString(value));\n}\n\nexport default castPath;\n","import isSymbol from './isSymbol.js';\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0;\n\n/**\n * Converts `value` to a string key if it's not a string or symbol.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {string|symbol} Returns the key.\n */\nfunction toKey(value) {\n if (typeof value == 'string' || isSymbol(value)) {\n return value;\n }\n var result = (value + '');\n return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n}\n\nexport default toKey;\n","import castPath from './_castPath.js';\nimport toKey from './_toKey.js';\n\n/**\n * The base implementation of `_.get` without support for default values.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @returns {*} Returns the resolved value.\n */\nfunction baseGet(object, path) {\n path = castPath(path, object);\n\n var index = 0,\n length = path.length;\n\n while (object != null && index < length) {\n object = object[toKey(path[index++])];\n }\n return (index && index == length) ? object : undefined;\n}\n\nexport default baseGet;\n","import baseGet from './_baseGet.js';\n\n/**\n * Gets the value at `path` of `object`. If the resolved value is\n * `undefined`, the `defaultValue` is returned in its place.\n *\n * @static\n * @memberOf _\n * @since 3.7.0\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @param {*} [defaultValue] The value returned for `undefined` resolved values.\n * @returns {*} Returns the resolved value.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }] };\n *\n * _.get(object, 'a[0].b.c');\n * // => 3\n *\n * _.get(object, ['a', '0', 'b', 'c']);\n * // => 3\n *\n * _.get(object, 'a.b.c', 'default');\n * // => 'default'\n */\nfunction get(object, path, defaultValue) {\n var result = object == null ? undefined : baseGet(object, path);\n return result === undefined ? defaultValue : result;\n}\n\nexport default get;\n","/**\n * Appends the elements of `values` to `array`.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {Array} values The values to append.\n * @returns {Array} Returns `array`.\n */\nfunction arrayPush(array, values) {\n var index = -1,\n length = values.length,\n offset = array.length;\n\n while (++index < length) {\n array[offset + index] = values[index];\n }\n return array;\n}\n\nexport default arrayPush;\n","import Symbol from './_Symbol.js';\nimport isArguments from './isArguments.js';\nimport isArray from './isArray.js';\n\n/** Built-in value references. */\nvar spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined;\n\n/**\n * Checks if `value` is a flattenable `arguments` object or array.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.\n */\nfunction isFlattenable(value) {\n return isArray(value) || isArguments(value) ||\n !!(spreadableSymbol && value && value[spreadableSymbol]);\n}\n\nexport default isFlattenable;\n","import arrayPush from './_arrayPush.js';\nimport isFlattenable from './_isFlattenable.js';\n\n/**\n * The base implementation of `_.flatten` with support for restricting flattening.\n *\n * @private\n * @param {Array} array The array to flatten.\n * @param {number} depth The maximum recursion depth.\n * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.\n * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.\n * @param {Array} [result=[]] The initial result value.\n * @returns {Array} Returns the new flattened array.\n */\nfunction baseFlatten(array, depth, predicate, isStrict, result) {\n var index = -1,\n length = array.length;\n\n predicate || (predicate = isFlattenable);\n result || (result = []);\n\n while (++index < length) {\n var value = array[index];\n if (depth > 0 && predicate(value)) {\n if (depth > 1) {\n // Recursively flatten arrays (susceptible to call stack limits).\n baseFlatten(value, depth - 1, predicate, isStrict, result);\n } else {\n arrayPush(result, value);\n }\n } else if (!isStrict) {\n result[result.length] = value;\n }\n }\n return result;\n}\n\nexport default baseFlatten;\n","import baseFlatten from './_baseFlatten.js';\n\n/**\n * Flattens `array` a single level deep.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to flatten.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * _.flatten([1, [2, [3, [4]], 5]]);\n * // => [1, 2, [3, [4]], 5]\n */\nfunction flatten(array) {\n var length = array == null ? 0 : array.length;\n return length ? baseFlatten(array, 1) : [];\n}\n\nexport default flatten;\n","import flatten from './flatten.js';\nimport overRest from './_overRest.js';\nimport setToString from './_setToString.js';\n\n/**\n * A specialized version of `baseRest` which flattens the rest array.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @returns {Function} Returns the new function.\n */\nfunction flatRest(func) {\n return setToString(overRest(func, undefined, flatten), func + '');\n}\n\nexport default flatRest;\n","import overArg from './_overArg.js';\n\n/** Built-in value references. */\nvar getPrototype = overArg(Object.getPrototypeOf, Object);\n\nexport default getPrototype;\n","import baseGetTag from './_baseGetTag.js';\nimport getPrototype from './_getPrototype.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** `Object#toString` result references. */\nvar objectTag = '[object Object]';\n\n/** Used for built-in method references. */\nvar funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Used to infer the `Object` constructor. */\nvar objectCtorString = funcToString.call(Object);\n\n/**\n * Checks if `value` is a plain object, that is, an object created by the\n * `Object` constructor or one with a `[[Prototype]]` of `null`.\n *\n * @static\n * @memberOf _\n * @since 0.8.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * _.isPlainObject(new Foo);\n * // => false\n *\n * _.isPlainObject([1, 2, 3]);\n * // => false\n *\n * _.isPlainObject({ 'x': 0, 'y': 0 });\n * // => true\n *\n * _.isPlainObject(Object.create(null));\n * // => true\n */\nfunction isPlainObject(value) {\n if (!isObjectLike(value) || baseGetTag(value) != objectTag) {\n return false;\n }\n var proto = getPrototype(value);\n if (proto === null) {\n return true;\n }\n var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;\n return typeof Ctor == 'function' && Ctor instanceof Ctor &&\n funcToString.call(Ctor) == objectCtorString;\n}\n\nexport default isPlainObject;\n","/**\n * The base implementation of `_.slice` without an iteratee call guard.\n *\n * @private\n * @param {Array} array The array to slice.\n * @param {number} [start=0] The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns the slice of `array`.\n */\nfunction baseSlice(array, start, end) {\n var index = -1,\n length = array.length;\n\n if (start < 0) {\n start = -start > length ? 0 : (length + start);\n }\n end = end > length ? length : end;\n if (end < 0) {\n end += length;\n }\n length = start > end ? 0 : ((end - start) >>> 0);\n start >>>= 0;\n\n var result = Array(length);\n while (++index < length) {\n result[index] = array[index + start];\n }\n return result;\n}\n\nexport default baseSlice;\n","import baseSlice from './_baseSlice.js';\n\n/**\n * Casts `array` to a slice if it's needed.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {number} start The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns the cast slice.\n */\nfunction castSlice(array, start, end) {\n var length = array.length;\n end = end === undefined ? length : end;\n return (!start && end >= length) ? array : baseSlice(array, start, end);\n}\n\nexport default castSlice;\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 rsVarRange = '\\\\ufe0e\\\\ufe0f';\n\n/** Used to compose unicode capture groups. */\nvar rsZWJ = '\\\\u200d';\n\n/** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */\nvar reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']');\n\n/**\n * Checks if `string` contains Unicode symbols.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {boolean} Returns `true` if a symbol is found, else `false`.\n */\nfunction hasUnicode(string) {\n return reHasUnicode.test(string);\n}\n\nexport default hasUnicode;\n","/**\n * Converts an ASCII `string` to an array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the converted array.\n */\nfunction asciiToArray(string) {\n return string.split('');\n}\n\nexport default asciiToArray;\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 rsVarRange = '\\\\ufe0e\\\\ufe0f';\n\n/** Used to compose unicode capture groups. */\nvar rsAstral = '[' + rsAstralRange + ']',\n rsCombo = '[' + rsComboRange + ']',\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 rsZWJ = '\\\\u200d';\n\n/** Used to compose unicode regexes. */\nvar reOptMod = rsModifier + '?',\n rsOptVar = '[' + rsVarRange + ']?',\n rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',\n rsSeq = rsOptVar + reOptMod + rsOptJoin,\n rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';\n\n/** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */\nvar reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');\n\n/**\n * Converts a Unicode `string` to an array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the converted array.\n */\nfunction unicodeToArray(string) {\n return string.match(reUnicode) || [];\n}\n\nexport default unicodeToArray;\n","import asciiToArray from './_asciiToArray.js';\nimport hasUnicode from './_hasUnicode.js';\nimport unicodeToArray from './_unicodeToArray.js';\n\n/**\n * Converts `string` to an array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the converted array.\n */\nfunction stringToArray(string) {\n return hasUnicode(string)\n ? unicodeToArray(string)\n : asciiToArray(string);\n}\n\nexport default stringToArray;\n","import castSlice from './_castSlice.js';\nimport hasUnicode from './_hasUnicode.js';\nimport stringToArray from './_stringToArray.js';\nimport toString from './toString.js';\n\n/**\n * Creates a function like `_.lowerFirst`.\n *\n * @private\n * @param {string} methodName The name of the `String` case method to use.\n * @returns {Function} Returns the new case function.\n */\nfunction createCaseFirst(methodName) {\n return function(string) {\n string = toString(string);\n\n var strSymbols = hasUnicode(string)\n ? stringToArray(string)\n : undefined;\n\n var chr = strSymbols\n ? strSymbols[0]\n : string.charAt(0);\n\n var trailing = strSymbols\n ? castSlice(strSymbols, 1).join('')\n : string.slice(1);\n\n return chr[methodName]() + trailing;\n };\n}\n\nexport default createCaseFirst;\n","import createCaseFirst from './_createCaseFirst.js';\n\n/**\n * Converts the first character of `string` to upper case.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the converted string.\n * @example\n *\n * _.upperFirst('fred');\n * // => 'Fred'\n *\n * _.upperFirst('FRED');\n * // => 'FRED'\n */\nvar upperFirst = createCaseFirst('toUpperCase');\n\nexport default upperFirst;\n","import toString from './toString.js';\nimport upperFirst from './upperFirst.js';\n\n/**\n * Converts the first character of `string` to upper case and the remaining\n * to lower case.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to capitalize.\n * @returns {string} Returns the capitalized string.\n * @example\n *\n * _.capitalize('FRED');\n * // => 'Fred'\n */\nfunction capitalize(string) {\n return upperFirst(toString(string).toLowerCase());\n}\n\nexport default capitalize;\n","/**\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","import capitalize from './capitalize.js';\nimport createCompounder from './_createCompounder.js';\n\n/**\n * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase).\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 camel cased string.\n * @example\n *\n * _.camelCase('Foo Bar');\n * // => 'fooBar'\n *\n * _.camelCase('--foo-bar--');\n * // => 'fooBar'\n *\n * _.camelCase('__FOO_BAR__');\n * // => 'fooBar'\n */\nvar camelCase = createCompounder(function(result, word, index) {\n word = word.toLowerCase();\n return result + (index ? capitalize(word) : word);\n});\n\nexport default camelCase;\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","import ListCache from './_ListCache.js';\n\n/**\n * Removes all key-value entries from the stack.\n *\n * @private\n * @name clear\n * @memberOf Stack\n */\nfunction stackClear() {\n this.__data__ = new ListCache;\n this.size = 0;\n}\n\nexport default stackClear;\n","/**\n * Removes `key` and its value from the stack.\n *\n * @private\n * @name delete\n * @memberOf Stack\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction stackDelete(key) {\n var data = this.__data__,\n result = data['delete'](key);\n\n this.size = data.size;\n return result;\n}\n\nexport default stackDelete;\n","/**\n * Gets the stack value for `key`.\n *\n * @private\n * @name get\n * @memberOf Stack\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction stackGet(key) {\n return this.__data__.get(key);\n}\n\nexport default stackGet;\n","/**\n * Checks if a stack value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Stack\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction stackHas(key) {\n return this.__data__.has(key);\n}\n\nexport default stackHas;\n","import ListCache from './_ListCache.js';\nimport Map from './_Map.js';\nimport MapCache from './_MapCache.js';\n\n/** Used as the size to enable large array optimizations. */\nvar LARGE_ARRAY_SIZE = 200;\n\n/**\n * Sets the stack `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Stack\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the stack cache instance.\n */\nfunction stackSet(key, value) {\n var data = this.__data__;\n if (data instanceof ListCache) {\n var pairs = data.__data__;\n if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {\n pairs.push([key, value]);\n this.size = ++data.size;\n return this;\n }\n data = this.__data__ = new MapCache(pairs);\n }\n data.set(key, value);\n this.size = data.size;\n return this;\n}\n\nexport default stackSet;\n","import ListCache from './_ListCache.js';\nimport stackClear from './_stackClear.js';\nimport stackDelete from './_stackDelete.js';\nimport stackGet from './_stackGet.js';\nimport stackHas from './_stackHas.js';\nimport stackSet from './_stackSet.js';\n\n/**\n * Creates a stack cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Stack(entries) {\n var data = this.__data__ = new ListCache(entries);\n this.size = data.size;\n}\n\n// Add methods to `Stack`.\nStack.prototype.clear = stackClear;\nStack.prototype['delete'] = stackDelete;\nStack.prototype.get = stackGet;\nStack.prototype.has = stackHas;\nStack.prototype.set = stackSet;\n\nexport default Stack;\n","import copyObject from './_copyObject.js';\nimport keys from './keys.js';\n\n/**\n * The base implementation of `_.assign` without support for multiple sources\n * or `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\nfunction baseAssign(object, source) {\n return object && copyObject(source, keys(source), object);\n}\n\nexport default baseAssign;\n","import copyObject from './_copyObject.js';\nimport keysIn from './keysIn.js';\n\n/**\n * The base implementation of `_.assignIn` without support for multiple sources\n * or `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\nfunction baseAssignIn(object, source) {\n return object && copyObject(source, keysIn(source), object);\n}\n\nexport default baseAssignIn;\n","import root from './_root.js';\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Built-in value references. */\nvar Buffer = moduleExports ? root.Buffer : undefined,\n allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined;\n\n/**\n * Creates a clone of `buffer`.\n *\n * @private\n * @param {Buffer} buffer The buffer to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Buffer} Returns the cloned buffer.\n */\nfunction cloneBuffer(buffer, isDeep) {\n if (isDeep) {\n return buffer.slice();\n }\n var length = buffer.length,\n result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);\n\n buffer.copy(result);\n return result;\n}\n\nexport default cloneBuffer;\n","/**\n * A specialized version of `_.filter` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n */\nfunction arrayFilter(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index];\n if (predicate(value, index, array)) {\n result[resIndex++] = value;\n }\n }\n return result;\n}\n\nexport default arrayFilter;\n","/**\n * This method returns a new empty array.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {Array} Returns the new empty array.\n * @example\n *\n * var arrays = _.times(2, _.stubArray);\n *\n * console.log(arrays);\n * // => [[], []]\n *\n * console.log(arrays[0] === arrays[1]);\n * // => false\n */\nfunction stubArray() {\n return [];\n}\n\nexport default stubArray;\n","import arrayFilter from './_arrayFilter.js';\nimport stubArray from './stubArray.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Built-in value references. */\nvar propertyIsEnumerable = objectProto.propertyIsEnumerable;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeGetSymbols = Object.getOwnPropertySymbols;\n\n/**\n * Creates an array of the own enumerable symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\nvar getSymbols = !nativeGetSymbols ? stubArray : function(object) {\n if (object == null) {\n return [];\n }\n object = Object(object);\n return arrayFilter(nativeGetSymbols(object), function(symbol) {\n return propertyIsEnumerable.call(object, symbol);\n });\n};\n\nexport default getSymbols;\n","import copyObject from './_copyObject.js';\nimport getSymbols from './_getSymbols.js';\n\n/**\n * Copies own symbols of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\nfunction copySymbols(source, object) {\n return copyObject(source, getSymbols(source), object);\n}\n\nexport default copySymbols;\n","import arrayPush from './_arrayPush.js';\nimport getPrototype from './_getPrototype.js';\nimport getSymbols from './_getSymbols.js';\nimport stubArray from './stubArray.js';\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeGetSymbols = Object.getOwnPropertySymbols;\n\n/**\n * Creates an array of the own and inherited enumerable symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\nvar getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {\n var result = [];\n while (object) {\n arrayPush(result, getSymbols(object));\n object = getPrototype(object);\n }\n return result;\n};\n\nexport default getSymbolsIn;\n","import copyObject from './_copyObject.js';\nimport getSymbolsIn from './_getSymbolsIn.js';\n\n/**\n * Copies own and inherited symbols of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\nfunction copySymbolsIn(source, object) {\n return copyObject(source, getSymbolsIn(source), object);\n}\n\nexport default copySymbolsIn;\n","import arrayPush from './_arrayPush.js';\nimport isArray from './isArray.js';\n\n/**\n * The base implementation of `getAllKeys` and `getAllKeysIn` which uses\n * `keysFunc` and `symbolsFunc` to get the enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @param {Function} symbolsFunc The function to get the symbols of `object`.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction baseGetAllKeys(object, keysFunc, symbolsFunc) {\n var result = keysFunc(object);\n return isArray(object) ? result : arrayPush(result, symbolsFunc(object));\n}\n\nexport default baseGetAllKeys;\n","import baseGetAllKeys from './_baseGetAllKeys.js';\nimport getSymbols from './_getSymbols.js';\nimport keys from './keys.js';\n\n/**\n * Creates an array of own enumerable property names and symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction getAllKeys(object) {\n return baseGetAllKeys(object, keys, getSymbols);\n}\n\nexport default getAllKeys;\n","import baseGetAllKeys from './_baseGetAllKeys.js';\nimport getSymbolsIn from './_getSymbolsIn.js';\nimport keysIn from './keysIn.js';\n\n/**\n * Creates an array of own and inherited enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction getAllKeysIn(object) {\n return baseGetAllKeys(object, keysIn, getSymbolsIn);\n}\n\nexport default getAllKeysIn;\n","import getNative from './_getNative.js';\nimport root from './_root.js';\n\n/* Built-in method references that are verified to be native. */\nvar DataView = getNative(root, 'DataView');\n\nexport default DataView;\n","import getNative from './_getNative.js';\nimport root from './_root.js';\n\n/* Built-in method references that are verified to be native. */\nvar Promise = getNative(root, 'Promise');\n\nexport default Promise;\n","import getNative from './_getNative.js';\nimport root from './_root.js';\n\n/* Built-in method references that are verified to be native. */\nvar Set = getNative(root, 'Set');\n\nexport default Set;\n","import DataView from './_DataView.js';\nimport Map from './_Map.js';\nimport Promise from './_Promise.js';\nimport Set from './_Set.js';\nimport WeakMap from './_WeakMap.js';\nimport baseGetTag from './_baseGetTag.js';\nimport toSource from './_toSource.js';\n\n/** `Object#toString` result references. */\nvar mapTag = '[object Map]',\n objectTag = '[object Object]',\n promiseTag = '[object Promise]',\n setTag = '[object Set]',\n weakMapTag = '[object WeakMap]';\n\nvar dataViewTag = '[object DataView]';\n\n/** Used to detect maps, sets, and weakmaps. */\nvar dataViewCtorString = toSource(DataView),\n mapCtorString = toSource(Map),\n promiseCtorString = toSource(Promise),\n setCtorString = toSource(Set),\n weakMapCtorString = toSource(WeakMap);\n\n/**\n * Gets the `toStringTag` of `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nvar getTag = baseGetTag;\n\n// Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.\nif ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||\n (Map && getTag(new Map) != mapTag) ||\n (Promise && getTag(Promise.resolve()) != promiseTag) ||\n (Set && getTag(new Set) != setTag) ||\n (WeakMap && getTag(new WeakMap) != weakMapTag)) {\n getTag = function(value) {\n var result = baseGetTag(value),\n Ctor = result == objectTag ? value.constructor : undefined,\n ctorString = Ctor ? toSource(Ctor) : '';\n\n if (ctorString) {\n switch (ctorString) {\n case dataViewCtorString: return dataViewTag;\n case mapCtorString: return mapTag;\n case promiseCtorString: return promiseTag;\n case setCtorString: return setTag;\n case weakMapCtorString: return weakMapTag;\n }\n }\n return result;\n };\n}\n\nexport default getTag;\n","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Initializes an array clone.\n *\n * @private\n * @param {Array} array The array to clone.\n * @returns {Array} Returns the initialized clone.\n */\nfunction initCloneArray(array) {\n var length = array.length,\n result = new array.constructor(length);\n\n // Add properties assigned by `RegExp#exec`.\n if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {\n result.index = array.index;\n result.input = array.input;\n }\n return result;\n}\n\nexport default initCloneArray;\n","import root from './_root.js';\n\n/** Built-in value references. */\nvar Uint8Array = root.Uint8Array;\n\nexport default Uint8Array;\n","import Uint8Array from './_Uint8Array.js';\n\n/**\n * Creates a clone of `arrayBuffer`.\n *\n * @private\n * @param {ArrayBuffer} arrayBuffer The array buffer to clone.\n * @returns {ArrayBuffer} Returns the cloned array buffer.\n */\nfunction cloneArrayBuffer(arrayBuffer) {\n var result = new arrayBuffer.constructor(arrayBuffer.byteLength);\n new Uint8Array(result).set(new Uint8Array(arrayBuffer));\n return result;\n}\n\nexport default cloneArrayBuffer;\n","import cloneArrayBuffer from './_cloneArrayBuffer.js';\n\n/**\n * Creates a clone of `dataView`.\n *\n * @private\n * @param {Object} dataView The data view to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned data view.\n */\nfunction cloneDataView(dataView, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;\n return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);\n}\n\nexport default cloneDataView;\n","/** Used to match `RegExp` flags from their coerced string values. */\nvar reFlags = /\\w*$/;\n\n/**\n * Creates a clone of `regexp`.\n *\n * @private\n * @param {Object} regexp The regexp to clone.\n * @returns {Object} Returns the cloned regexp.\n */\nfunction cloneRegExp(regexp) {\n var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));\n result.lastIndex = regexp.lastIndex;\n return result;\n}\n\nexport default cloneRegExp;\n","import Symbol from './_Symbol.js';\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;\n\n/**\n * Creates a clone of the `symbol` object.\n *\n * @private\n * @param {Object} symbol The symbol object to clone.\n * @returns {Object} Returns the cloned symbol object.\n */\nfunction cloneSymbol(symbol) {\n return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};\n}\n\nexport default cloneSymbol;\n","import cloneArrayBuffer from './_cloneArrayBuffer.js';\n\n/**\n * Creates a clone of `typedArray`.\n *\n * @private\n * @param {Object} typedArray The typed array to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned typed array.\n */\nfunction cloneTypedArray(typedArray, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;\n return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);\n}\n\nexport default cloneTypedArray;\n","import cloneArrayBuffer from './_cloneArrayBuffer.js';\nimport cloneDataView from './_cloneDataView.js';\nimport cloneRegExp from './_cloneRegExp.js';\nimport cloneSymbol from './_cloneSymbol.js';\nimport cloneTypedArray from './_cloneTypedArray.js';\n\n/** `Object#toString` result references. */\nvar boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/**\n * Initializes an object clone based on its `toStringTag`.\n *\n * **Note:** This function only supports cloning values with tags of\n * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.\n *\n * @private\n * @param {Object} object The object to clone.\n * @param {string} tag The `toStringTag` of the object to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the initialized clone.\n */\nfunction initCloneByTag(object, tag, isDeep) {\n var Ctor = object.constructor;\n switch (tag) {\n case arrayBufferTag:\n return cloneArrayBuffer(object);\n\n case boolTag:\n case dateTag:\n return new Ctor(+object);\n\n case dataViewTag:\n return cloneDataView(object, isDeep);\n\n case float32Tag: case float64Tag:\n case int8Tag: case int16Tag: case int32Tag:\n case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:\n return cloneTypedArray(object, isDeep);\n\n case mapTag:\n return new Ctor;\n\n case numberTag:\n case stringTag:\n return new Ctor(object);\n\n case regexpTag:\n return cloneRegExp(object);\n\n case setTag:\n return new Ctor;\n\n case symbolTag:\n return cloneSymbol(object);\n }\n}\n\nexport default initCloneByTag;\n","import baseCreate from './_baseCreate.js';\nimport getPrototype from './_getPrototype.js';\nimport isPrototype from './_isPrototype.js';\n\n/**\n * Initializes an object clone.\n *\n * @private\n * @param {Object} object The object to clone.\n * @returns {Object} Returns the initialized clone.\n */\nfunction initCloneObject(object) {\n return (typeof object.constructor == 'function' && !isPrototype(object))\n ? baseCreate(getPrototype(object))\n : {};\n}\n\nexport default initCloneObject;\n","import getTag from './_getTag.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** `Object#toString` result references. */\nvar mapTag = '[object Map]';\n\n/**\n * The base implementation of `_.isMap` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a map, else `false`.\n */\nfunction baseIsMap(value) {\n return isObjectLike(value) && getTag(value) == mapTag;\n}\n\nexport default baseIsMap;\n","import baseIsMap from './_baseIsMap.js';\nimport baseUnary from './_baseUnary.js';\nimport nodeUtil from './_nodeUtil.js';\n\n/* Node.js helper references. */\nvar nodeIsMap = nodeUtil && nodeUtil.isMap;\n\n/**\n * Checks if `value` is classified as a `Map` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a map, else `false`.\n * @example\n *\n * _.isMap(new Map);\n * // => true\n *\n * _.isMap(new WeakMap);\n * // => false\n */\nvar isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;\n\nexport default isMap;\n","import getTag from './_getTag.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** `Object#toString` result references. */\nvar setTag = '[object Set]';\n\n/**\n * The base implementation of `_.isSet` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a set, else `false`.\n */\nfunction baseIsSet(value) {\n return isObjectLike(value) && getTag(value) == setTag;\n}\n\nexport default baseIsSet;\n","import baseIsSet from './_baseIsSet.js';\nimport baseUnary from './_baseUnary.js';\nimport nodeUtil from './_nodeUtil.js';\n\n/* Node.js helper references. */\nvar nodeIsSet = nodeUtil && nodeUtil.isSet;\n\n/**\n * Checks if `value` is classified as a `Set` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a set, else `false`.\n * @example\n *\n * _.isSet(new Set);\n * // => true\n *\n * _.isSet(new WeakSet);\n * // => false\n */\nvar isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;\n\nexport default isSet;\n","import Stack from './_Stack.js';\nimport arrayEach from './_arrayEach.js';\nimport assignValue from './_assignValue.js';\nimport baseAssign from './_baseAssign.js';\nimport baseAssignIn from './_baseAssignIn.js';\nimport cloneBuffer from './_cloneBuffer.js';\nimport copyArray from './_copyArray.js';\nimport copySymbols from './_copySymbols.js';\nimport copySymbolsIn from './_copySymbolsIn.js';\nimport getAllKeys from './_getAllKeys.js';\nimport getAllKeysIn from './_getAllKeysIn.js';\nimport getTag from './_getTag.js';\nimport initCloneArray from './_initCloneArray.js';\nimport initCloneByTag from './_initCloneByTag.js';\nimport initCloneObject from './_initCloneObject.js';\nimport isArray from './isArray.js';\nimport isBuffer from './isBuffer.js';\nimport isMap from './isMap.js';\nimport isObject from './isObject.js';\nimport isSet from './isSet.js';\nimport keys from './keys.js';\nimport keysIn from './keysIn.js';\n\n/** Used to compose bitmasks for cloning. */\nvar CLONE_DEEP_FLAG = 1,\n CLONE_FLAT_FLAG = 2,\n CLONE_SYMBOLS_FLAG = 4;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n objectTag = '[object Object]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]',\n weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/** Used to identify `toStringTag` values supported by `_.clone`. */\nvar cloneableTags = {};\ncloneableTags[argsTag] = cloneableTags[arrayTag] =\ncloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =\ncloneableTags[boolTag] = cloneableTags[dateTag] =\ncloneableTags[float32Tag] = cloneableTags[float64Tag] =\ncloneableTags[int8Tag] = cloneableTags[int16Tag] =\ncloneableTags[int32Tag] = cloneableTags[mapTag] =\ncloneableTags[numberTag] = cloneableTags[objectTag] =\ncloneableTags[regexpTag] = cloneableTags[setTag] =\ncloneableTags[stringTag] = cloneableTags[symbolTag] =\ncloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =\ncloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;\ncloneableTags[errorTag] = cloneableTags[funcTag] =\ncloneableTags[weakMapTag] = false;\n\n/**\n * The base implementation of `_.clone` and `_.cloneDeep` which tracks\n * traversed objects.\n *\n * @private\n * @param {*} value The value to clone.\n * @param {boolean} bitmask The bitmask flags.\n * 1 - Deep clone\n * 2 - Flatten inherited properties\n * 4 - Clone symbols\n * @param {Function} [customizer] The function to customize cloning.\n * @param {string} [key] The key of `value`.\n * @param {Object} [object] The parent object of `value`.\n * @param {Object} [stack] Tracks traversed objects and their clone counterparts.\n * @returns {*} Returns the cloned value.\n */\nfunction baseClone(value, bitmask, customizer, key, object, stack) {\n var result,\n isDeep = bitmask & CLONE_DEEP_FLAG,\n isFlat = bitmask & CLONE_FLAT_FLAG,\n isFull = bitmask & CLONE_SYMBOLS_FLAG;\n\n if (customizer) {\n result = object ? customizer(value, key, object, stack) : customizer(value);\n }\n if (result !== undefined) {\n return result;\n }\n if (!isObject(value)) {\n return value;\n }\n var isArr = isArray(value);\n if (isArr) {\n result = initCloneArray(value);\n if (!isDeep) {\n return copyArray(value, result);\n }\n } else {\n var tag = getTag(value),\n isFunc = tag == funcTag || tag == genTag;\n\n if (isBuffer(value)) {\n return cloneBuffer(value, isDeep);\n }\n if (tag == objectTag || tag == argsTag || (isFunc && !object)) {\n result = (isFlat || isFunc) ? {} : initCloneObject(value);\n if (!isDeep) {\n return isFlat\n ? copySymbolsIn(value, baseAssignIn(result, value))\n : copySymbols(value, baseAssign(result, value));\n }\n } else {\n if (!cloneableTags[tag]) {\n return object ? value : {};\n }\n result = initCloneByTag(value, tag, isDeep);\n }\n }\n // Check for circular references and return its corresponding clone.\n stack || (stack = new Stack);\n var stacked = stack.get(value);\n if (stacked) {\n return stacked;\n }\n stack.set(value, result);\n\n if (isSet(value)) {\n value.forEach(function(subValue) {\n result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));\n });\n } else if (isMap(value)) {\n value.forEach(function(subValue, key) {\n result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));\n });\n }\n\n var keysFunc = isFull\n ? (isFlat ? getAllKeysIn : getAllKeys)\n : (isFlat ? keysIn : keys);\n\n var props = isArr ? undefined : keysFunc(value);\n arrayEach(props || value, function(subValue, key) {\n if (props) {\n key = subValue;\n subValue = value[key];\n }\n // Recursively populate clone (susceptible to call stack limits).\n assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));\n });\n return result;\n}\n\nexport default baseClone;\n","import baseClone from './_baseClone.js';\n\n/** Used to compose bitmasks for cloning. */\nvar CLONE_DEEP_FLAG = 1,\n CLONE_SYMBOLS_FLAG = 4;\n\n/**\n * This method is like `_.clone` except that it recursively clones `value`.\n *\n * @static\n * @memberOf _\n * @since 1.0.0\n * @category Lang\n * @param {*} value The value to recursively clone.\n * @returns {*} Returns the deep cloned value.\n * @see _.clone\n * @example\n *\n * var objects = [{ 'a': 1 }, { 'b': 2 }];\n *\n * var deep = _.cloneDeep(objects);\n * console.log(deep[0] === objects[0]);\n * // => false\n */\nfunction cloneDeep(value) {\n return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);\n}\n\nexport default cloneDeep;\n","/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/**\n * Adds `value` to the array cache.\n *\n * @private\n * @name add\n * @memberOf SetCache\n * @alias push\n * @param {*} value The value to cache.\n * @returns {Object} Returns the cache instance.\n */\nfunction setCacheAdd(value) {\n this.__data__.set(value, HASH_UNDEFINED);\n return this;\n}\n\nexport default setCacheAdd;\n","/**\n * Checks if `value` is in the array cache.\n *\n * @private\n * @name has\n * @memberOf SetCache\n * @param {*} value The value to search for.\n * @returns {number} Returns `true` if `value` is found, else `false`.\n */\nfunction setCacheHas(value) {\n return this.__data__.has(value);\n}\n\nexport default setCacheHas;\n","import MapCache from './_MapCache.js';\nimport setCacheAdd from './_setCacheAdd.js';\nimport setCacheHas from './_setCacheHas.js';\n\n/**\n *\n * Creates an array cache object to store unique values.\n *\n * @private\n * @constructor\n * @param {Array} [values] The values to cache.\n */\nfunction SetCache(values) {\n var index = -1,\n length = values == null ? 0 : values.length;\n\n this.__data__ = new MapCache;\n while (++index < length) {\n this.add(values[index]);\n }\n}\n\n// Add methods to `SetCache`.\nSetCache.prototype.add = SetCache.prototype.push = setCacheAdd;\nSetCache.prototype.has = setCacheHas;\n\nexport default SetCache;\n","/**\n * A specialized version of `_.some` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array 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 arraySome(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (predicate(array[index], index, array)) {\n return true;\n }\n }\n return false;\n}\n\nexport default arraySome;\n","/**\n * Checks if a `cache` value for `key` exists.\n *\n * @private\n * @param {Object} cache The cache to query.\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction cacheHas(cache, key) {\n return cache.has(key);\n}\n\nexport default cacheHas;\n","import SetCache from './_SetCache.js';\nimport arraySome from './_arraySome.js';\nimport cacheHas from './_cacheHas.js';\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n/**\n * A specialized version of `baseIsEqualDeep` for arrays with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Array} array The array to compare.\n * @param {Array} other The other array to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `array` and `other` objects.\n * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.\n */\nfunction equalArrays(array, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n arrLength = array.length,\n othLength = other.length;\n\n if (arrLength != othLength && !(isPartial && othLength > arrLength)) {\n return false;\n }\n // Check that cyclic values are equal.\n var arrStacked = stack.get(array);\n var othStacked = stack.get(other);\n if (arrStacked && othStacked) {\n return arrStacked == other && othStacked == array;\n }\n var index = -1,\n result = true,\n seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;\n\n stack.set(array, other);\n stack.set(other, array);\n\n // Ignore non-index properties.\n while (++index < arrLength) {\n var arrValue = array[index],\n othValue = other[index];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, arrValue, index, other, array, stack)\n : customizer(arrValue, othValue, index, array, other, stack);\n }\n if (compared !== undefined) {\n if (compared) {\n continue;\n }\n result = false;\n break;\n }\n // Recursively compare arrays (susceptible to call stack limits).\n if (seen) {\n if (!arraySome(other, function(othValue, othIndex) {\n if (!cacheHas(seen, othIndex) &&\n (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {\n return seen.push(othIndex);\n }\n })) {\n result = false;\n break;\n }\n } else if (!(\n arrValue === othValue ||\n equalFunc(arrValue, othValue, bitmask, customizer, stack)\n )) {\n result = false;\n break;\n }\n }\n stack['delete'](array);\n stack['delete'](other);\n return result;\n}\n\nexport default equalArrays;\n","/**\n * Converts `map` to its key-value pairs.\n *\n * @private\n * @param {Object} map The map to convert.\n * @returns {Array} Returns the key-value pairs.\n */\nfunction mapToArray(map) {\n var index = -1,\n result = Array(map.size);\n\n map.forEach(function(value, key) {\n result[++index] = [key, value];\n });\n return result;\n}\n\nexport default mapToArray;\n","/**\n * Converts `set` to an array of its values.\n *\n * @private\n * @param {Object} set The set to convert.\n * @returns {Array} Returns the values.\n */\nfunction setToArray(set) {\n var index = -1,\n result = Array(set.size);\n\n set.forEach(function(value) {\n result[++index] = value;\n });\n return result;\n}\n\nexport default setToArray;\n","import Symbol from './_Symbol.js';\nimport Uint8Array from './_Uint8Array.js';\nimport eq from './eq.js';\nimport equalArrays from './_equalArrays.js';\nimport mapToArray from './_mapToArray.js';\nimport setToArray from './_setToArray.js';\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n/** `Object#toString` result references. */\nvar boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]';\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;\n\n/**\n * A specialized version of `baseIsEqualDeep` for comparing objects of\n * the same `toStringTag`.\n *\n * **Note:** This function only supports comparing values with tags of\n * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {string} tag The `toStringTag` of the objects to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {\n switch (tag) {\n case dataViewTag:\n if ((object.byteLength != other.byteLength) ||\n (object.byteOffset != other.byteOffset)) {\n return false;\n }\n object = object.buffer;\n other = other.buffer;\n\n case arrayBufferTag:\n if ((object.byteLength != other.byteLength) ||\n !equalFunc(new Uint8Array(object), new Uint8Array(other))) {\n return false;\n }\n return true;\n\n case boolTag:\n case dateTag:\n case numberTag:\n // Coerce booleans to `1` or `0` and dates to milliseconds.\n // Invalid dates are coerced to `NaN`.\n return eq(+object, +other);\n\n case errorTag:\n return object.name == other.name && object.message == other.message;\n\n case regexpTag:\n case stringTag:\n // Coerce regexes to strings and treat strings, primitives and objects,\n // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring\n // for more details.\n return object == (other + '');\n\n case mapTag:\n var convert = mapToArray;\n\n case setTag:\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG;\n convert || (convert = setToArray);\n\n if (object.size != other.size && !isPartial) {\n return false;\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(object);\n if (stacked) {\n return stacked == other;\n }\n bitmask |= COMPARE_UNORDERED_FLAG;\n\n // Recursively compare objects (susceptible to call stack limits).\n stack.set(object, other);\n var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);\n stack['delete'](object);\n return result;\n\n case symbolTag:\n if (symbolValueOf) {\n return symbolValueOf.call(object) == symbolValueOf.call(other);\n }\n }\n return false;\n}\n\nexport default equalByTag;\n","import getAllKeys from './_getAllKeys.js';\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1;\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * A specialized version of `baseIsEqualDeep` for objects with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction equalObjects(object, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n objProps = getAllKeys(object),\n objLength = objProps.length,\n othProps = getAllKeys(other),\n othLength = othProps.length;\n\n if (objLength != othLength && !isPartial) {\n return false;\n }\n var index = objLength;\n while (index--) {\n var key = objProps[index];\n if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {\n return false;\n }\n }\n // Check that cyclic values are equal.\n var objStacked = stack.get(object);\n var othStacked = stack.get(other);\n if (objStacked && othStacked) {\n return objStacked == other && othStacked == object;\n }\n var result = true;\n stack.set(object, other);\n stack.set(other, object);\n\n var skipCtor = isPartial;\n while (++index < objLength) {\n key = objProps[index];\n var objValue = object[key],\n othValue = other[key];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, objValue, key, other, object, stack)\n : customizer(objValue, othValue, key, object, other, stack);\n }\n // Recursively compare objects (susceptible to call stack limits).\n if (!(compared === undefined\n ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))\n : compared\n )) {\n result = false;\n break;\n }\n skipCtor || (skipCtor = key == 'constructor');\n }\n if (result && !skipCtor) {\n var objCtor = object.constructor,\n othCtor = other.constructor;\n\n // Non `Object` object instances with different constructors are not equal.\n if (objCtor != othCtor &&\n ('constructor' in object && 'constructor' in other) &&\n !(typeof objCtor == 'function' && objCtor instanceof objCtor &&\n typeof othCtor == 'function' && othCtor instanceof othCtor)) {\n result = false;\n }\n }\n stack['delete'](object);\n stack['delete'](other);\n return result;\n}\n\nexport default equalObjects;\n","import Stack from './_Stack.js';\nimport equalArrays from './_equalArrays.js';\nimport equalByTag from './_equalByTag.js';\nimport equalObjects from './_equalObjects.js';\nimport getTag from './_getTag.js';\nimport isArray from './isArray.js';\nimport isBuffer from './isBuffer.js';\nimport isTypedArray from './isTypedArray.js';\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n objectTag = '[object Object]';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * A specialized version of `baseIsEqual` for arrays and objects which performs\n * deep comparisons and tracks traversed objects enabling objects with circular\n * references to be compared.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} [stack] Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {\n var objIsArr = isArray(object),\n othIsArr = isArray(other),\n objTag = objIsArr ? arrayTag : getTag(object),\n othTag = othIsArr ? arrayTag : getTag(other);\n\n objTag = objTag == argsTag ? objectTag : objTag;\n othTag = othTag == argsTag ? objectTag : othTag;\n\n var objIsObj = objTag == objectTag,\n othIsObj = othTag == objectTag,\n isSameTag = objTag == othTag;\n\n if (isSameTag && isBuffer(object)) {\n if (!isBuffer(other)) {\n return false;\n }\n objIsArr = true;\n objIsObj = false;\n }\n if (isSameTag && !objIsObj) {\n stack || (stack = new Stack);\n return (objIsArr || isTypedArray(object))\n ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)\n : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);\n }\n if (!(bitmask & COMPARE_PARTIAL_FLAG)) {\n var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),\n othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');\n\n if (objIsWrapped || othIsWrapped) {\n var objUnwrapped = objIsWrapped ? object.value() : object,\n othUnwrapped = othIsWrapped ? other.value() : other;\n\n stack || (stack = new Stack);\n return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);\n }\n }\n if (!isSameTag) {\n return false;\n }\n stack || (stack = new Stack);\n return equalObjects(object, other, bitmask, customizer, equalFunc, stack);\n}\n\nexport default baseIsEqualDeep;\n","import baseIsEqualDeep from './_baseIsEqualDeep.js';\nimport isObjectLike from './isObjectLike.js';\n\n/**\n * The base implementation of `_.isEqual` which supports partial comparisons\n * and tracks traversed objects.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @param {boolean} bitmask The bitmask flags.\n * 1 - Unordered comparison\n * 2 - Partial comparison\n * @param {Function} [customizer] The function to customize comparisons.\n * @param {Object} [stack] Tracks traversed `value` and `other` objects.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n */\nfunction baseIsEqual(value, other, bitmask, customizer, stack) {\n if (value === other) {\n return true;\n }\n if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {\n return value !== value && other !== other;\n }\n return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);\n}\n\nexport default baseIsEqual;\n","import Stack from './_Stack.js';\nimport baseIsEqual from './_baseIsEqual.js';\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n/**\n * The base implementation of `_.isMatch` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The object to inspect.\n * @param {Object} source The object of property values to match.\n * @param {Array} matchData The property names, values, and compare flags to match.\n * @param {Function} [customizer] The function to customize comparisons.\n * @returns {boolean} Returns `true` if `object` is a match, else `false`.\n */\nfunction baseIsMatch(object, source, matchData, customizer) {\n var index = matchData.length,\n length = index,\n noCustomizer = !customizer;\n\n if (object == null) {\n return !length;\n }\n object = Object(object);\n while (index--) {\n var data = matchData[index];\n if ((noCustomizer && data[2])\n ? data[1] !== object[data[0]]\n : !(data[0] in object)\n ) {\n return false;\n }\n }\n while (++index < length) {\n data = matchData[index];\n var key = data[0],\n objValue = object[key],\n srcValue = data[1];\n\n if (noCustomizer && data[2]) {\n if (objValue === undefined && !(key in object)) {\n return false;\n }\n } else {\n var stack = new Stack;\n if (customizer) {\n var result = customizer(objValue, srcValue, key, object, source, stack);\n }\n if (!(result === undefined\n ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack)\n : result\n )) {\n return false;\n }\n }\n }\n return true;\n}\n\nexport default baseIsMatch;\n","import isObject from './isObject.js';\n\n/**\n * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` if suitable for strict\n * equality comparisons, else `false`.\n */\nfunction isStrictComparable(value) {\n return value === value && !isObject(value);\n}\n\nexport default isStrictComparable;\n","import isStrictComparable from './_isStrictComparable.js';\nimport keys from './keys.js';\n\n/**\n * Gets the property names, values, and compare flags of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the match data of `object`.\n */\nfunction getMatchData(object) {\n var result = keys(object),\n length = result.length;\n\n while (length--) {\n var key = result[length],\n value = object[key];\n\n result[length] = [key, value, isStrictComparable(value)];\n }\n return result;\n}\n\nexport default getMatchData;\n","/**\n * A specialized version of `matchesProperty` for source values suitable\n * for strict equality comparisons, i.e. `===`.\n *\n * @private\n * @param {string} key The key of the property to get.\n * @param {*} srcValue The value to match.\n * @returns {Function} Returns the new spec function.\n */\nfunction matchesStrictComparable(key, srcValue) {\n return function(object) {\n if (object == null) {\n return false;\n }\n return object[key] === srcValue &&\n (srcValue !== undefined || (key in Object(object)));\n };\n}\n\nexport default matchesStrictComparable;\n","import baseIsMatch from './_baseIsMatch.js';\nimport getMatchData from './_getMatchData.js';\nimport matchesStrictComparable from './_matchesStrictComparable.js';\n\n/**\n * The base implementation of `_.matches` which doesn't clone `source`.\n *\n * @private\n * @param {Object} source The object of property values to match.\n * @returns {Function} Returns the new spec function.\n */\nfunction baseMatches(source) {\n var matchData = getMatchData(source);\n if (matchData.length == 1 && matchData[0][2]) {\n return matchesStrictComparable(matchData[0][0], matchData[0][1]);\n }\n return function(object) {\n return object === source || baseIsMatch(object, source, matchData);\n };\n}\n\nexport default baseMatches;\n","/**\n * The base implementation of `_.hasIn` without support for deep paths.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {Array|string} key The key to check.\n * @returns {boolean} Returns `true` if `key` exists, else `false`.\n */\nfunction baseHasIn(object, key) {\n return object != null && key in Object(object);\n}\n\nexport default baseHasIn;\n","import castPath from './_castPath.js';\nimport isArguments from './isArguments.js';\nimport isArray from './isArray.js';\nimport isIndex from './_isIndex.js';\nimport isLength from './isLength.js';\nimport toKey from './_toKey.js';\n\n/**\n * Checks if `path` exists on `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @param {Function} hasFunc The function to check properties.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n */\nfunction hasPath(object, path, hasFunc) {\n path = castPath(path, object);\n\n var index = -1,\n length = path.length,\n result = false;\n\n while (++index < length) {\n var key = toKey(path[index]);\n if (!(result = object != null && hasFunc(object, key))) {\n break;\n }\n object = object[key];\n }\n if (result || ++index != length) {\n return result;\n }\n length = object == null ? 0 : object.length;\n return !!length && isLength(length) && isIndex(key, length) &&\n (isArray(object) || isArguments(object));\n}\n\nexport default hasPath;\n","import baseHasIn from './_baseHasIn.js';\nimport hasPath from './_hasPath.js';\n\n/**\n * Checks if `path` is a direct or inherited property of `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n * @example\n *\n * var object = _.create({ 'a': _.create({ 'b': 2 }) });\n *\n * _.hasIn(object, 'a');\n * // => true\n *\n * _.hasIn(object, 'a.b');\n * // => true\n *\n * _.hasIn(object, ['a', 'b']);\n * // => true\n *\n * _.hasIn(object, 'b');\n * // => false\n */\nfunction hasIn(object, path) {\n return object != null && hasPath(object, path, baseHasIn);\n}\n\nexport default hasIn;\n","import baseIsEqual from './_baseIsEqual.js';\nimport get from './get.js';\nimport hasIn from './hasIn.js';\nimport isKey from './_isKey.js';\nimport isStrictComparable from './_isStrictComparable.js';\nimport matchesStrictComparable from './_matchesStrictComparable.js';\nimport toKey from './_toKey.js';\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n/**\n * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.\n *\n * @private\n * @param {string} path The path of the property to get.\n * @param {*} srcValue The value to match.\n * @returns {Function} Returns the new spec function.\n */\nfunction baseMatchesProperty(path, srcValue) {\n if (isKey(path) && isStrictComparable(srcValue)) {\n return matchesStrictComparable(toKey(path), srcValue);\n }\n return function(object) {\n var objValue = get(object, path);\n return (objValue === undefined && objValue === srcValue)\n ? hasIn(object, path)\n : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);\n };\n}\n\nexport default baseMatchesProperty;\n","/**\n * The base implementation of `_.property` without support for deep paths.\n *\n * @private\n * @param {string} key The key of the property to get.\n * @returns {Function} Returns the new accessor function.\n */\nfunction baseProperty(key) {\n return function(object) {\n return object == null ? undefined : object[key];\n };\n}\n\nexport default baseProperty;\n","import baseGet from './_baseGet.js';\n\n/**\n * A specialized version of `baseProperty` which supports deep paths.\n *\n * @private\n * @param {Array|string} path The path of the property to get.\n * @returns {Function} Returns the new accessor function.\n */\nfunction basePropertyDeep(path) {\n return function(object) {\n return baseGet(object, path);\n };\n}\n\nexport default basePropertyDeep;\n","import baseProperty from './_baseProperty.js';\nimport basePropertyDeep from './_basePropertyDeep.js';\nimport isKey from './_isKey.js';\nimport toKey from './_toKey.js';\n\n/**\n * Creates a function that returns the value at `path` of a given object.\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Util\n * @param {Array|string} path The path of the property to get.\n * @returns {Function} Returns the new accessor function.\n * @example\n *\n * var objects = [\n * { 'a': { 'b': 2 } },\n * { 'a': { 'b': 1 } }\n * ];\n *\n * _.map(objects, _.property('a.b'));\n * // => [2, 1]\n *\n * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');\n * // => [1, 2]\n */\nfunction property(path) {\n return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);\n}\n\nexport default property;\n","import baseMatches from './_baseMatches.js';\nimport baseMatchesProperty from './_baseMatchesProperty.js';\nimport identity from './identity.js';\nimport isArray from './isArray.js';\nimport property from './property.js';\n\n/**\n * The base implementation of `_.iteratee`.\n *\n * @private\n * @param {*} [value=_.identity] The value to convert to an iteratee.\n * @returns {Function} Returns the iteratee.\n */\nfunction baseIteratee(value) {\n // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.\n // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.\n if (typeof value == 'function') {\n return value;\n }\n if (value == null) {\n return identity;\n }\n if (typeof value == 'object') {\n return isArray(value)\n ? baseMatchesProperty(value[0], value[1])\n : baseMatches(value);\n }\n return property(value);\n}\n\nexport default baseIteratee;\n","/**\n * A specialized version of `baseAggregator` for arrays.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} setter The function to set `accumulator` values.\n * @param {Function} iteratee The iteratee to transform keys.\n * @param {Object} accumulator The initial aggregated object.\n * @returns {Function} Returns `accumulator`.\n */\nfunction arrayAggregator(array, setter, iteratee, accumulator) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n var value = array[index];\n setter(accumulator, value, iteratee(value), array);\n }\n return accumulator;\n}\n\nexport default arrayAggregator;\n","/**\n * Creates a base function for methods like `_.forIn` and `_.forOwn`.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\nfunction createBaseFor(fromRight) {\n return function(object, iteratee, keysFunc) {\n var index = -1,\n iterable = Object(object),\n props = keysFunc(object),\n length = props.length;\n\n while (length--) {\n var key = props[fromRight ? length : ++index];\n if (iteratee(iterable[key], key, iterable) === false) {\n break;\n }\n }\n return object;\n };\n}\n\nexport default createBaseFor;\n","import createBaseFor from './_createBaseFor.js';\n\n/**\n * The base implementation of `baseForOwn` which iterates over `object`\n * properties returned by `keysFunc` and invokes `iteratee` for each property.\n * Iteratee functions may exit iteration early by explicitly returning `false`.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @returns {Object} Returns `object`.\n */\nvar baseFor = createBaseFor();\n\nexport default baseFor;\n","import baseFor from './_baseFor.js';\nimport keys from './keys.js';\n\n/**\n * The base implementation of `_.forOwn` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Object} Returns `object`.\n */\nfunction baseForOwn(object, iteratee) {\n return object && baseFor(object, iteratee, keys);\n}\n\nexport default baseForOwn;\n","import isArrayLike from './isArrayLike.js';\n\n/**\n * Creates a `baseEach` or `baseEachRight` function.\n *\n * @private\n * @param {Function} eachFunc The function to iterate over a collection.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\nfunction createBaseEach(eachFunc, fromRight) {\n return function(collection, iteratee) {\n if (collection == null) {\n return collection;\n }\n if (!isArrayLike(collection)) {\n return eachFunc(collection, iteratee);\n }\n var length = collection.length,\n index = fromRight ? length : -1,\n iterable = Object(collection);\n\n while ((fromRight ? index-- : ++index < length)) {\n if (iteratee(iterable[index], index, iterable) === false) {\n break;\n }\n }\n return collection;\n };\n}\n\nexport default createBaseEach;\n","import baseForOwn from './_baseForOwn.js';\nimport createBaseEach from './_createBaseEach.js';\n\n/**\n * The base implementation of `_.forEach` 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|Object} Returns `collection`.\n */\nvar baseEach = createBaseEach(baseForOwn);\n\nexport default baseEach;\n","import baseEach from './_baseEach.js';\n\n/**\n * Aggregates elements of `collection` on `accumulator` with keys transformed\n * by `iteratee` and values set by `setter`.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} setter The function to set `accumulator` values.\n * @param {Function} iteratee The iteratee to transform keys.\n * @param {Object} accumulator The initial aggregated object.\n * @returns {Function} Returns `accumulator`.\n */\nfunction baseAggregator(collection, setter, iteratee, accumulator) {\n baseEach(collection, function(value, key, collection) {\n setter(accumulator, value, iteratee(value), collection);\n });\n return accumulator;\n}\n\nexport default baseAggregator;\n","import arrayAggregator from './_arrayAggregator.js';\nimport baseAggregator from './_baseAggregator.js';\nimport baseIteratee from './_baseIteratee.js';\nimport isArray from './isArray.js';\n\n/**\n * Creates a function like `_.groupBy`.\n *\n * @private\n * @param {Function} setter The function to set accumulator values.\n * @param {Function} [initializer] The accumulator object initializer.\n * @returns {Function} Returns the new aggregator function.\n */\nfunction createAggregator(setter, initializer) {\n return function(collection, iteratee) {\n var func = isArray(collection) ? arrayAggregator : baseAggregator,\n accumulator = initializer ? initializer() : {};\n\n return func(collection, setter, baseIteratee(iteratee, 2), accumulator);\n };\n}\n\nexport default createAggregator;\n","import root from './_root.js';\n\n/**\n * Gets the timestamp of the number of milliseconds that have elapsed since\n * the Unix epoch (1 January 1970 00:00:00 UTC).\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Date\n * @returns {number} Returns the timestamp.\n * @example\n *\n * _.defer(function(stamp) {\n * console.log(_.now() - stamp);\n * }, _.now());\n * // => Logs the number of milliseconds it took for the deferred invocation.\n */\nvar now = function() {\n return root.Date.now();\n};\n\nexport default now;\n","import isObject from './isObject.js';\nimport now from './now.js';\nimport toNumber from './toNumber.js';\n\n/** Error message constants. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max,\n nativeMin = Math.min;\n\n/**\n * Creates a debounced function that delays invoking `func` until after `wait`\n * milliseconds have elapsed since the last time the debounced function was\n * invoked. The debounced function comes with a `cancel` method to cancel\n * delayed `func` invocations and a `flush` method to immediately invoke them.\n * Provide `options` to indicate whether `func` should be invoked on the\n * leading and/or trailing edge of the `wait` timeout. The `func` is invoked\n * with the last arguments provided to the debounced function. Subsequent\n * calls to the debounced function return the result of the last `func`\n * invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the debounced function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until to the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n * for details over the differences between `_.debounce` and `_.throttle`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to debounce.\n * @param {number} [wait=0] The number of milliseconds to delay.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.leading=false]\n * Specify invoking on the leading edge of the timeout.\n * @param {number} [options.maxWait]\n * The maximum time `func` is allowed to be delayed before it's invoked.\n * @param {boolean} [options.trailing=true]\n * Specify invoking on the trailing edge of the timeout.\n * @returns {Function} Returns the new debounced function.\n * @example\n *\n * // Avoid costly calculations while the window size is in flux.\n * jQuery(window).on('resize', _.debounce(calculateLayout, 150));\n *\n * // Invoke `sendMail` when clicked, debouncing subsequent calls.\n * jQuery(element).on('click', _.debounce(sendMail, 300, {\n * 'leading': true,\n * 'trailing': false\n * }));\n *\n * // Ensure `batchLog` is invoked once after 1 second of debounced calls.\n * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });\n * var source = new EventSource('/stream');\n * jQuery(source).on('message', debounced);\n *\n * // Cancel the trailing debounced invocation.\n * jQuery(window).on('popstate', debounced.cancel);\n */\nfunction debounce(func, wait, options) {\n var lastArgs,\n lastThis,\n maxWait,\n result,\n timerId,\n lastCallTime,\n lastInvokeTime = 0,\n leading = false,\n maxing = false,\n trailing = true;\n\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n wait = toNumber(wait) || 0;\n if (isObject(options)) {\n leading = !!options.leading;\n maxing = 'maxWait' in options;\n maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;\n trailing = 'trailing' in options ? !!options.trailing : trailing;\n }\n\n function invokeFunc(time) {\n var args = lastArgs,\n thisArg = lastThis;\n\n lastArgs = lastThis = undefined;\n lastInvokeTime = time;\n result = func.apply(thisArg, args);\n return result;\n }\n\n function leadingEdge(time) {\n // Reset any `maxWait` timer.\n lastInvokeTime = time;\n // Start the timer for the trailing edge.\n timerId = setTimeout(timerExpired, wait);\n // Invoke the leading edge.\n return leading ? invokeFunc(time) : result;\n }\n\n function remainingWait(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime,\n timeWaiting = wait - timeSinceLastCall;\n\n return maxing\n ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)\n : timeWaiting;\n }\n\n function shouldInvoke(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime;\n\n // Either this is the first call, activity has stopped and we're at the\n // trailing edge, the system time has gone backwards and we're treating\n // it as the trailing edge, or we've hit the `maxWait` limit.\n return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||\n (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));\n }\n\n function timerExpired() {\n var time = now();\n if (shouldInvoke(time)) {\n return trailingEdge(time);\n }\n // Restart the timer.\n timerId = setTimeout(timerExpired, remainingWait(time));\n }\n\n function trailingEdge(time) {\n timerId = undefined;\n\n // Only invoke if we have `lastArgs` which means `func` has been\n // debounced at least once.\n if (trailing && lastArgs) {\n return invokeFunc(time);\n }\n lastArgs = lastThis = undefined;\n return result;\n }\n\n function cancel() {\n if (timerId !== undefined) {\n clearTimeout(timerId);\n }\n lastInvokeTime = 0;\n lastArgs = lastCallTime = lastThis = timerId = undefined;\n }\n\n function flush() {\n return timerId === undefined ? result : trailingEdge(now());\n }\n\n function debounced() {\n var time = now(),\n isInvoking = shouldInvoke(time);\n\n lastArgs = arguments;\n lastThis = this;\n lastCallTime = time;\n\n if (isInvoking) {\n if (timerId === undefined) {\n return leadingEdge(lastCallTime);\n }\n if (maxing) {\n // Handle invocations in a tight loop.\n clearTimeout(timerId);\n timerId = setTimeout(timerExpired, wait);\n return invokeFunc(lastCallTime);\n }\n }\n if (timerId === undefined) {\n timerId = setTimeout(timerExpired, wait);\n }\n return result;\n }\n debounced.cancel = cancel;\n debounced.flush = flush;\n return debounced;\n}\n\nexport default debounce;\n","import baseAssignValue from './_baseAssignValue.js';\nimport eq from './eq.js';\n\n/**\n * This function is like `assignValue` except that it doesn't assign\n * `undefined` values.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction assignMergeValue(object, key, value) {\n if ((value !== undefined && !eq(object[key], value)) ||\n (value === undefined && !(key in object))) {\n baseAssignValue(object, key, value);\n }\n}\n\nexport default assignMergeValue;\n","import isArrayLike from './isArrayLike.js';\nimport isObjectLike from './isObjectLike.js';\n\n/**\n * This method is like `_.isArrayLike` except that it also checks if `value`\n * is an object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array-like object,\n * else `false`.\n * @example\n *\n * _.isArrayLikeObject([1, 2, 3]);\n * // => true\n *\n * _.isArrayLikeObject(document.body.children);\n * // => true\n *\n * _.isArrayLikeObject('abc');\n * // => false\n *\n * _.isArrayLikeObject(_.noop);\n * // => false\n */\nfunction isArrayLikeObject(value) {\n return isObjectLike(value) && isArrayLike(value);\n}\n\nexport default isArrayLikeObject;\n","/**\n * Gets the value at `key`, unless `key` is \"__proto__\" or \"constructor\".\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction safeGet(object, key) {\n if (key === 'constructor' && typeof object[key] === 'function') {\n return;\n }\n\n if (key == '__proto__') {\n return;\n }\n\n return object[key];\n}\n\nexport default safeGet;\n","import copyObject from './_copyObject.js';\nimport keysIn from './keysIn.js';\n\n/**\n * Converts `value` to a plain object flattening inherited enumerable string\n * keyed properties of `value` to own properties of the plain object.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {Object} Returns the converted plain object.\n * @example\n *\n * function Foo() {\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.assign({ 'a': 1 }, new Foo);\n * // => { 'a': 1, 'b': 2 }\n *\n * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));\n * // => { 'a': 1, 'b': 2, 'c': 3 }\n */\nfunction toPlainObject(value) {\n return copyObject(value, keysIn(value));\n}\n\nexport default toPlainObject;\n","import assignMergeValue from './_assignMergeValue.js';\nimport cloneBuffer from './_cloneBuffer.js';\nimport cloneTypedArray from './_cloneTypedArray.js';\nimport copyArray from './_copyArray.js';\nimport initCloneObject from './_initCloneObject.js';\nimport isArguments from './isArguments.js';\nimport isArray from './isArray.js';\nimport isArrayLikeObject from './isArrayLikeObject.js';\nimport isBuffer from './isBuffer.js';\nimport isFunction from './isFunction.js';\nimport isObject from './isObject.js';\nimport isPlainObject from './isPlainObject.js';\nimport isTypedArray from './isTypedArray.js';\nimport safeGet from './_safeGet.js';\nimport toPlainObject from './toPlainObject.js';\n\n/**\n * A specialized version of `baseMerge` for arrays and objects which performs\n * deep merges and tracks traversed objects enabling objects with circular\n * references to be merged.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @param {string} key The key of the value to merge.\n * @param {number} srcIndex The index of `source`.\n * @param {Function} mergeFunc The function to merge values.\n * @param {Function} [customizer] The function to customize assigned values.\n * @param {Object} [stack] Tracks traversed source values and their merged\n * counterparts.\n */\nfunction baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {\n var objValue = safeGet(object, key),\n srcValue = safeGet(source, key),\n stacked = stack.get(srcValue);\n\n if (stacked) {\n assignMergeValue(object, key, stacked);\n return;\n }\n var newValue = customizer\n ? customizer(objValue, srcValue, (key + ''), object, source, stack)\n : undefined;\n\n var isCommon = newValue === undefined;\n\n if (isCommon) {\n var isArr = isArray(srcValue),\n isBuff = !isArr && isBuffer(srcValue),\n isTyped = !isArr && !isBuff && isTypedArray(srcValue);\n\n newValue = srcValue;\n if (isArr || isBuff || isTyped) {\n if (isArray(objValue)) {\n newValue = objValue;\n }\n else if (isArrayLikeObject(objValue)) {\n newValue = copyArray(objValue);\n }\n else if (isBuff) {\n isCommon = false;\n newValue = cloneBuffer(srcValue, true);\n }\n else if (isTyped) {\n isCommon = false;\n newValue = cloneTypedArray(srcValue, true);\n }\n else {\n newValue = [];\n }\n }\n else if (isPlainObject(srcValue) || isArguments(srcValue)) {\n newValue = objValue;\n if (isArguments(objValue)) {\n newValue = toPlainObject(objValue);\n }\n else if (!isObject(objValue) || isFunction(objValue)) {\n newValue = initCloneObject(srcValue);\n }\n }\n else {\n isCommon = false;\n }\n }\n if (isCommon) {\n // Recursively merge objects and arrays (susceptible to call stack limits).\n stack.set(srcValue, newValue);\n mergeFunc(newValue, srcValue, srcIndex, customizer, stack);\n stack['delete'](srcValue);\n }\n assignMergeValue(object, key, newValue);\n}\n\nexport default baseMergeDeep;\n","import Stack from './_Stack.js';\nimport assignMergeValue from './_assignMergeValue.js';\nimport baseFor from './_baseFor.js';\nimport baseMergeDeep from './_baseMergeDeep.js';\nimport isObject from './isObject.js';\nimport keysIn from './keysIn.js';\nimport safeGet from './_safeGet.js';\n\n/**\n * The base implementation of `_.merge` without support for multiple sources.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @param {number} srcIndex The index of `source`.\n * @param {Function} [customizer] The function to customize merged values.\n * @param {Object} [stack] Tracks traversed source values and their merged\n * counterparts.\n */\nfunction baseMerge(object, source, srcIndex, customizer, stack) {\n if (object === source) {\n return;\n }\n baseFor(source, function(srcValue, key) {\n stack || (stack = new Stack);\n if (isObject(srcValue)) {\n baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);\n }\n else {\n var newValue = customizer\n ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack)\n : undefined;\n\n if (newValue === undefined) {\n newValue = srcValue;\n }\n assignMergeValue(object, key, newValue);\n }\n }, keysIn);\n}\n\nexport default baseMerge;\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","/**\n * Gets the last element of `array`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to query.\n * @returns {*} Returns the last element of `array`.\n * @example\n *\n * _.last([1, 2, 3]);\n * // => 3\n */\nfunction last(array) {\n var length = array == null ? 0 : array.length;\n return length ? array[length - 1] : undefined;\n}\n\nexport default last;\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","/**\n * The inverse of `_.toPairs`; this method returns an object composed\n * from key-value `pairs`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} pairs The key-value pairs.\n * @returns {Object} Returns the new object.\n * @example\n *\n * _.fromPairs([['a', 1], ['b', 2]]);\n * // => { 'a': 1, 'b': 2 }\n */\nfunction fromPairs(pairs) {\n var index = -1,\n length = pairs == null ? 0 : pairs.length,\n result = {};\n\n while (++index < length) {\n var pair = pairs[index];\n result[pair[0]] = pair[1];\n }\n return result;\n}\n\nexport default fromPairs;\n","import baseAssignValue from './_baseAssignValue.js';\nimport createAggregator from './_createAggregator.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Creates an object composed of keys generated from the results of running\n * each element of `collection` thru `iteratee`. The order of grouped values\n * is determined by the order they occur in `collection`. The corresponding\n * value of each key is an array of elements responsible for generating the\n * key. The iteratee is invoked with one argument: (value).\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 iteratee to transform keys.\n * @returns {Object} Returns the composed aggregate object.\n * @example\n *\n * _.groupBy([6.1, 4.2, 6.3], Math.floor);\n * // => { '4': [4.2], '6': [6.1, 6.3] }\n *\n * // The `_.property` iteratee shorthand.\n * _.groupBy(['one', 'two', 'three'], 'length');\n * // => { '3': ['one', 'two'], '5': ['three'] }\n */\nvar groupBy = createAggregator(function(result, value, key) {\n if (hasOwnProperty.call(result, key)) {\n result[key].push(value);\n } else {\n baseAssignValue(result, key, [value]);\n }\n});\n\nexport default groupBy;\n","import baseGet from './_baseGet.js';\nimport baseSlice from './_baseSlice.js';\n\n/**\n * Gets the parent value at `path` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array} path The path to get the parent value of.\n * @returns {*} Returns the parent value.\n */\nfunction parent(object, path) {\n return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));\n}\n\nexport default parent;\n","import baseKeys from './_baseKeys.js';\nimport getTag from './_getTag.js';\nimport isArguments from './isArguments.js';\nimport isArray from './isArray.js';\nimport isArrayLike from './isArrayLike.js';\nimport isBuffer from './isBuffer.js';\nimport isPrototype from './_isPrototype.js';\nimport isTypedArray from './isTypedArray.js';\n\n/** `Object#toString` result references. */\nvar mapTag = '[object Map]',\n setTag = '[object Set]';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Checks if `value` is an empty object, collection, map, or set.\n *\n * Objects are considered empty if they have no own enumerable string keyed\n * properties.\n *\n * Array-like values such as `arguments` objects, arrays, buffers, strings, or\n * jQuery-like collections are considered empty if they have a `length` of `0`.\n * Similarly, maps and sets are considered empty if they have a `size` of `0`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is empty, else `false`.\n * @example\n *\n * _.isEmpty(null);\n * // => true\n *\n * _.isEmpty(true);\n * // => true\n *\n * _.isEmpty(1);\n * // => true\n *\n * _.isEmpty([1, 2, 3]);\n * // => false\n *\n * _.isEmpty({ 'a': 1 });\n * // => false\n */\nfunction isEmpty(value) {\n if (value == null) {\n return true;\n }\n if (isArrayLike(value) &&\n (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' ||\n isBuffer(value) || isTypedArray(value) || isArguments(value))) {\n return !value.length;\n }\n var tag = getTag(value);\n if (tag == mapTag || tag == setTag) {\n return !value.size;\n }\n if (isPrototype(value)) {\n return !baseKeys(value).length;\n }\n for (var key in value) {\n if (hasOwnProperty.call(value, key)) {\n return false;\n }\n }\n return true;\n}\n\nexport default isEmpty;\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 baseMerge from './_baseMerge.js';\nimport createAssigner from './_createAssigner.js';\n\n/**\n * This method is like `_.assign` except that it recursively merges own and\n * inherited enumerable string keyed properties of source objects into the\n * destination object. Source properties that resolve to `undefined` are\n * skipped if a destination value exists. Array and plain object properties\n * are merged recursively. Other objects and value types are overridden by\n * assignment. Source objects are applied from left to right. Subsequent\n * sources overwrite property assignments of previous sources.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 0.5.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = {\n * 'a': [{ 'b': 2 }, { 'd': 4 }]\n * };\n *\n * var other = {\n * 'a': [{ 'c': 3 }, { 'e': 5 }]\n * };\n *\n * _.merge(object, other);\n * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }\n */\nvar merge = createAssigner(function(object, source, srcIndex) {\n baseMerge(object, source, srcIndex);\n});\n\nexport default merge;\n","import castPath from './_castPath.js';\nimport last from './last.js';\nimport parent from './_parent.js';\nimport toKey from './_toKey.js';\n\n/**\n * The base implementation of `_.unset`.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {Array|string} path The property path to unset.\n * @returns {boolean} Returns `true` if the property is deleted, else `false`.\n */\nfunction baseUnset(object, path) {\n path = castPath(path, object);\n object = parent(object, path);\n return object == null || delete object[toKey(last(path))];\n}\n\nexport default baseUnset;\n","import isPlainObject from './isPlainObject.js';\n\n/**\n * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain\n * objects.\n *\n * @private\n * @param {*} value The value to inspect.\n * @param {string} key The key of the property to inspect.\n * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`.\n */\nfunction customOmitClone(value) {\n return isPlainObject(value) ? undefined : value;\n}\n\nexport default customOmitClone;\n","import arrayMap from './_arrayMap.js';\nimport baseClone from './_baseClone.js';\nimport baseUnset from './_baseUnset.js';\nimport castPath from './_castPath.js';\nimport copyObject from './_copyObject.js';\nimport customOmitClone from './_customOmitClone.js';\nimport flatRest from './_flatRest.js';\nimport getAllKeysIn from './_getAllKeysIn.js';\n\n/** Used to compose bitmasks for cloning. */\nvar CLONE_DEEP_FLAG = 1,\n CLONE_FLAT_FLAG = 2,\n CLONE_SYMBOLS_FLAG = 4;\n\n/**\n * The opposite of `_.pick`; this method creates an object composed of the\n * own and inherited enumerable property paths of `object` that are not omitted.\n *\n * **Note:** This method is considerably slower than `_.pick`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The source object.\n * @param {...(string|string[])} [paths] The property paths to omit.\n * @returns {Object} Returns the new object.\n * @example\n *\n * var object = { 'a': 1, 'b': '2', 'c': 3 };\n *\n * _.omit(object, ['a', 'c']);\n * // => { 'b': '2' }\n */\nvar omit = flatRest(function(object, paths) {\n var result = {};\n if (object == null) {\n return result;\n }\n var isDeep = false;\n paths = arrayMap(paths, function(path) {\n path = castPath(path, object);\n isDeep || (isDeep = path.length > 1);\n return path;\n });\n copyObject(object, getAllKeysIn(object), result);\n if (isDeep) {\n result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone);\n }\n var length = paths.length;\n while (length--) {\n baseUnset(result, paths[length]);\n }\n return result;\n});\n\nexport default omit;\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","import Set from './_Set.js';\nimport noop from './noop.js';\nimport setToArray from './_setToArray.js';\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0;\n\n/**\n * Creates a set object of `values`.\n *\n * @private\n * @param {Array} values The values to add to the set.\n * @returns {Object} Returns the new set.\n */\nvar createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {\n return new Set(values);\n};\n\nexport default createSet;\n","import SetCache from './_SetCache.js';\nimport arrayIncludes from './_arrayIncludes.js';\nimport arrayIncludesWith from './_arrayIncludesWith.js';\nimport cacheHas from './_cacheHas.js';\nimport createSet from './_createSet.js';\nimport setToArray from './_setToArray.js';\n\n/** Used as the size to enable large array optimizations. */\nvar LARGE_ARRAY_SIZE = 200;\n\n/**\n * The base implementation of `_.uniqBy` without support for iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new duplicate free array.\n */\nfunction baseUniq(array, iteratee, comparator) {\n var index = -1,\n includes = arrayIncludes,\n length = array.length,\n isCommon = true,\n result = [],\n seen = result;\n\n if (comparator) {\n isCommon = false;\n includes = arrayIncludesWith;\n }\n else if (length >= LARGE_ARRAY_SIZE) {\n var set = iteratee ? null : createSet(array);\n if (set) {\n return setToArray(set);\n }\n isCommon = false;\n includes = cacheHas;\n seen = new SetCache;\n }\n else {\n seen = iteratee ? [] : result;\n }\n outer:\n while (++index < length) {\n var value = array[index],\n computed = iteratee ? iteratee(value) : value;\n\n value = (comparator || value !== 0) ? value : 0;\n if (isCommon && computed === computed) {\n var seenIndex = seen.length;\n while (seenIndex--) {\n if (seen[seenIndex] === computed) {\n continue outer;\n }\n }\n if (iteratee) {\n seen.push(computed);\n }\n result.push(value);\n }\n else if (!includes(seen, computed, comparator)) {\n if (seen !== result) {\n seen.push(computed);\n }\n result.push(value);\n }\n }\n return result;\n}\n\nexport default baseUniq;\n","import baseFlatten from './_baseFlatten.js';\nimport baseIteratee from './_baseIteratee.js';\nimport baseRest from './_baseRest.js';\nimport baseUniq from './_baseUniq.js';\nimport isArrayLikeObject from './isArrayLikeObject.js';\nimport last from './last.js';\n\n/**\n * This method is like `_.union` except that it accepts `iteratee` which is\n * invoked for each element of each `arrays` to generate the criterion by\n * which uniqueness is computed. Result values are chosen from the first\n * array in which the value occurs. The iteratee is invoked with one argument:\n * (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {Array} Returns the new array of combined values.\n * @example\n *\n * _.unionBy([2.1], [1.2, 2.3], Math.floor);\n * // => [2.1, 1.2]\n *\n * // The `_.property` iteratee shorthand.\n * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');\n * // => [{ 'x': 1 }, { 'x': 2 }]\n */\nvar unionBy = baseRest(function(arrays) {\n var iteratee = last(arrays);\n if (isArrayLikeObject(iteratee)) {\n iteratee = undefined;\n }\n return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), baseIteratee(iteratee, 2));\n});\n\nexport default unionBy;\n","import baseUniq from './_baseUniq.js';\n\n/**\n * Creates a duplicate-free version of an array, using\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons, in which only the first occurrence of each element\n * is kept. The order of result values is determined by the order they occur\n * in the array.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @returns {Array} Returns the new duplicate free array.\n * @example\n *\n * _.uniq([2, 1, 2]);\n * // => [2, 1]\n */\nfunction uniq(array) {\n return (array && array.length) ? baseUniq(array) : [];\n}\n\nexport default uniq;\n","/**\n * enum of all events related to the chart on the DOM\n */\nexport enum Chart {\n\tRENDER_FINISHED = 'render-finished',\n\tRESIZE = 'chart-resize',\n\tMOUSEOVER = 'chart-mouseover',\n\t// MOUSEMOVE = \"chart-mousemove\",\n\t// CLICK = \"chart-click\",\n\tMOUSEOUT = 'chart-mouseout'\n}\n\n/**\n * enum of all events related to the overlay modal\n */\nexport enum Modal {\n\tSHOW = 'show-modal',\n\tHIDE = 'hide-modal'\n}\n\n/**\n * enum of all events related to the chart model\n */\nexport enum Model {\n\tUPDATE = 'model-update'\n}\n\n/**\n * enum of all toolbar events\n */\nexport enum Toolbar {\n\tSHOW_OVERFLOW_MENU = 'show-toolbar-overflow-menu',\n\tHIDE_OVERFLOW_MENU = 'hide-toolbar-overflow-menu',\n\tBUTTON_CLICK = 'toolbar-button-click',\n\tSHOW_TOOLTIP = 'toolbar-show-tooltip',\n\tHIDE_TOOLTIP = 'toolbar-hide-tooltip'\n}\n\n/**\n * enum of all events related to the zoom-bar\n */\nexport enum ZoomBar {\n\tUPDATE = 'zoom-bar-update',\n\tSELECTION_START = 'zoom-bar-selection-start',\n\tSELECTION_IN_PROGRESS = 'zoom-bar-selection-in-progress',\n\tSELECTION_END = 'zoom-bar-selection-end'\n}\n\n/**\n * enum of all events related to the zoom domain\n */\nexport enum ZoomDomain {\n\tCHANGE = 'zoom-domain-change'\n}\n\n/** enum of all events related to canvas zoom *\n *\n */\nexport enum CanvasZoom {\n\tCANVAS_ZOOM_IN = 'canvas-zoom-in',\n\tCANVAS_ZOOM_OUT = 'canvas-zoom-out'\n}\n\n/**\n * enum of all axis-related events\n */\nexport enum Axis {\n\tLABEL_MOUSEOVER = 'axis-label-mouseover',\n\tLABEL_MOUSEMOVE = 'axis-label-mousemove',\n\tLABEL_CLICK = 'axis-label-click',\n\tLABEL_MOUSEOUT = 'axis-label-mouseout',\n\tLABEL_FOCUS = 'axis-label-focus',\n\tLABEL_BLUR = 'axis-label-blur',\n\tRENDER_COMPLETE = 'axis-render-complete'\n}\n\n/**\n * enum of all area graph events\n */\nexport enum Area {\n\tPOINT_MOUSEOVER = 'scatter-mouseover',\n\tPOINT_MOUSEMOVE = 'scatter-mousemove',\n\tPOINT_CLICK = 'scatter-click',\n\tPOINT_MOUSEOUT = 'scatter-mouseout'\n}\n\n/**\n * enum of all wordcloud graph events\n */\nexport enum WordCloud {\n\tWORD_MOUSEOVER = 'wordcloud-word-mouseover',\n\tWORD_MOUSEMOVE = 'wordcloud-word-mousemove',\n\tWORD_CLICK = 'wordcloud-word-click',\n\tWORD_MOUSEOUT = 'wordcloud-word-mouseout'\n}\n\n/**\n * enum of all pie graph events\n */\nexport enum Pie {\n\tSLICE_MOUSEOVER = 'pie-slice-mouseover',\n\tSLICE_MOUSEMOVE = 'pie-slice-mousemove',\n\tSLICE_CLICK = 'pie-slice-click',\n\tSLICE_MOUSEOUT = 'pie-slice-mouseout'\n}\n\n/**\n * enum of all gauge graph events\n */\nexport enum Gauge {\n\tARC_MOUSEOVER = 'gauge-arc-mouseover',\n\tARC_MOUSEMOVE = 'gauge-arc-mousemove',\n\tARC_CLICK = 'gauge-arc-click',\n\tARC_MOUSEOUT = 'gauge-arc-mouseout'\n}\n\n/**\n * enum of all bar graph events\n */\nexport enum Bar {\n\tBAR_MOUSEOVER = 'bar-mouseover',\n\tBAR_MOUSEMOVE = 'bar-mousemove',\n\tBAR_CLICK = 'bar-click',\n\tBAR_MOUSEOUT = 'bar-mouseout'\n}\n\n/**\n * enum of all boxplot graph events\n */\nexport enum Boxplot {\n\tBOX_MOUSEOVER = 'box-mouseover',\n\tBOX_MOUSEMOVE = 'box-mousemove',\n\tBOX_CLICK = 'box-click',\n\tBOX_MOUSEOUT = 'box-mouseout',\n\tOUTLIER_MOUSEOVER = 'outlier-mouseover',\n\tOUTLIER_MOUSEMOVE = 'outlier-mousemove',\n\tOUTLIER_CLICK = 'outlier-click',\n\tOUTLIER_MOUSEOUT = 'outlier-mouseout'\n}\n\n/**\n * enum of all scatter graph events\n */\nexport enum Scatter {\n\tSCATTER_MOUSEOVER = 'scatter-mouseover',\n\tSCATTER_MOUSEMOVE = 'scatter-mousemove',\n\tSCATTER_CLICK = 'scatter-click',\n\tSCATTER_MOUSEOUT = 'scatter-mouseout'\n}\n\n/**\n * enum of all line graph events\n */\nexport enum Line {\n\tPOINT_MOUSEOVER = 'scatter-mouseover',\n\tPOINT_MOUSEMOVE = 'scatter-mousemove',\n\tPOINT_CLICK = 'scatter-click',\n\tPOINT_MOUSEOUT = 'scatter-mouseout'\n}\n\n/**\n * enum of all radar graph events\n */\nexport enum Radar {\n\tX_AXIS_MOUSEOVER = 'radar-x-axis-mouseover',\n\tX_AXIS_MOUSEMOVE = 'radar-x-axis-mousemove',\n\tX_AXIS_CLICK = 'radar-x-axis-click',\n\tX_AXIS_MOUSEOUT = 'radar-x-axis-mouseout'\n}\n\n/**\n * enum of all tree graph events\n */\nexport enum Tree {\n\tNODE_MOUSEOVER = 'tree-node-mouseover',\n\tNODE_CLICK = 'tree-node-click',\n\tNODE_MOUSEOUT = 'tree-node-mouseout'\n}\n\n/**\n * enum of all treemap graph events\n */\nexport enum Treemap {\n\tLEAF_MOUSEOVER = 'leaf-mouseover',\n\tLEAF_MOUSEMOVE = 'leaf-mousemove',\n\tLEAF_CLICK = 'leaf-click',\n\tLEAF_MOUSEOUT = 'leaf-mouseout'\n}\n\n/**\n * enum of all tooltip events\n */\nexport enum Tooltip {\n\tSHOW = 'show-tooltip',\n\tMOVE = 'move-tooltip',\n\tHIDE = 'hide-tooltip'\n}\n\n/**\n * enum of all threshold events\n */\nexport enum Threshold {\n\tSHOW = 'show-threshold',\n\tHIDE = 'hide-threshold'\n}\n\n/**\n * enum of all legend related events\n */\nexport enum Legend {\n\tITEM_HOVER = 'legend-item-onhover',\n\tITEM_CLICK = 'legend-item-onclick',\n\tITEM_MOUSEOUT = 'legend-item-onmouseout',\n\tITEMS_UPDATE = 'legend-items-update'\n}\n\n/**\n * enum of all circlepack related events\n */\nexport enum CirclePack {\n\tCIRCLE_MOUSEOVER = 'circle-leaf-mouseover',\n\tCIRCLE_CLICK = 'circle-leaf-click',\n\tCIRCLE_MOUSEOUT = 'circle-leaf-mouseout',\n\tCIRCLE_MOUSEMOVE = 'circle-leaf-mousemove'\n}\n\n/**\n * enum of all alluvial related events\n */\nexport enum Alluvial {\n\tNODE_MOUSEOVER = 'alluvial-node-mouseover',\n\tNODE_CLICK = 'alluvial-node-click',\n\tNODE_MOUSEOUT = 'alluvial-node-mouseout',\n\tNODE_MOUSEMOVE = 'alluvial-node-mousemove',\n\tLINE_MOUSEOVER = 'alluvial-line-mouseover',\n\tLINE_CLICK = 'alluvial-line-click',\n\tLINE_MOUSEOUT = 'alluvial-line-mouseout',\n\tLINE_MOUSEMOVE = 'alluvial-line-mousemove'\n}\n\n/**\n * enum of all meter related events\n */\nexport enum Meter {\n\tMETER_MOUSEOVER = 'meter-mouseover',\n\tMETER_CLICK = 'meter-click',\n\tMETER_MOUSEOUT = 'meter-mouseout',\n\tMETER_MOUSEMOVE = 'meter-mousemove'\n}\n\n/**\n * enum of all heatmap related events\n */\nexport enum Heatmap {\n\tHEATMAP_MOUSEOVER = 'heatmap-mouseover',\n\tHEATMAP_CLICK = 'heatmap-click',\n\tHEATMAP_MOUSEOUT = 'heatmap-mouseout',\n\tHEATMAP_MOUSEMOVE = 'hetmap-mousemove'\n}\n\n/**\n * enum of all choropleth related events\n */\nexport enum Choropleth {\n\tCHOROPLETH_MOUSEOVER = 'choropleth-mouseover',\n\tCHOROPLETH_CLICK = 'choropleth-click',\n\tCHOROPLETH_MOUSEOUT = 'choropleth-mouseout',\n\tCHOROPLETH_MOUSEMOVE = 'choropleth-mousemove'\n}\n","import * as EventEnums from './events'\nexport const Events = EventEnums\n\nexport enum RenderTypes {\n\tHTML = 'html',\n\tSVG = 'svg'\n}\n\n/**\n * enum of all supported chart themes\n */\nexport enum ChartTheme {\n\tWHITE = 'white',\n\tG100 = 'g100',\n\tG90 = 'g90',\n\tG10 = 'g10'\n}\n\n/**\n * enum of all color classname types\n */\nexport enum ColorClassNameTypes {\n\tBACKGROUND = 'background',\n\tFILL = 'fill',\n\tSTROKE = 'stroke',\n\tTOOLTIP = 'tooltip'\n}\n\n/**\n * enum of all possible axis positions\n */\nexport enum AxisPositions {\n\tLEFT = 'left',\n\tRIGHT = 'right',\n\tTOP = 'top',\n\tBOTTOM = 'bottom'\n}\n\n/**\n * enum of all possible axis positions\n */\nexport enum ZoomBarTypes {\n\tGRAPH_VIEW = 'graph_view',\n\tSLIDER_VIEW = 'slider_view'\n}\n\n/**\n * enum of all possible truncation types\n */\nexport enum TruncationTypes {\n\tEND_LINE = 'end_line',\n\tMID_LINE = 'mid_line',\n\tFRONT_LINE = 'front_line',\n\tNONE = 'none'\n}\n\n/**\n * enum of all possible cartesian orientations\n * to be used for determining the orientation\n * of graphs being draw over\n * cartesian scales\n */\nexport enum CartesianOrientations {\n\tVERTICAL = 'vertical',\n\tHORIZONTAL = 'horizontal'\n}\n\n/**\n * enum of all possible scale types\n */\nexport enum ScaleTypes {\n\tTIME = 'time',\n\tLINEAR = 'linear',\n\tLOG = 'log',\n\tLABELS = 'labels',\n\tLABELS_RATIO = 'labels-ratio'\n}\n\n/**\n * enum of all possible legend positions\n */\nexport enum LegendPositions {\n\tRIGHT = 'right',\n\tLEFT = 'left',\n\tTOP = 'top',\n\tBOTTOM = 'bottom'\n}\n\n/**\n * enum of all possible alignments\n */\nexport enum Alignments {\n\tLEFT = 'left',\n\tCENTER = 'center',\n\tRIGHT = 'right'\n}\n\n/**\n * enum of all possible legend orientations\n */\nexport enum LegendOrientations {\n\tHORIZONTAL = 'horizontal',\n\tVERTICAL = 'vertical'\n}\n\n/**\n * enum of tree types for the tree chart\n */\nexport enum TreeTypes {\n\tTREE = 'tree',\n\tDENDROGRAM = 'dendrogram'\n}\n\n/**\n * enum of all possible layout directions\n */\nexport enum LayoutDirection {\n\tROW = 'row',\n\tCOLUMN = 'column',\n\tROW_REVERSE = 'row-reverse',\n\tCOLUMN_REVERSE = 'column-reverse'\n}\n\n/**\n * enum of all possible layout growth values\n */\nexport enum LayoutGrowth {\n\tFIXED = 'fixed',\n\tPREFERRED = 'preferred',\n\tSTRETCH = 'stretch'\n}\n\n/**\n * enum of all possible layout align-items values\n */\nexport enum LayoutAlignItems {\n\tCENTER = 'center'\n}\n\n/**\n * enum of all possible callout directions\n */\nexport enum CalloutDirections {\n\tLEFT = 'left',\n\tRIGHT = 'right'\n}\n\n/**\n * enum of all possible skeleton/empty state types\n */\nexport enum Skeletons {\n\tGRID = 'grid',\n\tVERT_OR_HORIZ = 'vertOrHoriz',\n\tPIE = 'pie',\n\tDONUT = 'donut'\n}\n\n/**\n * enum of all possible attributes used to aling text horizontally\n */\nexport enum TextAnchor {\n\tSTART = 'start',\n\tMIDDLE = 'middle',\n\tEND = 'end'\n}\n\n/**\n * enum of all possible attributes used to aling text vertically\n */\nexport enum DominantBaseline {\n\tBASELINE = 'baseline',\n\tMIDDLE = 'middle',\n\tHANGING = 'hanging'\n}\n\nexport enum GaugeTypes {\n\tSEMI = 'semi',\n\tFULL = 'full'\n}\n\n/**\n * enum of all possible callout directions\n */\nexport enum ArrowDirections {\n\tUP = 'up',\n\tDOWN = 'down'\n}\n\n/**\n * enum of carbon statuses\n */\nexport enum Statuses {\n\tSUCCESS = 'success',\n\tWARNING = 'warning',\n\tDANGER = 'danger'\n}\n\n/**\n * enum of axis ticks rotation\n */\nexport enum TickRotations {\n\tALWAYS = 'always',\n\tAUTO = 'auto',\n\tNEVER = 'never'\n}\n\n/**\n * enum of chartTypes that work with combo chart\n */\nexport enum ChartTypes {\n\tSCATTER = 'scatter',\n\tLINE = 'line',\n\tSIMPLE_BAR = 'simple-bar',\n\tSTACKED_BAR = 'stacked-bar',\n\tGROUPED_BAR = 'grouped-bar',\n\tAREA = 'area',\n\tSTACKED_AREA = 'stacked-area'\n}\n\n/**\n * enum of supported toolbar control types\n */\nexport enum ToolbarControlTypes {\n\tEXPORT_CSV = 'Export as CSV',\n\tEXPORT_PNG = 'Export as PNG',\n\tEXPORT_JPG = 'Export as JPG',\n\tZOOM_IN = 'Zoom in',\n\tZOOM_OUT = 'Zoom out',\n\tRESET_ZOOM = 'Reset zoom',\n\tMAKE_FULLSCREEN = 'Make fullscreen',\n\tEXIT_FULLSCREEN = 'Exit fullscreen',\n\tSHOW_AS_DATATABLE = 'Show as data-table',\n\tCUSTOM = 'Custom'\n}\n\n/**\n * enum of title orientations for _vertical axes_\n */\nexport enum AxisTitleOrientations {\n\tLEFT = 'left',\n\tRIGHT = 'right'\n}\n\n/**\n * enum of legend item type\n */\nexport enum LegendItemType {\n\tCHECKBOX = 'checkbox',\n\tRADIUS = 'radius',\n\tAREA = 'area',\n\tSIZE = 'size',\n\tLINE = 'line',\n\tQUARTILE = 'quartile',\n\tZOOM = 'zoom'\n}\n\n/**\n * enum of color legend types\n */\nexport enum ColorLegendType {\n\tLINEAR = 'linear',\n\tQUANTIZE = 'quantize'\n}\n\n/**\n * enum of divider status for heatmap\n */\nexport enum DividerStatus {\n\tON = 'on',\n\tAUTO = 'auto',\n\tOFF = 'off'\n}\n\n/**\n * enum of axis flavor\n */\nexport enum AxisFlavor {\n\tDEFAULT = 'default',\n\tHOVERABLE = 'hoverable'\n}\n\n/**\n * enum of supported projection types\n */\nexport enum Projection {\n\t// Azimuthal Projections\n\tgeoEqualEarth = 'geoEqualEarth',\n\n\t// Conic projections\n\tgeoAlbers = 'geoAlbers',\n\tgeoConicEqualArea = 'geoConicEqualArea',\n\tgeoConicEquidistant = 'geoConicEquidistant',\n\n\t// Cylindrical projections\n\tgeoEquirectangular = 'geoEquirectangular',\n\tgeoMercator = 'geoMercator',\n\tgeoNaturalEarth1 = 'geoNaturalEarth1'\n}\n","import { easeCubicInOut } from 'd3'\nimport { LegendItemType, ZoomBarTypes } from '@/interfaces/enums'\n\nexport const carbonPrefix = 'cds' as string\n\nexport const area = {\n\topacity: {\n\t\tunselected: 0.05,\n\t\tselected: 0.4\n\t}\n}\n\nexport const axis = {\n\tticks: {\n\t\tnumber: 7,\n\t\trotateIfSmallerThan: 30,\n\t\tverticalSpaceRatio: 2.5,\n\t\thorizontalSpaceRatio: 3.5\n\t},\n\tratio: {\n\t\treference: 'value',\n\t\tcompareTo: 'marker'\n\t},\n\tpaddingRatio: 0.1,\n\thover: {\n\t\trectanglePadding: 4\n\t}\n}\n\nexport const canvasZoomSettings = {\n\tduration: 1000,\n\tease: easeCubicInOut,\n\tzoomLevel: 3\n}\n\nexport const circlePack = {\n\tcircles: {\n\t\tfillOpacity: 0.3,\n\t\thover: {\n\t\t\tstroke: '#FFF'\n\t\t}\n\t},\n\tpadding: {\n\t\tmainGroup: 4,\n\t\tchildren: 2\n\t},\n\tdepth: 2\n}\n\nexport const color = {\n\tpairingOptions: {\n\t\t'1-color': 4,\n\t\t'2-color': 5,\n\t\t'3-color': 5,\n\t\t'4-color': 3,\n\t\t'5-color': 2,\n\t\t'14-color': 1\n\t}\n}\n\nexport const boxplot = {\n\tcircle: {\n\t\tradius: 4,\n\t\topacity: {\n\t\t\thovered: 1,\n\t\t\tdefault: 0.3\n\t\t}\n\t},\n\tbox: {\n\t\topacity: {\n\t\t\thovered: 0.5,\n\t\t\tdefault: 0.3\n\t\t}\n\t},\n\tstrokeWidth: {\n\t\tdefault: 1,\n\t\tthicker: 2\n\t}\n}\n\nexport const histogram = {\n\tdefaultBins: 10\n}\n\nexport const legend = {\n\titems: {\n\t\tstatus: {\n\t\t\tACTIVE: 1,\n\t\t\tDISABLED: 0\n\t\t},\n\t\thorizontalSpace: 12,\n\t\tverticalSpace: 24,\n\t\ttextYOffset: 8,\n\t\tspaceAfter: 4\n\t},\n\tcheckbox: {\n\t\tradius: 6.5\n\t},\n\tradius: {\n\t\ticonData: [\n\t\t\t{ cx: 7, cy: 7, r: 6.5 },\n\t\t\t{ cx: 7, cy: 10, r: 3.5 }\n\t\t],\n\t\tfill: null as any,\n\t\tstroke: '#8c8c8c'\n\t},\n\tline: {\n\t\tyPosition: 6,\n\t\twidth: 24,\n\t\tstrokeWidth: 1.4,\n\t\tfill: null as any,\n\t\tstroke: '#999999'\n\t},\n\tarea: {\n\t\twidth: 24,\n\t\theight: 14,\n\t\tfill: '#6f6f6f',\n\t\tstroke: null as any\n\t},\n\tsize: {\n\t\ticonData: [\n\t\t\t{ width: 23, height: 12 },\n\t\t\t{ width: 13, height: 6 }\n\t\t],\n\t\tfill: null as any,\n\t\tstroke: '#8D8D8D'\n\t},\n\tquartile: {\n\t\ticonData: [\n\t\t\t{ x: 0, y: 0, width: 24, height: 13 },\n\t\t\t{ x: 11, y: 4, width: 1, height: 4 }\n\t\t]\n\t},\n\tzoom: {\n\t\ticonData: [{ x: 0, y: 0, width: 12, height: 12 }],\n\t\tcolor: '#8D8D8D'\n\t},\n\tcolor: {\n\t\tbarWidth: 300,\n\t\tbarHeight: 8,\n\t\taxisYTranslation: 10\n\t}\n}\n\nexport const lines = {\n\topacity: {\n\t\tunselected: 0.3,\n\t\tselected: 1\n\t},\n\tweight: {\n\t\tselected: 2,\n\t\tunselected: 1\n\t}\n}\n\nexport const meter = {\n\tstatusBar: {\n\t\tpaddingRight: 5\n\t},\n\tstatus: {\n\t\tindicatorSize: 16,\n\t\tpaddingLeft: 15\n\t},\n\ttotal: {\n\t\tpaddingLeft: 36,\n\t\tpaddingRight: 24\n\t},\n\theight: {\n\t\tdefault: 8,\n\t\tproportional: 16\n\t},\n\tdividerWidth: 2\n}\n\nexport const pie = {\n\tradiusOffset: -15,\n\tinnerRadius: 2,\n\tpadAngle: 0.007,\n\thoverArc: {\n\t\touterRadiusOffset: 3\n\t},\n\txOffset: 30,\n\tyOffset: 20,\n\tyOffsetCallout: 10,\n\tcallout: {\n\t\tminSliceDegree: 5,\n\t\toffsetX: 15,\n\t\toffsetY: 12,\n\t\thorizontalLineLength: 8,\n\t\ttextMargin: 2\n\t}\n}\n\nexport const radar = {\n\topacity: {\n\t\tunselected: 0.1,\n\t\tselected: 0.3\n\t},\n\txLabelPadding: 10,\n\tyLabelPadding: 8,\n\tyTicksNumber: 4,\n\tminRange: 10,\n\txAxisRectHeight: 50,\n\tdotsRadius: 5\n}\n\nexport const alluvial = {\n\tnodeWidth: 4,\n\tnodeHoveredWidth: 8,\n\tminNodePadding: 24,\n\topacity: {\n\t\tunfocus: 0.3,\n\t\tdefault: 0.8,\n\t\tselected: 1\n\t}\n}\n\nexport const heatmap = {\n\tminCellDividerDimension: 16,\n\t// Ensures axes lines are displayed with or without stroke disabled\n\tchartPadding: 0.5\n}\n\nexport const spacers = {\n\tdefault: {\n\t\tsize: 24\n\t}\n}\n\nexport const tooltips = {\n\tdefaultOffset: 4,\n\thorizontalOffset: 10\n}\n\n/**\n * Base transition configuration\n */\nexport const transitions = {\n\tdefault: {\n\t\tduration: 300\n\t},\n\tpie_slice_mouseover: {\n\t\tduration: 100\n\t},\n\tpie_slice_mouseout: {\n\t\tduration: 100\n\t},\n\tpie_chart_titles: {\n\t\tduration: 375\n\t},\n\tgraph_element_mouseover_fill_update: {\n\t\tduration: 100\n\t},\n\tgraph_element_mouseout_fill_update: {\n\t\tduration: 100\n\t}\n}\n\nexport const toolbar = {\n\tbuttonSize: 32,\n\ticonSize: 20,\n\theight: 32,\n\tspacerHeight: 10,\n\ticonPadding: 6\n}\n\nexport const zoomBar = {\n\theight: {\n\t\t[ZoomBarTypes.GRAPH_VIEW]: 32,\n\t\t[ZoomBarTypes.SLIDER_VIEW]: 10\n\t},\n\tspacerHeight: 8,\n\thandleWidth: 5,\n\thandleBarWidth: 1,\n\thandleBarHeight: 12\n}\n\nexport const defaultLegendAdditionalItems = [\n\t{\n\t\ttype: LegendItemType.RADIUS,\n\t\tname: 'Radius'\n\t},\n\t{\n\t\ttype: LegendItemType.AREA,\n\t\tname: 'Poor area'\n\t},\n\t{\n\t\ttype: LegendItemType.AREA,\n\t\tname: 'Satisfactory area'\n\t},\n\t{\n\t\ttype: LegendItemType.AREA,\n\t\tname: 'Great area'\n\t},\n\t{\n\t\ttype: LegendItemType.QUARTILE,\n\t\tname: 'Quartiles'\n\t}\n]\n","import { pointer, type Numeric } from 'd3'\nimport { merge, cloneDeep, unionBy } from 'lodash-es'\nimport { CartesianOrientations, ScaleTypes, TruncationTypes } from '@/interfaces/enums'\nimport { defaultLegendAdditionalItems } from './configuration-non-customizable'\n\nexport function debounceWithD3MousePosition(fn: any, delay: number, holder: any) {\n\tlet timer: any = null\n\treturn function (...args: any) {\n\t\tconst context = this\n\n\t\t// Get D3 event here\n\t\tcontext.mousePosition = pointer(args[0], holder)\n\n\t\tclearTimeout(timer)\n\n\t\ttimer = setTimeout(function () {\n\t\t\t// and use reference here\n\t\t\tfn.apply(context, args)\n\t\t}, delay)\n\t}\n}\n\n/**\n * Returns default chart options merged with provided options,\n * with special cases for axes.\n * Axes object will not merge the not provided axes.\n *\n * @export\n * @param {AxisChartOptions} defaultOptions Configuration.options[chartType]\n * @param {AxisChartOptions} providedOptions user provided options\n * @returns merged options\n */\nexport function mergeDefaultChartOptions(defaultOptions: any, providedOptions: any) {\n\tconst clonedDefaultOptions = cloneDeep(defaultOptions)\n\tconst providedAxesNames = Object.keys(providedOptions.axes || {})\n\n\t// Use provide controls list if it exists\n\t// Prevents merging and element overriding of the two lists\n\tif (providedOptions?.toolbar?.controls) {\n\t\tdelete clonedDefaultOptions.toolbar.controls\n\t}\n\n\tif (providedAxesNames.length === 0) {\n\t\tdelete clonedDefaultOptions.axes\n\t}\n\n\t// Update deprecated options to work with the tabular data format\n\t// Similar to the functionality in model.transformToTabularData()\n\tfor (const axisName in clonedDefaultOptions.axes) {\n\t\tif (providedAxesNames.includes(axisName)) {\n\t\t\tconst providedAxisOptions = providedOptions.axes[axisName]\n\n\t\t\tif (providedAxisOptions['primary'] || providedAxisOptions['secondary']) {\n\t\t\t\tconsole.warn(\n\t\t\t\t\t'`primary` & `secondary` are no longer needed for axis configurations. Read more here https://charts.carbondesignsystem.com/'\n\t\t\t\t)\n\t\t\t}\n\n\t\t\tconst identifier = providedAxisOptions['mapsTo']\n\t\t\tif (identifier === undefined || identifier === null) {\n\t\t\t\tconst scaleType = providedAxisOptions['scaleType']\n\n\t\t\t\tif (scaleType === undefined || scaleType === null) {\n\t\t\t\t\tprovidedAxisOptions['mapsTo'] = 'value'\n\t\t\t\t} else if (scaleType === ScaleTypes.TIME) {\n\t\t\t\t\tprovidedAxisOptions['mapsTo'] = 'date'\n\t\t\t\t} else if (scaleType === ScaleTypes.LABELS) {\n\t\t\t\t\tprovidedAxisOptions['mapsTo'] = 'key'\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tdelete clonedDefaultOptions.axes[axisName]\n\t\t}\n\t}\n\n\tupdateLegendAdditionalItems(clonedDefaultOptions, providedOptions)\n\n\treturn merge(clonedDefaultOptions, providedOptions)\n}\n\n/**************************************\n * DOM-related operations *\n *************************************/\n\n/**\n * Get width & height of an element\n *\n * @export\n * @param {any} el element to get dimensions from\n * @returns an object containing the width and height of el\n */\nexport function getDimensions(el: any) {\n\treturn {\n\t\twidth: parseFloat(el.style.width.replace('px', '') || el.offsetWidth),\n\t\theight: parseFloat(el.style.height.replace('px', '') || el.offsetHeight)\n\t}\n}\n\n/**\n * Gets elements' x and y translations from transform attribute or returns null\n *\n * @param {HTMLElement} elementRef\n * @returns an object containing the translated x and y values or null\n */\nexport function getTranslationValues(elementRef: HTMLElement) {\n\tif (!elementRef) {\n\t\treturn\n\t}\n\n\t// regex to ONLY get values for translate (instead of all rotate, translate, skew, etc)\n\tconst translateRegex = /translate\\([0-9]+\\.?[0-9]*,[0-9]+\\.?[0-9]*\\)/\n\n\tconst transformStr = elementRef.getAttribute('transform').match(translateRegex)\n\tif (!transformStr) {\n\t\treturn null\n\t}\n\n\t// check for the match\n\tif (transformStr[0]) {\n\t\tconst transforms = transformStr[0]\n\t\t\t.replace(/translate\\(/, '')\n\t\t\t.replace(/\\)/, '')\n\t\t\t.split(',')\n\n\t\treturn {\n\t\t\ttx: transforms[0],\n\t\t\tty: transforms[1]\n\t\t}\n\t}\n\treturn null\n}\n\n/**************************************\n * Formatting & calculations *\n *************************************/\n\n/**\n * Gets x and y coordinates from HTML transform attribute\n *\n * @export\n * @param transform string the transform attribute string ie. transform(x,y)\n * @returns Returns an object with x and y offsets of the transform\n */\nexport function getTransformOffsets(transform: string) {\n\tconst regExp = /\\(([^)]+)\\)/\n\tconst match = regExp.exec(transform)\n\n\tif (match && match.length > 1) {\n\t\tconst xyString = match[1].split(',')\n\n\t\tif (xyString.length > 1) {\n\t\t\treturn {\n\t\t\t\tx: parseFloat(xyString[0]),\n\t\t\t\ty: parseFloat(xyString[1])\n\t\t\t}\n\t\t}\n\t}\n\n\treturn { x: 0, y: 0 }\n}\n\n/**\n * Returns string value for height/width using pixels if there isn't a specified unit of measure\n *\n * @param value string or number value to be checked for unit of measure\n */\nexport function formatWidthHeightValues(value: string | number) {\n\tconst stringValue = value.toString()\n\n\t// If the value provided contains any letters\n\t// Return it the same way\n\tif (stringValue.match(/[a-z]/i)) {\n\t\treturn stringValue\n\t}\n\n\treturn stringValue + 'px'\n}\n\n/**\n * Capitalizes first letter of a string\n *\n * @export\n * @param {any} word the input string to perform first letter capitalization with\n * @returns The transformed string after first letter is capitalized\n */\nexport function capitalizeFirstLetter(word: string) {\n\treturn word[0].toUpperCase() + word.slice(1)\n}\n\n/**\n * Get the percentage of a datapoint compared to the entire dataset.\n * @export\n * @param {any} item\n * @param {any} fullData\n * @param {string} key\n * @returns The percentage in the form of a number (1 significant digit if necessary)\n */\nexport function convertValueToPercentage(\n\titem: any,\n\tfullData: any,\n\tkey = 'value',\n\tentireValue = false\n) {\n\tconst percentage =\n\t\t(item / fullData.reduce((accum: number, val: any) => accum + val[key], 0)) * 100\n\t//in need for entire float percentage value\n\tif (entireValue) {\n\t\treturn percentage\n\t} else {\n\t\t// if the value has any significant figures, keep 1\n\t\treturn percentage % 1 !== 0 ? parseFloat(percentage.toFixed(1)) : percentage\n\t}\n}\n\n/**\n * Truncate the labels\n * @export\n * @param {any} fullText\n * @param {any} truncationType\n * @param {any} numCharacter\n * @returns Truncated text\n */\nexport function truncateLabel(fullText: any, truncationType: any, numCharacter: any) {\n\tif (numCharacter > fullText.length) {\n\t\treturn fullText\n\t}\n\tif (truncationType === TruncationTypes.MID_LINE) {\n\t\treturn fullText.substr(0, numCharacter / 2) + '...' + fullText.substr(-numCharacter / 2)\n\t} else if (truncationType === TruncationTypes.FRONT_LINE) {\n\t\treturn '...' + fullText.substr(-numCharacter)\n\t} else if (truncationType === TruncationTypes.END_LINE) {\n\t\treturn fullText.substr(0, numCharacter) + '...'\n\t}\n}\n\n/**\n * Update legend additional items\n * @param {any} defaultOptions\n * @param {any} providedOptions\n */\nexport function updateLegendAdditionalItems(defaultOptions: any, providedOptions: any) {\n\tconst defaultAdditionalItems = getProperty(defaultOptions, 'legend', 'additionalItems')\n\tconst userProvidedAdditionalItems = getProperty(providedOptions, 'legend', 'additionalItems')\n\n\t// Retain default legend additional items\n\tif (defaultAdditionalItems && userProvidedAdditionalItems) {\n\t\tconst providedTypes = userProvidedAdditionalItems.map((item: any) => item.type)\n\n\t\tconst defaultTypes = defaultAdditionalItems.map((item: any) => item.type)\n\n\t\t// Get default items in default options but not in provided options\n\t\tconst updatedDefaultItems = defaultLegendAdditionalItems.filter(\n\t\t\titem => defaultTypes.includes(item.type) && !providedTypes.includes(item.type)\n\t\t)\n\n\t\tdefaultOptions.legend.additionalItems = updatedDefaultItems\n\n\t\tprovidedOptions.legend.additionalItems = unionBy(\n\t\t\tupdatedDefaultItems,\n\t\t\tuserProvidedAdditionalItems,\n\t\t\t'name'\n\t\t)\n\t}\n}\n\n/**************************************\n * Object/array related checks *\n *************************************/\n\n/**\n * Compares two arrays to return the difference between two arrays' items.\n *\n * @export\n * @param {any[]} oldArray the array to check for missing items\n * @param {any[]} newArray the array to check for newly added items\n * @returns An object containing items missing (existing in oldArray but not newArray)\n * and items added (existing in newArray but not in oldArray). Object is of the form { missing: [], added: [] }\n */\nexport function arrayDifferences(oldArray: any[], newArray: any[]) {\n\tconst difference = {\n\t\tmissing: [] as any[],\n\t\tadded: [] as any[]\n\t}\n\n\toldArray.forEach((element: any) => {\n\t\tif (newArray.indexOf(element) === -1) {\n\t\t\tdifference.missing.push(element)\n\t\t}\n\t})\n\n\tnewArray.forEach((element: any) => {\n\t\tif (oldArray.indexOf(element) === -1) {\n\t\t\tdifference.added.push(element)\n\t\t}\n\t})\n\n\treturn difference\n}\n\n/**\n * Gets the duplicated keys from an array of data\n *\n * @export\n * @param {*} arr - array of data\n * @returns A list of the duplicated keys in data\n */\nexport function getDuplicateValues(arr: any) {\n\tconst values: any[] = []\n\tconst duplicateValues: any[] = []\n\n\tarr.forEach((value: any) => {\n\t\tif (values.indexOf(value) !== -1 && duplicateValues.indexOf(value) === -1) {\n\t\t\tduplicateValues.push(value)\n\t\t}\n\n\t\tvalues.push(value)\n\t})\n\n\treturn duplicateValues\n}\n\n// ================================================================================\n// D3 Extensions\n// ================================================================================\n\n/**\n * In D3, moves an element to the front of the canvas\n *\n * @export\n * @param {any} element input element to moved in front\n * @returns The function to be used by D3 to push element to the top of the canvas\n */\nexport function moveToFront(element: any) {\n\treturn element.each(function () {\n\t\tthis.parentNode.appendChild(this)\n\t})\n}\n\n// ================================================================================\n// Style Helpers\n// ================================================================================\n\n/**\n * Gets a speicified property from within an object.\n *\n * @param object the object containing the property to retrieve\n * @param propPath nested properties used to extract the final property from within the object\n * (i.e \"style\", \"color\" would retrieve the color property from within an object that has \"color\" nested within \"style\")\n */\nexport const getProperty = (object: any, ...propPath: any) => {\n\tlet position = object\n\tif (position) {\n\t\tfor (const prop of propPath) {\n\t\t\tif (position[prop] !== null && position[prop] !== undefined) {\n\t\t\t\tposition = position[prop]\n\t\t\t} else {\n\t\t\t\treturn null\n\t\t\t}\n\t\t}\n\t\treturn position\n\t}\n\n\treturn null\n}\n\ninterface SVGPathCoordinates {\n\tx0: number\n\tx1: number\n\ty0: number\n\ty1: number\n}\n\nexport const flipSVGCoordinatesBasedOnOrientation = (\n\tverticalCoordinates: SVGPathCoordinates,\n\torientation?: CartesianOrientations\n) => {\n\tif (orientation === CartesianOrientations.HORIZONTAL) {\n\t\treturn {\n\t\t\ty0: verticalCoordinates.x0,\n\t\t\ty1: verticalCoordinates.x1,\n\t\t\tx0: verticalCoordinates.y0,\n\t\t\tx1: verticalCoordinates.y1\n\t\t}\n\t}\n\n\treturn verticalCoordinates\n}\n\nexport const generateSVGPathString = (\n\tverticalCoordinates: SVGPathCoordinates,\n\torientation?: CartesianOrientations\n) => {\n\tconst { x0, x1, y0, y1 } = flipSVGCoordinatesBasedOnOrientation(verticalCoordinates, orientation)\n\n\treturn `M${x0},${y0}L${x0},${y1}L${x1},${y1}L${x1},${y0}L${x0},${y0}`\n}\n\nexport function flipDomainAndRangeBasedOnOrientation(\n\tdomain: D,\n\trange: R,\n\torientation?: CartesianOrientations\n): [D, R] | [R, D] {\n\treturn orientation === CartesianOrientations.VERTICAL ? [domain, range] : [range, domain]\n}\n\nexport const compareNumeric = (a: Numeric, b: Numeric) => Number(a) === Number(b)\n","export function buildFormatLongFn(args) {\n return (options = {}) => {\n // TODO: Remove String()\n const width = options.width ? String(options.width) : args.defaultWidth;\n const format = args.formats[width] || args.formats[args.defaultWidth];\n return format;\n };\n}\n","/* eslint-disable no-unused-vars */\n\n/**\n * The localize function argument callback which allows to convert raw value to\n * the actual type.\n *\n * @param value - The value to convert\n *\n * @returns The converted value\n */\n\n/**\n * The map of localized values for each width.\n */\n\n/**\n * The index type of the locale unit value. It types conversion of units of\n * values that don't start at 0 (i.e. quarters).\n */\n\n/**\n * Converts the unit value to the tuple of values.\n */\n\n/**\n * The tuple of localized era values. The first element represents BC,\n * the second element represents AD.\n */\n\n/**\n * The tuple of localized quarter values. The first element represents Q1.\n */\n\n/**\n * The tuple of localized day values. The first element represents Sunday.\n */\n\n/**\n * The tuple of localized month values. The first element represents January.\n */\n\nexport function buildLocalizeFn(args) {\n return (value, options) => {\n const context = options?.context ? String(options.context) : \"standalone\";\n\n let valuesArray;\n if (context === \"formatting\" && args.formattingValues) {\n const defaultWidth = args.defaultFormattingWidth || args.defaultWidth;\n const width = options?.width ? String(options.width) : defaultWidth;\n\n valuesArray =\n args.formattingValues[width] || args.formattingValues[defaultWidth];\n } else {\n const defaultWidth = args.defaultWidth;\n const width = options?.width ? String(options.width) : args.defaultWidth;\n\n valuesArray = args.values[width] || args.values[defaultWidth];\n }\n const index = args.argumentCallback ? args.argumentCallback(value) : value;\n\n // @ts-expect-error - For some reason TypeScript just don't want to match it, no matter how hard we try. I challenge you to try to remove it!\n return valuesArray[index];\n };\n}\n","export function buildMatchFn(args) {\n return (string, options = {}) => {\n const width = options.width;\n\n const matchPattern =\n (width && args.matchPatterns[width]) ||\n args.matchPatterns[args.defaultMatchWidth];\n const matchResult = string.match(matchPattern);\n\n if (!matchResult) {\n return null;\n }\n const matchedString = matchResult[0];\n\n const parsePatterns =\n (width && args.parsePatterns[width]) ||\n args.parsePatterns[args.defaultParseWidth];\n\n const key = Array.isArray(parsePatterns)\n ? findIndex(parsePatterns, (pattern) => pattern.test(matchedString))\n : // eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type\n findKey(parsePatterns, (pattern) => pattern.test(matchedString));\n\n let value;\n\n value = args.valueCallback ? args.valueCallback(key) : key;\n value = options.valueCallback\n ? // eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type\n options.valueCallback(value)\n : value;\n\n const rest = string.slice(matchedString.length);\n\n return { value, rest };\n };\n}\n\nfunction findKey(object, predicate) {\n for (const key in object) {\n if (\n Object.prototype.hasOwnProperty.call(object, key) &&\n predicate(object[key])\n ) {\n return key;\n }\n }\n return undefined;\n}\n\nfunction findIndex(array, predicate) {\n for (let key = 0; key < array.length; key++) {\n if (predicate(array[key])) {\n return key;\n }\n }\n return undefined;\n}\n","export function buildMatchPatternFn(args) {\n return (string, options = {}) => {\n const matchResult = string.match(args.matchPattern);\n if (!matchResult) return null;\n const matchedString = matchResult[0];\n\n const parseResult = string.match(args.parsePattern);\n if (!parseResult) return null;\n let value = args.valueCallback\n ? args.valueCallback(parseResult[0])\n : parseResult[0];\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type\n value = options.valueCallback ? options.valueCallback(value) : value;\n\n const rest = string.slice(matchedString.length);\n\n return { value, rest };\n };\n}\n","/**\n * @name toDate\n * @category Common Helpers\n * @summary Convert the given argument to an instance of Date.\n *\n * @description\n * Convert the given argument to an instance of Date.\n *\n * If the argument is an instance of Date, the function returns its clone.\n *\n * If the argument is a number, it is treated as a timestamp.\n *\n * If the argument is none of the above, the function returns Invalid Date.\n *\n * **Note**: *all* Date arguments passed to any *date-fns* function is processed by `toDate`.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param argument - The value to convert\n *\n * @returns The parsed date in the local time zone\n *\n * @example\n * // Clone the date:\n * const result = toDate(new Date(2014, 1, 11, 11, 30, 30))\n * //=> Tue Feb 11 2014 11:30:30\n *\n * @example\n * // Convert the timestamp to date:\n * const result = toDate(1392098430000)\n * //=> Tue Feb 11 2014 11:30:30\n */\nexport function toDate(argument) {\n const argStr = Object.prototype.toString.call(argument);\n\n // Clone the date\n if (\n argument instanceof Date ||\n (typeof argument === \"object\" && argStr === \"[object Date]\")\n ) {\n // Prevent the date to lose the milliseconds when passed to new Date() in IE10\n return new argument.constructor(+argument);\n } else if (\n typeof argument === \"number\" ||\n argStr === \"[object Number]\" ||\n typeof argument === \"string\" ||\n argStr === \"[object String]\"\n ) {\n // TODO: Can we get rid of as?\n return new Date(argument);\n } else {\n // TODO: Can we get rid of as?\n return new Date(NaN);\n }\n}\n\n// Fallback for modularized imports:\nexport default toDate;\n","let defaultOptions = {};\n\nexport function getDefaultOptions() {\n return defaultOptions;\n}\n\nexport function setDefaultOptions(newOptions) {\n defaultOptions = newOptions;\n}\n","import { toDate } from \"./toDate.mjs\";\nimport { getDefaultOptions } from \"./_lib/defaultOptions.mjs\";\n\n/**\n * The {@link startOfWeek} function options.\n */\n\n/**\n * @name startOfWeek\n * @category Week Helpers\n * @summary Return the start of a week for the given date.\n *\n * @description\n * Return the start of a week for the given date.\n * The result will be in the local timezone.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The original date\n * @param options - An object with options\n *\n * @returns The start of a week\n *\n * @example\n * // The start of a week for 2 September 2014 11:55:00:\n * const result = startOfWeek(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Sun Aug 31 2014 00:00:00\n *\n * @example\n * // If the week starts on Monday, the start of the week for 2 September 2014 11:55:00:\n * const result = startOfWeek(new Date(2014, 8, 2, 11, 55, 0), { weekStartsOn: 1 })\n * //=> Mon Sep 01 2014 00:00:00\n */\nexport function startOfWeek(date, options) {\n const defaultOptions = getDefaultOptions();\n const weekStartsOn =\n options?.weekStartsOn ??\n options?.locale?.options?.weekStartsOn ??\n defaultOptions.weekStartsOn ??\n defaultOptions.locale?.options?.weekStartsOn ??\n 0;\n\n const _date = toDate(date);\n const day = _date.getDay();\n const diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;\n\n _date.setDate(_date.getDate() - diff);\n _date.setHours(0, 0, 0, 0);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default startOfWeek;\n","const formatDistanceLocale = {\n lessThanXSeconds: {\n one: \"less than a second\",\n other: \"less than {{count}} seconds\",\n },\n\n xSeconds: {\n one: \"1 second\",\n other: \"{{count}} seconds\",\n },\n\n halfAMinute: \"half a minute\",\n\n lessThanXMinutes: {\n one: \"less than a minute\",\n other: \"less than {{count}} minutes\",\n },\n\n xMinutes: {\n one: \"1 minute\",\n other: \"{{count}} minutes\",\n },\n\n aboutXHours: {\n one: \"about 1 hour\",\n other: \"about {{count}} hours\",\n },\n\n xHours: {\n one: \"1 hour\",\n other: \"{{count}} hours\",\n },\n\n xDays: {\n one: \"1 day\",\n other: \"{{count}} days\",\n },\n\n aboutXWeeks: {\n one: \"about 1 week\",\n other: \"about {{count}} weeks\",\n },\n\n xWeeks: {\n one: \"1 week\",\n other: \"{{count}} weeks\",\n },\n\n aboutXMonths: {\n one: \"about 1 month\",\n other: \"about {{count}} months\",\n },\n\n xMonths: {\n one: \"1 month\",\n other: \"{{count}} months\",\n },\n\n aboutXYears: {\n one: \"about 1 year\",\n other: \"about {{count}} years\",\n },\n\n xYears: {\n one: \"1 year\",\n other: \"{{count}} years\",\n },\n\n overXYears: {\n one: \"over 1 year\",\n other: \"over {{count}} years\",\n },\n\n almostXYears: {\n one: \"almost 1 year\",\n other: \"almost {{count}} years\",\n },\n};\n\nexport const formatDistance = (token, count, options) => {\n let result;\n\n const tokenValue = formatDistanceLocale[token];\n if (typeof tokenValue === \"string\") {\n result = tokenValue;\n } else if (count === 1) {\n result = tokenValue.one;\n } else {\n result = tokenValue.other.replace(\"{{count}}\", count.toString());\n }\n\n if (options?.addSuffix) {\n if (options.comparison && options.comparison > 0) {\n return \"in \" + result;\n } else {\n return result + \" ago\";\n }\n }\n\n return result;\n};\n","const formatRelativeLocale = {\n lastWeek: \"'last' eeee 'at' p\",\n yesterday: \"'yesterday at' p\",\n today: \"'today at' p\",\n tomorrow: \"'tomorrow at' p\",\n nextWeek: \"eeee 'at' p\",\n other: \"P\",\n};\n\nexport const formatRelative = (token, _date, _baseDate, _options) =>\n formatRelativeLocale[token];\n","import { buildLocalizeFn } from \"../../_lib/buildLocalizeFn.mjs\";\n\nconst eraValues = {\n narrow: [\"B\", \"A\"],\n abbreviated: [\"BC\", \"AD\"],\n wide: [\"Before Christ\", \"Anno Domini\"],\n};\n\nconst quarterValues = {\n narrow: [\"1\", \"2\", \"3\", \"4\"],\n abbreviated: [\"Q1\", \"Q2\", \"Q3\", \"Q4\"],\n wide: [\"1st quarter\", \"2nd quarter\", \"3rd quarter\", \"4th quarter\"],\n};\n\n// Note: in English, the names of days of the week and months are capitalized.\n// If you are making a new locale based on this one, check if the same is true for the language you're working on.\n// Generally, formatted dates should look like they are in the middle of a sentence,\n// e.g. in Spanish language the weekdays and months should be in the lowercase.\nconst monthValues = {\n narrow: [\"J\", \"F\", \"M\", \"A\", \"M\", \"J\", \"J\", \"A\", \"S\", \"O\", \"N\", \"D\"],\n abbreviated: [\n \"Jan\",\n \"Feb\",\n \"Mar\",\n \"Apr\",\n \"May\",\n \"Jun\",\n \"Jul\",\n \"Aug\",\n \"Sep\",\n \"Oct\",\n \"Nov\",\n \"Dec\",\n ],\n\n wide: [\n \"January\",\n \"February\",\n \"March\",\n \"April\",\n \"May\",\n \"June\",\n \"July\",\n \"August\",\n \"September\",\n \"October\",\n \"November\",\n \"December\",\n ],\n};\n\nconst dayValues = {\n narrow: [\"S\", \"M\", \"T\", \"W\", \"T\", \"F\", \"S\"],\n short: [\"Su\", \"Mo\", \"Tu\", \"We\", \"Th\", \"Fr\", \"Sa\"],\n abbreviated: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"],\n wide: [\n \"Sunday\",\n \"Monday\",\n \"Tuesday\",\n \"Wednesday\",\n \"Thursday\",\n \"Friday\",\n \"Saturday\",\n ],\n};\n\nconst dayPeriodValues = {\n narrow: {\n am: \"a\",\n pm: \"p\",\n midnight: \"mi\",\n noon: \"n\",\n morning: \"morning\",\n afternoon: \"afternoon\",\n evening: \"evening\",\n night: \"night\",\n },\n abbreviated: {\n am: \"AM\",\n pm: \"PM\",\n midnight: \"midnight\",\n noon: \"noon\",\n morning: \"morning\",\n afternoon: \"afternoon\",\n evening: \"evening\",\n night: \"night\",\n },\n wide: {\n am: \"a.m.\",\n pm: \"p.m.\",\n midnight: \"midnight\",\n noon: \"noon\",\n morning: \"morning\",\n afternoon: \"afternoon\",\n evening: \"evening\",\n night: \"night\",\n },\n};\n\nconst formattingDayPeriodValues = {\n narrow: {\n am: \"a\",\n pm: \"p\",\n midnight: \"mi\",\n noon: \"n\",\n morning: \"in the morning\",\n afternoon: \"in the afternoon\",\n evening: \"in the evening\",\n night: \"at night\",\n },\n abbreviated: {\n am: \"AM\",\n pm: \"PM\",\n midnight: \"midnight\",\n noon: \"noon\",\n morning: \"in the morning\",\n afternoon: \"in the afternoon\",\n evening: \"in the evening\",\n night: \"at night\",\n },\n wide: {\n am: \"a.m.\",\n pm: \"p.m.\",\n midnight: \"midnight\",\n noon: \"noon\",\n morning: \"in the morning\",\n afternoon: \"in the afternoon\",\n evening: \"in the evening\",\n night: \"at night\",\n },\n};\n\nconst ordinalNumber = (dirtyNumber, _options) => {\n const number = Number(dirtyNumber);\n\n // If ordinal numbers depend on context, for example,\n // if they are different for different grammatical genders,\n // use `options.unit`.\n //\n // `unit` can be 'year', 'quarter', 'month', 'week', 'date', 'dayOfYear',\n // 'day', 'hour', 'minute', 'second'.\n\n const rem100 = number % 100;\n if (rem100 > 20 || rem100 < 10) {\n switch (rem100 % 10) {\n case 1:\n return number + \"st\";\n case 2:\n return number + \"nd\";\n case 3:\n return number + \"rd\";\n }\n }\n return number + \"th\";\n};\n\nexport const localize = {\n ordinalNumber,\n\n era: buildLocalizeFn({\n values: eraValues,\n defaultWidth: \"wide\",\n }),\n\n quarter: buildLocalizeFn({\n values: quarterValues,\n defaultWidth: \"wide\",\n argumentCallback: (quarter) => quarter - 1,\n }),\n\n month: buildLocalizeFn({\n values: monthValues,\n defaultWidth: \"wide\",\n }),\n\n day: buildLocalizeFn({\n values: dayValues,\n defaultWidth: \"wide\",\n }),\n\n dayPeriod: buildLocalizeFn({\n values: dayPeriodValues,\n defaultWidth: \"wide\",\n formattingValues: formattingDayPeriodValues,\n defaultFormattingWidth: \"wide\",\n }),\n};\n","import { buildMatchFn } from \"../../_lib/buildMatchFn.mjs\";\nimport { buildMatchPatternFn } from \"../../_lib/buildMatchPatternFn.mjs\";\n\nconst matchOrdinalNumberPattern = /^(\\d+)(th|st|nd|rd)?/i;\nconst parseOrdinalNumberPattern = /\\d+/i;\n\nconst matchEraPatterns = {\n narrow: /^(b|a)/i,\n abbreviated: /^(b\\.?\\s?c\\.?|b\\.?\\s?c\\.?\\s?e\\.?|a\\.?\\s?d\\.?|c\\.?\\s?e\\.?)/i,\n wide: /^(before christ|before common era|anno domini|common era)/i,\n};\nconst parseEraPatterns = {\n any: [/^b/i, /^(a|c)/i],\n};\n\nconst matchQuarterPatterns = {\n narrow: /^[1234]/i,\n abbreviated: /^q[1234]/i,\n wide: /^[1234](th|st|nd|rd)? quarter/i,\n};\nconst parseQuarterPatterns = {\n any: [/1/i, /2/i, /3/i, /4/i],\n};\n\nconst matchMonthPatterns = {\n narrow: /^[jfmasond]/i,\n abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,\n wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i,\n};\nconst parseMonthPatterns = {\n narrow: [\n /^j/i,\n /^f/i,\n /^m/i,\n /^a/i,\n /^m/i,\n /^j/i,\n /^j/i,\n /^a/i,\n /^s/i,\n /^o/i,\n /^n/i,\n /^d/i,\n ],\n\n any: [\n /^ja/i,\n /^f/i,\n /^mar/i,\n /^ap/i,\n /^may/i,\n /^jun/i,\n /^jul/i,\n /^au/i,\n /^s/i,\n /^o/i,\n /^n/i,\n /^d/i,\n ],\n};\n\nconst matchDayPatterns = {\n narrow: /^[smtwf]/i,\n short: /^(su|mo|tu|we|th|fr|sa)/i,\n abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,\n wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i,\n};\nconst parseDayPatterns = {\n narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],\n any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i],\n};\n\nconst matchDayPeriodPatterns = {\n narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,\n any: /^([ap]\\.?\\s?m\\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i,\n};\nconst parseDayPeriodPatterns = {\n any: {\n am: /^a/i,\n pm: /^p/i,\n midnight: /^mi/i,\n noon: /^no/i,\n morning: /morning/i,\n afternoon: /afternoon/i,\n evening: /evening/i,\n night: /night/i,\n },\n};\n\nexport const match = {\n ordinalNumber: buildMatchPatternFn({\n matchPattern: matchOrdinalNumberPattern,\n parsePattern: parseOrdinalNumberPattern,\n valueCallback: (value) => parseInt(value, 10),\n }),\n\n era: buildMatchFn({\n matchPatterns: matchEraPatterns,\n defaultMatchWidth: \"wide\",\n parsePatterns: parseEraPatterns,\n defaultParseWidth: \"any\",\n }),\n\n quarter: buildMatchFn({\n matchPatterns: matchQuarterPatterns,\n defaultMatchWidth: \"wide\",\n parsePatterns: parseQuarterPatterns,\n defaultParseWidth: \"any\",\n valueCallback: (index) => index + 1,\n }),\n\n month: buildMatchFn({\n matchPatterns: matchMonthPatterns,\n defaultMatchWidth: \"wide\",\n parsePatterns: parseMonthPatterns,\n defaultParseWidth: \"any\",\n }),\n\n day: buildMatchFn({\n matchPatterns: matchDayPatterns,\n defaultMatchWidth: \"wide\",\n parsePatterns: parseDayPatterns,\n defaultParseWidth: \"any\",\n }),\n\n dayPeriod: buildMatchFn({\n matchPatterns: matchDayPeriodPatterns,\n defaultMatchWidth: \"any\",\n parsePatterns: parseDayPeriodPatterns,\n defaultParseWidth: \"any\",\n }),\n};\n","import { buildFormatLongFn } from \"../../_lib/buildFormatLongFn.mjs\";\n\nconst dateFormats = {\n full: \"EEEE, MMMM do, y\",\n long: \"MMMM do, y\",\n medium: \"MMM d, y\",\n short: \"MM/dd/yyyy\",\n};\n\nconst timeFormats = {\n full: \"h:mm:ss a zzzz\",\n long: \"h:mm:ss a z\",\n medium: \"h:mm:ss a\",\n short: \"h:mm a\",\n};\n\nconst dateTimeFormats = {\n full: \"{{date}} 'at' {{time}}\",\n long: \"{{date}} 'at' {{time}}\",\n medium: \"{{date}}, {{time}}\",\n short: \"{{date}}, {{time}}\",\n};\n\nexport const formatLong = {\n date: buildFormatLongFn({\n formats: dateFormats,\n defaultWidth: \"full\",\n }),\n\n time: buildFormatLongFn({\n formats: timeFormats,\n defaultWidth: \"full\",\n }),\n\n dateTime: buildFormatLongFn({\n formats: dateTimeFormats,\n defaultWidth: \"full\",\n }),\n};\n","import { formatDistance } from \"./en-US/_lib/formatDistance.mjs\";\nimport { formatLong } from \"./en-US/_lib/formatLong.mjs\";\nimport { formatRelative } from \"./en-US/_lib/formatRelative.mjs\";\nimport { localize } from \"./en-US/_lib/localize.mjs\";\nimport { match } from \"./en-US/_lib/match.mjs\";\n\n/**\n * @category Locales\n * @summary English locale (United States).\n * @language English\n * @iso-639-2 eng\n * @author Sasha Koss [@kossnocorp](https://github.com/kossnocorp)\n * @author Lesha Koss [@leshakoss](https://github.com/leshakoss)\n */\nexport const enUS = {\n code: \"en-US\",\n formatDistance: formatDistance,\n formatLong: formatLong,\n formatRelative: formatRelative,\n localize: localize,\n match: match,\n options: {\n weekStartsOn: 0 /* Sunday */,\n firstWeekContainsDate: 1,\n },\n};\n\n// Fallback for modularized imports:\nexport default enUS;\n","import { enUS as localeObject } from 'date-fns/locale'\nimport { merge } from 'lodash-es'\nimport { circlePack } from './configuration-non-customizable'\n\nimport type {\n\tAlluvialChartOptions,\n\tAreaChartOptions,\n\tAxisChartOptions,\n\tBarChartOptions,\n\tBaseChartOptions,\n\tBoxplotChartOptions,\n\tBubbleChartOptions,\n\tBulletChartOptions,\n\tChoroplethChartOptions,\n\tCirclePackChartOptions,\n\tComboChartOptions,\n\tDonutChartOptions,\n\tGaugeChartOptions,\n\tHeatmapChartOptions,\n\tHistogramChartOptions,\n\tLollipopChartOptions,\n\tLineChartOptions,\n\tMeterChartOptions,\n\tPieChartOptions,\n\tProportionalMeterChartOptions,\n\tRadarChartOptions,\n\tScatterChartOptions,\n\tStackedBarChartOptions,\n\tThematicChartOptions,\n\tTreeChartOptions,\n\tTreemapChartOptions,\n\tWordCloudChartTooltipOptions,\n\tWordCloudChartOptions\n} from '@/interfaces/charts'\nimport {\n\tAlignments,\n\tGaugeTypes,\n\tLegendPositions,\n\tTruncationTypes,\n\tToolbarControlTypes,\n\tZoomBarTypes,\n\tLegendItemType,\n\tTreeTypes,\n\tDividerStatus,\n\tProjection,\n\tChartTheme\n} from '@/interfaces/enums'\nimport type { AxesOptions, AxisOptions, TimeScaleOptions } from '@/interfaces/axis-scales'\nimport type {\n\tGridOptions,\n\tRulerOptions,\n\tTooltipOptions,\n\tLegendOptions,\n\tStackedBarOptions,\n\tToolbarOptions,\n\tZoomBarsOptions,\n\tLocale\n} from '@/interfaces/components'\n\n/*\n *****************************\n * User configurable options *\n *****************************\n */\n\n/**\n * Default truncation configuration\n */\nconst standardTruncationOptions = {\n\ttype: TruncationTypes.END_LINE,\n\tthreshold: 16,\n\tnumCharacter: 14\n}\n\n/**\n * Locale options\n */\nconst locale: Locale = {\n\tcode: (typeof navigator !== 'undefined' && navigator?.language) || 'en-US', // read from browser's navigator.language\n\tnumber: (value, language = navigator?.language || 'en-US') => value.toLocaleString(language), // based on code property if specified\n\tdate: (\n\t\tvalue,\n\t\tlanguage = navigator?.language || 'en-US',\n\t\toptions = {},\n\t\tpreformattedLocaleValue = null\n\t) =>\n\t\tpreformattedLocaleValue ? preformattedLocaleValue : value.toLocaleDateString(language, options), // based on code property if specified\n\ttime: (\n\t\tvalue,\n\t\tlanguage = navigator?.language || 'en-US',\n\t\toptions = {},\n\t\tpreformattedLocaleValue = null\n\t) =>\n\t\tpreformattedLocaleValue ? preformattedLocaleValue : value.toLocaleTimeString(language, options), // based on code property if specified\n\toptionsObject: {\n\t\t'15seconds': {\n\t\t\tprimary: {\n\t\t\t\t'MMM d, pp': {\n\t\t\t\t\tmonth: 'short',\n\t\t\t\t\tday: 'numeric',\n\t\t\t\t\thour: 'numeric',\n\t\t\t\t\tminute: '2-digit',\n\t\t\t\t\tsecond: '2-digit',\n\t\t\t\t\thourCycle: 'h12'\n\t\t\t\t},\n\t\t\t\t'MMM d, h:mm:ss.SSS a': {\n\t\t\t\t\tmonth: 'short',\n\t\t\t\t\tday: 'numeric',\n\t\t\t\t\thour: 'numeric',\n\t\t\t\t\tminute: '2-digit',\n\t\t\t\t\tfractionalSecondDigits: 3,\n\t\t\t\t\thourCycle: 'h12'\n\t\t\t\t}\n\t\t\t},\n\t\t\tsecondary: {\n\t\t\t\tpp: {\n\t\t\t\t\thour: 'numeric',\n\t\t\t\t\tminute: '2-digit',\n\t\t\t\t\tsecond: '2-digit',\n\t\t\t\t\thourCycle: 'h12'\n\t\t\t\t},\n\t\t\t\t'h:mm:ss.SSS a': {\n\t\t\t\t\thour: 'numeric',\n\t\t\t\t\tminute: '2-digit',\n\t\t\t\t\tfractionalSecondDigits: 3,\n\t\t\t\t\thourCycle: 'h12'\n\t\t\t\t}\n\t\t\t},\n\t\t\ttype: 'time'\n\t\t},\n\t\tminute: {\n\t\t\tprimary: {\n\t\t\t\t'MMM d, p': {\n\t\t\t\t\tmonth: 'short',\n\t\t\t\t\tday: 'numeric',\n\t\t\t\t\thour: 'numeric',\n\t\t\t\t\tminute: '2-digit',\n\t\t\t\t\thourCycle: 'h12'\n\t\t\t\t}\n\t\t\t},\n\t\t\tsecondary: {\n\t\t\t\tp: {\n\t\t\t\t\thour: 'numeric',\n\t\t\t\t\tminute: '2-digit',\n\t\t\t\t\thourCycle: 'h12'\n\t\t\t\t}\n\t\t\t},\n\t\t\ttype: 'time'\n\t\t},\n\t\t'30minutes': {\n\t\t\tprimary: {\n\t\t\t\t'MMM d, p': {\n\t\t\t\t\tmonth: 'short',\n\t\t\t\t\tday: 'numeric',\n\t\t\t\t\thour: 'numeric',\n\t\t\t\t\tminute: '2-digit',\n\t\t\t\t\thourCycle: 'h12'\n\t\t\t\t}\n\t\t\t},\n\t\t\tsecondary: {\n\t\t\t\tp: {\n\t\t\t\t\thour: 'numeric',\n\t\t\t\t\tminute: '2-digit',\n\t\t\t\t\thourCycle: 'h12'\n\t\t\t\t}\n\t\t\t},\n\t\t\ttype: 'time'\n\t\t},\n\t\thourly: {\n\t\t\tprimary: {\n\t\t\t\t'MMM d, hh a': {\n\t\t\t\t\tmonth: 'short',\n\t\t\t\t\tday: 'numeric',\n\t\t\t\t\thour: '2-digit',\n\t\t\t\t\thourCycle: 'h12'\n\t\t\t\t}\n\t\t\t},\n\t\t\tsecondary: {\n\t\t\t\t'hh a': {\n\t\t\t\t\thour: '2-digit',\n\t\t\t\t\thourCycle: 'h12'\n\t\t\t\t}\n\t\t\t},\n\t\t\ttype: 'time'\n\t\t},\n\t\tdaily: {\n\t\t\tprimary: {\n\t\t\t\t'MMM d': {\n\t\t\t\t\tmonth: 'short',\n\t\t\t\t\tday: 'numeric'\n\t\t\t\t}\n\t\t\t},\n\t\t\tsecondary: {\n\t\t\t\td: {\n\t\t\t\t\tday: 'numeric'\n\t\t\t\t}\n\t\t\t},\n\t\t\ttype: 'date'\n\t\t},\n\t\tweekly: {\n\t\t\tprimary: {\n\t\t\t\t'eee, MMM d': {\n\t\t\t\t\tweekday: 'short',\n\t\t\t\t\tmonth: 'short',\n\t\t\t\t\tday: 'numeric'\n\t\t\t\t}\n\t\t\t},\n\t\t\tsecondary: {\n\t\t\t\teee: {\n\t\t\t\t\tweekday: 'short'\n\t\t\t\t}\n\t\t\t},\n\t\t\ttype: 'date'\n\t\t},\n\t\tmonthly: {\n\t\t\tprimary: {\n\t\t\t\t'MMM yyyy': {\n\t\t\t\t\tmonth: 'short',\n\t\t\t\t\tyear: 'numeric'\n\t\t\t\t}\n\t\t\t},\n\t\t\tsecondary: {\n\t\t\t\tMMM: {\n\t\t\t\t\tmonth: 'short'\n\t\t\t\t}\n\t\t\t},\n\t\t\ttype: 'date'\n\t\t},\n\t\tquarterly: {\n\t\t\tprimary: {},\n\t\t\tsecondary: {},\n\t\t\ttype: 'date'\n\t\t},\n\t\tyearly: {\n\t\t\tprimary: {\n\t\t\t\tyyyy: {\n\t\t\t\t\tyear: 'numeric'\n\t\t\t\t}\n\t\t\t},\n\t\t\tsecondary: {\n\t\t\t\tyyyy: {\n\t\t\t\t\tyear: 'numeric'\n\t\t\t\t}\n\t\t\t},\n\t\t\ttype: 'date'\n\t\t}\n\t},\n\ttranslations: {\n\t\tgroup: 'Group',\n\t\ttotal: 'Total',\n\t\tmeter: {\n\t\t\ttitle: '' //default is emply string as meter title is dataset label\n\t\t},\n\t\ttabularRep: {\n\t\t\ttitle: 'Tabular representation',\n\t\t\tdownloadAsCSV: 'Download as CSV'\n\t\t},\n\t\ttoolbar: {\n\t\t\texportAsCSV: 'Export to CSV',\n\t\t\texportAsJPG: 'Export to JPG',\n\t\t\texportAsPNG: 'Export to PNG',\n\t\t\tzoomIn: 'Zoom in',\n\t\t\tzoomOut: 'Zoom out',\n\t\t\tresetZoom: 'Reset zoom',\n\t\t\tmoreOptions: 'More options',\n\t\t\tmakeFullScreen: 'Make fullscreen',\n\t\t\texitFullScreen: 'Exit fullscreen',\n\t\t\tshowAsTable: 'Show as table'\n\t\t}\n\t}\n}\n\n/**\n * Legend options\n */\nconst legend: LegendOptions = {\n\tenabled: true,\n\tposition: LegendPositions.BOTTOM,\n\tclickable: true,\n\ttruncation: standardTruncationOptions,\n\talignment: Alignments.LEFT,\n\torder: null,\n\tadditionalItems: []\n}\n\n/**\n * Grid options\n */\nexport const grid: GridOptions = {\n\tx: {\n\t\t// set enable to false will not draw grid and stroke of grid backdrop\n\t\tenabled: true,\n\t\tnumberOfTicks: 15,\n\t\talignWithAxisTicks: false\n\t},\n\ty: {\n\t\t// set enable to false will not draw grid and stroke of grid backdrop\n\t\tenabled: true,\n\t\tnumberOfTicks: 5,\n\t\talignWithAxisTicks: false\n\t}\n}\n\n/**\n * Ruler options\n */\nexport const ruler: RulerOptions = {\n\t// enable or disable ruler\n\tenabled: true\n}\n\n/**\n * Tooltip options\n */\nexport const baseTooltip: TooltipOptions = {\n\tenabled: true,\n\tshowTotal: true,\n\ttruncation: standardTruncationOptions,\n\tgroupLabel: 'Group'\n}\n\n// These options will be managed by merge()\n// by removing the ones the user is not providing,\n// and by TwoDimensionalAxes.\nconst axes: AxesOptions = {\n\ttop: {\n\t\tvisible: true,\n\t\tincludeZero: true,\n\t\ttruncation: standardTruncationOptions\n\t},\n\tbottom: {\n\t\tvisible: true,\n\t\tincludeZero: true,\n\t\ttruncation: standardTruncationOptions\n\t},\n\tleft: {\n\t\tvisible: true,\n\t\tincludeZero: true,\n\t\ttruncation: standardTruncationOptions\n\t},\n\tright: {\n\t\tvisible: true,\n\t\tincludeZero: true,\n\t\ttruncation: standardTruncationOptions\n\t}\n}\n\nexport const timeScale: TimeScaleOptions = {\n\taddSpaceOnEdges: 1,\n\tshowDayName: false,\n\tlocaleObject,\n\ttimeIntervalFormats: {\n\t\t'15seconds': { primary: 'MMM d, pp', secondary: 'pp' },\n\t\tminute: { primary: 'MMM d, p', secondary: 'p' },\n\t\t'30minutes': { primary: 'MMM d, p', secondary: 'p' },\n\t\thourly: { primary: 'MMM d, hh a', secondary: 'hh a' },\n\t\tdaily: { primary: 'MMM d', secondary: 'd' },\n\t\tweekly: { primary: 'eee, MMM d', secondary: 'eee' },\n\t\tmonthly: { primary: 'MMM yyyy', secondary: 'MMM' },\n\t\tquarterly: { primary: \"QQQ ''yy\", secondary: 'QQQ' },\n\t\tyearly: { primary: 'yyyy', secondary: 'yyyy' }\n\t}\n}\n\nlet isFullScreenEnabled = false\n\ntry {\n\tisFullScreenEnabled =\n\t\ttypeof document !== 'undefined' &&\n\t\t(document['fullscreenEnabled'] ||\n\t\t\tdocument['webkitFullscreenEnabled'] ||\n\t\t\tdocument['mozFullScreenEnabled'] ||\n\t\t\tdocument['msFullscreenEnabled'])\n} catch (e) {\n\t// some environments block access to fullscreenEnabled\n\tconsole.warn('Fullscreen capabilities check failed: ', e.message)\n}\n\n/**\n * Base chart options common to any chart\n */\nconst chart: BaseChartOptions = {\n\twidth: null,\n\theight: null,\n\tresizable: true,\n\ttheme: ChartTheme.WHITE,\n\ttooltip: baseTooltip,\n\tlegend,\n\tlocale,\n\tstyle: {\n\t\tprefix: 'cc'\n\t},\n\tdata: {\n\t\tgroupMapsTo: 'group',\n\t\tloading: false,\n\t\tselectedGroups: []\n\t},\n\tcolor: {\n\t\tscale: null,\n\t\tpairing: {\n\t\t\tnumberOfVariants: null,\n\t\t\toption: 1\n\t\t},\n\t\tgradient: {\n\t\t\tenabled: false\n\t\t}\n\t},\n\ttoolbar: {\n\t\tenabled: true,\n\t\tnumberOfIcons: 3,\n\t\tcontrols: [\n\t\t\t{\n\t\t\t\ttype: ToolbarControlTypes.SHOW_AS_DATATABLE\n\t\t\t},\n\t\t\t...(isFullScreenEnabled\n\t\t\t\t? [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttype: ToolbarControlTypes.MAKE_FULLSCREEN\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\ttype: ToolbarControlTypes.EXPORT_CSV\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: ToolbarControlTypes.EXPORT_PNG\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: ToolbarControlTypes.EXPORT_JPG\n\t\t\t}\n\t\t]\n\t} as ToolbarOptions\n}\n\n/**\n * Options common to any thematic chart\n */\nconst thematicChart: ThematicChartOptions = merge({}, chart, {\n\tthematic: {\n\t\tprojection: Projection.geoNaturalEarth1\n\t}\n})\n\n/**\n * Options common to any chart with an axis\n */\nconst axisChart: AxisChartOptions = merge({}, chart, {\n\taxes,\n\ttimeScale,\n\tgrid,\n\truler,\n\tzoomBar: {\n\t\tzoomRatio: 0.4,\n\t\tminZoomRatio: 0.01,\n\t\ttop: {\n\t\t\tenabled: false,\n\t\t\ttype: ZoomBarTypes.GRAPH_VIEW\n\t\t}\n\t} as ZoomBarsOptions\n} as AxisChartOptions)\n\n/**\n * options specific to simple bar charts\n */\nconst baseBarChart: BarChartOptions = merge({}, axisChart, {\n\tbars: {\n\t\tmaxWidth: 16,\n\t\tspacingFactor: 0.25\n\t},\n\ttimeScale: merge(timeScale, {\n\t\taddSpaceOnEdges: 1\n\t} as TimeScaleOptions)\n} as BarChartOptions)\n\n/**\n * options specific to simple bar charts\n */\nconst simpleBarChart: BarChartOptions = merge({}, baseBarChart, {} as BarChartOptions)\n\n/**\n * options specific to simple bar charts\n */\nconst groupedBarChart: BarChartOptions = merge({}, baseBarChart, {} as BarChartOptions)\n\n/**\n * options specific to stacked bar charts\n */\nconst stackedBarChart: StackedBarChartOptions = merge({}, baseBarChart, {\n\tbars: merge({}, baseBarChart.bars, {\n\t\tdividerSize: 1.5\n\t} as StackedBarOptions)\n} as BarChartOptions)\n\n/**\n * options specific to boxplot charts\n */\nconst boxplotChart: BoxplotChartOptions = merge({}, baseBarChart, {} as BarChartOptions)\n\n/**\n * options specific to scatter charts\n */\nconst scatterChart: ScatterChartOptions = merge({}, axisChart, {\n\tpoints: {\n\t\t// default point radius to 4\n\t\tradius: 4,\n\t\tfillOpacity: 0.3,\n\t\tfilled: true,\n\t\tenabled: true\n\t}\n} as ScatterChartOptions)\n\n/**\n * options specific to lollipop charts\n */\nconst lollipopChart: LollipopChartOptions = scatterChart as LollipopChartOptions\n\n/**\n * options specific to line charts\n */\nconst lineChart: LineChartOptions = merge({}, scatterChart, {\n\tpoints: {\n\t\t// default point radius to 3\n\t\tradius: 3,\n\t\tfilled: false,\n\t\tenabled: true\n\t}\n} as LineChartOptions)\n\n/**\n * options specific to area charts\n */\nconst areaChart: AreaChartOptions = merge({}, lineChart, {\n\ttimeScale: merge(timeScale, {\n\t\taddSpaceOnEdges: 0\n\t} as TimeScaleOptions)\n} as LineChartOptions)\n\n/**\n * options specific to stacked area charts\n */\nconst stackedAreaChart = areaChart\n\n/**\n * options specific to bubble charts\n */\nconst bubbleChart: BubbleChartOptions = merge({}, axisChart, {\n\tbubble: {\n\t\tradiusMapsTo: 'radius',\n\t\tradiusLabel: 'Radius',\n\t\tradiusRange: (chartSize: any) => {\n\t\t\tconst smallerChartDimension = Math.min(chartSize.width, chartSize.height)\n\t\t\treturn [(smallerChartDimension * 3) / 400, (smallerChartDimension * 25) / 400]\n\t\t},\n\t\tfillOpacity: 0.2,\n\t\tenabled: true\n\t},\n\tpoints: {\n\t\tfilled: true\n\t},\n\tlegend: {\n\t\tadditionalItems: [\n\t\t\t{\n\t\t\t\ttype: LegendItemType.RADIUS,\n\t\t\t\tname: 'Radius'\n\t\t\t}\n\t\t]\n\t}\n} as BubbleChartOptions)\n\n/**\n * options specific to bullet charts\n */\nconst bulletChart: BulletChartOptions = merge({}, axisChart, {\n\tbullet: {\n\t\tperformanceAreaTitles: ['Poor', 'Satisfactory', 'Great']\n\t},\n\tgrid: {\n\t\tx: {\n\t\t\tenabled: false\n\t\t},\n\t\ty: {\n\t\t\tenabled: false\n\t\t}\n\t},\n\tlegend: {\n\t\tadditionalItems: [\n\t\t\t{\n\t\t\t\ttype: LegendItemType.AREA,\n\t\t\t\tname: 'Poor area'\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: LegendItemType.AREA,\n\t\t\t\tname: 'Satisfactory area'\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: LegendItemType.AREA,\n\t\t\t\tname: 'Great area'\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: LegendItemType.QUARTILE,\n\t\t\t\tname: 'Quartiles'\n\t\t\t}\n\t\t]\n\t}\n} as BulletChartOptions)\n\n/**\n * options specific to stacked bar charts\n */\nconst histogramChart: HistogramChartOptions = merge({}, baseBarChart, {\n\tbars: {\n\t\tdividerSize: 1.5\n\t} as StackedBarOptions,\n\ttimeScale: merge(timeScale, {\n\t\taddSpaceOnEdges: 0\n\t} as TimeScaleOptions)\n} as BarChartOptions)\n\n/*\n * options specific to word cloud charts\n */\nconst wordCloudChart: WordCloudChartOptions = merge({}, chart, {\n\ttooltip: merge({}, baseTooltip, {\n\t\twordLabel: 'Word',\n\t\tvalueLabel: 'Value'\n\t}) as WordCloudChartTooltipOptions,\n\twordCloud: {\n\t\tfontSizeMapsTo: 'value',\n\t\tfontSizeRange: (chartSize: any) => {\n\t\t\tconst smallerChartDimension = Math.min(chartSize.width, chartSize.height)\n\t\t\treturn [(smallerChartDimension * 20) / 400, (smallerChartDimension * 75) / 400]\n\t\t},\n\t\twordMapsTo: 'word'\n\t}\n} as WordCloudChartOptions)\n\n/**\n * options specific to pie charts\n */\nconst pieChart: PieChartOptions = merge({}, chart, {\n\tpie: {\n\t\tlabels: {\n\t\t\tformatter: null,\n\t\t\tenabled: true\n\t\t},\n\t\talignment: Alignments.LEFT,\n\t\tsortFunction: null,\n\t\tvalueMapsTo: 'value'\n\t}\n} as PieChartOptions)\n\n/**\n * options specific to gauge charts\n */\nconst gaugeChart: GaugeChartOptions = merge({}, chart, {\n\tlegend: {\n\t\tenabled: false\n\t},\n\tgauge: {\n\t\ttype: GaugeTypes.SEMI,\n\t\tarcWidth: 16,\n\t\tdeltaArrow: {\n\t\t\tsize: (radius: number) => radius / 8,\n\t\t\tenabled: true\n\t\t},\n\t\tshowPercentageSymbol: true,\n\t\tstatus: null,\n\t\tnumberSpacing: 10,\n\t\tdeltaFontSize: (radius: number) => radius / 8,\n\t\tvalueFontSize: (radius: number) => radius / 2.5,\n\t\talignment: Alignments.LEFT\n\t}\n} as GaugeChartOptions)\n\n/**\n * options specific to donut charts\n */\nconst donutChart: DonutChartOptions = merge({}, pieChart, {\n\tdonut: {\n\t\tcenter: {\n\t\t\tnumberFontSize: radius => `${Math.min((radius / 100) * 24, 24)}px`,\n\t\t\ttitleFontSize: radius => `${Math.min((radius / 100) * 15, 15)}px`,\n\t\t\ttitleYPosition: radius => Math.min((radius / 80) * 20, 20)\n\t\t},\n\t\talignment: Alignments.LEFT\n\t}\n} as DonutChartOptions)\n\nconst meterChart: MeterChartOptions = merge({}, chart, {\n\tlegend: {\n\t\tenabled: false,\n\t\tclickable: false\n\t},\n\tmeter: {\n\t\tshowLabels: true,\n\t\tproportional: null,\n\t\tstatusBar: {\n\t\t\tpercentageIndicator: {\n\t\t\t\tenabled: true\n\t\t\t}\n\t\t}\n\t}\n} as MeterChartOptions)\n\nconst proportionalMeterChart: ProportionalMeterChartOptions = merge({}, meterChart, {\n\tlegend: {\n\t\tenabled: true\n\t}\n} as MeterChartOptions)\n\n/**\n * options specific to radar charts\n */\nconst radarChart: RadarChartOptions = merge({}, chart, {\n\tradar: {\n\t\taxes: {\n\t\t\tangle: 'key',\n\t\t\tvalue: 'value'\n\t\t},\n\t\talignment: Alignments.LEFT\n\t},\n\ttooltip: {\n\t\tgridline: {\n\t\t\tenabled: true\n\t\t}\n\t}\n} as RadarChartOptions)\n\n/**\n * options specific to combo charts\n */\nconst comboChart: ComboChartOptions = merge({}, baseBarChart, {\n\tcomboChartTypes: []\n} as ComboChartOptions)\n\n/*\n * options specific to tree charts\n */\nconst treeChart: TreeChartOptions = merge(\n\t{\n\t\ttree: {\n\t\t\ttype: TreeTypes.TREE\n\t\t}\n\t},\n\tchart,\n\t{} as TreeChartOptions\n)\n\n/*\n * options specific to treemap charts\n */\nconst treemapChart: TreemapChartOptions = merge({}, chart, {\n\tdata: merge(chart.data, {\n\t\tgroupMapsTo: 'name'\n\t})\n} as TreemapChartOptions)\n\n/*\n * options specific to circle pack charts\n */\nconst circlePackChart: CirclePackChartOptions = merge({}, chart, circlePack, {\n\tdata: merge(chart.data, {\n\t\tgroupMapsTo: 'name'\n\t})\n} as CirclePackChartOptions)\n\nconst alluvialChart: AlluvialChartOptions = merge({}, chart, {\n\talluvial: {\n\t\tdata: merge(chart.data, {\n\t\t\tgroupMapsTo: 'source'\n\t\t}),\n\t\tnodeAlignment: Alignments.CENTER,\n\t\tnodePadding: 24,\n\t\tmonochrome: false,\n\t\tnodes: []\n\t}\n} as AlluvialChartOptions)\n\nconst heatmapChart: HeatmapChartOptions = merge({}, chart, {\n\taxes,\n\theatmap: {\n\t\tdivider: {\n\t\t\tstate: DividerStatus.AUTO\n\t\t},\n\t\tcolorLegend: {\n\t\t\ttype: 'linear'\n\t\t}\n\t}\n} as HeatmapChartOptions)\n\nconst choroplethChart: ChoroplethChartOptions = merge({}, thematicChart, {\n\tchoropleth: {\n\t\tcolorLegend: {\n\t\t\ttype: 'linear'\n\t\t}\n\t}\n} as ChoroplethChartOptions)\n\nexport const options = {\n\talluvialChart,\n\tareaChart,\n\taxisChart,\n\tboxplotChart,\n\tbubbleChart,\n\tbulletChart,\n\tchart,\n\tcirclePackChart,\n\tchoroplethChart,\n\tcomboChart,\n\tdonutChart,\n\tgaugeChart,\n\tgroupedBarChart,\n\theatmapChart,\n\thistogramChart,\n\tlineChart,\n\tlollipopChart,\n\tmeterChart,\n\tpieChart,\n\tproportionalMeterChart,\n\tradarChart,\n\tscatterChart,\n\tsimpleBarChart,\n\tstackedAreaChart,\n\tstackedBarChart,\n\tthematicChart,\n\ttreeChart,\n\ttreemapChart,\n\twordCloudChart\n}\n\nexport {\n\talluvial,\n\tarea,\n\taxis,\n\tboxplot,\n\tcanvasZoomSettings,\n\tcarbonPrefix,\n\tcirclePack,\n\tcolor,\n\tdefaultLegendAdditionalItems,\n\theatmap,\n\thistogram,\n\tlegend,\n\tlines,\n\tmeter,\n\tpie,\n\tradar,\n\tspacers,\n\ttooltips,\n\ttransitions,\n\ttoolbar,\n\tzoomBar\n} from './configuration-non-customizable'\n","/**\n * @module constants\n * @summary Useful constants\n * @description\n * Collection of useful date constants.\n *\n * The constants could be imported from `date-fns/constants`:\n *\n * ```ts\n * import { maxTime, minTime } from \"./constants/date-fns/constants\";\n *\n * function isAllowedTime(time) {\n * return time <= maxTime && time >= minTime;\n * }\n * ```\n */\n\n/**\n * @constant\n * @name daysInWeek\n * @summary Days in 1 week.\n */\nexport const daysInWeek = 7;\n\n/**\n * @constant\n * @name daysInYear\n * @summary Days in 1 year.\n *\n * @description\n * How many days in a year.\n *\n * One years equals 365.2425 days according to the formula:\n *\n * > Leap year occures every 4 years, except for years that are divisable by 100 and not divisable by 400.\n * > 1 mean year = (365+1/4-1/100+1/400) days = 365.2425 days\n */\nexport const daysInYear = 365.2425;\n\n/**\n * @constant\n * @name maxTime\n * @summary Maximum allowed time.\n *\n * @example\n * import { maxTime } from \"./constants/date-fns/constants\";\n *\n * const isValid = 8640000000000001 <= maxTime;\n * //=> false\n *\n * new Date(8640000000000001);\n * //=> Invalid Date\n */\nexport const maxTime = Math.pow(10, 8) * 24 * 60 * 60 * 1000;\n\n/**\n * @constant\n * @name minTime\n * @summary Minimum allowed time.\n *\n * @example\n * import { minTime } from \"./constants/date-fns/constants\";\n *\n * const isValid = -8640000000000001 >= minTime;\n * //=> false\n *\n * new Date(-8640000000000001)\n * //=> Invalid Date\n */\nexport const minTime = -maxTime;\n\n/**\n * @constant\n * @name millisecondsInWeek\n * @summary Milliseconds in 1 week.\n */\nexport const millisecondsInWeek = 604800000;\n\n/**\n * @constant\n * @name millisecondsInDay\n * @summary Milliseconds in 1 day.\n */\nexport const millisecondsInDay = 86400000;\n\n/**\n * @constant\n * @name millisecondsInMinute\n * @summary Milliseconds in 1 minute\n */\nexport const millisecondsInMinute = 60000;\n\n/**\n * @constant\n * @name millisecondsInHour\n * @summary Milliseconds in 1 hour\n */\nexport const millisecondsInHour = 3600000;\n\n/**\n * @constant\n * @name millisecondsInSecond\n * @summary Milliseconds in 1 second\n */\nexport const millisecondsInSecond = 1000;\n\n/**\n * @constant\n * @name minutesInYear\n * @summary Minutes in 1 year.\n */\nexport const minutesInYear = 525600;\n\n/**\n * @constant\n * @name minutesInMonth\n * @summary Minutes in 1 month.\n */\nexport const minutesInMonth = 43200;\n\n/**\n * @constant\n * @name minutesInDay\n * @summary Minutes in 1 day.\n */\nexport const minutesInDay = 1440;\n\n/**\n * @constant\n * @name minutesInHour\n * @summary Minutes in 1 hour.\n */\nexport const minutesInHour = 60;\n\n/**\n * @constant\n * @name monthsInQuarter\n * @summary Months in 1 quarter.\n */\nexport const monthsInQuarter = 3;\n\n/**\n * @constant\n * @name monthsInYear\n * @summary Months in 1 year.\n */\nexport const monthsInYear = 12;\n\n/**\n * @constant\n * @name quartersInYear\n * @summary Quarters in 1 year\n */\nexport const quartersInYear = 4;\n\n/**\n * @constant\n * @name secondsInHour\n * @summary Seconds in 1 hour.\n */\nexport const secondsInHour = 3600;\n\n/**\n * @constant\n * @name secondsInMinute\n * @summary Seconds in 1 minute.\n */\nexport const secondsInMinute = 60;\n\n/**\n * @constant\n * @name secondsInDay\n * @summary Seconds in 1 day.\n */\nexport const secondsInDay = secondsInHour * 24;\n\n/**\n * @constant\n * @name secondsInWeek\n * @summary Seconds in 1 week.\n */\nexport const secondsInWeek = secondsInDay * 7;\n\n/**\n * @constant\n * @name secondsInYear\n * @summary Seconds in 1 year.\n */\nexport const secondsInYear = secondsInDay * daysInYear;\n\n/**\n * @constant\n * @name secondsInMonth\n * @summary Seconds in 1 month\n */\nexport const secondsInMonth = secondsInYear / 12;\n\n/**\n * @constant\n * @name secondsInQuarter\n * @summary Seconds in 1 quarter.\n */\nexport const secondsInQuarter = secondsInMonth * 3;\n","import { toDate } from \"./toDate.mjs\";\n\n/**\n * @name startOfDay\n * @category Day Helpers\n * @summary Return the start of a day for the given date.\n *\n * @description\n * Return the start of a day for the given date.\n * The result will be in the local timezone.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The original date\n *\n * @returns The start of a day\n *\n * @example\n * // The start of a day for 2 September 2014 11:55:00:\n * const result = startOfDay(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Tue Sep 02 2014 00:00:00\n */\nexport function startOfDay(date) {\n const _date = toDate(date);\n _date.setHours(0, 0, 0, 0);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default startOfDay;\n","import { toDate } from \"../toDate.mjs\";\n\n/**\n * Google Chrome as of 67.0.3396.87 introduced timezones with offset that includes seconds.\n * They usually appear for dates that denote time before the timezones were introduced\n * (e.g. for 'Europe/Prague' timezone the offset is GMT+00:57:44 before 1 October 1891\n * and GMT+01:00:00 after that date)\n *\n * Date#getTimezoneOffset returns the offset in minutes and would return 57 for the example above,\n * which would lead to incorrect calculations.\n *\n * This function returns the timezone offset in milliseconds that takes seconds in account.\n */\nexport function getTimezoneOffsetInMilliseconds(date) {\n const _date = toDate(date);\n const utcDate = new Date(\n Date.UTC(\n _date.getFullYear(),\n _date.getMonth(),\n _date.getDate(),\n _date.getHours(),\n _date.getMinutes(),\n _date.getSeconds(),\n _date.getMilliseconds(),\n ),\n );\n utcDate.setUTCFullYear(_date.getFullYear());\n return +date - +utcDate;\n}\n","import { millisecondsInDay } from \"./constants.mjs\";\nimport { startOfDay } from \"./startOfDay.mjs\";\nimport { getTimezoneOffsetInMilliseconds } from \"./_lib/getTimezoneOffsetInMilliseconds.mjs\";\n\n/**\n * @name differenceInCalendarDays\n * @category Day Helpers\n * @summary Get the number of calendar days between the given dates.\n *\n * @description\n * Get the number of calendar days between the given dates. This means that the times are removed\n * from the dates and then the difference in days is calculated.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param dateLeft - The later date\n * @param dateRight - The earlier date\n *\n * @returns The number of calendar days\n *\n * @example\n * // How many calendar days are between\n * // 2 July 2011 23:00:00 and 2 July 2012 00:00:00?\n * const result = differenceInCalendarDays(\n * new Date(2012, 6, 2, 0, 0),\n * new Date(2011, 6, 2, 23, 0)\n * )\n * //=> 366\n * // How many calendar days are between\n * // 2 July 2011 23:59:00 and 3 July 2011 00:01:00?\n * const result = differenceInCalendarDays(\n * new Date(2011, 6, 3, 0, 1),\n * new Date(2011, 6, 2, 23, 59)\n * )\n * //=> 1\n */\nexport function differenceInCalendarDays(dateLeft, dateRight) {\n const startOfDayLeft = startOfDay(dateLeft);\n const startOfDayRight = startOfDay(dateRight);\n\n const timestampLeft =\n +startOfDayLeft - getTimezoneOffsetInMilliseconds(startOfDayLeft);\n const timestampRight =\n +startOfDayRight - getTimezoneOffsetInMilliseconds(startOfDayRight);\n\n // Round the number of days to the nearest integer because the number of\n // milliseconds in a day is not constant (e.g. it's different in the week of\n // the daylight saving time clock shift).\n return Math.round((timestampLeft - timestampRight) / millisecondsInDay);\n}\n\n// Fallback for modularized imports:\nexport default differenceInCalendarDays;\n","/**\n * @name constructFrom\n * @category Generic Helpers\n * @summary Constructs a date using the reference date and the value\n *\n * @description\n * The function constructs a new date using the constructor from the reference\n * date and the given value. It helps to build generic functions that accept\n * date extensions.\n *\n * It defaults to `Date` if the passed reference date is a number or a string.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The reference date to take constructor from\n * @param value - The value to create the date\n *\n * @returns Date initialized using the given date and value\n *\n * @example\n * import { constructFrom } from 'date-fns'\n *\n * // A function that clones a date preserving the original type\n * function cloneDate Wed Jan 01 2014 00:00:00\n */\nexport function startOfYear(date) {\n const cleanDate = toDate(date);\n const _date = constructFrom(date, 0);\n _date.setFullYear(cleanDate.getFullYear(), 0, 1);\n _date.setHours(0, 0, 0, 0);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default startOfYear;\n","import { differenceInCalendarDays } from \"./differenceInCalendarDays.mjs\";\nimport { startOfYear } from \"./startOfYear.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n/**\n * @name getDayOfYear\n * @category Day Helpers\n * @summary Get the day of the year of the given date.\n *\n * @description\n * Get the day of the year of the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The given date\n *\n * @returns The day of year\n *\n * @example\n * // Which day of the year is 2 July 2014?\n * const result = getDayOfYear(new Date(2014, 6, 2))\n * //=> 183\n */\nexport function getDayOfYear(date) {\n const _date = toDate(date);\n const diff = differenceInCalendarDays(_date, startOfYear(_date));\n const dayOfYear = diff + 1;\n return dayOfYear;\n}\n\n// Fallback for modularized imports:\nexport default getDayOfYear;\n","import { startOfWeek } from \"./startOfWeek.mjs\";\n\n/**\n * @name startOfISOWeek\n * @category ISO Week Helpers\n * @summary Return the start of an ISO week for the given date.\n *\n * @description\n * Return the start of an ISO week for the given date.\n * The result will be in the local timezone.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The original date\n *\n * @returns The start of an ISO week\n *\n * @example\n * // The start of an ISO week for 2 September 2014 11:55:00:\n * const result = startOfISOWeek(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Mon Sep 01 2014 00:00:00\n */\nexport function startOfISOWeek(date) {\n return startOfWeek(date, { weekStartsOn: 1 });\n}\n\n// Fallback for modularized imports:\nexport default startOfISOWeek;\n","import { constructFrom } from \"./constructFrom.mjs\";\nimport { startOfISOWeek } from \"./startOfISOWeek.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n/**\n * @name getISOWeekYear\n * @category ISO Week-Numbering Year Helpers\n * @summary Get the ISO week-numbering year of the given date.\n *\n * @description\n * Get the ISO week-numbering year of the given date,\n * which always starts 3 days before the year's first Thursday.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The given date\n *\n * @returns The ISO week-numbering year\n *\n * @example\n * // Which ISO-week numbering year is 2 January 2005?\n * const result = getISOWeekYear(new Date(2005, 0, 2))\n * //=> 2004\n */\nexport function getISOWeekYear(date) {\n const _date = toDate(date);\n const year = _date.getFullYear();\n\n const fourthOfJanuaryOfNextYear = constructFrom(date, 0);\n fourthOfJanuaryOfNextYear.setFullYear(year + 1, 0, 4);\n fourthOfJanuaryOfNextYear.setHours(0, 0, 0, 0);\n const startOfNextYear = startOfISOWeek(fourthOfJanuaryOfNextYear);\n\n const fourthOfJanuaryOfThisYear = constructFrom(date, 0);\n fourthOfJanuaryOfThisYear.setFullYear(year, 0, 4);\n fourthOfJanuaryOfThisYear.setHours(0, 0, 0, 0);\n const startOfThisYear = startOfISOWeek(fourthOfJanuaryOfThisYear);\n\n if (_date.getTime() >= startOfNextYear.getTime()) {\n return year + 1;\n } else if (_date.getTime() >= startOfThisYear.getTime()) {\n return year;\n } else {\n return year - 1;\n }\n}\n\n// Fallback for modularized imports:\nexport default getISOWeekYear;\n","import { getISOWeekYear } from \"./getISOWeekYear.mjs\";\nimport { startOfISOWeek } from \"./startOfISOWeek.mjs\";\nimport { constructFrom } from \"./constructFrom.mjs\";\n\n/**\n * @name startOfISOWeekYear\n * @category ISO Week-Numbering Year Helpers\n * @summary Return the start of an ISO week-numbering year for the given date.\n *\n * @description\n * Return the start of an ISO week-numbering year,\n * which always starts 3 days before the year's first Thursday.\n * The result will be in the local timezone.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The original date\n *\n * @returns The start of an ISO week-numbering year\n *\n * @example\n * // The start of an ISO week-numbering year for 2 July 2005:\n * const result = startOfISOWeekYear(new Date(2005, 6, 2))\n * //=> Mon Jan 03 2005 00:00:00\n */\nexport function startOfISOWeekYear(date) {\n const year = getISOWeekYear(date);\n const fourthOfJanuary = constructFrom(date, 0);\n fourthOfJanuary.setFullYear(year, 0, 4);\n fourthOfJanuary.setHours(0, 0, 0, 0);\n return startOfISOWeek(fourthOfJanuary);\n}\n\n// Fallback for modularized imports:\nexport default startOfISOWeekYear;\n","import { millisecondsInWeek } from \"./constants.mjs\";\nimport { startOfISOWeek } from \"./startOfISOWeek.mjs\";\nimport { startOfISOWeekYear } from \"./startOfISOWeekYear.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n/**\n * @name getISOWeek\n * @category ISO Week Helpers\n * @summary Get the ISO week of the given date.\n *\n * @description\n * Get the ISO week of the given date.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The given date\n *\n * @returns The ISO week\n *\n * @example\n * // Which week of the ISO-week numbering year is 2 January 2005?\n * const result = getISOWeek(new Date(2005, 0, 2))\n * //=> 53\n */\nexport function getISOWeek(date) {\n const _date = toDate(date);\n const diff = +startOfISOWeek(_date) - +startOfISOWeekYear(_date);\n\n // Round the number of weeks to the nearest integer because the number of\n // milliseconds in a week is not constant (e.g. it's different in the week of\n // the daylight saving time clock shift).\n return Math.round(diff / millisecondsInWeek) + 1;\n}\n\n// Fallback for modularized imports:\nexport default getISOWeek;\n","import { constructFrom } from \"./constructFrom.mjs\";\nimport { startOfWeek } from \"./startOfWeek.mjs\";\nimport { toDate } from \"./toDate.mjs\";\nimport { getDefaultOptions } from \"./_lib/defaultOptions.mjs\";\n\n/**\n * The {@link getWeekYear} function options.\n */\n\n/**\n * @name getWeekYear\n * @category Week-Numbering Year Helpers\n * @summary Get the local week-numbering year of the given date.\n *\n * @description\n * Get the local week-numbering year of the given date.\n * The exact calculation depends on the values of\n * `options.weekStartsOn` (which is the index of the first day of the week)\n * and `options.firstWeekContainsDate` (which is the day of January, which is always in\n * the first week of the week-numbering year)\n *\n * Week numbering: https://en.wikipedia.org/wiki/Week#The_ISO_week_date_system\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The given date\n * @param options - An object with options.\n *\n * @returns The local week-numbering year\n *\n * @example\n * // Which week numbering year is 26 December 2004 with the default settings?\n * const result = getWeekYear(new Date(2004, 11, 26))\n * //=> 2005\n *\n * @example\n * // Which week numbering year is 26 December 2004 if week starts on Saturday?\n * const result = getWeekYear(new Date(2004, 11, 26), { weekStartsOn: 6 })\n * //=> 2004\n *\n * @example\n * // Which week numbering year is 26 December 2004 if the first week contains 4 January?\n * const result = getWeekYear(new Date(2004, 11, 26), { firstWeekContainsDate: 4 })\n * //=> 2004\n */\nexport function getWeekYear(date, options) {\n const _date = toDate(date);\n const year = _date.getFullYear();\n\n const defaultOptions = getDefaultOptions();\n const firstWeekContainsDate =\n options?.firstWeekContainsDate ??\n options?.locale?.options?.firstWeekContainsDate ??\n defaultOptions.firstWeekContainsDate ??\n defaultOptions.locale?.options?.firstWeekContainsDate ??\n 1;\n\n const firstWeekOfNextYear = constructFrom(date, 0);\n firstWeekOfNextYear.setFullYear(year + 1, 0, firstWeekContainsDate);\n firstWeekOfNextYear.setHours(0, 0, 0, 0);\n const startOfNextYear = startOfWeek(firstWeekOfNextYear, options);\n\n const firstWeekOfThisYear = constructFrom(date, 0);\n firstWeekOfThisYear.setFullYear(year, 0, firstWeekContainsDate);\n firstWeekOfThisYear.setHours(0, 0, 0, 0);\n const startOfThisYear = startOfWeek(firstWeekOfThisYear, options);\n\n if (_date.getTime() >= startOfNextYear.getTime()) {\n return year + 1;\n } else if (_date.getTime() >= startOfThisYear.getTime()) {\n return year;\n } else {\n return year - 1;\n }\n}\n\n// Fallback for modularized imports:\nexport default getWeekYear;\n","import { constructFrom } from \"./constructFrom.mjs\";\nimport { getWeekYear } from \"./getWeekYear.mjs\";\nimport { startOfWeek } from \"./startOfWeek.mjs\";\nimport { getDefaultOptions } from \"./_lib/defaultOptions.mjs\";\n\n/**\n * The {@link startOfWeekYear} function options.\n */\n\n/**\n * @name startOfWeekYear\n * @category Week-Numbering Year Helpers\n * @summary Return the start of a local week-numbering year for the given date.\n *\n * @description\n * Return the start of a local week-numbering year.\n * The exact calculation depends on the values of\n * `options.weekStartsOn` (which is the index of the first day of the week)\n * and `options.firstWeekContainsDate` (which is the day of January, which is always in\n * the first week of the week-numbering year)\n *\n * Week numbering: https://en.wikipedia.org/wiki/Week#The_ISO_week_date_system\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The original date\n * @param options - An object with options\n *\n * @returns The start of a week-numbering year\n *\n * @example\n * // The start of an a week-numbering year for 2 July 2005 with default settings:\n * const result = startOfWeekYear(new Date(2005, 6, 2))\n * //=> Sun Dec 26 2004 00:00:00\n *\n * @example\n * // The start of a week-numbering year for 2 July 2005\n * // if Monday is the first day of week\n * // and 4 January is always in the first week of the year:\n * const result = startOfWeekYear(new Date(2005, 6, 2), {\n * weekStartsOn: 1,\n * firstWeekContainsDate: 4\n * })\n * //=> Mon Jan 03 2005 00:00:00\n */\nexport function startOfWeekYear(date, options) {\n const defaultOptions = getDefaultOptions();\n const firstWeekContainsDate =\n options?.firstWeekContainsDate ??\n options?.locale?.options?.firstWeekContainsDate ??\n defaultOptions.firstWeekContainsDate ??\n defaultOptions.locale?.options?.firstWeekContainsDate ??\n 1;\n\n const year = getWeekYear(date, options);\n const firstWeek = constructFrom(date, 0);\n firstWeek.setFullYear(year, 0, firstWeekContainsDate);\n firstWeek.setHours(0, 0, 0, 0);\n const _date = startOfWeek(firstWeek, options);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default startOfWeekYear;\n","import { millisecondsInWeek } from \"./constants.mjs\";\nimport { startOfWeek } from \"./startOfWeek.mjs\";\nimport { startOfWeekYear } from \"./startOfWeekYear.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n/**\n * The {@link getWeek} function options.\n */\n\n/**\n * @name getWeek\n * @category Week Helpers\n * @summary Get the local week index of the given date.\n *\n * @description\n * Get the local week index of the given date.\n * The exact calculation depends on the values of\n * `options.weekStartsOn` (which is the index of the first day of the week)\n * and `options.firstWeekContainsDate` (which is the day of January, which is always in\n * the first week of the week-numbering year)\n *\n * Week numbering: https://en.wikipedia.org/wiki/Week#The_ISO_week_date_system\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The given date\n * @param options - An object with options\n *\n * @returns The week\n *\n * @example\n * // Which week of the local week numbering year is 2 January 2005 with default options?\n * const result = getWeek(new Date(2005, 0, 2))\n * //=> 2\n *\n * @example\n * // Which week of the local week numbering year is 2 January 2005,\n * // if Monday is the first day of the week,\n * // and the first week of the year always contains 4 January?\n * const result = getWeek(new Date(2005, 0, 2), {\n * weekStartsOn: 1,\n * firstWeekContainsDate: 4\n * })\n * //=> 53\n */\n\nexport function getWeek(date, options) {\n const _date = toDate(date);\n const diff = +startOfWeek(_date, options) - +startOfWeekYear(_date, options);\n\n // Round the number of weeks to the nearest integer because the number of\n // milliseconds in a week is not constant (e.g. it's different in the week of\n // the daylight saving time clock shift).\n return Math.round(diff / millisecondsInWeek) + 1;\n}\n\n// Fallback for modularized imports:\nexport default getWeek;\n","export function addLeadingZeros(number, targetLength) {\n const sign = number < 0 ? \"-\" : \"\";\n const output = Math.abs(number).toString().padStart(targetLength, \"0\");\n return sign + output;\n}\n","import { addLeadingZeros } from \"../addLeadingZeros.mjs\";\n\n/*\n * | | Unit | | Unit |\n * |-----|--------------------------------|-----|--------------------------------|\n * | a | AM, PM | A* | |\n * | d | Day of month | D | |\n * | h | Hour [1-12] | H | Hour [0-23] |\n * | m | Minute | M | Month |\n * | s | Second | S | Fraction of second |\n * | y | Year (abs) | Y | |\n *\n * Letters marked by * are not implemented but reserved by Unicode standard.\n */\n\nexport const lightFormatters = {\n // Year\n y(date, token) {\n // From http://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Format_tokens\n // | Year | y | yy | yyy | yyyy | yyyyy |\n // |----------|-------|----|-------|-------|-------|\n // | AD 1 | 1 | 01 | 001 | 0001 | 00001 |\n // | AD 12 | 12 | 12 | 012 | 0012 | 00012 |\n // | AD 123 | 123 | 23 | 123 | 0123 | 00123 |\n // | AD 1234 | 1234 | 34 | 1234 | 1234 | 01234 |\n // | AD 12345 | 12345 | 45 | 12345 | 12345 | 12345 |\n\n const signedYear = date.getFullYear();\n // Returns 1 for 1 BC (which is year 0 in JavaScript)\n const year = signedYear > 0 ? signedYear : 1 - signedYear;\n return addLeadingZeros(token === \"yy\" ? year % 100 : year, token.length);\n },\n\n // Month\n M(date, token) {\n const month = date.getMonth();\n return token === \"M\" ? String(month + 1) : addLeadingZeros(month + 1, 2);\n },\n\n // Day of the month\n d(date, token) {\n return addLeadingZeros(date.getDate(), token.length);\n },\n\n // AM or PM\n a(date, token) {\n const dayPeriodEnumValue = date.getHours() / 12 >= 1 ? \"pm\" : \"am\";\n\n switch (token) {\n case \"a\":\n case \"aa\":\n return dayPeriodEnumValue.toUpperCase();\n case \"aaa\":\n return dayPeriodEnumValue;\n case \"aaaaa\":\n return dayPeriodEnumValue[0];\n case \"aaaa\":\n default:\n return dayPeriodEnumValue === \"am\" ? \"a.m.\" : \"p.m.\";\n }\n },\n\n // Hour [1-12]\n h(date, token) {\n return addLeadingZeros(date.getHours() % 12 || 12, token.length);\n },\n\n // Hour [0-23]\n H(date, token) {\n return addLeadingZeros(date.getHours(), token.length);\n },\n\n // Minute\n m(date, token) {\n return addLeadingZeros(date.getMinutes(), token.length);\n },\n\n // Second\n s(date, token) {\n return addLeadingZeros(date.getSeconds(), token.length);\n },\n\n // Fraction of second\n S(date, token) {\n const numberOfDigits = token.length;\n const milliseconds = date.getMilliseconds();\n const fractionalSeconds = Math.trunc(\n milliseconds * Math.pow(10, numberOfDigits - 3),\n );\n return addLeadingZeros(fractionalSeconds, token.length);\n },\n};\n","import { getDayOfYear } from \"../../getDayOfYear.mjs\";\nimport { getISOWeek } from \"../../getISOWeek.mjs\";\nimport { getISOWeekYear } from \"../../getISOWeekYear.mjs\";\nimport { getWeek } from \"../../getWeek.mjs\";\nimport { getWeekYear } from \"../../getWeekYear.mjs\";\nimport { addLeadingZeros } from \"../addLeadingZeros.mjs\";\nimport { lightFormatters } from \"./lightFormatters.mjs\";\n\nconst dayPeriodEnum = {\n am: \"am\",\n pm: \"pm\",\n midnight: \"midnight\",\n noon: \"noon\",\n morning: \"morning\",\n afternoon: \"afternoon\",\n evening: \"evening\",\n night: \"night\",\n};\n\n/*\n * | | Unit | | Unit |\n * |-----|--------------------------------|-----|--------------------------------|\n * | a | AM, PM | A* | Milliseconds in day |\n * | b | AM, PM, noon, midnight | B | Flexible day period |\n * | c | Stand-alone local day of week | C* | Localized hour w/ day period |\n * | d | Day of month | D | Day of year |\n * | e | Local day of week | E | Day of week |\n * | f | | F* | Day of week in month |\n * | g* | Modified Julian day | G | Era |\n * | h | Hour [1-12] | H | Hour [0-23] |\n * | i! | ISO day of week | I! | ISO week of year |\n * | j* | Localized hour w/ day period | J* | Localized hour w/o day period |\n * | k | Hour [1-24] | K | Hour [0-11] |\n * | l* | (deprecated) | L | Stand-alone month |\n * | m | Minute | M | Month |\n * | n | | N | |\n * | o! | Ordinal number modifier | O | Timezone (GMT) |\n * | p! | Long localized time | P! | Long localized date |\n * | q | Stand-alone quarter | Q | Quarter |\n * | r* | Related Gregorian year | R! | ISO week-numbering year |\n * | s | Second | S | Fraction of second |\n * | t! | Seconds timestamp | T! | Milliseconds timestamp |\n * | u | Extended year | U* | Cyclic year |\n * | v* | Timezone (generic non-locat.) | V* | Timezone (location) |\n * | w | Local week of year | W* | Week of month |\n * | x | Timezone (ISO-8601 w/o Z) | X | Timezone (ISO-8601) |\n * | y | Year (abs) | Y | Local week-numbering year |\n * | z | Timezone (specific non-locat.) | Z* | Timezone (aliases) |\n *\n * Letters marked by * are not implemented but reserved by Unicode standard.\n *\n * Letters marked by ! are non-standard, but implemented by date-fns:\n * - `o` modifies the previous token to turn it into an ordinal (see `format` docs)\n * - `i` is ISO day of week. For `i` and `ii` is returns numeric ISO week days,\n * i.e. 7 for Sunday, 1 for Monday, etc.\n * - `I` is ISO week of year, as opposed to `w` which is local week of year.\n * - `R` is ISO week-numbering year, as opposed to `Y` which is local week-numbering year.\n * `R` is supposed to be used in conjunction with `I` and `i`\n * for universal ISO week-numbering date, whereas\n * `Y` is supposed to be used in conjunction with `w` and `e`\n * for week-numbering date specific to the locale.\n * - `P` is long localized date format\n * - `p` is long localized time format\n */\n\nexport const formatters = {\n // Era\n G: function (date, token, localize) {\n const era = date.getFullYear() > 0 ? 1 : 0;\n switch (token) {\n // AD, BC\n case \"G\":\n case \"GG\":\n case \"GGG\":\n return localize.era(era, { width: \"abbreviated\" });\n // A, B\n case \"GGGGG\":\n return localize.era(era, { width: \"narrow\" });\n // Anno Domini, Before Christ\n case \"GGGG\":\n default:\n return localize.era(era, { width: \"wide\" });\n }\n },\n\n // Year\n y: function (date, token, localize) {\n // Ordinal number\n if (token === \"yo\") {\n const signedYear = date.getFullYear();\n // Returns 1 for 1 BC (which is year 0 in JavaScript)\n const year = signedYear > 0 ? signedYear : 1 - signedYear;\n return localize.ordinalNumber(year, { unit: \"year\" });\n }\n\n return lightFormatters.y(date, token);\n },\n\n // Local week-numbering year\n Y: function (date, token, localize, options) {\n const signedWeekYear = getWeekYear(date, options);\n // Returns 1 for 1 BC (which is year 0 in JavaScript)\n const weekYear = signedWeekYear > 0 ? signedWeekYear : 1 - signedWeekYear;\n\n // Two digit year\n if (token === \"YY\") {\n const twoDigitYear = weekYear % 100;\n return addLeadingZeros(twoDigitYear, 2);\n }\n\n // Ordinal number\n if (token === \"Yo\") {\n return localize.ordinalNumber(weekYear, { unit: \"year\" });\n }\n\n // Padding\n return addLeadingZeros(weekYear, token.length);\n },\n\n // ISO week-numbering year\n R: function (date, token) {\n const isoWeekYear = getISOWeekYear(date);\n\n // Padding\n return addLeadingZeros(isoWeekYear, token.length);\n },\n\n // Extended year. This is a single number designating the year of this calendar system.\n // The main difference between `y` and `u` localizers are B.C. years:\n // | Year | `y` | `u` |\n // |------|-----|-----|\n // | AC 1 | 1 | 1 |\n // | BC 1 | 1 | 0 |\n // | BC 2 | 2 | -1 |\n // Also `yy` always returns the last two digits of a year,\n // while `uu` pads single digit years to 2 characters and returns other years unchanged.\n u: function (date, token) {\n const year = date.getFullYear();\n return addLeadingZeros(year, token.length);\n },\n\n // Quarter\n Q: function (date, token, localize) {\n const quarter = Math.ceil((date.getMonth() + 1) / 3);\n switch (token) {\n // 1, 2, 3, 4\n case \"Q\":\n return String(quarter);\n // 01, 02, 03, 04\n case \"QQ\":\n return addLeadingZeros(quarter, 2);\n // 1st, 2nd, 3rd, 4th\n case \"Qo\":\n return localize.ordinalNumber(quarter, { unit: \"quarter\" });\n // Q1, Q2, Q3, Q4\n case \"QQQ\":\n return localize.quarter(quarter, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n // 1, 2, 3, 4 (narrow quarter; could be not numerical)\n case \"QQQQQ\":\n return localize.quarter(quarter, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // 1st quarter, 2nd quarter, ...\n case \"QQQQ\":\n default:\n return localize.quarter(quarter, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // Stand-alone quarter\n q: function (date, token, localize) {\n const quarter = Math.ceil((date.getMonth() + 1) / 3);\n switch (token) {\n // 1, 2, 3, 4\n case \"q\":\n return String(quarter);\n // 01, 02, 03, 04\n case \"qq\":\n return addLeadingZeros(quarter, 2);\n // 1st, 2nd, 3rd, 4th\n case \"qo\":\n return localize.ordinalNumber(quarter, { unit: \"quarter\" });\n // Q1, Q2, Q3, Q4\n case \"qqq\":\n return localize.quarter(quarter, {\n width: \"abbreviated\",\n context: \"standalone\",\n });\n // 1, 2, 3, 4 (narrow quarter; could be not numerical)\n case \"qqqqq\":\n return localize.quarter(quarter, {\n width: \"narrow\",\n context: \"standalone\",\n });\n // 1st quarter, 2nd quarter, ...\n case \"qqqq\":\n default:\n return localize.quarter(quarter, {\n width: \"wide\",\n context: \"standalone\",\n });\n }\n },\n\n // Month\n M: function (date, token, localize) {\n const month = date.getMonth();\n switch (token) {\n case \"M\":\n case \"MM\":\n return lightFormatters.M(date, token);\n // 1st, 2nd, ..., 12th\n case \"Mo\":\n return localize.ordinalNumber(month + 1, { unit: \"month\" });\n // Jan, Feb, ..., Dec\n case \"MMM\":\n return localize.month(month, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n // J, F, ..., D\n case \"MMMMM\":\n return localize.month(month, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // January, February, ..., December\n case \"MMMM\":\n default:\n return localize.month(month, { width: \"wide\", context: \"formatting\" });\n }\n },\n\n // Stand-alone month\n L: function (date, token, localize) {\n const month = date.getMonth();\n switch (token) {\n // 1, 2, ..., 12\n case \"L\":\n return String(month + 1);\n // 01, 02, ..., 12\n case \"LL\":\n return addLeadingZeros(month + 1, 2);\n // 1st, 2nd, ..., 12th\n case \"Lo\":\n return localize.ordinalNumber(month + 1, { unit: \"month\" });\n // Jan, Feb, ..., Dec\n case \"LLL\":\n return localize.month(month, {\n width: \"abbreviated\",\n context: \"standalone\",\n });\n // J, F, ..., D\n case \"LLLLL\":\n return localize.month(month, {\n width: \"narrow\",\n context: \"standalone\",\n });\n // January, February, ..., December\n case \"LLLL\":\n default:\n return localize.month(month, { width: \"wide\", context: \"standalone\" });\n }\n },\n\n // Local week of year\n w: function (date, token, localize, options) {\n const week = getWeek(date, options);\n\n if (token === \"wo\") {\n return localize.ordinalNumber(week, { unit: \"week\" });\n }\n\n return addLeadingZeros(week, token.length);\n },\n\n // ISO week of year\n I: function (date, token, localize) {\n const isoWeek = getISOWeek(date);\n\n if (token === \"Io\") {\n return localize.ordinalNumber(isoWeek, { unit: \"week\" });\n }\n\n return addLeadingZeros(isoWeek, token.length);\n },\n\n // Day of the month\n d: function (date, token, localize) {\n if (token === \"do\") {\n return localize.ordinalNumber(date.getDate(), { unit: \"date\" });\n }\n\n return lightFormatters.d(date, token);\n },\n\n // Day of year\n D: function (date, token, localize) {\n const dayOfYear = getDayOfYear(date);\n\n if (token === \"Do\") {\n return localize.ordinalNumber(dayOfYear, { unit: \"dayOfYear\" });\n }\n\n return addLeadingZeros(dayOfYear, token.length);\n },\n\n // Day of week\n E: function (date, token, localize) {\n const dayOfWeek = date.getDay();\n switch (token) {\n // Tue\n case \"E\":\n case \"EE\":\n case \"EEE\":\n return localize.day(dayOfWeek, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n // T\n case \"EEEEE\":\n return localize.day(dayOfWeek, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // Tu\n case \"EEEEEE\":\n return localize.day(dayOfWeek, {\n width: \"short\",\n context: \"formatting\",\n });\n // Tuesday\n case \"EEEE\":\n default:\n return localize.day(dayOfWeek, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // Local day of week\n e: function (date, token, localize, options) {\n const dayOfWeek = date.getDay();\n const localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;\n switch (token) {\n // Numerical value (Nth day of week with current locale or weekStartsOn)\n case \"e\":\n return String(localDayOfWeek);\n // Padded numerical value\n case \"ee\":\n return addLeadingZeros(localDayOfWeek, 2);\n // 1st, 2nd, ..., 7th\n case \"eo\":\n return localize.ordinalNumber(localDayOfWeek, { unit: \"day\" });\n case \"eee\":\n return localize.day(dayOfWeek, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n // T\n case \"eeeee\":\n return localize.day(dayOfWeek, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // Tu\n case \"eeeeee\":\n return localize.day(dayOfWeek, {\n width: \"short\",\n context: \"formatting\",\n });\n // Tuesday\n case \"eeee\":\n default:\n return localize.day(dayOfWeek, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // Stand-alone local day of week\n c: function (date, token, localize, options) {\n const dayOfWeek = date.getDay();\n const localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;\n switch (token) {\n // Numerical value (same as in `e`)\n case \"c\":\n return String(localDayOfWeek);\n // Padded numerical value\n case \"cc\":\n return addLeadingZeros(localDayOfWeek, token.length);\n // 1st, 2nd, ..., 7th\n case \"co\":\n return localize.ordinalNumber(localDayOfWeek, { unit: \"day\" });\n case \"ccc\":\n return localize.day(dayOfWeek, {\n width: \"abbreviated\",\n context: \"standalone\",\n });\n // T\n case \"ccccc\":\n return localize.day(dayOfWeek, {\n width: \"narrow\",\n context: \"standalone\",\n });\n // Tu\n case \"cccccc\":\n return localize.day(dayOfWeek, {\n width: \"short\",\n context: \"standalone\",\n });\n // Tuesday\n case \"cccc\":\n default:\n return localize.day(dayOfWeek, {\n width: \"wide\",\n context: \"standalone\",\n });\n }\n },\n\n // ISO day of week\n i: function (date, token, localize) {\n const dayOfWeek = date.getDay();\n const isoDayOfWeek = dayOfWeek === 0 ? 7 : dayOfWeek;\n switch (token) {\n // 2\n case \"i\":\n return String(isoDayOfWeek);\n // 02\n case \"ii\":\n return addLeadingZeros(isoDayOfWeek, token.length);\n // 2nd\n case \"io\":\n return localize.ordinalNumber(isoDayOfWeek, { unit: \"day\" });\n // Tue\n case \"iii\":\n return localize.day(dayOfWeek, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n // T\n case \"iiiii\":\n return localize.day(dayOfWeek, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // Tu\n case \"iiiiii\":\n return localize.day(dayOfWeek, {\n width: \"short\",\n context: \"formatting\",\n });\n // Tuesday\n case \"iiii\":\n default:\n return localize.day(dayOfWeek, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // AM or PM\n a: function (date, token, localize) {\n const hours = date.getHours();\n const dayPeriodEnumValue = hours / 12 >= 1 ? \"pm\" : \"am\";\n\n switch (token) {\n case \"a\":\n case \"aa\":\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n case \"aaa\":\n return localize\n .dayPeriod(dayPeriodEnumValue, {\n width: \"abbreviated\",\n context: \"formatting\",\n })\n .toLowerCase();\n case \"aaaaa\":\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"narrow\",\n context: \"formatting\",\n });\n case \"aaaa\":\n default:\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // AM, PM, midnight, noon\n b: function (date, token, localize) {\n const hours = date.getHours();\n let dayPeriodEnumValue;\n if (hours === 12) {\n dayPeriodEnumValue = dayPeriodEnum.noon;\n } else if (hours === 0) {\n dayPeriodEnumValue = dayPeriodEnum.midnight;\n } else {\n dayPeriodEnumValue = hours / 12 >= 1 ? \"pm\" : \"am\";\n }\n\n switch (token) {\n case \"b\":\n case \"bb\":\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n case \"bbb\":\n return localize\n .dayPeriod(dayPeriodEnumValue, {\n width: \"abbreviated\",\n context: \"formatting\",\n })\n .toLowerCase();\n case \"bbbbb\":\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"narrow\",\n context: \"formatting\",\n });\n case \"bbbb\":\n default:\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // in the morning, in the afternoon, in the evening, at night\n B: function (date, token, localize) {\n const hours = date.getHours();\n let dayPeriodEnumValue;\n if (hours >= 17) {\n dayPeriodEnumValue = dayPeriodEnum.evening;\n } else if (hours >= 12) {\n dayPeriodEnumValue = dayPeriodEnum.afternoon;\n } else if (hours >= 4) {\n dayPeriodEnumValue = dayPeriodEnum.morning;\n } else {\n dayPeriodEnumValue = dayPeriodEnum.night;\n }\n\n switch (token) {\n case \"B\":\n case \"BB\":\n case \"BBB\":\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n case \"BBBBB\":\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"narrow\",\n context: \"formatting\",\n });\n case \"BBBB\":\n default:\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // Hour [1-12]\n h: function (date, token, localize) {\n if (token === \"ho\") {\n let hours = date.getHours() % 12;\n if (hours === 0) hours = 12;\n return localize.ordinalNumber(hours, { unit: \"hour\" });\n }\n\n return lightFormatters.h(date, token);\n },\n\n // Hour [0-23]\n H: function (date, token, localize) {\n if (token === \"Ho\") {\n return localize.ordinalNumber(date.getHours(), { unit: \"hour\" });\n }\n\n return lightFormatters.H(date, token);\n },\n\n // Hour [0-11]\n K: function (date, token, localize) {\n const hours = date.getHours() % 12;\n\n if (token === \"Ko\") {\n return localize.ordinalNumber(hours, { unit: \"hour\" });\n }\n\n return addLeadingZeros(hours, token.length);\n },\n\n // Hour [1-24]\n k: function (date, token, localize) {\n let hours = date.getHours();\n if (hours === 0) hours = 24;\n\n if (token === \"ko\") {\n return localize.ordinalNumber(hours, { unit: \"hour\" });\n }\n\n return addLeadingZeros(hours, token.length);\n },\n\n // Minute\n m: function (date, token, localize) {\n if (token === \"mo\") {\n return localize.ordinalNumber(date.getMinutes(), { unit: \"minute\" });\n }\n\n return lightFormatters.m(date, token);\n },\n\n // Second\n s: function (date, token, localize) {\n if (token === \"so\") {\n return localize.ordinalNumber(date.getSeconds(), { unit: \"second\" });\n }\n\n return lightFormatters.s(date, token);\n },\n\n // Fraction of second\n S: function (date, token) {\n return lightFormatters.S(date, token);\n },\n\n // Timezone (ISO-8601. If offset is 0, output is always `'Z'`)\n X: function (date, token, _localize) {\n const timezoneOffset = date.getTimezoneOffset();\n\n if (timezoneOffset === 0) {\n return \"Z\";\n }\n\n switch (token) {\n // Hours and optional minutes\n case \"X\":\n return formatTimezoneWithOptionalMinutes(timezoneOffset);\n\n // Hours, minutes and optional seconds without `:` delimiter\n // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets\n // so this token always has the same output as `XX`\n case \"XXXX\":\n case \"XX\": // Hours and minutes without `:` delimiter\n return formatTimezone(timezoneOffset);\n\n // Hours, minutes and optional seconds with `:` delimiter\n // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets\n // so this token always has the same output as `XXX`\n case \"XXXXX\":\n case \"XXX\": // Hours and minutes with `:` delimiter\n default:\n return formatTimezone(timezoneOffset, \":\");\n }\n },\n\n // Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)\n x: function (date, token, _localize) {\n const timezoneOffset = date.getTimezoneOffset();\n\n switch (token) {\n // Hours and optional minutes\n case \"x\":\n return formatTimezoneWithOptionalMinutes(timezoneOffset);\n\n // Hours, minutes and optional seconds without `:` delimiter\n // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets\n // so this token always has the same output as `xx`\n case \"xxxx\":\n case \"xx\": // Hours and minutes without `:` delimiter\n return formatTimezone(timezoneOffset);\n\n // Hours, minutes and optional seconds with `:` delimiter\n // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets\n // so this token always has the same output as `xxx`\n case \"xxxxx\":\n case \"xxx\": // Hours and minutes with `:` delimiter\n default:\n return formatTimezone(timezoneOffset, \":\");\n }\n },\n\n // Timezone (GMT)\n O: function (date, token, _localize) {\n const timezoneOffset = date.getTimezoneOffset();\n\n switch (token) {\n // Short\n case \"O\":\n case \"OO\":\n case \"OOO\":\n return \"GMT\" + formatTimezoneShort(timezoneOffset, \":\");\n // Long\n case \"OOOO\":\n default:\n return \"GMT\" + formatTimezone(timezoneOffset, \":\");\n }\n },\n\n // Timezone (specific non-location)\n z: function (date, token, _localize) {\n const timezoneOffset = date.getTimezoneOffset();\n\n switch (token) {\n // Short\n case \"z\":\n case \"zz\":\n case \"zzz\":\n return \"GMT\" + formatTimezoneShort(timezoneOffset, \":\");\n // Long\n case \"zzzz\":\n default:\n return \"GMT\" + formatTimezone(timezoneOffset, \":\");\n }\n },\n\n // Seconds timestamp\n t: function (date, token, _localize) {\n const timestamp = Math.trunc(date.getTime() / 1000);\n return addLeadingZeros(timestamp, token.length);\n },\n\n // Milliseconds timestamp\n T: function (date, token, _localize) {\n const timestamp = date.getTime();\n return addLeadingZeros(timestamp, token.length);\n },\n};\n\nfunction formatTimezoneShort(offset, delimiter = \"\") {\n const sign = offset > 0 ? \"-\" : \"+\";\n const absOffset = Math.abs(offset);\n const hours = Math.trunc(absOffset / 60);\n const minutes = absOffset % 60;\n if (minutes === 0) {\n return sign + String(hours);\n }\n return sign + String(hours) + delimiter + addLeadingZeros(minutes, 2);\n}\n\nfunction formatTimezoneWithOptionalMinutes(offset, delimiter) {\n if (offset % 60 === 0) {\n const sign = offset > 0 ? \"-\" : \"+\";\n return sign + addLeadingZeros(Math.abs(offset) / 60, 2);\n }\n return formatTimezone(offset, delimiter);\n}\n\nfunction formatTimezone(offset, delimiter = \"\") {\n const sign = offset > 0 ? \"-\" : \"+\";\n const absOffset = Math.abs(offset);\n const hours = addLeadingZeros(Math.trunc(absOffset / 60), 2);\n const minutes = addLeadingZeros(absOffset % 60, 2);\n return sign + hours + delimiter + minutes;\n}\n","const dateLongFormatter = (pattern, formatLong) => {\n switch (pattern) {\n case \"P\":\n return formatLong.date({ width: \"short\" });\n case \"PP\":\n return formatLong.date({ width: \"medium\" });\n case \"PPP\":\n return formatLong.date({ width: \"long\" });\n case \"PPPP\":\n default:\n return formatLong.date({ width: \"full\" });\n }\n};\n\nconst timeLongFormatter = (pattern, formatLong) => {\n switch (pattern) {\n case \"p\":\n return formatLong.time({ width: \"short\" });\n case \"pp\":\n return formatLong.time({ width: \"medium\" });\n case \"ppp\":\n return formatLong.time({ width: \"long\" });\n case \"pppp\":\n default:\n return formatLong.time({ width: \"full\" });\n }\n};\n\nconst dateTimeLongFormatter = (pattern, formatLong) => {\n const matchResult = pattern.match(/(P+)(p+)?/) || [];\n const datePattern = matchResult[1];\n const timePattern = matchResult[2];\n\n if (!timePattern) {\n return dateLongFormatter(pattern, formatLong);\n }\n\n let dateTimeFormat;\n\n switch (datePattern) {\n case \"P\":\n dateTimeFormat = formatLong.dateTime({ width: \"short\" });\n break;\n case \"PP\":\n dateTimeFormat = formatLong.dateTime({ width: \"medium\" });\n break;\n case \"PPP\":\n dateTimeFormat = formatLong.dateTime({ width: \"long\" });\n break;\n case \"PPPP\":\n default:\n dateTimeFormat = formatLong.dateTime({ width: \"full\" });\n break;\n }\n\n return dateTimeFormat\n .replace(\"{{date}}\", dateLongFormatter(datePattern, formatLong))\n .replace(\"{{time}}\", timeLongFormatter(timePattern, formatLong));\n};\n\nexport const longFormatters = {\n p: timeLongFormatter,\n P: dateTimeLongFormatter,\n};\n","const dayOfYearTokenRE = /^D+$/;\nconst weekYearTokenRE = /^Y+$/;\n\nconst throwTokens = [\"D\", \"DD\", \"YY\", \"YYYY\"];\n\nexport function isProtectedDayOfYearToken(token) {\n return dayOfYearTokenRE.test(token);\n}\n\nexport function isProtectedWeekYearToken(token) {\n return weekYearTokenRE.test(token);\n}\n\nexport function warnOrThrowProtectedError(token, format, input) {\n const _message = message(token, format, input);\n console.warn(_message);\n if (throwTokens.includes(token)) throw new RangeError(_message);\n}\n\nfunction message(token, format, input) {\n const subject = token[0] === \"Y\" ? \"years\" : \"days of the month\";\n return `Use \\`${token.toLowerCase()}\\` instead of \\`${token}\\` (in \\`${format}\\`) for formatting ${subject} to the input \\`${input}\\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`;\n}\n","/**\n * @name isDate\n * @category Common Helpers\n * @summary Is the given value a date?\n *\n * @description\n * Returns true if the given value is an instance of Date. The function works for dates transferred across iframes.\n *\n * @param value - The value to check\n *\n * @returns True if the given value is a date\n *\n * @example\n * // For a valid date:\n * const result = isDate(new Date())\n * //=> true\n *\n * @example\n * // For an invalid date:\n * const result = isDate(new Date(NaN))\n * //=> true\n *\n * @example\n * // For some value:\n * const result = isDate('2014-02-31')\n * //=> false\n *\n * @example\n * // For an object:\n * const result = isDate({})\n * //=> false\n */\nexport function isDate(value) {\n return (\n value instanceof Date ||\n (typeof value === \"object\" &&\n Object.prototype.toString.call(value) === \"[object Date]\")\n );\n}\n\n// Fallback for modularized imports:\nexport default isDate;\n","import { isDate } from \"./isDate.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n/**\n * @name isValid\n * @category Common Helpers\n * @summary Is the given date valid?\n *\n * @description\n * Returns false if argument is Invalid Date and true otherwise.\n * Argument is converted to Date using `toDate`. See [toDate](https://date-fns.org/docs/toDate)\n * Invalid Date is a Date, whose time value is NaN.\n *\n * Time value of Date: http://es5.github.io/#x15.9.1.1\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The date to check\n *\n * @returns The date is valid\n *\n * @example\n * // For the valid date:\n * const result = isValid(new Date(2014, 1, 31))\n * //=> true\n *\n * @example\n * // For the value, convertable into a date:\n * const result = isValid(1393804800000)\n * //=> true\n *\n * @example\n * // For the invalid date:\n * const result = isValid(new Date(''))\n * //=> false\n */\nexport function isValid(date) {\n if (!isDate(date) && typeof date !== \"number\") {\n return false;\n }\n const _date = toDate(date);\n return !isNaN(Number(_date));\n}\n\n// Fallback for modularized imports:\nexport default isValid;\n","import { defaultLocale } from \"./_lib/defaultLocale.mjs\";\nimport { getDefaultOptions } from \"./_lib/defaultOptions.mjs\";\nimport { formatters } from \"./_lib/format/formatters.mjs\";\nimport { longFormatters } from \"./_lib/format/longFormatters.mjs\";\nimport {\n isProtectedDayOfYearToken,\n isProtectedWeekYearToken,\n warnOrThrowProtectedError,\n} from \"./_lib/protectedTokens.mjs\";\nimport { isValid } from \"./isValid.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n// Rexports of internal for libraries to use.\n// See: https://github.com/date-fns/date-fns/issues/3638#issuecomment-1877082874\nexport { formatters, longFormatters };\n\n// This RegExp consists of three parts separated by `|`:\n// - [yYQqMLwIdDecihHKkms]o matches any available ordinal number token\n// (one of the certain letters followed by `o`)\n// - (\\w)\\1* matches any sequences of the same letter\n// - '' matches two quote characters in a row\n// - '(''|[^'])+('|$) matches anything surrounded by two quote characters ('),\n// except a single quote symbol, which ends the sequence.\n// Two quote characters do not end the sequence.\n// If there is no matching single quote\n// then the sequence will continue until the end of the string.\n// - . matches any single character unmatched by previous parts of the RegExps\nconst formattingTokensRegExp =\n /[yYQqMLwIdDecihHKkms]o|(\\w)\\1*|''|'(''|[^'])+('|$)|./g;\n\n// This RegExp catches symbols escaped by quotes, and also\n// sequences of symbols P, p, and the combinations like `PPPPPPPppppp`\nconst longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;\n\nconst escapedStringRegExp = /^'([^]*?)'?$/;\nconst doubleQuoteRegExp = /''/g;\nconst unescapedLatinCharacterRegExp = /[a-zA-Z]/;\n\nexport { format as formatDate };\n\n/**\n * The {@link format} function options.\n */\n\n/**\n * @name format\n * @alias formatDate\n * @category Common Helpers\n * @summary Format the date.\n *\n * @description\n * Return the formatted date string in the given format. The result may vary by locale.\n *\n * > ⚠️ Please note that the `format` tokens differ from Moment.js and other libraries.\n * > See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n *\n * The characters wrapped between two single quotes characters (') are escaped.\n * Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.\n * (see the last example)\n *\n * Format of the string is based on Unicode Technical Standard #35:\n * https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table\n * with a few additions (see note 7 below the table).\n *\n * Accepted patterns:\n * | Unit | Pattern | Result examples | Notes |\n * |---------------------------------|---------|-----------------------------------|-------|\n * | Era | G..GGG | AD, BC | |\n * | | GGGG | Anno Domini, Before Christ | 2 |\n * | | GGGGG | A, B | |\n * | Calendar year | y | 44, 1, 1900, 2017 | 5 |\n * | | yo | 44th, 1st, 0th, 17th | 5,7 |\n * | | yy | 44, 01, 00, 17 | 5 |\n * | | yyy | 044, 001, 1900, 2017 | 5 |\n * | | yyyy | 0044, 0001, 1900, 2017 | 5 |\n * | | yyyyy | ... | 3,5 |\n * | Local week-numbering year | Y | 44, 1, 1900, 2017 | 5 |\n * | | Yo | 44th, 1st, 1900th, 2017th | 5,7 |\n * | | YY | 44, 01, 00, 17 | 5,8 |\n * | | YYY | 044, 001, 1900, 2017 | 5 |\n * | | YYYY | 0044, 0001, 1900, 2017 | 5,8 |\n * | | YYYYY | ... | 3,5 |\n * | ISO week-numbering year | R | -43, 0, 1, 1900, 2017 | 5,7 |\n * | | RR | -43, 00, 01, 1900, 2017 | 5,7 |\n * | | RRR | -043, 000, 001, 1900, 2017 | 5,7 |\n * | | RRRR | -0043, 0000, 0001, 1900, 2017 | 5,7 |\n * | | RRRRR | ... | 3,5,7 |\n * | Extended year | u | -43, 0, 1, 1900, 2017 | 5 |\n * | | uu | -43, 01, 1900, 2017 | 5 |\n * | | uuu | -043, 001, 1900, 2017 | 5 |\n * | | uuuu | -0043, 0001, 1900, 2017 | 5 |\n * | | uuuuu | ... | 3,5 |\n * | Quarter (formatting) | Q | 1, 2, 3, 4 | |\n * | | Qo | 1st, 2nd, 3rd, 4th | 7 |\n * | | QQ | 01, 02, 03, 04 | |\n * | | QQQ | Q1, Q2, Q3, Q4 | |\n * | | QQQQ | 1st quarter, 2nd quarter, ... | 2 |\n * | | QQQQQ | 1, 2, 3, 4 | 4 |\n * | Quarter (stand-alone) | q | 1, 2, 3, 4 | |\n * | | qo | 1st, 2nd, 3rd, 4th | 7 |\n * | | qq | 01, 02, 03, 04 | |\n * | | qqq | Q1, Q2, Q3, Q4 | |\n * | | qqqq | 1st quarter, 2nd quarter, ... | 2 |\n * | | qqqqq | 1, 2, 3, 4 | 4 |\n * | Month (formatting) | M | 1, 2, ..., 12 | |\n * | | Mo | 1st, 2nd, ..., 12th | 7 |\n * | | MM | 01, 02, ..., 12 | |\n * | | MMM | Jan, Feb, ..., Dec | |\n * | | MMMM | January, February, ..., December | 2 |\n * | | MMMMM | J, F, ..., D | |\n * | Month (stand-alone) | L | 1, 2, ..., 12 | |\n * | | Lo | 1st, 2nd, ..., 12th | 7 |\n * | | LL | 01, 02, ..., 12 | |\n * | | LLL | Jan, Feb, ..., Dec | |\n * | | LLLL | January, February, ..., December | 2 |\n * | | LLLLL | J, F, ..., D | |\n * | Local week of year | w | 1, 2, ..., 53 | |\n * | | wo | 1st, 2nd, ..., 53th | 7 |\n * | | ww | 01, 02, ..., 53 | |\n * | ISO week of year | I | 1, 2, ..., 53 | 7 |\n * | | Io | 1st, 2nd, ..., 53th | 7 |\n * | | II | 01, 02, ..., 53 | 7 |\n * | Day of month | d | 1, 2, ..., 31 | |\n * | | do | 1st, 2nd, ..., 31st | 7 |\n * | | dd | 01, 02, ..., 31 | |\n * | Day of year | D | 1, 2, ..., 365, 366 | 9 |\n * | | Do | 1st, 2nd, ..., 365th, 366th | 7 |\n * | | DD | 01, 02, ..., 365, 366 | 9 |\n * | | DDD | 001, 002, ..., 365, 366 | |\n * | | DDDD | ... | 3 |\n * | Day of week (formatting) | E..EEE | Mon, Tue, Wed, ..., Sun | |\n * | | EEEE | Monday, Tuesday, ..., Sunday | 2 |\n * | | EEEEE | M, T, W, T, F, S, S | |\n * | | EEEEEE | Mo, Tu, We, Th, Fr, Sa, Su | |\n * | ISO day of week (formatting) | i | 1, 2, 3, ..., 7 | 7 |\n * | | io | 1st, 2nd, ..., 7th | 7 |\n * | | ii | 01, 02, ..., 07 | 7 |\n * | | iii | Mon, Tue, Wed, ..., Sun | 7 |\n * | | iiii | Monday, Tuesday, ..., Sunday | 2,7 |\n * | | iiiii | M, T, W, T, F, S, S | 7 |\n * | | iiiiii | Mo, Tu, We, Th, Fr, Sa, Su | 7 |\n * | Local day of week (formatting) | e | 2, 3, 4, ..., 1 | |\n * | | eo | 2nd, 3rd, ..., 1st | 7 |\n * | | ee | 02, 03, ..., 01 | |\n * | | eee | Mon, Tue, Wed, ..., Sun | |\n * | | eeee | Monday, Tuesday, ..., Sunday | 2 |\n * | | eeeee | M, T, W, T, F, S, S | |\n * | | eeeeee | Mo, Tu, We, Th, Fr, Sa, Su | |\n * | Local day of week (stand-alone) | c | 2, 3, 4, ..., 1 | |\n * | | co | 2nd, 3rd, ..., 1st | 7 |\n * | | cc | 02, 03, ..., 01 | |\n * | | ccc | Mon, Tue, Wed, ..., Sun | |\n * | | cccc | Monday, Tuesday, ..., Sunday | 2 |\n * | | ccccc | M, T, W, T, F, S, S | |\n * | | cccccc | Mo, Tu, We, Th, Fr, Sa, Su | |\n * | AM, PM | a..aa | AM, PM | |\n * | | aaa | am, pm | |\n * | | aaaa | a.m., p.m. | 2 |\n * | | aaaaa | a, p | |\n * | AM, PM, noon, midnight | b..bb | AM, PM, noon, midnight | |\n * | | bbb | am, pm, noon, midnight | |\n * | | bbbb | a.m., p.m., noon, midnight | 2 |\n * | | bbbbb | a, p, n, mi | |\n * | Flexible day period | B..BBB | at night, in the morning, ... | |\n * | | BBBB | at night, in the morning, ... | 2 |\n * | | BBBBB | at night, in the morning, ... | |\n * | Hour [1-12] | h | 1, 2, ..., 11, 12 | |\n * | | ho | 1st, 2nd, ..., 11th, 12th | 7 |\n * | | hh | 01, 02, ..., 11, 12 | |\n * | Hour [0-23] | H | 0, 1, 2, ..., 23 | |\n * | | Ho | 0th, 1st, 2nd, ..., 23rd | 7 |\n * | | HH | 00, 01, 02, ..., 23 | |\n * | Hour [0-11] | K | 1, 2, ..., 11, 0 | |\n * | | Ko | 1st, 2nd, ..., 11th, 0th | 7 |\n * | | KK | 01, 02, ..., 11, 00 | |\n * | Hour [1-24] | k | 24, 1, 2, ..., 23 | |\n * | | ko | 24th, 1st, 2nd, ..., 23rd | 7 |\n * | | kk | 24, 01, 02, ..., 23 | |\n * | Minute | m | 0, 1, ..., 59 | |\n * | | mo | 0th, 1st, ..., 59th | 7 |\n * | | mm | 00, 01, ..., 59 | |\n * | Second | s | 0, 1, ..., 59 | |\n * | | so | 0th, 1st, ..., 59th | 7 |\n * | | ss | 00, 01, ..., 59 | |\n * | Fraction of second | S | 0, 1, ..., 9 | |\n * | | SS | 00, 01, ..., 99 | |\n * | | SSS | 000, 001, ..., 999 | |\n * | | SSSS | ... | 3 |\n * | Timezone (ISO-8601 w/ Z) | X | -08, +0530, Z | |\n * | | XX | -0800, +0530, Z | |\n * | | XXX | -08:00, +05:30, Z | |\n * | | XXXX | -0800, +0530, Z, +123456 | 2 |\n * | | XXXXX | -08:00, +05:30, Z, +12:34:56 | |\n * | Timezone (ISO-8601 w/o Z) | x | -08, +0530, +00 | |\n * | | xx | -0800, +0530, +0000 | |\n * | | xxx | -08:00, +05:30, +00:00 | 2 |\n * | | xxxx | -0800, +0530, +0000, +123456 | |\n * | | xxxxx | -08:00, +05:30, +00:00, +12:34:56 | |\n * | Timezone (GMT) | O...OOO | GMT-8, GMT+5:30, GMT+0 | |\n * | | OOOO | GMT-08:00, GMT+05:30, GMT+00:00 | 2 |\n * | Timezone (specific non-locat.) | z...zzz | GMT-8, GMT+5:30, GMT+0 | 6 |\n * | | zzzz | GMT-08:00, GMT+05:30, GMT+00:00 | 2,6 |\n * | Seconds timestamp | t | 512969520 | 7 |\n * | | tt | ... | 3,7 |\n * | Milliseconds timestamp | T | 512969520900 | 7 |\n * | | TT | ... | 3,7 |\n * | Long localized date | P | 04/29/1453 | 7 |\n * | | PP | Apr 29, 1453 | 7 |\n * | | PPP | April 29th, 1453 | 7 |\n * | | PPPP | Friday, April 29th, 1453 | 2,7 |\n * | Long localized time | p | 12:00 AM | 7 |\n * | | pp | 12:00:00 AM | 7 |\n * | | ppp | 12:00:00 AM GMT+2 | 7 |\n * | | pppp | 12:00:00 AM GMT+02:00 | 2,7 |\n * | Combination of date and time | Pp | 04/29/1453, 12:00 AM | 7 |\n * | | PPpp | Apr 29, 1453, 12:00:00 AM | 7 |\n * | | PPPppp | April 29th, 1453 at ... | 7 |\n * | | PPPPpppp| Friday, April 29th, 1453 at ... | 2,7 |\n * Notes:\n * 1. \"Formatting\" units (e.g. formatting quarter) in the default en-US locale\n * are the same as \"stand-alone\" units, but are different in some languages.\n * \"Formatting\" units are declined according to the rules of the language\n * in the context of a date. \"Stand-alone\" units are always nominative singular:\n *\n * `format(new Date(2017, 10, 6), 'do LLLL', {locale: cs}) //=> '6. listopad'`\n *\n * `format(new Date(2017, 10, 6), 'do MMMM', {locale: cs}) //=> '6. listopadu'`\n *\n * 2. Any sequence of the identical letters is a pattern, unless it is escaped by\n * the single quote characters (see below).\n * If the sequence is longer than listed in table (e.g. `EEEEEEEEEEE`)\n * the output will be the same as default pattern for this unit, usually\n * the longest one (in case of ISO weekdays, `EEEE`). Default patterns for units\n * are marked with \"2\" in the last column of the table.\n *\n * `format(new Date(2017, 10, 6), 'MMM') //=> 'Nov'`\n *\n * `format(new Date(2017, 10, 6), 'MMMM') //=> 'November'`\n *\n * `format(new Date(2017, 10, 6), 'MMMMM') //=> 'N'`\n *\n * `format(new Date(2017, 10, 6), 'MMMMMM') //=> 'November'`\n *\n * `format(new Date(2017, 10, 6), 'MMMMMMM') //=> 'November'`\n *\n * 3. Some patterns could be unlimited length (such as `yyyyyyyy`).\n * The output will be padded with zeros to match the length of the pattern.\n *\n * `format(new Date(2017, 10, 6), 'yyyyyyyy') //=> '00002017'`\n *\n * 4. `QQQQQ` and `qqqqq` could be not strictly numerical in some locales.\n * These tokens represent the shortest form of the quarter.\n *\n * 5. The main difference between `y` and `u` patterns are B.C. years:\n *\n * | Year | `y` | `u` |\n * |------|-----|-----|\n * | AC 1 | 1 | 1 |\n * | BC 1 | 1 | 0 |\n * | BC 2 | 2 | -1 |\n *\n * Also `yy` always returns the last two digits of a year,\n * while `uu` pads single digit years to 2 characters and returns other years unchanged:\n *\n * | Year | `yy` | `uu` |\n * |------|------|------|\n * | 1 | 01 | 01 |\n * | 14 | 14 | 14 |\n * | 376 | 76 | 376 |\n * | 1453 | 53 | 1453 |\n *\n * The same difference is true for local and ISO week-numbering years (`Y` and `R`),\n * except local week-numbering years are dependent on `options.weekStartsOn`\n * and `options.firstWeekContainsDate` (compare [getISOWeekYear](https://date-fns.org/docs/getISOWeekYear)\n * and [getWeekYear](https://date-fns.org/docs/getWeekYear)).\n *\n * 6. Specific non-location timezones are currently unavailable in `date-fns`,\n * so right now these tokens fall back to GMT timezones.\n *\n * 7. These patterns are not in the Unicode Technical Standard #35:\n * - `i`: ISO day of week\n * - `I`: ISO week of year\n * - `R`: ISO week-numbering year\n * - `t`: seconds timestamp\n * - `T`: milliseconds timestamp\n * - `o`: ordinal number modifier\n * - `P`: long localized date\n * - `p`: long localized time\n *\n * 8. `YY` and `YYYY` tokens represent week-numbering years but they are often confused with years.\n * You should enable `options.useAdditionalWeekYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n *\n * 9. `D` and `DD` tokens represent days of the year but they are often confused with days of the month.\n * You should enable `options.useAdditionalDayOfYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The original date\n * @param format - The string of tokens\n * @param options - An object with options\n *\n * @returns The formatted date string\n *\n * @throws `date` must not be Invalid Date\n * @throws `options.locale` must contain `localize` property\n * @throws `options.locale` must contain `formatLong` property\n * @throws use `yyyy` instead of `YYYY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws use `yy` instead of `YY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws use `d` instead of `D` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws use `dd` instead of `DD` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws format string contains an unescaped latin alphabet character\n *\n * @example\n * // Represent 11 February 2014 in middle-endian format:\n * const result = format(new Date(2014, 1, 11), 'MM/dd/yyyy')\n * //=> '02/11/2014'\n *\n * @example\n * // Represent 2 July 2014 in Esperanto:\n * import { eoLocale } from 'date-fns/locale/eo'\n * const result = format(new Date(2014, 6, 2), \"do 'de' MMMM yyyy\", {\n * locale: eoLocale\n * })\n * //=> '2-a de julio 2014'\n *\n * @example\n * // Escape string by single quote characters:\n * const result = format(new Date(2014, 6, 2, 15), \"h 'o''clock'\")\n * //=> \"3 o'clock\"\n */\nexport function format(date, formatStr, options) {\n const defaultOptions = getDefaultOptions();\n const locale = options?.locale ?? defaultOptions.locale ?? defaultLocale;\n\n const firstWeekContainsDate =\n options?.firstWeekContainsDate ??\n options?.locale?.options?.firstWeekContainsDate ??\n defaultOptions.firstWeekContainsDate ??\n defaultOptions.locale?.options?.firstWeekContainsDate ??\n 1;\n\n const weekStartsOn =\n options?.weekStartsOn ??\n options?.locale?.options?.weekStartsOn ??\n defaultOptions.weekStartsOn ??\n defaultOptions.locale?.options?.weekStartsOn ??\n 0;\n\n const originalDate = toDate(date);\n\n if (!isValid(originalDate)) {\n throw new RangeError(\"Invalid time value\");\n }\n\n let parts = formatStr\n .match(longFormattingTokensRegExp)\n .map((substring) => {\n const firstCharacter = substring[0];\n if (firstCharacter === \"p\" || firstCharacter === \"P\") {\n const longFormatter = longFormatters[firstCharacter];\n return longFormatter(substring, locale.formatLong);\n }\n return substring;\n })\n .join(\"\")\n .match(formattingTokensRegExp)\n .map((substring) => {\n // Replace two single quote characters with one single quote character\n if (substring === \"''\") {\n return { isToken: false, value: \"'\" };\n }\n\n const firstCharacter = substring[0];\n if (firstCharacter === \"'\") {\n return { isToken: false, value: cleanEscapedString(substring) };\n }\n\n if (formatters[firstCharacter]) {\n return { isToken: true, value: substring };\n }\n\n if (firstCharacter.match(unescapedLatinCharacterRegExp)) {\n throw new RangeError(\n \"Format string contains an unescaped latin alphabet character `\" +\n firstCharacter +\n \"`\",\n );\n }\n\n return { isToken: false, value: substring };\n });\n\n // invoke localize preprocessor (only for french locales at the moment)\n if (locale.localize.preprocessor) {\n parts = locale.localize.preprocessor(originalDate, parts);\n }\n\n const formatterOptions = {\n firstWeekContainsDate,\n weekStartsOn,\n locale,\n };\n\n return parts\n .map((part) => {\n if (!part.isToken) return part.value;\n\n const token = part.value;\n\n if (\n (!options?.useAdditionalWeekYearTokens &&\n isProtectedWeekYearToken(token)) ||\n (!options?.useAdditionalDayOfYearTokens &&\n isProtectedDayOfYearToken(token))\n ) {\n warnOrThrowProtectedError(token, formatStr, String(date));\n }\n\n const formatter = formatters[token[0]];\n return formatter(originalDate, token, locale.localize, formatterOptions);\n })\n .join(\"\");\n}\n\nfunction cleanEscapedString(input) {\n const matched = input.match(escapedStringRegExp);\n\n if (!matched) {\n return input;\n }\n\n return matched[1].replace(doubleQuoteRegExp, \"'\");\n}\n\n// Fallback for modularized imports:\nexport default format;\n","import type { AxisDomain } from 'd3'\nimport type { Locale } from 'date-fns/locale'\nimport type { AxisTitleOrientations, ScaleTypes, TickRotations } from './enums'\nimport type { ThresholdOptions } from './components'\nimport type { TruncationOptions } from './truncation'\n\nexport interface BasedAxisOptions {\n\t/**\n\t * type of the scale used on axis\n\t */\n\tscaleType?: ScaleTypes\n\t/**\n\t * Whether the Axis should use the specified domain\n\t * instead of it being dynamically generated based on data extents.\n\t * The type of values should depend on the scale type.\n\t * Example for continuous axis scale: [-100, 100]\n\t * Example for discrete axis scale: ['Qty', 'More', 'Sold']\n\t * No need to define domain for percentage axis scale\n\t */\n\tdomain?: AxisDomain[]\n\t/**\n\t * an additional key from the charting data that is used to\n\t * extend the domain of an axis by\n\t * (e.g. in the bullet graph we need both the marker &\n\t * the data values to define the domain of the linear scale)\n\t */\n\textendLinearDomainBy?: string\n\t/**\n\t * Whether the Axis should be forced to include 0 as a starting point\n\t * (or ending point, in case of all negative axis).\n\t * Default: true\n\t */\n\tincludeZero?: boolean\n\t/**\n\t * identifies what key within the data the axis values would map to\n\t */\n\tmapsTo?: string\n\t/**\n\t * optional title for the scales\n\t */\n\ttitle?: string\n\t/**\n\t * Override for the orientation of the title (for vertical axes).\n\t * The title string can be overrided to be rotated left or right.\n\t */\n\ttitleOrientation?: AxisTitleOrientations | string\n\t/**\n\t * thresholds\n\t * @example\n\t * [\n\t *\t\t{ value: 10000 },\n\t *\t\t{ value: 40020, valueFormatter: (x) => x },\n\t *\t\t{ value: 55000, label: \"Custom label\", fillColor: \"#03a9f4\" },\n\t * ]\n\t */\n\tthresholds?: ThresholdOptions[]\n\t/**\n\t * tick configuration\n\t */\n\tticks?: {\n\t\t/**\n\t\t * number of ticks to show\n\t\t */\n\t\tnumber?: number\n\t\t/**\n\t\t * minimum tick value\n\t\t */\n\t\tmin?: number\n\t\t/**\n\t\t * maximum tick value\n\t\t */\n\t\tmax?: number\n\t\t/**\n\t\t * minimum width of a tick\n\t\t * before getting rotated (in pixels)\n\t\t */\n\t\trotateIfSmallerThan?: number\n\t\t/**\n\t\t * when to rotate ticks\n\t\t */\n\t\trotation?: TickRotations\n\t\t/**\n\t\t * function to format the ticks\n\t\t */\n\t\tformatter?: ((tick: number | Date, i: number) => string) | ((tick: number | Date) => string)\n\t\t/**\n\t\t * optional array of tick values that is within the domain of data\n\t\t */\n\t\tvalues?: any[]\n\t}\n\ttruncation?: TruncationOptions\n\t/**\n\t * is axis visible or not\n\t */\n\tvisible?: boolean\n\t/**\n\t * Bins to display (Histogram)\n\t * bins: 20\n\t * bins: [0, 20, 40, 60]\n\t * bins: [new Date(...), new Date(...), ...]\n\t */\n\tbins?: number | any[]\n\t/**\n\t * limit the visible axis domain to only the binned area\n\t */\n\tlimitDomainToBins?: boolean\n\t/**\n\t * should be set to `true` on the domain\n\t * axis that's being broken into bins\n\t */\n\tbinned?: boolean\n\t/**\n\t * used to map data on the secondary axis\n\t */\n\tcorrespondingDatasets?: Array\n}\n\n/**\n * options to configure a scale. not all options are used by all scales\n */\nexport interface AxisOptions extends BasedAxisOptions {\n\t/**\n\t * option for stacked axis\n\t */\n\tstacked?: boolean\n\t/**\n\t * option for percentage axis scale\n\t */\n\tpercentage?: boolean\n}\n\nexport interface ComboChartAxisOptions extends AxisOptions {\n\t/**\n\t * should be set to `true` for the\n\t * left axis to be the primary axis\n\t */\n\tmain?: boolean\n}\n\nexport interface BinnedAxisOptions {\n\t/**\n\t * should be set to `true` on the domain\n\t * axis that's being broken into bins\n\t */\n\tbinned?: boolean\n\t/**\n\t * Bins to display (Histogram)\n\t * bins: 20\n\t * bins: [0, 20, 40, 60]\n\t * bins: [new Date(...), new Date(...), ...]\n\t */\n\tbins?: number | any[]\n\t/**\n\t * limit the visible axis domain to only the binned area\n\t */\n\tlimitDomainToBins?: boolean\n}\n\n/**\n * customize time series scales\n */\nexport interface TimeScaleOptions {\n\taddSpaceOnEdges?: number\n\t/**\n\t * if it's true, days are shown as mon-sun,\n\t * otherwise days are shown as number 1-31\n\t */\n\tshowDayName?: boolean\n\t/**\n\t * this can be used to override the time interval\n\t * that's chosen by the library\n\t */\n\ttimeInterval?: TimeIntervalNames\n\t/**\n\t * formats for each time interval\n\t */\n\ttimeIntervalFormats?: TimeIntervalFormats\n\t/**\n\t * locale object, for more information see https://date-fns.org/v2.11.0/docs/Locale.\n\t * example: `import { fr as localeObject } from 'date-fns/locale'`.\n\t * available locale objects are: https://github.com/date-fns/date-fns/tree/master/src/locale\n\t */\n\tlocaleObject?: Locale\n}\n\n/**\n * time scales: customize ticks format for different time intervals\n */\nexport interface TickFormats {\n\tprimary?: string\n\tsecondary?: string\n}\n\nexport enum TimeIntervalNames {\n\t'15seconds' = '15seconds',\n\tminute = 'minute',\n\t'30minutes' = '30minutes',\n\thourly = 'hourly',\n\tdaily = 'daily',\n\tweekly = 'weekly',\n\tmonthly = 'monthly',\n\tquarterly = 'quarterly',\n\tyearly = 'yearly'\n}\n\nexport interface TimeIntervalFormats {\n\t'15seconds'?: TickFormats\n\tminute?: TickFormats\n\t'30minutes'?: TickFormats\n\thourly?: TickFormats\n\tdaily?: TickFormats\n\tweekly?: TickFormats\n\tmonthly?: TickFormats\n\tquarterly?: TickFormats\n\tyearly?: TickFormats\n}\n\n/**\n * customize the axes components\n */\nexport interface AxesOptions {\n\tleft?: AxesOptionType\n\tbottom?: AxesOptionType\n\tright?: AxesOptionType\n\ttop?: AxesOptionType\n}\n","import { min } from 'd3'\nimport { format } from 'date-fns/format'\nimport { Locale } from '../interfaces/components'\nimport { getProperty } from '@/tools'\nimport { TimeIntervalFormats, TimeIntervalNames, TimeScaleOptions } from '@/interfaces/axis-scales'\n\nexport const TIME_INTERVALS = [\n\t['15seconds', 15 * 1000],\n\t['minute', 60 * 1000],\n\t['30minutes', 30 * 60 * 1000],\n\t['hourly', 60 * 60 * 1000],\n\t['daily', 24 * 60 * 60 * 1000],\n\t['monthly', 30 * 24 * 60 * 60 * 1000],\n\t['quarterly', 3 * 30 * 24 * 60 * 60 * 1000],\n\t['yearly', 12 * 30 * 24 * 60 * 60 * 1000]\n]\n\n// Return true if the tick is a primary tick, false otherwise\nexport function isTickPrimary(\n\ttick: number,\n\ti: number,\n\tallTicks: Array,\n\tinterval: string,\n\tshowDayName: boolean\n): boolean {\n\tconst isFirstTick = i === 0\n\tconst hasANewWeekStarted = Number(format(new Date(tick), 'c')) === 2\n\tconst isFirstQuarter = Number(format(new Date(tick), 'q')) === 1\n\tconst previousTick = i !== 0 ? allTicks[i - 1] : null\n\n\tswitch (interval) {\n\t\tcase '15seconds':\n\t\t\treturn (\n\t\t\t\tisFirstTick ||\n\t\t\t\tisDayOfMonthChanged(tick) ||\n\t\t\t\tisMonthChanged(tick, previousTick) ||\n\t\t\t\tisYearChanged(tick)\n\t\t\t)\n\t\tcase 'minute':\n\t\t\treturn (\n\t\t\t\tisFirstTick ||\n\t\t\t\tisDayOfMonthChanged(tick) ||\n\t\t\t\tisMonthChanged(tick, previousTick) ||\n\t\t\t\tisYearChanged(tick)\n\t\t\t)\n\t\tcase '30minutes':\n\t\t\treturn (\n\t\t\t\tisFirstTick ||\n\t\t\t\tisDayOfMonthChanged(tick) ||\n\t\t\t\tisMonthChanged(tick, previousTick) ||\n\t\t\t\tisYearChanged(tick)\n\t\t\t)\n\t\tcase 'hourly':\n\t\t\treturn (\n\t\t\t\tisFirstTick ||\n\t\t\t\tisDayOfMonthChanged(tick) ||\n\t\t\t\tisMonthChanged(tick, previousTick) ||\n\t\t\t\tisYearChanged(tick)\n\t\t\t)\n\t\tcase 'daily':\n\t\t\tif (!showDayName) {\n\t\t\t\t// daily\n\t\t\t\treturn isFirstTick || isMonthChanged(tick, previousTick) || isYearChanged(tick)\n\t\t\t} else {\n\t\t\t\t// weekly\n\t\t\t\treturn isFirstTick || hasANewWeekStarted || isYearChanged(tick)\n\t\t\t}\n\t\tcase 'weekly':\n\t\t\treturn isFirstTick || hasANewWeekStarted || isYearChanged(tick)\n\t\tcase 'monthly':\n\t\t\treturn isFirstTick || isYearChanged(tick)\n\t\tcase 'quarterly':\n\t\t\treturn isFirstTick || isFirstQuarter\n\t\tcase 'yearly':\n\t\t\treturn false\n\t\tdefault:\n\t\t\tthrow new Error(`${interval} is not a valid time interval.`)\n\t}\n}\n\n// Return the formatted current tick\nexport function formatTick(\n\ttick: number,\n\ti: number,\n\tallTicks: Array,\n\tinterval: string,\n\ttimeScaleOptions: TimeScaleOptions,\n\tlocaleOptions?: Locale\n): string {\n\tconst showDayName = timeScaleOptions.showDayName\n\tconst intervalConsideringAlsoShowDayNameOption =\n\t\tinterval === 'daily' && showDayName ? 'weekly' : interval\n\tconst date = new Date(tick)\n\tconst formats = getProperty(timeScaleOptions, 'timeIntervalFormats')[\n\t\tintervalConsideringAlsoShowDayNameOption\n\t]\n\tconst primary = getProperty(formats, 'primary')\n\tconst secondary = getProperty(formats, 'secondary')\n\tconst primaryTickFlag = isTickPrimary(tick, i, allTicks, interval, showDayName)\n\tlet formatString = primaryTickFlag ? primary : secondary\n\n\t// if the interval, and the timestamp includes milliseconds value\n\tif (interval === '15seconds' && date.getMilliseconds() !== 0) {\n\t\t// show milliseconds in tick\n\t\tformatString = formatString.replace('pp', 'h:mm:ss.SSS a')\n\t}\n\n\tconst locale = timeScaleOptions.localeObject\n\tconst { code: localeCode, optionsObject } = localeOptions\n\tconst formatterType = optionsObject[interval]['type']\n\tconst formatterOptions =\n\t\toptionsObject[interval][primaryTickFlag ? 'primary' : 'secondary'][formatString]\n\n\tif (interval === 'quarterly' || !formatterOptions) {\n\t\tconst formattedDate = format(date, formatString, { locale })\n\t\tconst formatArr = formattedDate.split('').map(val => {\n\t\t\tconst num = Number(val)\n\t\t\tif (val !== ' ' && !Number.isNaN(num)) {\n\t\t\t\treturn num.toLocaleString(localeCode)\n\t\t\t} else {\n\t\t\t\treturn val\n\t\t\t}\n\t\t})\n\t\treturn localeOptions[formatterType](date, localeCode, {}, formatArr.join(''))\n\t} else {\n\t\treturn localeOptions[formatterType](date, localeCode, formatterOptions)\n\t}\n}\n\n// Given a timestamp, return an object of useful time formats\n// Use Unicode date field symbol (https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table)\nexport function getTimeformats(timestamp: number) {\n\tconst date = new Date(timestamp)\n\treturn {\n\t\tM: date.getMonth() + 1, // month: 1-12\n\t\td: date.getDate(), // day of the month: 1-31\n\t\tH: date.getHours(), // 24-hour clock: 0-23\n\t\tm: date.getMinutes(), // minute: 0-59\n\t\ts: date.getSeconds() // seconds: 0-59\n\t}\n}\n\n// Find the differences between consecutive numbers in an array\nfunction getConsecutiveDifferences(elements: number[]): number[] {\n\tif (!elements) {\n\t\treturn\n\t}\n\treturn elements.slice(1).map((elem, i) => elem - elements[i])\n}\n\n// Given a duration in ms, return the closest TIME_INTERVAL name\nfunction closestTimeIntervalName(duration: number): string {\n\tconst index = TIME_INTERVALS.reduce((nearestIndex, [, delta]: [string, number], i) => {\n\t\tconst deltaNearest = TIME_INTERVALS[nearestIndex][1] as number\n\t\tconst oldNearestSpan = Math.abs(deltaNearest - duration)\n\t\tconst currentSpan = Math.abs(delta - duration)\n\t\treturn oldNearestSpan < currentSpan ? nearestIndex : i\n\t}, 0)\n\treturn TIME_INTERVALS[index][0] as string\n}\n\n// Given an array of timestamps, return the interval name\n// between 15seconds, minute, 30minutes, hourly, daily, weekly, monthly, quarterly, yearly\nexport function computeTimeIntervalName(\n\tticks: number[],\n\tintervalOverride?: keyof TimeIntervalFormats\n): string {\n\tif (TimeIntervalNames[intervalOverride]) {\n\t\treturn intervalOverride\n\t}\n\n\t// special case: if the dataset has only one datum, we show the tick in the most detailed way possible\n\tif (ticks.length === 1) {\n\t\treturn '15seconds'\n\t}\n\tconst differences = getConsecutiveDifferences(ticks)\n\tconst minDifference = min(differences)\n\treturn closestTimeIntervalName(minDifference)\n}\n\n// Return true if the day of the month (D = 1-31) is changed, false otherwise\nfunction isDayOfMonthChanged(timestamp: number): boolean {\n\tconst { s, m, H } = getTimeformats(timestamp)\n\treturn H === 0 && m === 0 && s === 0\n}\n\n// Return true if the month (M = 1-12) is changed from previous tick's timestamp, false otherwise\nfunction isMonthChanged(timestamp: number, previousTimestamp?: number): boolean {\n\tconst currentMonth = getTimeformats(timestamp).M\n\tconst previousMonth = getTimeformats(previousTimestamp).M\n\treturn currentMonth !== previousMonth\n}\n\n// Return true if the year (YYYY) is changed, false otherwise\nfunction isYearChanged(timestamp: number): boolean {\n\tconst { M, d, s, m, H } = getTimeformats(timestamp)\n\treturn M === 1 && d === 1 && H === 0 && m === 0 && s === 0\n}\n\n// Return string value of Date with milliseconds\nexport function formatDateTillMilliSeconds(date: Date) {\n\tif (date === undefined) {\n\t\treturn ''\n\t}\n\n\t// The only valid format with millisecond is ISO 8601\n\treturn date.toISOString()\n}\n","import { bin as d3Bin, scaleOrdinal, stack, stackOffsetDiverging } from 'd3'\nimport { cloneDeep, fromPairs, groupBy, merge, uniq } from 'lodash-es'\nimport { getProperty, updateLegendAdditionalItems } from '@/tools'\nimport { color as colorConfigs, legend as legendConfigs } from '@/configuration'\nimport { histogram as histogramConfigs } from '@/configuration-non-customizable'\nimport { Events, ScaleTypes, ColorClassNameTypes } from '@/interfaces/enums'\nimport { formatDateTillMilliSeconds } from '@/services/time-series'\nimport type { ChartTabularData } from '@/interfaces/model'\n\nexport type StackKeysParams = {\n\tbins?: any\n\tgroups?: any\n\tpercentage?: any\n\tdivergent?: any\n}\n\nfunction _sanitizeCsvCell(cellContent: string): string {\n\tconst _trimmedCell = cellContent.trim()\n\tif (['=', '+', '-', '@', '\\t', '\\r'].includes(_trimmedCell.charAt(0))) {\n\t\treturn `\\xA0${_trimmedCell}`\n\t}\n\n\t// Only add quotes if cell contains commas, newlines, or quotes\n\tif (/[,\\\"\\n]/.test(_trimmedCell)) {\n\t\treturn `\"${_trimmedCell}\"`\n\t}\n\n\treturn _trimmedCell\n}\n\n/** The charting model layer which includes mainly the chart data and options,\n * as well as some misc. information to be shared among components */\nexport class ChartModel {\n\tprotected services: any\n\n\t// Internal Model state\n\tprotected state: any = {\n\t\toptions: {}\n\t}\n\n\t// Data labels\n\t/**\n\t * A list of all the data groups that have existed within the lifetime of the chart\n\t * @type string[]\n\t */\n\tprotected allDataGroups: string[]\n\n\t// Fill scales & fill related objects\n\tprotected colorScale: any = {}\n\n\tprotected colorClassNames: any = {}\n\n\tconstructor(services: any) {\n\t\tthis.services = services\n\t}\n\n\tformatTable({ headers, cells }) {\n\t\tconst options = this.getOptions()\n\t\tconst {\n\t\t\tcode: localeCode,\n\t\t\tdate: dateFormatter,\n\t\t\tnumber: numberFormatter\n\t\t} = getProperty(options, 'locale')\n\t\tconst tableHeadingFormatter = getProperty(options, 'tabularRepModal', 'tableHeadingFormatter')\n\t\tconst tableCellFormatter = getProperty(options, 'tabularRepModal', 'tableCellFormatter')\n\t\tconst { cartesianScales } = this.services\n\t\tconst domainScaleType = cartesianScales?.getDomainAxisScaleType()\n\t\tlet domainValueFormatter: any\n\n\t\tif (domainScaleType === ScaleTypes.TIME) {\n\t\t\tdomainValueFormatter = (d: any) =>\n\t\t\t\tdateFormatter(d, localeCode, { month: 'short', day: 'numeric', year: 'numeric' })\n\t\t}\n\n\t\tconst result = [\n\t\t\ttypeof tableHeadingFormatter === 'function' ? tableHeadingFormatter(headers) : headers,\n\t\t\t...(typeof tableCellFormatter === 'function'\n\t\t\t\t? tableCellFormatter(cells)\n\t\t\t\t: cells.map((data: (string | number)[]) => {\n\t\t\t\t\t\tif (domainValueFormatter) {\n\t\t\t\t\t\t\tdata[1] = domainValueFormatter(data[1]) as string\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfor (const i in data) {\n\t\t\t\t\t\t\tconst val = data[i]\n\t\t\t\t\t\t\tif (typeof val === 'number') {\n\t\t\t\t\t\t\t\tdata[i] = numberFormatter(val, localeCode)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn data\n\t\t\t\t\t}))\n\t\t]\n\t\treturn result\n\t}\n\n\tgetAllDataFromDomain(groups?: any) {\n\t\tif (!this.getData()) {\n\t\t\treturn null\n\t\t}\n\t\tconst options = this.getOptions()\n\t\t// Remove datasets that have been disabled\n\t\tlet allData = this.getData()\n\t\tconst dataGroups = this.getDataGroups()\n\t\tconst { groupMapsTo } = getProperty(options, 'data')\n\t\tconst axesOptions = getProperty(options, 'axes')\n\n\t\t// filter out the groups that are irrelevant to the component\n\t\tif (groups) {\n\t\t\tallData = allData.filter((item: any) => groups.includes(item[groupMapsTo]))\n\t\t}\n\n\t\tif (axesOptions) {\n\t\t\tObject.keys(axesOptions).forEach(axis => {\n\t\t\t\tconst mapsTo = axesOptions[axis].mapsTo\n\t\t\t\tconst scaleType = axesOptions[axis].scaleType\n\t\t\t\t// make sure linear/log values are numbers\n\t\t\t\tif (scaleType === ScaleTypes.LINEAR || scaleType === ScaleTypes.LOG) {\n\t\t\t\t\tallData = allData.map((datum: any) => {\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t...datum,\n\t\t\t\t\t\t\t[mapsTo]: datum[mapsTo] === null ? datum[mapsTo] : Number(datum[mapsTo])\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t}\n\n\t\t\t\t// Check for custom domain\n\t\t\t\tif (mapsTo && axesOptions[axis].domain) {\n\t\t\t\t\tif (scaleType === ScaleTypes.LABELS) {\n\t\t\t\t\t\tallData = allData.filter((datum: any) =>\n\t\t\t\t\t\t\taxesOptions[axis].domain.includes(datum[mapsTo])\n\t\t\t\t\t\t)\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconst [start, end] = axesOptions[axis].domain\n\t\t\t\t\t\t// Filter out data outside domain if that datapoint is using that axis (has mapsTo property)\n\t\t\t\t\t\tallData = allData.filter(\n\t\t\t\t\t\t\t(datum: any) => !(mapsTo in datum) || (datum[mapsTo] >= start && datum[mapsTo] <= end)\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 allData.filter((datum: any) => {\n\t\t\treturn dataGroups.find((group: any) => group.name === datum[groupMapsTo])\n\t\t})\n\t}\n\n\t/**\n\t * Charts that have group configs passed into them, only want to retrieve the display data relevant to that chart\n\t * @param groups the included datasets for the particular chart\n\t */\n\tgetDisplayData(groups?: any) {\n\t\tif (!this.get('data')) {\n\t\t\treturn null\n\t\t}\n\n\t\tconst { ACTIVE } = legendConfigs.items.status\n\t\tconst dataGroups = this.getDataGroups(groups)\n\t\tconst { groupMapsTo } = this.getOptions().data\n\t\tconst allDataFromDomain = this.getAllDataFromDomain(groups)\n\n\t\treturn allDataFromDomain.filter((datum: any) => {\n\t\t\treturn dataGroups.find(\n\t\t\t\t(dataGroup: any) => dataGroup.name === datum[groupMapsTo] && dataGroup.status === ACTIVE\n\t\t\t)\n\t\t})\n\t}\n\n\tgetData() {\n\t\treturn this.get('data')\n\t}\n\n\tisDataEmpty() {\n\t\treturn !this.getData().length\n\t}\n\n\t/**\n\t * Sets the data for the current instance.\n\t *\n\t * This method sanitizes the provided data, generates data groups,\n\t * and updates the instance's state with the sanitized data and data groups.\n\t *\n\t * @param {any} newData - The new data to be set. This data will be cloned and sanitized.\n\t * @returns {any} - The sanitized version of the provided data.\n\t */\n\tsetData(newData: any) {\n\t\tconst sanitizedData = this.sanitize(cloneDeep(newData))\n\t\tconst dataGroups = this.generateDataGroups(sanitizedData)\n\n\t\tthis.set({\n\t\t\tdata: sanitizedData,\n\t\t\tdataGroups\n\t\t})\n\n\t\treturn sanitizedData\n\t}\n\n\tgetDataGroups(groups?: any) {\n\t\tconst isDataLoading = getProperty(this.getOptions(), 'data', 'loading')\n\n\t\t// No data should be displayed while data is still loading\n\t\tif (isDataLoading) {\n\t\t\treturn []\n\t\t}\n\n\t\t// if its a combo chart, the specific chart will pass the model the groups it needs\n\t\tif (groups) {\n\t\t\treturn this.get('dataGroups').filter((dataGroup: any) => groups.includes(dataGroup.name))\n\t\t}\n\t\treturn this.get('dataGroups')\n\t}\n\n\tgetActiveDataGroups(groups?: any) {\n\t\tconst { ACTIVE } = legendConfigs.items.status\n\n\t\treturn this.getDataGroups(groups).filter((dataGroup: any) => dataGroup.status === ACTIVE)\n\t}\n\n\tgetDataGroupNames(groups?: any) {\n\t\tconst dataGroups = this.getDataGroups(groups)\n\t\treturn dataGroups.map((dataGroup: any) => dataGroup.name)\n\t}\n\n\tgetActiveDataGroupNames(groups?: any) {\n\t\tconst activeDataGroups = this.getActiveDataGroups(groups)\n\t\treturn activeDataGroups.map((dataGroup: any) => dataGroup.name)\n\t}\n\n\tprivate aggregateBinDataByGroup(bin: any) {\n\t\treturn groupBy(bin, 'group')\n\t}\n\n\tgetBinConfigurations() {\n\t\t// Manipulate data and options for Histogram\n\t\tconst data = this.getDisplayData()\n\t\tconst options = this.getOptions()\n\n\t\tconst mainXPos = this.services.cartesianScales.getMainXAxisPosition()\n\t\tconst domainIdentifier = this.services.cartesianScales.getDomainIdentifier()\n\n\t\tconst axisOptions = options.axes[mainXPos]\n\t\tconst { groupMapsTo } = options.data\n\t\tconst { bins: axisBins = histogramConfigs.defaultBins } = axisOptions\n\t\tconst areBinsDefined = Array.isArray(axisBins)\n\n\t\t// Get Histogram bins\n\t\tconst bins = d3Bin()\n\t\t\t.value((d: any) => d[domainIdentifier])\n\t\t\t.thresholds(axisBins)(data)\n\n\t\tif (!areBinsDefined) {\n\t\t\t// If bins are not defined by user\n\t\t\tconst binsWidth = bins[0].x1 - bins[0].x0\n\t\t\t// Set last bin width as the others\n\t\t\tbins[bins.length - 1].x1 = +bins[bins.length - 1].x0 + binsWidth\n\t\t} else {\n\t\t\t// Set last bin end as the last user defined one\n\t\t\tbins[bins.length - 1].x1 = axisBins[axisBins.length - 1]\n\t\t}\n\n\t\tconst binsDomain = areBinsDefined\n\t\t\t? [axisBins[0], axisBins[axisBins.length - 1]]\n\t\t\t: [bins[0].x0, bins[bins.length - 1].x1]\n\n\t\t// Get all groups\n\t\tconst groupsKeys = Array.from(new Set(data.map((d: any) => d[groupMapsTo])))\n\n\t\tconst histogramData = []\n\n\t\t// Group data by bin\n\t\tbins.forEach(bin => {\n\t\t\tconst key = `${bin.x0}-${bin.x1}`\n\t\t\tconst aggregateDataByGroup = this.aggregateBinDataByGroup(bin)\n\n\t\t\tgroupsKeys.forEach((group: string) => {\n\t\t\t\t// For each dataset put a bin with value 0 if not exist\n\t\t\t\t// (Scale X won't change when changing showed datasets)\n\t\t\t\thistogramData.push({\n\t\t\t\t\tgroup,\n\t\t\t\t\tkey,\n\t\t\t\t\tvalue: aggregateDataByGroup[group] || 0,\n\t\t\t\t\tbin: bin.x0\n\t\t\t\t})\n\t\t\t})\n\t\t})\n\n\t\treturn {\n\t\t\tbins,\n\t\t\tbinsDomain\n\t\t}\n\t}\n\n\tgetBinnedStackedData() {\n\t\tconst options = this.getOptions()\n\t\tconst { groupMapsTo } = options.data\n\n\t\tconst dataGroupNames = this.getActiveDataGroupNames()\n\n\t\tconst { bins } = this.getBinConfigurations()\n\t\tconst dataValuesGroupedByKeys = this.getDataValuesGroupedByKeys({\n\t\t\tbins\n\t\t})\n\n\t\treturn stack()\n\t\t\t.keys(dataGroupNames)(dataValuesGroupedByKeys)\n\t\t\t.map((series, i) => {\n\t\t\t\t// Add data group names to each series\n\t\t\t\treturn Object.keys(series)\n\t\t\t\t\t.filter((key: any) => !isNaN(key))\n\t\t\t\t\t.map((key: any) => {\n\t\t\t\t\t\tconst element = series[key]\n\t\t\t\t\t\telement[groupMapsTo] = dataGroupNames[i]\n\n\t\t\t\t\t\treturn element\n\t\t\t\t\t})\n\t\t\t})\n\t}\n\n\tgetGroupedData(groups?: any) {\n\t\tconst displayData = this.getDisplayData(groups)\n\t\tconst groupedData: any = {}\n\t\tconst { groupMapsTo } = this.getOptions().data\n\n\t\tdisplayData.map((datum: any) => {\n\t\t\tconst group = datum[groupMapsTo]\n\t\t\tif (groupedData[group] !== null && groupedData[group] !== undefined) {\n\t\t\t\tgroupedData[group].push(datum)\n\t\t\t} else {\n\t\t\t\tgroupedData[group] = [datum]\n\t\t\t}\n\t\t})\n\n\t\treturn Object.keys(groupedData).map(groupName => ({\n\t\t\tname: groupName,\n\t\t\tdata: groupedData[groupName]\n\t\t}))\n\t}\n\n\tgetStackKeys({ bins = null, groups = null }: StackKeysParams = { bins: null, groups: null }) {\n\t\tconst options = this.getOptions()\n\n\t\tconst displayData = this.getDisplayData(groups)\n\n\t\tlet stackKeys: any\n\t\tif (bins) {\n\t\t\tstackKeys = bins.map((bin: any) => `${bin.x0}:${bin.x1}`)\n\t\t} else {\n\t\t\tstackKeys = uniq(\n\t\t\t\tdisplayData.map((datum: any) => {\n\t\t\t\t\tconst domainIdentifier = this.services.cartesianScales.getDomainIdentifier(datum)\n\n\t\t\t\t\t// Use time value as key for Date object to avoid multiple data in the same second\n\t\t\t\t\tif (datum[domainIdentifier] instanceof Date) {\n\t\t\t\t\t\treturn formatDateTillMilliSeconds(datum[domainIdentifier])\n\t\t\t\t\t}\n\n\t\t\t\t\treturn datum[domainIdentifier] && typeof datum[domainIdentifier].toString === 'function'\n\t\t\t\t\t\t? datum[domainIdentifier].toString()\n\t\t\t\t\t\t: datum[domainIdentifier]\n\t\t\t\t})\n\t\t\t)\n\t\t}\n\n\t\tconst axisPosition = this.services.cartesianScales.domainAxisPosition\n\t\tconst scaleType = options.axes[axisPosition].scaleType\n\n\t\t// Sort keys\n\t\tif (scaleType === ScaleTypes.TIME) {\n\t\t\tstackKeys.sort((a: any, b: any) => {\n\t\t\t\tconst dateA: any = new Date(a)\n\t\t\t\tconst dateB: any = new Date(b)\n\n\t\t\t\treturn dateA - dateB\n\t\t\t})\n\t\t} else if (scaleType === ScaleTypes.LOG || scaleType === ScaleTypes.LINEAR) {\n\t\t\tstackKeys.sort((a: any, b: any) => a - b)\n\t\t}\n\n\t\treturn stackKeys\n\t}\n\n\tgetDataValuesGroupedByKeys({ bins = null, groups = null }: StackKeysParams) {\n\t\tconst options = this.getOptions()\n\t\tconst { groupMapsTo } = options.data\n\t\tconst displayData = this.getDisplayData(groups)\n\n\t\tconst dataGroupNames = this.getDataGroupNames()\n\n\t\tconst stackKeys = this.getStackKeys({ bins, groups })\n\t\tif (bins) {\n\t\t\treturn stackKeys.map((key: any) => {\n\t\t\t\tconst [binStart, binEnd] = key.split(':')\n\n\t\t\t\tconst correspondingValues: any = { x0: binStart, x1: binEnd }\n\t\t\t\tconst correspondingBin = bins.find((bin: any) => bin.x0.toString() === binStart.toString())\n\t\t\t\tdataGroupNames.forEach((dataGroupName: any) => {\n\t\t\t\t\tcorrespondingValues[dataGroupName] = correspondingBin.filter(\n\t\t\t\t\t\t(binItem: any) => binItem[groupMapsTo] === dataGroupName\n\t\t\t\t\t).length\n\t\t\t\t})\n\n\t\t\t\treturn correspondingValues\n\t\t\t}) as any\n\t\t}\n\n\t\treturn stackKeys.map((key: any) => {\n\t\t\tconst correspondingValues: any = { sharedStackKey: key }\n\t\t\tdataGroupNames.forEach((dataGroupName: any) => {\n\t\t\t\tconst correspondingDatum = displayData.find((datum: any) => {\n\t\t\t\t\tconst domainIdentifier = this.services.cartesianScales.getDomainIdentifier(datum)\n\n\t\t\t\t\treturn (\n\t\t\t\t\t\tdatum[groupMapsTo] === dataGroupName &&\n\t\t\t\t\t\tObject.prototype.hasOwnProperty.call(datum, domainIdentifier) &&\n\t\t\t\t\t\t(datum[domainIdentifier] instanceof Date\n\t\t\t\t\t\t\t? formatDateTillMilliSeconds(datum[domainIdentifier]) === key\n\t\t\t\t\t\t\t: datum[domainIdentifier].toString() === key)\n\t\t\t\t\t)\n\t\t\t\t})\n\n\t\t\t\tconst rangeIdentifier =\n\t\t\t\t\tthis.services.cartesianScales.getRangeIdentifier(correspondingValues)\n\t\t\t\tcorrespondingValues[dataGroupName] = correspondingDatum\n\t\t\t\t\t? correspondingDatum[rangeIdentifier]\n\t\t\t\t\t: null\n\t\t\t})\n\n\t\t\treturn correspondingValues\n\t\t}) as any\n\t}\n\n\tgetStackedData({ percentage = false, groups = null, divergent = false }: StackKeysParams) {\n\t\tconst options = this.getOptions()\n\t\tconst { groupMapsTo } = options.data\n\n\t\t// Get only active data groups so non-active data groups are not rendered\n\t\t// on legend item click\n\t\tconst dataGroupNames = this.getActiveDataGroupNames(groups)\n\t\tconst dataValuesGroupedByKeys = this.getDataValuesGroupedByKeys({\n\t\t\tgroups\n\t\t})\n\n\t\tif (percentage) {\n\t\t\tconst maxByKey = fromPairs(dataValuesGroupedByKeys.map((d: any) => [d.sharedStackKey, 0]))\n\n\t\t\tdataValuesGroupedByKeys.forEach((d: any) => {\n\t\t\t\tdataGroupNames.forEach((name: any) => {\n\t\t\t\t\tmaxByKey[d.sharedStackKey] += d[name]\n\t\t\t\t})\n\t\t\t})\n\n\t\t\t// cycle through data values to get percentage\n\t\t\tdataValuesGroupedByKeys.forEach((d: any) => {\n\t\t\t\tdataGroupNames.forEach((name: any) => {\n\t\t\t\t\tconst denominator: number = maxByKey[d.sharedStackKey] as number\n\t\t\t\t\tif (maxByKey[d.sharedStackKey]) {\n\t\t\t\t\t\td[name] = (d[name] / denominator) * 100\n\t\t\t\t\t} else {\n\t\t\t\t\t\td[name] = 0\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t})\n\t\t}\n\n\t\tconst stackToUse = divergent ? stack().offset(stackOffsetDiverging) : stack()\n\n\t\treturn stackToUse\n\t\t\t.keys(dataGroupNames)(dataValuesGroupedByKeys)\n\t\t\t.map((series: any, i: number) => {\n\t\t\t\t// Add data group names to each series\n\t\t\t\treturn Object.keys(series)\n\t\t\t\t\t.filter((key: any) => !isNaN(key))\n\t\t\t\t\t.map((key: any) => {\n\t\t\t\t\t\tconst element = series[key]\n\t\t\t\t\t\telement[groupMapsTo] = dataGroupNames[i]\n\n\t\t\t\t\t\treturn element\n\t\t\t\t\t})\n\t\t\t})\n\t}\n\n\t/**\n\t * Retrieves the current options from the instance's state.\n\t *\n\t * @returns {any} - The current options stored in the instance's state.\n\t */\n\tgetOptions() {\n\t\treturn this.state.options\n\t}\n\n\tset(newState: any, configs?: any) {\n\t\tthis.state = Object.assign({}, this.state, newState)\n\t\tconst newConfig = Object.assign(\n\t\t\t{ skipUpdate: false, animate: true }, // default configs\n\t\t\tconfigs\n\t\t)\n\t\tif (!newConfig.skipUpdate) {\n\t\t\tthis.update(newConfig.animate)\n\t\t}\n\t}\n\n\tget(property?: string) {\n\t\tif (property) {\n\t\t\treturn this.state[property]\n\t\t} else {\n\t\t\treturn this.state\n\t\t}\n\t}\n\n\t/**\n\t * Updates the current options for the instance.\n\t *\n\t * This method retrieves the existing options, updates the legend additional items,\n\t * and merges the new options with the existing ones. The instance's state is then updated\n\t * with the merged options.\n\t *\n\t * @param {any} newOptions - The new options to be set. These options will be merged with the existing options.\n\t */\n\tsetOptions(newOptions: any) {\n\t\tconst options = this.getOptions()\n\t\tupdateLegendAdditionalItems(options, newOptions)\n\n\t\tthis.set({\n\t\t\toptions: merge(options, newOptions)\n\t\t})\n\t}\n\n\t/**\n\t *\n\t * Updates miscellanous information within the model\n\t * such as the color scales, or the legend data labels\n\t */\n\tupdate(animate = true) {\n\t\tif (!this.getDisplayData()) {\n\t\t\treturn\n\t\t}\n\n\t\tthis.updateAllDataGroups()\n\n\t\tthis.setCustomColorScale()\n\t\tthis.setColorClassNames()\n\t\tthis.services.events.dispatchEvent(Events.Model.UPDATE, { animate })\n\t}\n\n\t/*\n\t * Data labels\n\t */\n\ttoggleDataLabel(changedLabel: string) {\n\t\tconst { ACTIVE, DISABLED } = legendConfigs.items.status\n\t\tconst dataGroups = this.getDataGroups()\n\n\t\tconst hasDeactivatedItems = dataGroups.some((group: any) => group.status === DISABLED)\n\t\tconst activeItems = dataGroups.filter((group: any) => group.status === ACTIVE)\n\n\t\t// If there are deactivated items, toggle \"changedLabel\"\n\t\tif (hasDeactivatedItems) {\n\t\t\t// If the only active item is being toggled\n\t\t\t// Activate all items\n\t\t\tif (activeItems.length === 1 && activeItems[0].name === changedLabel) {\n\t\t\t\t// If every item is active, then enable \"changedLabel\" and disable all other items\n\t\t\t\tdataGroups.forEach((_: any, i: number) => {\n\t\t\t\t\tdataGroups[i].status = ACTIVE\n\t\t\t\t})\n\t\t\t} else {\n\t\t\t\tconst indexToChange = dataGroups.findIndex((group: any) => group.name === changedLabel)\n\t\t\t\tdataGroups[indexToChange].status =\n\t\t\t\t\tdataGroups[indexToChange].status === DISABLED ? ACTIVE : DISABLED\n\t\t\t}\n\t\t} else {\n\t\t\t// If every item is active, then enable \"changedLabel\" and disable all other items\n\t\t\tdataGroups.forEach((group: any, i: number) => {\n\t\t\t\tdataGroups[i].status = group.name === changedLabel ? ACTIVE : DISABLED\n\t\t\t})\n\t\t}\n\n\t\t// Updates selected groups\n\t\tconst updatedActiveItems = dataGroups.filter((group: any) => group.status === ACTIVE)\n\t\tconst options = this.getOptions()\n\n\t\tconst hasUpdatedDeactivatedItems = dataGroups.some((group: any) => group.status === DISABLED)\n\n\t\t// If there are deactivated items, map the item name into selected groups\n\t\tif (hasUpdatedDeactivatedItems) {\n\t\t\toptions.data.selectedGroups = updatedActiveItems.map((activeItem: any) => activeItem.name)\n\t\t} else {\n\t\t\t// If every item is active, clear array\n\t\t\toptions.data.selectedGroups = []\n\t\t}\n\n\t\t// dispatch legend filtering event with the status of all the dataLabels\n\t\tthis.services.events.dispatchEvent(Events.Legend.ITEMS_UPDATE, {\n\t\t\tdataGroups\n\t\t})\n\n\t\t// Update model\n\t\tthis.set({\n\t\t\tdataGroups\n\t\t})\n\t}\n\n\t/**\n\t * Should the data point be filled?\n\t * @param group\n\t * @param key\n\t * @param data\n\t * @param defaultFilled the default for this chart\n\t */\n\tgetIsFilled(group: any, key?: any, data?: any, defaultFilled?: boolean) {\n\t\tconst options = this.getOptions()\n\t\tif (options.getIsFilled) {\n\t\t\treturn options.getIsFilled(group, key, data, defaultFilled)\n\t\t} else {\n\t\t\treturn defaultFilled\n\t\t}\n\t}\n\n\tgetFillColor(group: any, key?: any, data?: any) {\n\t\tconst options = this.getOptions()\n\t\tconst defaultFillColor = getProperty(this.colorScale, group)\n\n\t\tif (options.getFillColor) {\n\t\t\treturn options.getFillColor(group, key, data, defaultFillColor)\n\t\t} else {\n\t\t\treturn defaultFillColor\n\t\t}\n\t}\n\n\tgetStrokeColor(group: any, key?: any, data?: any) {\n\t\tconst options = this.getOptions()\n\t\tconst defaultStrokeColor = getProperty(this.colorScale, group)\n\n\t\tif (options.getStrokeColor) {\n\t\t\treturn options.getStrokeColor(group, key, data, defaultStrokeColor)\n\t\t} else {\n\t\t\treturn defaultStrokeColor\n\t\t}\n\t}\n\n\tisUserProvidedColorScaleValid() {\n\t\tconst userProvidedScale = getProperty(this.getOptions(), 'color', 'scale')\n\t\tconst dataGroups = this.getDataGroups()\n\n\t\tif (userProvidedScale == null || Object.keys(userProvidedScale).length == 0) {\n\t\t\treturn false\n\t\t}\n\n\t\treturn dataGroups.some((dataGroup: any) =>\n\t\t\tObject.keys(userProvidedScale).includes(dataGroup.name)\n\t\t)\n\t}\n\n\tgetColorClassName(configs: {\n\t\tclassNameTypes?: ColorClassNameTypes[] // heatmaps do not pass this value\n\t\tdataGroupName?: string | number\n\t\toriginalClassName?: string\n\t\tvalue?: number // required for heatmap override\n\t}) {\n\t\tconst colorPairingTag = this.colorClassNames(configs.dataGroupName)\n\t\tlet className = configs.originalClassName\n\t\tconfigs.classNameTypes.forEach(\n\t\t\ttype =>\n\t\t\t\t(className = configs.originalClassName\n\t\t\t\t\t? `${className} ${type}-${colorPairingTag}`\n\t\t\t\t\t: `${type}-${colorPairingTag}`)\n\t\t)\n\n\t\treturn className || ''\n\t}\n\n\t/**\n\t * For charts that might hold an associated status for their dataset\n\t */\n\tgetStatus(): any {\n\t\treturn null\n\t}\n\n\tgetAllDataGroupsNames() {\n\t\treturn this.allDataGroups\n\t}\n\n\t/**\n\t * Converts data provided in the older format to tabular\n\t *\n\t */\n\tprotected transformToTabularData(data: any) {\n\t\tconsole.warn(\n\t\t\t\"We've updated the charting data format to be tabular by default. The current format you're using is deprecated and will be removed in v1.0, read more here https://charts.carbondesignsystem.com/\"\n\t\t)\n\t\tconst tabularData: ChartTabularData = []\n\t\tconst { datasets, labels } = data\n\n\t\t// Loop through all datasets\n\t\tdatasets.forEach((dataset: any) => {\n\t\t\t// Update each data point to the new format\n\t\t\tdataset.data.forEach((datum: any, i: number) => {\n\t\t\t\tlet group\n\n\t\t\t\tconst datasetLabel = getProperty(dataset, 'label')\n\t\t\t\tif (datasetLabel === null) {\n\t\t\t\t\tconst correspondingLabel = getProperty(labels, i)\n\t\t\t\t\tif (correspondingLabel) {\n\t\t\t\t\t\tgroup = correspondingLabel\n\t\t\t\t\t} else {\n\t\t\t\t\t\tgroup = 'Ungrouped'\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tgroup = datasetLabel\n\t\t\t\t}\n\n\t\t\t\tconst updatedDatum: any = {\n\t\t\t\t\tgroup,\n\t\t\t\t\tkey: labels[i]\n\t\t\t\t}\n\n\t\t\t\tif (isNaN(datum)) {\n\t\t\t\t\tupdatedDatum['value'] = datum.value\n\t\t\t\t\tupdatedDatum['date'] = datum.date\n\t\t\t\t} else {\n\t\t\t\t\tupdatedDatum['value'] = datum\n\t\t\t\t}\n\n\t\t\t\ttabularData.push(updatedDatum)\n\t\t\t})\n\t\t})\n\n\t\treturn tabularData\n\t}\n\n\tgetTabularDataArray(): ChartTabularData {\n\t\t//apply tableFormatter\n\t\treturn []\n\t}\n\n\texportToCSV() {\n\t\tconst data = this.getTabularDataArray().map(row =>\n\t\t\trow.map((column: any) => {\n\t\t\t\tconst columnValue = column === '–' ? '–' : column\n\n\t\t\t\t// Split by separators and quotes, then sanitize each part individually\n\t\t\t\tconst sanitizedParts = columnValue.split(/[,;'\"`]/).map(part => _sanitizeCsvCell(part))\n\t\t\t\treturn `\"${sanitizedParts.join('')}\"`\n\t\t\t})\n\t\t)\n\n\t\tconst csvString = data.map(row => row.join(',')).join('\\n')\n\n\t\tconst options = this.getOptions()\n\n\t\tlet fileName = 'myChart'\n\t\tconst customFilename = getProperty(options, 'fileDownload', 'fileName')\n\n\t\tif (typeof customFilename === 'function') {\n\t\t\tfileName = customFilename('csv')\n\t\t} else if (typeof customFilename === 'string') {\n\t\t\tfileName = customFilename\n\t\t}\n\n\t\tthis.services.files.downloadCSV(csvString, `${fileName}.csv`)\n\t}\n\n\tprotected getTabularData(data: any) {\n\t\t// if data is not an array\n\t\tif (!Array.isArray(data)) {\n\t\t\treturn this.transformToTabularData(data)\n\t\t}\n\n\t\treturn data\n\t}\n\n\tprotected sanitize(data: any) {\n\t\tdata = this.getTabularData(data)\n\n\t\treturn data\n\t}\n\n\t/*\n\t * Data groups\n\t */\n\tprotected updateAllDataGroups() {\n\t\t// allDataGroups is used to generate a color scale that applies\n\t\t// to all the groups. Now when the data updates, you might remove a group,\n\t\t// and then bring it back in a newer data update, therefore\n\t\t// the order of the groups in allDataGroups matters so that you'd never\n\t\t// have an incorrect color assigned to a group.\n\n\t\t// Also, a new group should only be added to allDataGroups if\n\t\t// it doesn't currently exist\n\n\t\tif (!this.allDataGroups) {\n\t\t\tthis.allDataGroups = this.getDataGroupNames()\n\t\t} else {\n\t\t\t// Loop through current data groups\n\t\t\tthis.getDataGroupNames().forEach((dataGroupName: any) => {\n\t\t\t\t// If group name hasn't been stored yet, store it\n\t\t\t\tif (this.allDataGroups.indexOf(dataGroupName) === -1) {\n\t\t\t\t\tthis.allDataGroups.push(dataGroupName)\n\t\t\t\t}\n\t\t\t})\n\t\t}\n\t}\n\n\tprotected generateDataGroups(data: any) {\n\t\tconst { groupMapsTo } = this.getOptions().data\n\t\tconst { ACTIVE, DISABLED } = legendConfigs.items.status\n\t\tconst options = this.getOptions()\n\n\t\tconst uniqueDataGroups = uniq(data.map((datum: any) => datum[groupMapsTo]))\n\n\t\t// check if selectedGroups can be applied to chart with current data groups\n\t\tif (options.data.selectedGroups.length) {\n\t\t\tconst hasAllSelectedGroups = options.data.selectedGroups.every((groupName: any) =>\n\t\t\t\tuniqueDataGroups.includes(groupName)\n\t\t\t)\n\t\t\tif (!hasAllSelectedGroups) {\n\t\t\t\toptions.data.selectedGroups = []\n\t\t\t}\n\t\t}\n\n\t\t// Get group status based on items in selected groups\n\t\tconst getStatus = (groupName: any) =>\n\t\t\t!options.data.selectedGroups.length || options.data.selectedGroups.includes(groupName)\n\t\t\t\t? ACTIVE\n\t\t\t\t: DISABLED\n\n\t\treturn uniqueDataGroups.map(groupName => ({\n\t\t\tname: groupName,\n\t\t\tstatus: getStatus(groupName)\n\t\t}))\n\t}\n\n\t/*\n\t * Fill scales\n\t */\n\tprotected setCustomColorScale() {\n\t\tif (!this.isUserProvidedColorScaleValid()) {\n\t\t\treturn\n\t\t}\n\n\t\tconst options = this.getOptions()\n\t\tconst userProvidedScale = getProperty(options, 'color', 'scale')\n\n\t\tObject.keys(userProvidedScale).forEach(dataGroup => {\n\t\t\tif (!this.allDataGroups.includes(dataGroup)) {\n\t\t\t\tconsole.warn(`\"${dataGroup}\" does not exist in data groups.`)\n\t\t\t}\n\t\t})\n\n\t\t/**\n\t\t * Go through allDataGroups. If a data group has a color value provided\n\t\t * by the user, add that to the color range\n\t\t */\n\t\tconst providedDataGroups = this.allDataGroups.filter(dataGroup => userProvidedScale[dataGroup])\n\n\t\tprovidedDataGroups.forEach(\n\t\t\tdataGroup => (this.colorScale[dataGroup] = userProvidedScale[dataGroup])\n\t\t)\n\t}\n\n\t/*\n\t * Color palette\n\t */\n\tprotected setColorClassNames() {\n\t\tconst colorPairingOptions = getProperty(this.getOptions(), 'color', 'pairing')\n\n\t\t// Check if user has defined numberOfVariants (differ from given data)\n\t\tlet numberOfVariants = getProperty(colorPairingOptions, 'numberOfVariants')\n\t\tif (!numberOfVariants || numberOfVariants < this.allDataGroups.length) {\n\t\t\tnumberOfVariants = this.allDataGroups.length\n\t\t}\n\n\t\tlet pairingOption = getProperty(colorPairingOptions, 'option')\n\t\tconst colorPairingCounts = colorConfigs.pairingOptions\n\n\t\t// If number of dataGroups is greater than 5, user 14-color palette\n\t\tconst numberOfColors = numberOfVariants > 5 ? 14 : numberOfVariants\n\n\t\t// Use default palette if user choice is not in range\n\t\tconst key = `${numberOfColors}-color` as keyof typeof colorPairingCounts\n\t\tpairingOption = pairingOption <= colorPairingCounts[key] ? pairingOption : 1\n\n\t\t// Create color classes for graph, tooltip and stroke use\n\t\tconst colorPairing = this.allDataGroups.map(\n\t\t\t(_, index) => `${numberOfColors}-${pairingOption}-${(index % 14) + 1}`\n\t\t)\n\n\t\t// Create default color classnames\n\t\tthis.colorClassNames = scaleOrdinal().range(colorPairing).domain(this.allDataGroups)\n\t}\n}\n","export function resolveUrl(url, baseUrl) {\n // url is absolute already\n if (url.match(/^[a-z]+:\\/\\//i)) {\n return url;\n }\n // url is absolute already, without protocol\n if (url.match(/^\\/\\//)) {\n return window.location.protocol + url;\n }\n // dataURI, mailto:, tel:, etc.\n if (url.match(/^[a-z]+:/i)) {\n return url;\n }\n const doc = document.implementation.createHTMLDocument();\n const base = doc.createElement('base');\n const a = doc.createElement('a');\n doc.head.appendChild(base);\n doc.body.appendChild(a);\n if (baseUrl) {\n base.href = baseUrl;\n }\n a.href = url;\n return a.href;\n}\nexport const uuid = (() => {\n // generate uuid for className of pseudo elements.\n // We should not use GUIDs, otherwise pseudo elements sometimes cannot be captured.\n let counter = 0;\n // ref: http://stackoverflow.com/a/6248722/2519373\n const random = () => \n // eslint-disable-next-line no-bitwise\n `0000${((Math.random() * 36 ** 4) << 0).toString(36)}`.slice(-4);\n return () => {\n counter += 1;\n return `u${random()}${counter}`;\n };\n})();\nexport function delay(ms) {\n return (args) => new Promise((resolve) => {\n setTimeout(() => resolve(args), ms);\n });\n}\nexport function toArray(arrayLike) {\n const arr = [];\n for (let i = 0, l = arrayLike.length; i < l; i++) {\n arr.push(arrayLike[i]);\n }\n return arr;\n}\nfunction px(node, styleProperty) {\n const win = node.ownerDocument.defaultView || window;\n const val = win.getComputedStyle(node).getPropertyValue(styleProperty);\n return val ? parseFloat(val.replace('px', '')) : 0;\n}\nfunction getNodeWidth(node) {\n const leftBorder = px(node, 'border-left-width');\n const rightBorder = px(node, 'border-right-width');\n return node.clientWidth + leftBorder + rightBorder;\n}\nfunction getNodeHeight(node) {\n const topBorder = px(node, 'border-top-width');\n const bottomBorder = px(node, 'border-bottom-width');\n return node.clientHeight + topBorder + bottomBorder;\n}\nexport function getImageSize(targetNode, options = {}) {\n const width = options.width || getNodeWidth(targetNode);\n const height = options.height || getNodeHeight(targetNode);\n return { width, height };\n}\nexport function getPixelRatio() {\n let ratio;\n let FINAL_PROCESS;\n try {\n FINAL_PROCESS = process;\n }\n catch (e) {\n // pass\n }\n const val = FINAL_PROCESS && FINAL_PROCESS.env\n ? FINAL_PROCESS.env.devicePixelRatio\n : null;\n if (val) {\n ratio = parseInt(val, 10);\n if (Number.isNaN(ratio)) {\n ratio = 1;\n }\n }\n return ratio || window.devicePixelRatio || 1;\n}\n// @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/canvas#maximum_canvas_size\nconst canvasDimensionLimit = 16384;\nexport function checkCanvasDimensions(canvas) {\n if (canvas.width > canvasDimensionLimit ||\n canvas.height > canvasDimensionLimit) {\n if (canvas.width > canvasDimensionLimit &&\n canvas.height > canvasDimensionLimit) {\n if (canvas.width > canvas.height) {\n canvas.height *= canvasDimensionLimit / canvas.width;\n canvas.width = canvasDimensionLimit;\n }\n else {\n canvas.width *= canvasDimensionLimit / canvas.height;\n canvas.height = canvasDimensionLimit;\n }\n }\n else if (canvas.width > canvasDimensionLimit) {\n canvas.height *= canvasDimensionLimit / canvas.width;\n canvas.width = canvasDimensionLimit;\n }\n else {\n canvas.width *= canvasDimensionLimit / canvas.height;\n canvas.height = canvasDimensionLimit;\n }\n }\n}\nexport function canvasToBlob(canvas, options = {}) {\n if (canvas.toBlob) {\n return new Promise((resolve) => {\n canvas.toBlob(resolve, options.type ? options.type : 'image/png', options.quality ? options.quality : 1);\n });\n }\n return new Promise((resolve) => {\n const binaryString = window.atob(canvas\n .toDataURL(options.type ? options.type : undefined, options.quality ? options.quality : undefined)\n .split(',')[1]);\n const len = binaryString.length;\n const binaryArray = new Uint8Array(len);\n for (let i = 0; i < len; i += 1) {\n binaryArray[i] = binaryString.charCodeAt(i);\n }\n resolve(new Blob([binaryArray], {\n type: options.type ? options.type : 'image/png',\n }));\n });\n}\nexport function createImage(url) {\n return new Promise((resolve, reject) => {\n const img = new Image();\n img.decode = () => resolve(img);\n img.onload = () => resolve(img);\n img.onerror = reject;\n img.crossOrigin = 'anonymous';\n img.decoding = 'async';\n img.src = url;\n });\n}\nexport async function svgToDataURL(svg) {\n return Promise.resolve()\n .then(() => new XMLSerializer().serializeToString(svg))\n .then(encodeURIComponent)\n .then((html) => `data:image/svg+xml;charset=utf-8,${html}`);\n}\nexport async function nodeToDataURL(node, width, height) {\n const xmlns = 'http://www.w3.org/2000/svg';\n const svg = document.createElementNS(xmlns, 'svg');\n const foreignObject = document.createElementNS(xmlns, 'foreignObject');\n svg.setAttribute('width', `${width}`);\n svg.setAttribute('height', `${height}`);\n svg.setAttribute('viewBox', `0 0 ${width} ${height}`);\n foreignObject.setAttribute('width', '100%');\n foreignObject.setAttribute('height', '100%');\n foreignObject.setAttribute('x', '0');\n foreignObject.setAttribute('y', '0');\n foreignObject.setAttribute('externalResourcesRequired', 'true');\n svg.appendChild(foreignObject);\n foreignObject.appendChild(node);\n return svgToDataURL(svg);\n}\nexport const isInstanceOfElement = (node, instance) => {\n if (node instanceof instance)\n return true;\n const nodePrototype = Object.getPrototypeOf(node);\n if (nodePrototype === null)\n return false;\n return (nodePrototype.constructor.name === instance.name ||\n isInstanceOfElement(nodePrototype, instance));\n};\n//# sourceMappingURL=util.js.map","import { uuid, toArray } from './util';\nfunction formatCSSText(style) {\n const content = style.getPropertyValue('content');\n return `${style.cssText} content: '${content.replace(/'|\"/g, '')}';`;\n}\nfunction formatCSSProperties(style) {\n return toArray(style)\n .map((name) => {\n const value = style.getPropertyValue(name);\n const priority = style.getPropertyPriority(name);\n return `${name}: ${value}${priority ? ' !important' : ''};`;\n })\n .join(' ');\n}\nfunction getPseudoElementStyle(className, pseudo, style) {\n const selector = `.${className}:${pseudo}`;\n const cssText = style.cssText\n ? formatCSSText(style)\n : formatCSSProperties(style);\n return document.createTextNode(`${selector}{${cssText}}`);\n}\nfunction clonePseudoElement(nativeNode, clonedNode, pseudo) {\n const style = window.getComputedStyle(nativeNode, pseudo);\n const content = style.getPropertyValue('content');\n if (content === '' || content === 'none') {\n return;\n }\n const className = uuid();\n try {\n clonedNode.className = `${clonedNode.className} ${className}`;\n }\n catch (err) {\n return;\n }\n const styleElement = document.createElement('style');\n styleElement.appendChild(getPseudoElementStyle(className, pseudo, style));\n clonedNode.appendChild(styleElement);\n}\nexport function clonePseudoElements(nativeNode, clonedNode) {\n clonePseudoElement(nativeNode, clonedNode, ':before');\n clonePseudoElement(nativeNode, clonedNode, ':after');\n}\n//# sourceMappingURL=clone-pseudos.js.map","const WOFF = 'application/font-woff';\nconst JPEG = 'image/jpeg';\nconst mimes = {\n woff: WOFF,\n woff2: WOFF,\n ttf: 'application/font-truetype',\n eot: 'application/vnd.ms-fontobject',\n png: 'image/png',\n jpg: JPEG,\n jpeg: JPEG,\n gif: 'image/gif',\n tiff: 'image/tiff',\n svg: 'image/svg+xml',\n webp: 'image/webp',\n};\nfunction getExtension(url) {\n const match = /\\.([^./]*?)$/g.exec(url);\n return match ? match[1] : '';\n}\nexport function getMimeType(url) {\n const extension = getExtension(url).toLowerCase();\n return mimes[extension] || '';\n}\n//# sourceMappingURL=mimes.js.map","function getContentFromDataUrl(dataURL) {\n return dataURL.split(/,/)[1];\n}\nexport function isDataUrl(url) {\n return url.search(/^(data:)/) !== -1;\n}\nexport function makeDataUrl(content, mimeType) {\n return `data:${mimeType};base64,${content}`;\n}\nexport async function fetchAsDataURL(url, init, process) {\n const res = await fetch(url, init);\n if (res.status === 404) {\n throw new Error(`Resource \"${res.url}\" not found`);\n }\n const blob = await res.blob();\n return new Promise((resolve, reject) => {\n const reader = new FileReader();\n reader.onerror = reject;\n reader.onloadend = () => {\n try {\n resolve(process({ res, result: reader.result }));\n }\n catch (error) {\n reject(error);\n }\n };\n reader.readAsDataURL(blob);\n });\n}\nconst cache = {};\nfunction getCacheKey(url, contentType, includeQueryParams) {\n let key = url.replace(/\\?.*/, '');\n if (includeQueryParams) {\n key = url;\n }\n // font resource\n if (/ttf|otf|eot|woff2?/i.test(key)) {\n key = key.replace(/.*\\//, '');\n }\n return contentType ? `[${contentType}]${key}` : key;\n}\nexport async function resourceToDataURL(resourceUrl, contentType, options) {\n const cacheKey = getCacheKey(resourceUrl, contentType, options.includeQueryParams);\n if (cache[cacheKey] != null) {\n return cache[cacheKey];\n }\n // ref: https://developer.mozilla.org/en/docs/Web/API/XMLHttpRequest/Using_XMLHttpRequest#Bypassing_the_cache\n if (options.cacheBust) {\n // eslint-disable-next-line no-param-reassign\n resourceUrl += (/\\?/.test(resourceUrl) ? '&' : '?') + new Date().getTime();\n }\n let dataURL;\n try {\n const content = await fetchAsDataURL(resourceUrl, options.fetchRequestInit, ({ res, result }) => {\n if (!contentType) {\n // eslint-disable-next-line no-param-reassign\n contentType = res.headers.get('Content-Type') || '';\n }\n return getContentFromDataUrl(result);\n });\n dataURL = makeDataUrl(content, contentType);\n }\n catch (error) {\n dataURL = options.imagePlaceholder || '';\n let msg = `Failed to fetch resource: ${resourceUrl}`;\n if (error) {\n msg = typeof error === 'string' ? error : error.message;\n }\n if (msg) {\n console.warn(msg);\n }\n }\n cache[cacheKey] = dataURL;\n return dataURL;\n}\n//# sourceMappingURL=dataurl.js.map","import { clonePseudoElements } from './clone-pseudos';\nimport { createImage, toArray, isInstanceOfElement } from './util';\nimport { getMimeType } from './mimes';\nimport { resourceToDataURL } from './dataurl';\nasync function cloneCanvasElement(canvas) {\n const dataURL = canvas.toDataURL();\n if (dataURL === 'data:,') {\n return canvas.cloneNode(false);\n }\n return createImage(dataURL);\n}\nasync function cloneVideoElement(video, options) {\n if (video.currentSrc) {\n const canvas = document.createElement('canvas');\n const ctx = canvas.getContext('2d');\n canvas.width = video.clientWidth;\n canvas.height = video.clientHeight;\n ctx === null || ctx === void 0 ? void 0 : ctx.drawImage(video, 0, 0, canvas.width, canvas.height);\n const dataURL = canvas.toDataURL();\n return createImage(dataURL);\n }\n const poster = video.poster;\n const contentType = getMimeType(poster);\n const dataURL = await resourceToDataURL(poster, contentType, options);\n return createImage(dataURL);\n}\nasync function cloneIFrameElement(iframe) {\n var _a;\n try {\n if ((_a = iframe === null || iframe === void 0 ? void 0 : iframe.contentDocument) === null || _a === void 0 ? void 0 : _a.body) {\n return (await cloneNode(iframe.contentDocument.body, {}, true));\n }\n }\n catch (_b) {\n // Failed to clone iframe\n }\n return iframe.cloneNode(false);\n}\nasync function cloneSingleNode(node, options) {\n if (isInstanceOfElement(node, HTMLCanvasElement)) {\n return cloneCanvasElement(node);\n }\n if (isInstanceOfElement(node, HTMLVideoElement)) {\n return cloneVideoElement(node, options);\n }\n if (isInstanceOfElement(node, HTMLIFrameElement)) {\n return cloneIFrameElement(node);\n }\n return node.cloneNode(false);\n}\nconst isSlotElement = (node) => node.tagName != null && node.tagName.toUpperCase() === 'SLOT';\nasync function cloneChildren(nativeNode, clonedNode, options) {\n var _a, _b;\n let children = [];\n if (isSlotElement(nativeNode) && nativeNode.assignedNodes) {\n children = toArray(nativeNode.assignedNodes());\n }\n else if (isInstanceOfElement(nativeNode, HTMLIFrameElement) &&\n ((_a = nativeNode.contentDocument) === null || _a === void 0 ? void 0 : _a.body)) {\n children = toArray(nativeNode.contentDocument.body.childNodes);\n }\n else {\n children = toArray(((_b = nativeNode.shadowRoot) !== null && _b !== void 0 ? _b : nativeNode).childNodes);\n }\n if (children.length === 0 ||\n isInstanceOfElement(nativeNode, HTMLVideoElement)) {\n return clonedNode;\n }\n await children.reduce((deferred, child) => deferred\n .then(() => cloneNode(child, options))\n .then((clonedChild) => {\n if (clonedChild) {\n clonedNode.appendChild(clonedChild);\n }\n }), Promise.resolve());\n return clonedNode;\n}\nfunction cloneCSSStyle(nativeNode, clonedNode) {\n const targetStyle = clonedNode.style;\n if (!targetStyle) {\n return;\n }\n const sourceStyle = window.getComputedStyle(nativeNode);\n if (sourceStyle.cssText) {\n targetStyle.cssText = sourceStyle.cssText;\n targetStyle.transformOrigin = sourceStyle.transformOrigin;\n }\n else {\n toArray(sourceStyle).forEach((name) => {\n let value = sourceStyle.getPropertyValue(name);\n if (name === 'font-size' && value.endsWith('px')) {\n const reducedFont = Math.floor(parseFloat(value.substring(0, value.length - 2))) - 0.1;\n value = `${reducedFont}px`;\n }\n if (isInstanceOfElement(nativeNode, HTMLIFrameElement) &&\n name === 'display' &&\n value === 'inline') {\n value = 'block';\n }\n if (name === 'd' && clonedNode.getAttribute('d')) {\n value = `path(${clonedNode.getAttribute('d')})`;\n }\n targetStyle.setProperty(name, value, sourceStyle.getPropertyPriority(name));\n });\n }\n}\nfunction cloneInputValue(nativeNode, clonedNode) {\n if (isInstanceOfElement(nativeNode, HTMLTextAreaElement)) {\n clonedNode.innerHTML = nativeNode.value;\n }\n if (isInstanceOfElement(nativeNode, HTMLInputElement)) {\n clonedNode.setAttribute('value', nativeNode.value);\n }\n}\nfunction cloneSelectValue(nativeNode, clonedNode) {\n if (isInstanceOfElement(nativeNode, HTMLSelectElement)) {\n const clonedSelect = clonedNode;\n const selectedOption = Array.from(clonedSelect.children).find((child) => nativeNode.value === child.getAttribute('value'));\n if (selectedOption) {\n selectedOption.setAttribute('selected', '');\n }\n }\n}\nfunction decorate(nativeNode, clonedNode) {\n if (isInstanceOfElement(clonedNode, Element)) {\n cloneCSSStyle(nativeNode, clonedNode);\n clonePseudoElements(nativeNode, clonedNode);\n cloneInputValue(nativeNode, clonedNode);\n cloneSelectValue(nativeNode, clonedNode);\n }\n return clonedNode;\n}\nasync function ensureSVGSymbols(clone, options) {\n const uses = clone.querySelectorAll ? clone.querySelectorAll('use') : [];\n if (uses.length === 0) {\n return clone;\n }\n const processedDefs = {};\n for (let i = 0; i < uses.length; i++) {\n const use = uses[i];\n const id = use.getAttribute('xlink:href');\n if (id) {\n const exist = clone.querySelector(id);\n const definition = document.querySelector(id);\n if (!exist && definition && !processedDefs[id]) {\n // eslint-disable-next-line no-await-in-loop\n processedDefs[id] = (await cloneNode(definition, options, true));\n }\n }\n }\n const nodes = Object.values(processedDefs);\n if (nodes.length) {\n const ns = 'http://www.w3.org/1999/xhtml';\n const svg = document.createElementNS(ns, 'svg');\n svg.setAttribute('xmlns', ns);\n svg.style.position = 'absolute';\n svg.style.width = '0';\n svg.style.height = '0';\n svg.style.overflow = 'hidden';\n svg.style.display = 'none';\n const defs = document.createElementNS(ns, 'defs');\n svg.appendChild(defs);\n for (let i = 0; i < nodes.length; i++) {\n defs.appendChild(nodes[i]);\n }\n clone.appendChild(svg);\n }\n return clone;\n}\nexport async function cloneNode(node, options, isRoot) {\n if (!isRoot && options.filter && !options.filter(node)) {\n return null;\n }\n return Promise.resolve(node)\n .then((clonedNode) => cloneSingleNode(clonedNode, options))\n .then((clonedNode) => cloneChildren(node, clonedNode, options))\n .then((clonedNode) => decorate(node, clonedNode))\n .then((clonedNode) => ensureSVGSymbols(clonedNode, options));\n}\n//# sourceMappingURL=clone-node.js.map","import { resolveUrl } from './util';\nimport { getMimeType } from './mimes';\nimport { isDataUrl, makeDataUrl, resourceToDataURL } from './dataurl';\nconst URL_REGEX = /url\\((['\"]?)([^'\"]+?)\\1\\)/g;\nconst URL_WITH_FORMAT_REGEX = /url\\([^)]+\\)\\s*format\\(([\"']?)([^\"']+)\\1\\)/g;\nconst FONT_SRC_REGEX = /src:\\s*(?:url\\([^)]+\\)\\s*format\\([^)]+\\)[,;]\\s*)+/g;\nfunction toRegex(url) {\n // eslint-disable-next-line no-useless-escape\n const escaped = url.replace(/([.*+?^${}()|\\[\\]\\/\\\\])/g, '\\\\$1');\n return new RegExp(`(url\\\\(['\"]?)(${escaped})(['\"]?\\\\))`, 'g');\n}\nexport function parseURLs(cssText) {\n const urls = [];\n cssText.replace(URL_REGEX, (raw, quotation, url) => {\n urls.push(url);\n return raw;\n });\n return urls.filter((url) => !isDataUrl(url));\n}\nexport async function embed(cssText, resourceURL, baseURL, options, getContentFromUrl) {\n try {\n const resolvedURL = baseURL ? resolveUrl(resourceURL, baseURL) : resourceURL;\n const contentType = getMimeType(resourceURL);\n let dataURL;\n if (getContentFromUrl) {\n const content = await getContentFromUrl(resolvedURL);\n dataURL = makeDataUrl(content, contentType);\n }\n else {\n dataURL = await resourceToDataURL(resolvedURL, contentType, options);\n }\n return cssText.replace(toRegex(resourceURL), `$1${dataURL}$3`);\n }\n catch (error) {\n // pass\n }\n return cssText;\n}\nfunction filterPreferredFontFormat(str, { preferredFontFormat }) {\n return !preferredFontFormat\n ? str\n : str.replace(FONT_SRC_REGEX, (match) => {\n // eslint-disable-next-line no-constant-condition\n while (true) {\n const [src, , format] = URL_WITH_FORMAT_REGEX.exec(match) || [];\n if (!format) {\n return '';\n }\n if (format === preferredFontFormat) {\n return `src: ${src};`;\n }\n }\n });\n}\nexport function shouldEmbed(url) {\n return url.search(URL_REGEX) !== -1;\n}\nexport async function embedResources(cssText, baseUrl, options) {\n if (!shouldEmbed(cssText)) {\n return cssText;\n }\n const filteredCSSText = filterPreferredFontFormat(cssText, options);\n const urls = parseURLs(filteredCSSText);\n return urls.reduce((deferred, url) => deferred.then((css) => embed(css, url, baseUrl, options)), Promise.resolve(filteredCSSText));\n}\n//# sourceMappingURL=embed-resources.js.map","import { embedResources } from './embed-resources';\nimport { toArray, isInstanceOfElement } from './util';\nimport { isDataUrl, resourceToDataURL } from './dataurl';\nimport { getMimeType } from './mimes';\nasync function embedProp(propName, node, options) {\n var _a;\n const propValue = (_a = node.style) === null || _a === void 0 ? void 0 : _a.getPropertyValue(propName);\n if (propValue) {\n const cssString = await embedResources(propValue, null, options);\n node.style.setProperty(propName, cssString, node.style.getPropertyPriority(propName));\n return true;\n }\n return false;\n}\nasync function embedBackground(clonedNode, options) {\n if (!(await embedProp('background', clonedNode, options))) {\n await embedProp('background-image', clonedNode, options);\n }\n if (!(await embedProp('mask', clonedNode, options))) {\n await embedProp('mask-image', clonedNode, options);\n }\n}\nasync function embedImageNode(clonedNode, options) {\n const isImageElement = isInstanceOfElement(clonedNode, HTMLImageElement);\n if (!(isImageElement && !isDataUrl(clonedNode.src)) &&\n !(isInstanceOfElement(clonedNode, SVGImageElement) &&\n !isDataUrl(clonedNode.href.baseVal))) {\n return;\n }\n const url = isImageElement ? clonedNode.src : clonedNode.href.baseVal;\n const dataURL = await resourceToDataURL(url, getMimeType(url), options);\n await new Promise((resolve, reject) => {\n clonedNode.onload = resolve;\n clonedNode.onerror = reject;\n const image = clonedNode;\n if (image.decode) {\n image.decode = resolve;\n }\n if (image.loading === 'lazy') {\n image.loading = 'eager';\n }\n if (isImageElement) {\n clonedNode.srcset = '';\n clonedNode.src = dataURL;\n }\n else {\n clonedNode.href.baseVal = dataURL;\n }\n });\n}\nasync function embedChildren(clonedNode, options) {\n const children = toArray(clonedNode.childNodes);\n const deferreds = children.map((child) => embedImages(child, options));\n await Promise.all(deferreds).then(() => clonedNode);\n}\nexport async function embedImages(clonedNode, options) {\n if (isInstanceOfElement(clonedNode, Element)) {\n await embedBackground(clonedNode, options);\n await embedImageNode(clonedNode, options);\n await embedChildren(clonedNode, options);\n }\n}\n//# sourceMappingURL=embed-images.js.map","export function applyStyle(node, options) {\n const { style } = node;\n if (options.backgroundColor) {\n style.backgroundColor = options.backgroundColor;\n }\n if (options.width) {\n style.width = `${options.width}px`;\n }\n if (options.height) {\n style.height = `${options.height}px`;\n }\n const manual = options.style;\n if (manual != null) {\n Object.keys(manual).forEach((key) => {\n style[key] = manual[key];\n });\n }\n return node;\n}\n//# sourceMappingURL=apply-style.js.map","import { toArray } from './util';\nimport { fetchAsDataURL } from './dataurl';\nimport { shouldEmbed, embedResources } from './embed-resources';\nconst cssFetchCache = {};\nasync function fetchCSS(url) {\n let cache = cssFetchCache[url];\n if (cache != null) {\n return cache;\n }\n const res = await fetch(url);\n const cssText = await res.text();\n cache = { url, cssText };\n cssFetchCache[url] = cache;\n return cache;\n}\nasync function embedFonts(data, options) {\n let cssText = data.cssText;\n const regexUrl = /url\\([\"']?([^\"')]+)[\"']?\\)/g;\n const fontLocs = cssText.match(/url\\([^)]+\\)/g) || [];\n const loadFonts = fontLocs.map(async (loc) => {\n let url = loc.replace(regexUrl, '$1');\n if (!url.startsWith('https://')) {\n url = new URL(url, data.url).href;\n }\n return fetchAsDataURL(url, options.fetchRequestInit, ({ result }) => {\n cssText = cssText.replace(loc, `url(${result})`);\n return [loc, result];\n });\n });\n return Promise.all(loadFonts).then(() => cssText);\n}\nfunction parseCSS(source) {\n if (source == null) {\n return [];\n }\n const result = [];\n const commentsRegex = /(\\/\\*[\\s\\S]*?\\*\\/)/gi;\n // strip out comments\n let cssText = source.replace(commentsRegex, '');\n // eslint-disable-next-line prefer-regex-literals\n const keyframesRegex = new RegExp('((@.*?keyframes [\\\\s\\\\S]*?){([\\\\s\\\\S]*?}\\\\s*?)})', 'gi');\n // eslint-disable-next-line no-constant-condition\n while (true) {\n const matches = keyframesRegex.exec(cssText);\n if (matches === null) {\n break;\n }\n result.push(matches[0]);\n }\n cssText = cssText.replace(keyframesRegex, '');\n const importRegex = /@import[\\s\\S]*?url\\([^)]*\\)[\\s\\S]*?;/gi;\n // to match css & media queries together\n const combinedCSSRegex = '((\\\\s*?(?:\\\\/\\\\*[\\\\s\\\\S]*?\\\\*\\\\/)?\\\\s*?@media[\\\\s\\\\S]' +\n '*?){([\\\\s\\\\S]*?)}\\\\s*?})|(([\\\\s\\\\S]*?){([\\\\s\\\\S]*?)})';\n // unified regex\n const unifiedRegex = new RegExp(combinedCSSRegex, 'gi');\n // eslint-disable-next-line no-constant-condition\n while (true) {\n let matches = importRegex.exec(cssText);\n if (matches === null) {\n matches = unifiedRegex.exec(cssText);\n if (matches === null) {\n break;\n }\n else {\n importRegex.lastIndex = unifiedRegex.lastIndex;\n }\n }\n else {\n unifiedRegex.lastIndex = importRegex.lastIndex;\n }\n result.push(matches[0]);\n }\n return result;\n}\nasync function getCSSRules(styleSheets, options) {\n const ret = [];\n const deferreds = [];\n // First loop inlines imports\n styleSheets.forEach((sheet) => {\n if ('cssRules' in sheet) {\n try {\n toArray(sheet.cssRules || []).forEach((item, index) => {\n if (item.type === CSSRule.IMPORT_RULE) {\n let importIndex = index + 1;\n const url = item.href;\n const deferred = fetchCSS(url)\n .then((metadata) => embedFonts(metadata, options))\n .then((cssText) => parseCSS(cssText).forEach((rule) => {\n try {\n sheet.insertRule(rule, rule.startsWith('@import')\n ? (importIndex += 1)\n : sheet.cssRules.length);\n }\n catch (error) {\n console.error('Error inserting rule from remote css', {\n rule,\n error,\n });\n }\n }))\n .catch((e) => {\n console.error('Error loading remote css', e.toString());\n });\n deferreds.push(deferred);\n }\n });\n }\n catch (e) {\n const inline = styleSheets.find((a) => a.href == null) || document.styleSheets[0];\n if (sheet.href != null) {\n deferreds.push(fetchCSS(sheet.href)\n .then((metadata) => embedFonts(metadata, options))\n .then((cssText) => parseCSS(cssText).forEach((rule) => {\n inline.insertRule(rule, sheet.cssRules.length);\n }))\n .catch((err) => {\n console.error('Error loading remote stylesheet', err);\n }));\n }\n console.error('Error inlining remote css file', e);\n }\n }\n });\n return Promise.all(deferreds).then(() => {\n // Second loop parses rules\n styleSheets.forEach((sheet) => {\n if ('cssRules' in sheet) {\n try {\n toArray(sheet.cssRules || []).forEach((item) => {\n ret.push(item);\n });\n }\n catch (e) {\n console.error(`Error while reading CSS rules from ${sheet.href}`, e);\n }\n }\n });\n return ret;\n });\n}\nfunction getWebFontRules(cssRules) {\n return cssRules\n .filter((rule) => rule.type === CSSRule.FONT_FACE_RULE)\n .filter((rule) => shouldEmbed(rule.style.getPropertyValue('src')));\n}\nasync function parseWebFontRules(node, options) {\n if (node.ownerDocument == null) {\n throw new Error('Provided element is not within a Document');\n }\n const styleSheets = toArray(node.ownerDocument.styleSheets);\n const cssRules = await getCSSRules(styleSheets, options);\n return getWebFontRules(cssRules);\n}\nexport async function getWebFontCSS(node, options) {\n const rules = await parseWebFontRules(node, options);\n const cssTexts = await Promise.all(rules.map((rule) => {\n const baseUrl = rule.parentStyleSheet ? rule.parentStyleSheet.href : null;\n return embedResources(rule.cssText, baseUrl, options);\n }));\n return cssTexts.join('\\n');\n}\nexport async function embedWebFonts(clonedNode, options) {\n const cssText = options.fontEmbedCSS != null\n ? options.fontEmbedCSS\n : options.skipFonts\n ? null\n : await getWebFontCSS(clonedNode, options);\n if (cssText) {\n const styleNode = document.createElement('style');\n const sytleContent = document.createTextNode(cssText);\n styleNode.appendChild(sytleContent);\n if (clonedNode.firstChild) {\n clonedNode.insertBefore(styleNode, clonedNode.firstChild);\n }\n else {\n clonedNode.appendChild(styleNode);\n }\n }\n}\n//# sourceMappingURL=embed-webfonts.js.map","import { cloneNode } from './clone-node';\nimport { embedImages } from './embed-images';\nimport { applyStyle } from './apply-style';\nimport { embedWebFonts, getWebFontCSS } from './embed-webfonts';\nimport { getImageSize, getPixelRatio, createImage, canvasToBlob, nodeToDataURL, checkCanvasDimensions, } from './util';\nexport async function toSvg(node, options = {}) {\n const { width, height } = getImageSize(node, options);\n const clonedNode = (await cloneNode(node, options, true));\n await embedWebFonts(clonedNode, options);\n await embedImages(clonedNode, options);\n applyStyle(clonedNode, options);\n const datauri = await nodeToDataURL(clonedNode, width, height);\n return datauri;\n}\nexport async function toCanvas(node, options = {}) {\n const { width, height } = getImageSize(node, options);\n const svg = await toSvg(node, options);\n const img = await createImage(svg);\n const canvas = document.createElement('canvas');\n const context = canvas.getContext('2d');\n const ratio = options.pixelRatio || getPixelRatio();\n const canvasWidth = options.canvasWidth || width;\n const canvasHeight = options.canvasHeight || height;\n canvas.width = canvasWidth * ratio;\n canvas.height = canvasHeight * ratio;\n if (!options.skipAutoScale) {\n checkCanvasDimensions(canvas);\n }\n canvas.style.width = `${canvasWidth}`;\n canvas.style.height = `${canvasHeight}`;\n if (options.backgroundColor) {\n context.fillStyle = options.backgroundColor;\n context.fillRect(0, 0, canvas.width, canvas.height);\n }\n context.drawImage(img, 0, 0, canvas.width, canvas.height);\n return canvas;\n}\nexport async function toPixelData(node, options = {}) {\n const { width, height } = getImageSize(node, options);\n const canvas = await toCanvas(node, options);\n const ctx = canvas.getContext('2d');\n return ctx.getImageData(0, 0, width, height).data;\n}\nexport async function toPng(node, options = {}) {\n const canvas = await toCanvas(node, options);\n return canvas.toDataURL();\n}\nexport async function toJpeg(node, options = {}) {\n const canvas = await toCanvas(node, options);\n return canvas.toDataURL('image/jpeg', options.quality || 1);\n}\nexport async function toBlob(node, options = {}) {\n const canvas = await toCanvas(node, options);\n const blob = await canvasToBlob(canvas);\n return blob;\n}\nexport async function getFontEmbedCSS(node, options = {}) {\n return getWebFontCSS(node, options);\n}\n//# sourceMappingURL=index.js.map","import type { ChartModel } from '@/model/model'\nimport type { Services } from '@/interfaces/services'\n\nexport class Service {\n\tprotected model: ChartModel\n\tprotected services: Services\n\n\tconstructor(model: ChartModel, services: Services) {\n\t\tthis.model = model\n\t\tthis.services = services\n\n\t\tthis.init()\n\t}\n\n\tinit() {\n\t\t// do nothing.\n\t}\n\n\tupdate() {\n\t\t// do nothing.\n\t}\n\n\t// Used to pass down information to the components\n\tsetModel(newObj: ChartModel) {\n\t\tthis.model = newObj\n\t}\n\n\t// Used to pass down services to the components\n\tsetServices(newObj: Services) {\n\t\tthis.services = newObj\n\t}\n}\n","import { select, type Selection } from 'd3'\nimport { toPng, toJpeg } from 'html-to-image'\nimport { debounce } from 'lodash-es'\nimport { getProperty } from '@/tools'\nimport { carbonPrefix } from '@/configuration-non-customizable' // CSS prefix\nimport type { ChartModel } from '@/model/model'\nimport { Service } from '@/services/service'\nimport { Events } from '@/interfaces/enums'\n\nconst CSS_VERIFIER_ELEMENT_CLASSNAME = 'DONT_STYLE_ME_css_styles_verifier'\n\n// Functions like validateAndSetDimensions() may return strings or numbers\nexport interface Dimensions {\n\theight: number\n\twidth: number\n}\n\nexport interface getSVGElementSizeOptions {\n\tuseAttrs?: boolean\n\tuseClientDimensions?: boolean\n\tuseBBox?: boolean\n\tuseBoundingRect?: boolean\n}\n\nexport class DOMUtils extends Service {\n\tprivate chartID!: string // initialized in initializeID() called by init()\n\n\tconstructor(model: ChartModel, services: any) {\n\t\tsuper(model, services)\n\t}\n\n\tstatic getHTMLElementSize(element: HTMLElement) {\n\t\treturn {\n\t\t\twidth: element.clientWidth,\n\t\t\theight: element.clientHeight\n\t\t}\n\t}\n\n\tstatic getSVGElementSize(\n\t\tsvgSelector: Selection,\n\t\toptions: getSVGElementSizeOptions = {\n\t\t\tuseAttrs: false,\n\t\t\tuseClientDimensions: false,\n\t\t\tuseBBox: false,\n\t\t\tuseBoundingRect: false\n\t\t}\n\t) {\n\t\tif (!svgSelector.attr) {\n\t\t\tsvgSelector = select(svgSelector as any) // issue with @types/d3 - select can handle Selection parameters just fine\n\t\t}\n\n\t\tconst finalDimensions = {\n\t\t\twidth: 0,\n\t\t\theight: 0\n\t\t}\n\n\t\t// Dimensions can be width and height as numbers or strings\n\t\tconst validateAndSetDimensions = (dimensions: any) => {\n\t\t\tif (dimensions) {\n\t\t\t\tObject.keys(finalDimensions).forEach((dimensionKey: 'width' | 'height') => {\n\t\t\t\t\tif (dimensions[dimensionKey]) {\n\t\t\t\t\t\tconst dimension = dimensions[dimensionKey]\n\t\t\t\t\t\tconst dimensionNumber = parseFloat(dimension)\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tdimension &&\n\t\t\t\t\t\t\tdimensionNumber > finalDimensions[dimensionKey] &&\n\t\t\t\t\t\t\t('' + dimension).indexOf('%') === -1\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tfinalDimensions[dimensionKey] = dimensionNumber\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\tconst attrDimensions = {\n\t\t\twidth: svgSelector.attr('width'),\n\t\t\theight: svgSelector.attr('height')\n\t\t}\n\n\t\tconst svgElement = svgSelector.node()\n\n\t\tlet bbox: DOMRect,\n\t\t\tbboxDimensions: Dimensions,\n\t\t\tboundingRect: DOMRect,\n\t\t\tboundingRectDimensions: Dimensions\n\n\t\ttry {\n\t\t\t// Not all SVG graphics elements have bounding boxes (eg , , )\n\t\t\tif (typeof svgElement.getBBox === 'function') {\n\t\t\t\tbbox = svgElement.getBBox()\n\t\t\t\tbboxDimensions = {\n\t\t\t\t\twidth: bbox.width,\n\t\t\t\t\theight: bbox.height\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t}\n\n\t\ttry {\n\t\t\t// Not all SVG graphics elements have...\n\t\t\tif (typeof svgElement?.getBoundingClientRect === 'function') {\n\t\t\t\tboundingRect = svgElement.getBoundingClientRect()\n\t\t\t\tboundingRectDimensions = {\n\t\t\t\t\twidth: boundingRect.width,\n\t\t\t\t\theight: boundingRect.height\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t}\n\n\t\t// Not all SVG graphics elements have...\n\t\tlet clientDimensions: Dimensions\n\t\tif (svgElement instanceof SVGSVGElement) {\n\t\t\tclientDimensions = {\n\t\t\t\twidth: svgElement.clientWidth,\n\t\t\t\theight: svgElement.clientHeight\n\t\t\t}\n\t\t}\n\n\t\t// If both attribute values are numbers\n\t\t// And not percentages or NaN\n\t\tif (options) {\n\t\t\tif (options.useAttrs) {\n\t\t\t\tvalidateAndSetDimensions(attrDimensions)\n\n\t\t\t\tif (finalDimensions.width > 0 && finalDimensions.height > 0) {\n\t\t\t\t\treturn finalDimensions\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (options.useClientDimensions) {\n\t\t\t\tvalidateAndSetDimensions(clientDimensions)\n\n\t\t\t\tif (finalDimensions.width > 0 && finalDimensions.height > 0) {\n\t\t\t\t\treturn clientDimensions\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (options.useBBox) {\n\t\t\t\tvalidateAndSetDimensions(bboxDimensions)\n\n\t\t\t\tif (finalDimensions.width > 0 && finalDimensions.height > 0) {\n\t\t\t\t\treturn bboxDimensions\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (options.useBoundingRect) {\n\t\t\t\tvalidateAndSetDimensions(boundingRectDimensions)\n\n\t\t\t\tif (finalDimensions.width > 0 && finalDimensions.height > 0) {\n\t\t\t\t\treturn boundingRectDimensions\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\ttry {\n\t\t\tconst nativeDimensions = {\n\t\t\t\twidth: getProperty(svgSelector.node(), 'width', 'baseVal', 'value'),\n\t\t\t\theight: getProperty(svgSelector.node(), 'height', 'baseVal', 'value')\n\t\t\t}\n\n\t\t\tvalidateAndSetDimensions(nativeDimensions)\n\t\t} catch (e) {\n\t\t\tvalidateAndSetDimensions(clientDimensions)\n\t\t\tvalidateAndSetDimensions(bboxDimensions)\n\t\t\tvalidateAndSetDimensions(attrDimensions)\n\t\t}\n\t\treturn finalDimensions\n\t}\n\n\tstatic appendOrSelect(\n\t\tparent: Selection,\n\t\tquery: string\n\t) {\n\t\tconst selection = parent.select(`${query}`)\n\n\t\tif (selection.empty()) {\n\t\t\t// see if there is an id\n\t\t\tlet querySections = query.split('#')\n\t\t\tlet elementToAppend: any\n\t\t\tlet id: string\n\t\t\t// if there is an id\n\t\t\tif (querySections.length === 2) {\n\t\t\t\t// take out the element to append\n\t\t\t\telementToAppend = querySections[0]\n\t\t\t\t// split it by classes\n\t\t\t\tquerySections = querySections[1].split('.')\n\t\t\t\t// the first string is the id\n\t\t\t\tid = querySections[0]\n\t\t\t} else {\n\t\t\t\tquerySections = query.split('.')\n\t\t\t\telementToAppend = querySections[0]\n\t\t\t}\n\n\t\t\treturn parent\n\t\t\t\t.append(elementToAppend)\n\t\t\t\t.attr('id', id)\n\t\t\t\t.attr('class', querySections.slice(1).join(' '))\n\t\t}\n\n\t\treturn selection\n\t}\n\n\tprotected mainContainer: HTMLDivElement\n\tprotected width: string\n\tprotected height: string\n\n\tinit() {\n\t\t// Initialize chart ID\n\t\tthis.initializeID()\n\n\t\t// Add width & height to the chart holder if necessary, and add a classname\n\t\tthis.styleHolderElement()\n\n\t\tthis.addMainContainer()\n\n\t\tif (this.model.getOptions().resizable) {\n\t\t\tthis.addResizeListener()\n\t\t}\n\n\t\tthis.addHolderListeners()\n\n\t\tthis.handleFullscreenChange()\n\t}\n\n\tgetChartID() {\n\t\treturn this.chartID\n\t}\n\n\tgetElementOffset(element: HTMLElement, byViewPort = false) {\n\t\t// get relative position { left, top } based on \"chart holder\" OR \"viewport\"\n\t\tconst elementOffset = { left: 0, top: 0 }\n\t\tconst childRect = element.getBoundingClientRect()\n\t\tconst baseRect = byViewPort ? { left: 0, top: 0 } : this.getHolder().getBoundingClientRect()\n\n\t\ttry {\n\t\t\telementOffset.left = childRect.left - baseRect.left\n\t\t\telementOffset.top = childRect.top - baseRect.top\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t}\n\n\t\treturn elementOffset\n\t}\n\n\tgenerateElementIDString(originalID: string | number) {\n\t\treturn `chart-${this.chartID}-${originalID}`\n\t}\n\n\tprivate initializeID() {\n\t\tthis.chartID = Math.floor((1 + Math.random()) * 0x1000000000000).toString(16)\n\t}\n\n\taddMainContainer() {\n\t\tconst options = this.model.getOptions()\n\t\tconst chartsprefix = getProperty(options, 'style', 'prefix')\n\n\t\tconst mainContainer = select(this.getHolder())\n\t\t\t.append('div')\n\t\t\t.classed(`${carbonPrefix}--${chartsprefix}--chart-wrapper`, true)\n\t\t\t.attr('id', `chart-${this.getChartID()}`)\n\t\t\t.style('height', '100%')\n\t\t\t.style('width', '100%')\n\n\t\tmainContainer.append('g').attr('class', CSS_VERIFIER_ELEMENT_CLASSNAME)\n\n\t\tthis.mainContainer = mainContainer.node()\n\t}\n\n\tupdate() {\n\t\tthis.styleHolderElement()\n\t}\n\n\tstyleHolderElement() {\n\t\tconst holderElement = this.getHolder() as HTMLElement\n\n\t\t// In order for resize events to not clash with these updates\n\t\t// We'll check if the width & height values passed in options\n\t\t// Have changed, before setting them to the holder\n\t\tconst { width, height, theme } = this.model.getOptions()\n\t\tif (width !== this.width) {\n\t\t\t// Apply formatted width attribute to chart\n\t\t\tholderElement.style.width = width\n\n\t\t\tthis.width = width\n\t\t}\n\n\t\tif (height !== this.height) {\n\t\t\t// Apply formatted width attribute to chart\n\t\t\tholderElement.style.height = height\n\n\t\t\tthis.height = height\n\t\t}\n\n\t\t// Add class to chart holder\n\t\tselect(this.getHolder())\n\t\t\t.classed(`${carbonPrefix}--chart-holder`, true)\n\t\t\t.attr('data-carbon-theme', theme)\n\t}\n\n\tgetHolder() {\n\t\treturn this.model.get('holder')\n\t}\n\n\texportToJPG() {\n\t\tconst self = this\n\t\tconst options = this.model.getOptions()\n\n\t\tconst holder = this.getHolder()\n\t\tconst holderSelection = select(holder)\n\t\tholderSelection.classed('filled', true)\n\n\t\ttoJpeg(this.getMainContainer(), {\n\t\t\tquality: 1,\n\t\t\t// Remove toolbar\n\t\t\tfilter: (node: any) => {\n\t\t\t\tif (node.classList && node.classList.contains('cds--cc--toolbar')) {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\n\t\t\t\treturn true\n\t\t\t}\n\t\t}).then(function (dataUrl: string) {\n\t\t\tlet fileName = 'myChart'\n\t\t\tconst customFilename = getProperty(options, 'fileDownload', 'fileName')\n\n\t\t\tif (typeof customFilename === 'function') {\n\t\t\t\tfileName = customFilename('jpg')\n\t\t\t} else if (typeof customFilename === 'string') {\n\t\t\t\tfileName = customFilename\n\t\t\t}\n\n\t\t\tself.services.files?.downloadImage(dataUrl, `${fileName}.jpg`)\n\n\t\t\tholderSelection.classed('filled', false)\n\t\t})\n\t}\n\n\texportToPNG() {\n\t\tconst self = this\n\t\tconst options = this.model.getOptions()\n\n\t\tconst holder = this.getHolder()\n\t\tconst holderSelection = select(holder)\n\t\tholderSelection.classed('filled', true)\n\n\t\ttoPng(this.getMainContainer(), {\n\t\t\tquality: 1,\n\t\t\t// Remove toolbar\n\t\t\tfilter: (node: HTMLElement) => {\n\t\t\t\tif (node.classList && node.classList.contains('cds--cc--toolbar')) {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\n\t\t\t\treturn true\n\t\t\t}\n\t\t})\n\t\t\t.then(function (dataUrl: string) {\n\t\t\t\tlet fileName = 'myChart'\n\t\t\t\tconst customFilename = getProperty(options, 'fileDownload', 'fileName')\n\n\t\t\t\tif (typeof customFilename === 'function') {\n\t\t\t\t\tfileName = customFilename('png')\n\t\t\t\t} else if (typeof customFilename === 'string') {\n\t\t\t\t\tfileName = customFilename\n\t\t\t\t}\n\n\t\t\t\tself.services.files?.downloadImage(dataUrl, `${fileName}.png`)\n\n\t\t\t\tholderSelection.classed('filled', false)\n\t\t\t})\n\t\t\t.catch(function (error: Error) {\n\t\t\t\tconsole.error('oops, something went wrong!', error)\n\t\t\t})\n\t}\n\n\tisFullScreenMode() {\n\t\treturn select(this.getHolder()).classed('fullscreen')\n\t}\n\n\ttoggleFullscreen() {\n\t\tconst holder = this.getHolder()\n\t\tconst holderSelection = select(holder)\n\n\t\tconst isFullScreen = holderSelection.classed('fullscreen')\n\n\t\tif (\n\t\t\tisFullScreen &&\n\t\t\t(document.fullscreenElement ||\n\t\t\t\tdocument['webkitFullscreenElement'] ||\n\t\t\t\tdocument['mozFullScreenElement'] ||\n\t\t\t\tdocument['msFullscreenElement'])\n\t\t) {\n\t\t\t// Call the correct function depending on the browser\n\t\t\tif (document.exitFullscreen) {\n\t\t\t\tdocument.exitFullscreen()\n\t\t\t} else if (document['webkitExitFullscreen']) {\n\t\t\t\tdocument['webkitExitFullscreen']()\n\t\t\t} else if (document['mozCancelFullScreen']) {\n\t\t\t\tdocument['mozCancelFullScreen']()\n\t\t\t} else if (document['msExitFullscreen']) {\n\t\t\t\tdocument['msExitFullscreen']()\n\t\t\t}\n\t\t} else {\n\t\t\t// Call the correct function depending on the browser\n\t\t\tif (holder.requestFullscreen) {\n\t\t\t\tholder.requestFullscreen()\n\t\t\t} else if (holder.webkitRequestFullscreen) {\n\t\t\t\tholder.webkitRequestFullscreen()\n\t\t\t} else if (holder.mozRequestFullScreen) {\n\t\t\t\tholder.mozRequestFullScreen()\n\t\t\t} else if (holder.msRequestFullscreen) {\n\t\t\t\tholder.msRequestFullscreen()\n\t\t\t}\n\t\t}\n\t}\n\n\thandleFullscreenChange() {\n\t\tdocument.addEventListener('fullscreenchange', () => {\n\t\t\tconst holderSelection = select(this.getHolder())\n\t\t\tconst isFullScreen = holderSelection.classed('fullscreen')\n\n\t\t\t// Toggle the `fullscreen` classname\n\t\t\tholderSelection.classed('fullscreen', !isFullScreen)\n\t\t})\n\t}\n\n\tsetSVGMaxHeight() {\n\t\t// if there is a set height on the holder, leave the chart svg height at 100%\n\t\tif (!this.model.getOptions().height) {\n\t\t\tconst { height: chartHeight } = DOMUtils.getSVGElementSize(\n\t\t\t\tselect(this.mainContainer) as any,\n\t\t\t\t{\n\t\t\t\t\tuseBBox: true\n\t\t\t\t}\n\t\t\t)\n\t\t\tconst chartSVGSelector = select(this.mainContainer).attr('class')\n\t\t\tconst children = select(this.mainContainer).selectAll(`.${chartSVGSelector} > svg`)\n\n\t\t\t// get the height of the children SVGs (spacers, titles, etc)\n\t\t\tlet childrenHeight = 0\n\t\t\tchildren.nodes().forEach(function (childSVG) {\n\t\t\t\tchildrenHeight += Number(\n\t\t\t\t\tDOMUtils.getSVGElementSize(select(childSVG as any), {\n\t\t\t\t\t\tuseBBox: true\n\t\t\t\t\t}).height\n\t\t\t\t)\n\t\t\t})\n\n\t\t\t// set the chart svg height to the children height\n\t\t\t// forcing the chart not to take up any more space than it requires\n\t\t\tchildrenHeight <= chartHeight\n\t\t\t\t? select(this.mainContainer).attr('height', childrenHeight)\n\t\t\t\t: select(this.mainContainer).attr('height', '100%')\n\t\t}\n\t}\n\n\tgetMainContainer() {\n\t\treturn this.mainContainer\n\t}\n\n\taddHolderListeners() {\n\t\tconst holder = this.getHolder()\n\n\t\tif (!holder) {\n\t\t\treturn\n\t\t}\n\n\t\tselect(holder)\n\t\t\t.on('mouseover', () => {\n\t\t\t\t// Dispatch event\n\t\t\t\tthis.services.events?.dispatchEvent(Events.Chart.MOUSEOVER)\n\t\t\t})\n\t\t\t.on('mouseout', () => {\n\t\t\t\t// Dispatch event\n\t\t\t\tthis.services.events?.dispatchEvent(Events.Chart.MOUSEOUT)\n\t\t\t})\n\t}\n\n\taddResizeListener() {\n\t\tconst holder = this.getHolder()\n\n\t\tif (!holder) {\n\t\t\treturn\n\t\t}\n\n\t\t// Grab current dimensions of the chart holder\n\t\tlet containerWidth = holder.clientWidth\n\t\tlet containerHeight = holder.clientHeight\n\n\t\t// The resize callback function\n\t\tconst resizeCallback = debounce(() => {\n\t\t\tif (!holder) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\tMath.abs(containerWidth - holder.clientWidth) > 1 ||\n\t\t\t\tMath.abs(containerHeight - holder.clientHeight) > 1\n\t\t\t) {\n\t\t\t\tcontainerWidth = holder.clientWidth\n\t\t\t\tcontainerHeight = holder.clientHeight\n\n\t\t\t\tthis.services.events?.dispatchEvent(Events.Chart.RESIZE)\n\t\t\t}\n\t\t}, 12.5)\n\n\t\t// Observe the behaviour of resizing on the holder\n\t\tconst resizeObserver = new ResizeObserver(resizeCallback)\n\t\tresizeObserver.observe(holder)\n\t}\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;","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","export enum Roles {\n\tGRAPHICS_DOCUMENT = 'graphics-document',\n\tGRAPHICS_OBJECT = 'graphics-object',\n\tGRAPHICS_SYMBOL = 'graphics-symbol',\n\tGROUP = 'group',\n\tDOCUMENT = 'document',\n\tCHECKBOX = 'checkbox',\n\tBUTTON = 'button',\n\tMENU = 'menu',\n\tMENU_ITEM = 'menuitem',\n\tIMG = 'img'\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 { select } from 'd3'\nimport { Service } from './service'\nimport { Events } from '@/interfaces/enums'\nimport { canvasZoomSettings } from '@/configuration'\nimport { DOMUtils } from '@/services/essentials/dom-utils'\n\nexport class CanvasZoom extends Service {\n\tprotected model: any\n\n\t/**\n\t * focal: object to zoom into\n\t * canvasElements: all the elements to translate and zoom on the chart area\n\t * zoomSettings: object containing duration, easing and zoomlevel for the zoom behaviours\n\t * */\n\tzoomIn(focal: any, canvasElements: any, zoomSettings?: any) {\n\t\tlet x: number\n\t\tlet y: number\n\t\tlet zoomLevel: number\n\t\tconst settings = zoomSettings ? zoomSettings : canvasZoomSettings\n\n\t\tif (focal) {\n\t\t\tx = focal.x\n\t\t\ty = focal.y\n\t\t\tzoomLevel = 2\n\t\t}\n\n\t\t// the 'viewport' size of the chart\n\t\tconst { width, height } = DOMUtils.getSVGElementSize(this.services.domUtils.getHolder(), {\n\t\t\tuseClientDimensions: true\n\t\t})\n\n\t\tcanvasElements\n\t\t\t.transition()\n\t\t\t.duration(settings.duration)\n\t\t\t.ease(settings.ease)\n\t\t\t.attr(\n\t\t\t\t'transform',\n\t\t\t\t`translate(${width / 2}, ${height / 2}) scale(${zoomLevel}) translate(${-x},${-y})`\n\t\t\t)\n\n\t\t// Dispatch canvas zoom in event\n\t\tthis.services.events.dispatchEvent(Events.CanvasZoom.CANVAS_ZOOM_IN, {\n\t\t\telement: select(focal)\n\t\t})\n\t}\n\n\tzoomOut(canvasElements: any, zoomSettings?: any) {\n\t\tconst settings = zoomSettings ? zoomSettings : canvasZoomSettings\n\t\tcanvasElements\n\t\t\t.transition()\n\t\t\t.duration(settings.duration)\n\t\t\t.ease(settings.ease)\n\t\t\t.attr('transform', '')\n\n\t\t// Dispatch canvas zoom out event\n\t\tthis.services.events.dispatchEvent(Events.CanvasZoom.CANVAS_ZOOM_OUT)\n\t}\n}\n","import { Service } from '@/services/service'\n\nexport class Events extends Service {\n\t// DOM Event target\n\tdocumentFragment: DocumentFragment\n\n\tinit() {\n\t\t// Setup the event fragment on the DOM\n\t\tthis.documentFragment = document.createDocumentFragment()\n\t}\n\n\taddEventListener(type: string, listener: EventListenerOrEventListenerObject) {\n\t\tthis.documentFragment.addEventListener(type, listener)\n\t}\n\n\tremoveEventListener(type: string, listener: EventListenerOrEventListenerObject) {\n\t\tthis.documentFragment.removeEventListener(type, listener)\n\t}\n\n\tdispatchEvent(eventType: string, eventDetail?: object) {\n\t\tlet newEvent: any\n\t\tif (eventDetail) {\n\t\t\tnewEvent = new CustomEvent(eventType, {\n\t\t\t\tdetail: eventDetail\n\t\t\t})\n\t\t} else {\n\t\t\tnewEvent = document.createEvent('Event')\n\t\t\tnewEvent.initEvent(eventType, false, true)\n\t\t}\n\n\t\tthis.documentFragment.dispatchEvent(newEvent)\n\t}\n}\n","import { Service } from '@/services/service'\nimport { ChartModel } from '@/model/model'\n\nexport class Files extends Service {\n\tconstructor(model: ChartModel, services: any) {\n\t\tsuper(model, services)\n\t}\n\n\tdownloadCSV(content: any, filename: string) {\n\t\tconst anchor = document.createElement('a')\n\t\tconst mimeType = 'text/csv;encoding:utf-8'\n\n\t\tif (navigator['msSaveBlob']) {\n\t\t\t// Internet Explorer 10\n\t\t\tnavigator['msSaveBlob'](\n\t\t\t\tnew Blob([content], {\n\t\t\t\t\ttype: mimeType\n\t\t\t\t}),\n\t\t\t\tfilename\n\t\t\t)\n\t\t} else if (URL && 'download' in anchor) {\n\t\t\t// HTML5\n\t\t\tconst href = URL.createObjectURL(\n\t\t\t\tnew Blob([content], {\n\t\t\t\t\ttype: mimeType\n\t\t\t\t})\n\t\t\t)\n\t\t\tanchor.href = href\n\t\t\tanchor.setAttribute('download', filename)\n\n\t\t\t// Add anchor to body\n\t\t\tdocument.body.appendChild(anchor)\n\n\t\t\t// Click anchor\n\t\t\tanchor.click()\n\n\t\t\t// Remove anchor from body\n\t\t\tdocument.body.removeChild(anchor)\n\t\t\tURL.revokeObjectURL(href)\n\t\t} else {\n\t\t\tlocation.href = `data:application/octet-stream,${encodeURIComponent(content)}`\n\t\t}\n\t}\n\n\tdownloadImage(uri: string, name: string) {\n\t\tconst link = document.createElement('a')\n\t\tlink.download = name\n\t\tlink.href = uri\n\t\tdocument.body.appendChild(link)\n\t\tlink.click()\n\t\tdocument.body.removeChild(link)\n\t}\n}\n","import { Service } from '@/services/service'\n\nexport class GradientUtils extends Service {\n\tstatic appendOrUpdateLinearGradient(configs: any) {\n\t\tlet lg = configs.svg.select(`defs linearGradient#${configs.id}`)\n\t\tif (lg.empty()) {\n\t\t\tlg = configs.svg\n\t\t\t\t.append('defs')\n\t\t\t\t.append('linearGradient')\n\t\t\t\t.attr('id', configs.id)\n\t\t\t\t.attr('x1', configs.x1)\n\t\t\t\t.attr('x2', configs.x2)\n\t\t\t\t.attr('y1', configs.y1)\n\t\t\t\t.attr('y2', configs.y2)\n\t\t}\n\n\t\tlg.selectAll('stop').remove()\n\t\tlg.selectAll('stop')\n\t\t\t.data(configs.stops)\n\t\t\t.enter()\n\t\t\t.append('stop')\n\t\t\t.attr('offset', (d: any) => d.offset)\n\t\t\t.style('stop-color', (d: any) => d.color)\n\t\t\t.style('stop-opacity', (d: any) => d.opacity)\n\t}\n\n\tstatic getOffsetRatio(domain: any) {\n\t\tconst offsetRatio =\n\t\t\t((Math.abs(domain[1]) * 100) / Math.abs(domain[0] - domain[1])).toFixed(2) + '%'\n\t\treturn offsetRatio\n\t}\n\n\tstatic getStops(domain: any, color: string) {\n\t\tconst need3Stops = domain[0] < 0 && domain[1] > 0\n\t\tlet stops: object[] = [\n\t\t\t{\n\t\t\t\toffset: '0%',\n\t\t\t\tcolor: color,\n\t\t\t\topacity: '0.6'\n\t\t\t},\n\t\t\t{\n\t\t\t\toffset: '80%',\n\t\t\t\tcolor: color,\n\t\t\t\topacity: '0'\n\t\t\t}\n\t\t]\n\n\t\tif (need3Stops) {\n\t\t\tstops = [\n\t\t\t\t{\n\t\t\t\t\toffset: '0%',\n\t\t\t\t\tcolor: color,\n\t\t\t\t\topacity: '0.6'\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\toffset: GradientUtils.getOffsetRatio(domain),\n\t\t\t\t\tcolor: color,\n\t\t\t\t\topacity: '0'\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\toffset: '100%',\n\t\t\t\t\tcolor: color,\n\t\t\t\t\topacity: '0.6'\n\t\t\t\t}\n\t\t\t]\n\t\t}\n\t\treturn stops\n\t}\n}\n","import { getProperty } from '@/tools'\nimport { transitions as transitionConfigs } from '@/configuration'\nimport { Service } from '@/services/service'\nimport { Events } from '@/interfaces/enums'\nimport type { Transition } from 'd3'\n\nexport interface setupTransitionConfigs {\n\ttransition?: any // d3 types are causing issues here, hence why using `any`\n\tname?: string\n\tanimate?: boolean\n}\n\nexport class Transitions extends Service {\n\tpendingTransitions: Record> = {}\n\n\tinit() {\n\t\tthis.services.events?.addEventListener(Events.Model.UPDATE, () => {\n\t\t\tthis.pendingTransitions = {}\n\t\t})\n\t}\n\n\tsetupTransition({ transition: t, name, animate }: setupTransitionConfigs) {\n\t\tthis.pendingTransitions[t._id] = t\n\t\tt.on('end interrupt cancel', () => {\n\t\t\tdelete this.pendingTransitions[t._id]\n\t\t})\n\n\t\tif (this.model.getOptions().animations === false || animate === false) {\n\t\t\treturn t.duration(0)\n\t\t}\n\n\t\treturn t.duration(\n\t\t\tgetProperty(transitionConfigs, name, 'duration') || transitionConfigs.default.duration\n\t\t)\n\t}\n\n\tgetPendingTransitions() {\n\t\treturn this.pendingTransitions\n\t}\n}\n","import { getProperty } from '@/tools'\nimport { ChartModel } from '@/model/model'\nimport { ChartConfig } from '@/interfaces/model'\nimport { BaseChartOptions } from '@/interfaces/charts'\nimport {\n\tLayoutGrowth,\n\tLayoutAlignItems,\n\tLayoutDirection,\n\tLegendOrientations,\n\tEvents as ChartEvents,\n\tRenderTypes\n} from '@/interfaces/enums'\nimport type { Component } from '@/components/component'\nimport { Toolbar } from '@/components/axes/toolbar'\nimport { LayoutComponent } from '@/components/layout'\nimport { Spacer } from '@/components/layout/spacer'\nimport { Modal } from '@/components/essentials/modal'\nimport { Title } from '@/components/essentials/title'\nimport { Legend } from '@/components/essentials/legend'\nimport { CanvasChartClip } from '@/components/essentials/canvas-chart-clip'\nimport { Tooltip } from '@/components/essentials/tooltip'\nimport { CanvasZoom } from '@/services/canvas-zoom'\nimport { DOMUtils } from '@/services/essentials/dom-utils'\nimport { Events } from '@/services/essentials/events'\nimport { Files } from '@/services/essentials/files'\nimport { GradientUtils } from '@/services/essentials/gradient-utils'\nimport { Transitions } from '@/services/essentials/transitions'\n\nexport class Chart {\n\tcomponents: Component[] = []\n\tservices: any = {\n\t\tcanvasZoom: CanvasZoom,\n\t\tdomUtils: DOMUtils,\n\t\tevents: Events,\n\t\tfiles: Files,\n\t\tgradientUtils: GradientUtils,\n\t\ttransitions: Transitions\n\t}\n\tmodel: ChartModel = new ChartModel(this.services)\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\tconstructor(holder: HTMLDivElement, chartConfigs: ChartConfig) {\n\t\t// Allow for subclasses to override the constructor with additional parameters or initialization logic without breaking the API contract of the Chart class\n\t}\n\n\t// Contains the code that uses properties that are overridable by the super-class\n\tinit(holder: HTMLDivElement, chartConfigs: ChartConfig) {\n\t\t// Store the holder in the model\n\t\tthis.model.set({ holder }, { skipUpdate: true })\n\n\t\t// Initialize all services\n\t\tObject.keys(this.services).forEach(serviceName => {\n\t\t\tconst serviceObj = this.services[serviceName]\n\t\t\tthis.services[serviceName] = new serviceObj(this.model, this.services)\n\t\t})\n\n\t\t// Call update() when model has been updated\n\t\tthis.services.events.addEventListener(ChartEvents.Model.UPDATE, (e: CustomEvent) => {\n\t\t\tconst animate = !!getProperty(e, 'detail', 'animate')\n\t\t\tthis.update(animate)\n\t\t})\n\n\t\t// Set model data & options\n\t\tthis.model.setData(chartConfigs.data)\n\n\t\t// Set chart resize event listener\n\t\tthis.services.events.addEventListener(ChartEvents.Chart.RESIZE, () => {\n\t\t\tthis.update(false)\n\t\t})\n\n\t\tthis.components = this.getComponents()\n\n\t\tthis.update()\n\t}\n\n\t/**\n\t * Retrieves the components to be rendered inside the graph frame.\n\t *\n\t * @returns {Component[]} An array of components to be rendered.\n\t */\n\tgetComponents(): Component[] {\n\t\tconsole.error('getComponents() method is not implemented')\n\n\t\treturn []\n\t}\n\n\tupdate(animate = true) {\n\t\t// Called 4 times whenever a chart is displayed\n\t\tif (!this.components) {\n\t\t\treturn\n\t\t}\n\n\t\t// Update all services\n\t\tObject.keys(this.services).forEach((serviceName: string) => {\n\t\t\tconst serviceObj = this.services[serviceName]\n\t\t\tserviceObj.update()\n\t\t})\n\n\t\t// Render all components\n\t\tthis.components.forEach(component => component.render(animate))\n\n\t\t// Asynchronously dispatch a \"render-finished\" event\n\t\t// This is needed because of d3-transitions\n\t\t// Since at the start of the transition\n\t\t// Elements do not hold their final size or position\n\t\tconst pendingTransitions = this.services.transitions.getPendingTransitions()\n\t\tconst promises = Object.keys(pendingTransitions).map(transitionID => {\n\t\t\tconst transition = pendingTransitions[transitionID]\n\t\t\treturn transition.end().catch((e: any) => e) // Skip rejects since we don't care about those;\n\t\t})\n\n\t\tPromise.all(promises).then(() =>\n\t\t\tthis.services.events.dispatchEvent(ChartEvents.Chart.RENDER_FINISHED)\n\t\t)\n\t}\n\n\tdestroy() {\n\t\t// Call the destroy() method on all components\n\t\tthis.components.forEach(component => component.destroy())\n\n\t\t// Remove the chart holder\n\t\tthis.services.domUtils.getHolder().remove()\n\n\t\tthis.model.set({ destroyed: true }, { skipUpdate: true })\n\t}\n\n\tprotected getChartComponents(graphFrameComponents: any[], configs?: object) {\n\t\tconst options = this.model.getOptions()\n\n\t\tconst toolbarEnabled = getProperty(options, 'toolbar', 'enabled')\n\n\t\tconst legendComponent = {\n\t\t\tid: 'legend',\n\t\t\tcomponents: [new Legend(this.model, this.services)],\n\t\t\tgrowth: LayoutGrowth.PREFERRED\n\t\t}\n\n\t\t// if canvas zoom is enabled\n\t\tconst isZoomEnabled = getProperty(options, 'canvasZoom', 'enabled')\n\n\t\tif (isZoomEnabled && isZoomEnabled === true) {\n\t\t\tgraphFrameComponents.push(new CanvasChartClip(this.model, this.services))\n\t\t}\n\n\t\tconst titleAvailable = !!this.model.getOptions().title\n\t\tconst titleComponent = {\n\t\t\tid: 'title',\n\t\t\tcomponents: [new Title(this.model, this.services)],\n\t\t\tgrowth: LayoutGrowth.STRETCH\n\t\t}\n\n\t\tconst toolbarComponent = {\n\t\t\tid: 'toolbar',\n\t\t\tcomponents: [new Toolbar(this.model, this.services)],\n\t\t\tgrowth: LayoutGrowth.PREFERRED\n\t\t}\n\n\t\tconst headerComponent = {\n\t\t\tid: 'header',\n\t\t\tcomponents: [\n\t\t\t\tnew LayoutComponent(\n\t\t\t\t\tthis.model,\n\t\t\t\t\tthis.services,\n\t\t\t\t\t[\n\t\t\t\t\t\t// always add title to keep layout correct\n\t\t\t\t\t\ttitleComponent,\n\t\t\t\t\t\t...(toolbarEnabled ? [toolbarComponent] : [])\n\t\t\t\t\t],\n\t\t\t\t\t{\n\t\t\t\t\t\tdirection: LayoutDirection.ROW,\n\t\t\t\t\t\talignItems: LayoutAlignItems.CENTER\n\t\t\t\t\t}\n\t\t\t\t)\n\t\t\t],\n\t\t\tgrowth: LayoutGrowth.PREFERRED\n\t\t}\n\n\t\tconst graphFrameComponent = {\n\t\t\tid: 'graph-frame',\n\t\t\tcomponents: graphFrameComponents,\n\t\t\tgrowth: LayoutGrowth.STRETCH,\n\t\t\trenderType: getProperty(configs, 'graphFrameRenderType') || RenderTypes.SVG\n\t\t}\n\n\t\tconst isLegendEnabled =\n\t\t\tgetProperty(configs, 'excludeLegend') !== true && options.legend.enabled !== false\n\t\t// TODO: REUSE BETWEEN AXISCHART & CHART\n\t\t// Decide the position of the legend in reference to the chart\n\t\tlet fullFrameComponentDirection = LayoutDirection.COLUMN\n\t\tif (isLegendEnabled) {\n\t\t\tconst legendPosition = getProperty(options, 'legend', 'position')\n\t\t\tif (legendPosition === 'left') {\n\t\t\t\tfullFrameComponentDirection = LayoutDirection.ROW\n\n\t\t\t\tif (!options.legend.orientation) {\n\t\t\t\t\toptions.legend.orientation = LegendOrientations.VERTICAL\n\t\t\t\t}\n\t\t\t} else if (legendPosition === 'right') {\n\t\t\t\tfullFrameComponentDirection = LayoutDirection.ROW_REVERSE\n\n\t\t\t\tif (!options.legend.orientation) {\n\t\t\t\t\toptions.legend.orientation = LegendOrientations.VERTICAL\n\t\t\t\t}\n\t\t\t} else if (legendPosition === 'bottom') {\n\t\t\t\tfullFrameComponentDirection = LayoutDirection.COLUMN_REVERSE\n\t\t\t}\n\t\t}\n\n\t\tconst legendSpacerComponent = {\n\t\t\tid: 'spacer',\n\t\t\tcomponents: [new Spacer(this.model, this.services)],\n\t\t\tgrowth: LayoutGrowth.PREFERRED\n\t\t}\n\n\t\tconst fullFrameComponent = {\n\t\t\tid: 'full-frame',\n\t\t\tcomponents: [\n\t\t\t\tnew LayoutComponent(\n\t\t\t\t\tthis.model,\n\t\t\t\t\tthis.services,\n\t\t\t\t\t[\n\t\t\t\t\t\t...(isLegendEnabled ? [legendComponent] : []),\n\t\t\t\t\t\t...(isLegendEnabled ? [legendSpacerComponent] : []),\n\t\t\t\t\t\tgraphFrameComponent\n\t\t\t\t\t],\n\t\t\t\t\t{\n\t\t\t\t\t\tdirection: fullFrameComponentDirection\n\t\t\t\t\t}\n\t\t\t\t)\n\t\t\t],\n\t\t\tgrowth: LayoutGrowth.STRETCH\n\t\t}\n\n\t\t// Add chart title if it exists\n\t\tconst topLevelLayoutComponents: any[] = []\n\n\t\tif (titleAvailable || toolbarEnabled) {\n\t\t\ttopLevelLayoutComponents.push(headerComponent)\n\n\t\t\tconst titleSpacerComponent = {\n\t\t\t\tid: 'spacer',\n\t\t\t\tcomponents: [\n\t\t\t\t\tnew Spacer(this.model, this.services, toolbarEnabled ? { size: 15 } : undefined)\n\t\t\t\t],\n\t\t\t\tgrowth: LayoutGrowth.PREFERRED\n\t\t\t}\n\n\t\t\ttopLevelLayoutComponents.push(titleSpacerComponent)\n\t\t}\n\t\ttopLevelLayoutComponents.push(fullFrameComponent)\n\n\t\treturn [\n\t\t\tnew Tooltip(this.model, this.services),\n\t\t\tnew Modal(this.model, this.services),\n\t\t\tnew LayoutComponent(this.model, this.services, topLevelLayoutComponents, {\n\t\t\t\tdirection: LayoutDirection.COLUMN\n\t\t\t})\n\t\t]\n\t}\n}\n","import { cloneDeep, uniq } from 'lodash-es'\nimport { getProperty } from '@/tools'\nimport { ChartModel } from './model'\nimport { ScaleTypes, AxisPositions, AxisFlavor } from '@/interfaces/enums'\n\n/**\n * This supports adding X and Y Cartesian[2D] zoom data to a ChartModel\n * */\nexport class ChartModelCartesian extends ChartModel {\n\taxisFlavor = AxisFlavor.DEFAULT // can't be protected as it's used by two-dimensional-axes.ts\n\n\tconstructor(services: any) {\n\t\tsuper(services)\n\t}\n\n\t// get the scales information\n\t// needed for getTabularArray()\n\tprotected assignRangeAndDomains() {\n\t\tconst { cartesianScales } = this.services\n\t\tconst options = this.getOptions()\n\t\tconst isDualAxes = cartesianScales.isDualAxes()\n\n\t\tconst scales = {\n\t\t\tprimaryDomain: cartesianScales.domainAxisPosition,\n\t\t\tprimaryRange: cartesianScales.rangeAxisPosition,\n\t\t\tsecondaryDomain: null as any,\n\t\t\tsecondaryRange: null as any\n\t\t}\n\t\tif (isDualAxes) {\n\t\t\tscales.secondaryDomain = cartesianScales.secondaryDomainAxisPosition\n\t\t\tscales.secondaryRange = cartesianScales.secondaryRangeAxisPosition\n\t\t}\n\n\t\tObject.keys(scales).forEach(\n\t\t\t(scale: 'primaryDomain' | 'primaryRange' | 'secondaryDomain' | 'secondaryRange') => {\n\t\t\t\tconst position = scales[scale]\n\t\t\t\tif (cartesianScales.scales[position]) {\n\t\t\t\t\tscales[scale] = {\n\t\t\t\t\t\tposition: position,\n\t\t\t\t\t\tlabel: cartesianScales.getScaleLabel(position),\n\t\t\t\t\t\tidentifier: getProperty(options, 'axes', position, 'mapsTo')\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tscales[scale] = null\n\t\t\t\t}\n\t\t\t}\n\t\t)\n\n\t\treturn scales\n\t}\n\n\tgetTabularDataArray() {\n\t\tconst displayData = this.getDisplayData()\n\t\tconst options = this.getOptions()\n\t\tconst { groupMapsTo } = options.data\n\t\tconst { primaryDomain, primaryRange, secondaryDomain, secondaryRange } =\n\t\t\tthis.assignRangeAndDomains()\n\t\tconst { number: numberFormatter, code: localeCode } = getProperty(this.getOptions(), 'locale')\n\n\t\tconst headers = [\n\t\t\t'Group',\n\t\t\tprimaryDomain.label,\n\t\t\tprimaryRange.label,\n\t\t\t...(secondaryDomain ? [secondaryDomain.label] : []),\n\t\t\t...(secondaryRange ? [secondaryRange.label] : [])\n\t\t]\n\t\tconst cells = displayData.map((datum: any) => [\n\t\t\tdatum[groupMapsTo],\n\t\t\tdatum[primaryDomain.identifier] === null ? '–' : datum[primaryDomain.identifier],\n\t\t\tdatum[primaryRange.identifier] === null || isNaN(datum[primaryRange.identifier])\n\t\t\t\t? '–'\n\t\t\t\t: numberFormatter(datum[primaryRange.identifier], localeCode),\n\t\t\t...(secondaryDomain\n\t\t\t\t? [\n\t\t\t\t\t\tdatum[secondaryDomain.identifier] === null\n\t\t\t\t\t\t\t? '–'\n\t\t\t\t\t\t\t: datum[secondaryDomain.identifier]\n\t\t\t\t\t]\n\t\t\t\t: []),\n\t\t\t...(secondaryRange\n\t\t\t\t? [\n\t\t\t\t\t\tdatum[secondaryRange.identifier] === null || isNaN(datum[secondaryRange.identifier])\n\t\t\t\t\t\t\t? '–'\n\t\t\t\t\t\t\t: datum[secondaryRange.identifier]\n\t\t\t\t\t]\n\t\t\t\t: [])\n\t\t])\n\n\t\treturn super.formatTable({ headers, cells })\n\t}\n\n\tsetData(newData: any) {\n\t\tlet data: any\n\t\tif (newData) {\n\t\t\tdata = super.setData(newData)\n\t\t\tif (getProperty(this.getOptions(), 'zoomBar', AxisPositions.TOP, 'enabled')) {\n\t\t\t\t// get pre-defined zoom bar data\n\t\t\t\tconst definedZoomBarData = getProperty(\n\t\t\t\t\tthis.getOptions(),\n\t\t\t\t\t'zoomBar',\n\t\t\t\t\tAxisPositions.TOP,\n\t\t\t\t\t'data'\n\t\t\t\t)\n\t\t\t\t// if we have zoom bar data we need to update it as well\n\t\t\t\t// with pre-defined zoom bar data\n\t\t\t\tthis.setZoomBarData(definedZoomBarData)\n\t\t\t}\n\t\t}\n\n\t\treturn data\n\t}\n\n\t/**\n\t * Sets the zoom bar data for the current instance.\n\t *\n\t * This method sanitizes the provided zoom bar data or uses the display data if no explicit\n\t * zoom data is provided. It normalizes the zoom bar data by aggregating values based on unique\n\t * dates and updates the instance's state with the normalized data.\n\t *\n\t * @param {any} [newZoomBarData] - The new zoom bar data to be set. If not provided, the display data will be used.\n\t */\n\tsetZoomBarData(newZoomBarData?: any) {\n\t\tconst sanitizedData = newZoomBarData\n\t\t\t? this.sanitize(cloneDeep(newZoomBarData))\n\t\t\t: this.getDisplayData() // if we're not passed explicit zoom data use the model\n\n\t\tlet zoomBarNormalizedValues = sanitizedData\n\n\t\tconst { cartesianScales } = this.services\n\t\tif (sanitizedData && cartesianScales.domainAxisPosition && cartesianScales.rangeAxisPosition) {\n\t\t\tconst domainIdentifier = cartesianScales.getDomainIdentifier()\n\t\t\tconst rangeIdentifier = cartesianScales.getRangeIdentifier()\n\t\t\t// get all dates (Number) in displayData\n\t\t\tlet allDates = sanitizedData.map((datum: any) => datum[domainIdentifier].getTime())\n\t\t\tallDates = uniq(allDates).sort()\n\n\t\t\t// Go through all date values\n\t\t\t// And get corresponding data from each dataset\n\t\t\tzoomBarNormalizedValues = allDates.map((date: Date) => {\n\t\t\t\tlet sum = 0\n\t\t\t\tconst datum: any = {}\n\n\t\t\t\tsanitizedData.forEach((data: any) => {\n\t\t\t\t\tif (data[domainIdentifier].getTime() === date) {\n\t\t\t\t\t\tsum += data[rangeIdentifier]\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t\tdatum[domainIdentifier] = new Date(date)\n\t\t\t\tdatum[rangeIdentifier] = sum\n\n\t\t\t\treturn datum\n\t\t\t})\n\t\t}\n\n\t\tthis.set({ zoomBarData: zoomBarNormalizedValues })\n\t}\n\n\tgetZoomBarData() {\n\t\treturn this.get('zoomBarData')\n\t}\n\n\tprotected sanitizeDateValues(data: any) {\n\t\tconst options = this.getOptions()\n\n\t\tif (!options.axes) {\n\t\t\treturn data\n\t\t}\n\n\t\tconst keysToCheck: any[] = []\n\t\tObject.keys(AxisPositions).forEach((axisPositionKey: keyof typeof AxisPositions) => {\n\t\t\tconst axisPosition = AxisPositions[axisPositionKey]\n\t\t\tconst axisOptions = options.axes[axisPosition]\n\n\t\t\tif (axisOptions && axisOptions.scaleType === ScaleTypes.TIME) {\n\t\t\t\tconst axisMapsTo = axisOptions.mapsTo\n\n\t\t\t\tif (axisMapsTo !== null || axisMapsTo !== undefined) {\n\t\t\t\t\tkeysToCheck.push(axisMapsTo)\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\n\t\tif (keysToCheck.length > 0) {\n\t\t\t// Check all datapoints and sanitize dates\n\t\t\tdata.forEach((datum: any) => {\n\t\t\t\tkeysToCheck.forEach((key: any) => {\n\t\t\t\t\tif (getProperty(datum, key, 'getTime') === null) {\n\t\t\t\t\t\tdatum[key] = new Date(datum[key])\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t})\n\t\t}\n\n\t\treturn data\n\t}\n\n\tprotected sanitize(data: any) {\n\t\tdata = super.sanitize(data)\n\t\tdata = this.sanitizeDateValues(data)\n\n\t\treturn data\n\t}\n}\n","// Internal Imports\nimport { ChartModelCartesian } from './cartesian-charts'\nimport { getProperty } from '@/tools'\n/**\n * Alluvial chart model layer\n */\nexport class AlluvialChartModel extends ChartModelCartesian {\n\tconstructor(services: any) {\n\t\tsuper(services)\n\t}\n\n\tgetTabularDataArray() {\n\t\tconst displayData = this.getDisplayData()\n\t\tconst { number: numberFormatter, code: localeCode } = getProperty(this.getOptions(), 'locale')\n\n\t\t// Sort array by source to get a close depiction of the alluvial chart\n\t\tdisplayData.sort((a: any, b: any) => a['source'].localeCompare(b['source']))\n\t\tconst headers = ['Source', 'Target', 'Value']\n\t\tconst cells = [\n\t\t\t...displayData.map((datum: any) => [\n\t\t\t\tdatum['source'],\n\t\t\t\tdatum['target'],\n\t\t\t\tdatum['value'] === null ? '–' : numberFormatter(datum['value'], localeCode)\n\t\t\t])\n\t\t]\n\n\t\treturn super.formatTable({ headers, cells })\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 { Chart } from '@/chart'\nimport { AlluvialChartModel } from '@/model/alluvial'\nimport { options } from '@/configuration'\nimport type { ChartConfig } from '@/interfaces/model'\nimport type { AlluvialChartOptions } from '@/interfaces/charts'\nimport { mergeDefaultChartOptions } from '@/tools'\nimport { Alluvial } from '@/components/graphs/alluvial'\nimport type { Component } from '@/components/component'\n\nexport class AlluvialChart extends Chart {\n\tmodel = new AlluvialChartModel(this.services)\n\n\tconstructor(holder: HTMLDivElement, chartConfigs: ChartConfig) {\n\t\tsuper(holder, chartConfigs)\n\n\t\t// Merge the default options for this chart\n\t\t// With the user provided options\n\t\tthis.model.setOptions(mergeDefaultChartOptions(options.alluvialChart, chartConfigs.options))\n\n\t\t// Initialize data, services, components etc.\n\t\tthis.init(holder, chartConfigs)\n\t}\n\n\t/**\n\t * Retrieves the components to be rendered inside the graph frame.\n\t *\n\t * @returns {Component[]} An array of components to be rendered.\n\t */\n\tgetComponents() {\n\t\tconst graphFrameComponents: Component[] = [new Alluvial(this.model, this.services)]\n\n\t\tconst components: Component[] = this.getChartComponents(graphFrameComponents, {\n\t\t\texcludeLegend: true\n\t\t})\n\t\treturn components\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","import { toDate } from \"./toDate.mjs\";\n\n/**\n * @name compareAsc\n * @category Common Helpers\n * @summary Compare the two dates and return -1, 0 or 1.\n *\n * @description\n * Compare the two dates and return 1 if the first date is after the second,\n * -1 if the first date is before the second or 0 if dates are equal.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param dateLeft - The first date to compare\n * @param dateRight - The second date to compare\n *\n * @returns The result of the comparison\n *\n * @example\n * // Compare 11 February 1987 and 10 July 1989:\n * const result = compareAsc(new Date(1987, 1, 11), new Date(1989, 6, 10))\n * //=> -1\n *\n * @example\n * // Sort the array of dates:\n * const result = [\n * new Date(1995, 6, 2),\n * new Date(1987, 1, 11),\n * new Date(1989, 6, 10)\n * ].sort(compareAsc)\n * //=> [\n * // Wed Feb 11 1987 00:00:00,\n * // Mon Jul 10 1989 00:00:00,\n * // Sun Jul 02 1995 00:00:00\n * // ]\n */\nexport function compareAsc(dateLeft, dateRight) {\n const _dateLeft = toDate(dateLeft);\n const _dateRight = toDate(dateRight);\n\n const diff = _dateLeft.getTime() - _dateRight.getTime();\n\n if (diff < 0) {\n return -1;\n } else if (diff > 0) {\n return 1;\n // Return 0 if diff is 0; return NaN if diff is NaN\n } else {\n return diff;\n }\n}\n\n// Fallback for modularized imports:\nexport default compareAsc;\n","import { toDate } from \"./toDate.mjs\";\n\n/**\n * @name differenceInCalendarYears\n * @category Year Helpers\n * @summary Get the number of calendar years between the given dates.\n *\n * @description\n * Get the number of calendar years between the given dates.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param dateLeft - The later date\n * @param dateRight - The earlier date\n\n * @returns The number of calendar years\n *\n * @example\n * // How many calendar years are between 31 December 2013 and 11 February 2015?\n * const result = differenceInCalendarYears(\n * new Date(2015, 1, 11),\n * new Date(2013, 11, 31)\n * )\n * //=> 2\n */\nexport function differenceInCalendarYears(dateLeft, dateRight) {\n const _dateLeft = toDate(dateLeft);\n const _dateRight = toDate(dateRight);\n\n return _dateLeft.getFullYear() - _dateRight.getFullYear();\n}\n\n// Fallback for modularized imports:\nexport default differenceInCalendarYears;\n","import { compareAsc } from \"./compareAsc.mjs\";\nimport { differenceInCalendarYears } from \"./differenceInCalendarYears.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n/**\n * @name differenceInYears\n * @category Year Helpers\n * @summary Get the number of full years between the given dates.\n *\n * @description\n * Get the number of full years between the given dates.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param dateLeft - The later date\n * @param dateRight - The earlier date\n *\n * @returns The number of full years\n *\n * @example\n * // How many full years are between 31 December 2013 and 11 February 2015?\n * const result = differenceInYears(new Date(2015, 1, 11), new Date(2013, 11, 31))\n * //=> 1\n */\nexport function differenceInYears(dateLeft, dateRight) {\n const _dateLeft = toDate(dateLeft);\n const _dateRight = toDate(dateRight);\n\n const sign = compareAsc(_dateLeft, _dateRight);\n const difference = Math.abs(differenceInCalendarYears(_dateLeft, _dateRight));\n\n // Set both dates to a valid leap year for accurate comparison when dealing\n // with leap days\n _dateLeft.setFullYear(1584);\n _dateRight.setFullYear(1584);\n\n // Math.abs(diff in full years - diff in calendar years) === 1 if last calendar year is not full\n // If so, result must be decreased by 1 in absolute value\n const isLastYearNotFull = compareAsc(_dateLeft, _dateRight) === -sign;\n const result = sign * (difference - +isLastYearNotFull);\n\n // Prevent negative zero\n return result === 0 ? 0 : result;\n}\n\n// Fallback for modularized imports:\nexport default differenceInYears;\n","import { toDate } from \"./toDate.mjs\";\nimport { constructFrom } from \"./constructFrom.mjs\";\n\n/**\n * @name addMonths\n * @category Month Helpers\n * @summary Add the specified number of months to the given date.\n *\n * @description\n * Add the specified number of months to the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The date to be changed\n * @param amount - The amount of months to be added.\n *\n * @returns The new date with the months added\n *\n * @example\n * // Add 5 months to 1 September 2014:\n * const result = addMonths(new Date(2014, 8, 1), 5)\n * //=> Sun Feb 01 2015 00:00:00\n *\n * // Add one month to 30 January 2023:\n * const result = addMonths(new Date(2023, 0, 30), 1)\n * //=> Tue Feb 28 2023 00:00:00\n */\nexport function addMonths(date, amount) {\n const _date = toDate(date);\n if (isNaN(amount)) return constructFrom(date, NaN);\n if (!amount) {\n // If 0 months, no-op to avoid changing times in the hour before end of DST\n return _date;\n }\n const dayOfMonth = _date.getDate();\n\n // The JS Date object supports date math by accepting out-of-bounds values for\n // month, day, etc. For example, new Date(2020, 0, 0) returns 31 Dec 2019 and\n // new Date(2020, 13, 1) returns 1 Feb 2021. This is *almost* the behavior we\n // want except that dates will wrap around the end of a month, meaning that\n // new Date(2020, 13, 31) will return 3 Mar 2021 not 28 Feb 2021 as desired. So\n // we'll default to the end of the desired month by adding 1 to the desired\n // month and using a date of 0 to back up one day to the end of the desired\n // month.\n const endOfDesiredMonth = constructFrom(date, _date.getTime());\n endOfDesiredMonth.setMonth(_date.getMonth() + amount + 1, 0);\n const daysInMonth = endOfDesiredMonth.getDate();\n if (dayOfMonth >= daysInMonth) {\n // If we're already at the end of the month, then this is the correct date\n // and we're done.\n return endOfDesiredMonth;\n } else {\n // Otherwise, we now know that setting the original day-of-month value won't\n // cause an overflow, so set the desired day-of-month. Note that we can't\n // just set the date of `endOfDesiredMonth` because that object may have had\n // its time changed in the unusual case where where a DST transition was on\n // the last day of the month and its local time was in the hour skipped or\n // repeated next to a DST transition. So we use `date` instead which is\n // guaranteed to still have the original time.\n _date.setFullYear(\n endOfDesiredMonth.getFullYear(),\n endOfDesiredMonth.getMonth(),\n dayOfMonth,\n );\n return _date;\n }\n}\n\n// Fallback for modularized imports:\nexport default addMonths;\n","import { addMonths } from \"./addMonths.mjs\";\n\n/**\n * @name addYears\n * @category Year Helpers\n * @summary Add the specified number of years to the given date.\n *\n * @description\n * Add the specified number of years to the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The date to be changed\n * @param amount - The amount of years to be added.\n *\n * @returns The new date with the years added\n *\n * @example\n * // Add 5 years to 1 September 2014:\n * const result = addYears(new Date(2014, 8, 1), 5)\n * //=> Sun Sep 01 2019 00:00:00\n */\nexport function addYears(date, amount) {\n return addMonths(date, amount * 12);\n}\n\n// Fallback for modularized imports:\nexport default addYears;\n","import { addYears } from \"./addYears.mjs\";\n\n/**\n * @name subYears\n * @category Year Helpers\n * @summary Subtract the specified number of years from the given date.\n *\n * @description\n * Subtract the specified number of years from the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The date to be changed\n * @param amount - The amount of years to be subtracted.\n *\n * @returns The new date with the years subtracted\n *\n * @example\n * // Subtract 5 years from 1 September 2014:\n * const result = subYears(new Date(2014, 8, 1), 5)\n * //=> Tue Sep 01 2009 00:00:00\n */\nexport function subYears(date, amount) {\n return addYears(date, -amount);\n}\n\n// Fallback for modularized imports:\nexport default subYears;\n","import { toDate } from \"./toDate.mjs\";\n\n/**\n * @name differenceInCalendarMonths\n * @category Month Helpers\n * @summary Get the number of calendar months between the given dates.\n *\n * @description\n * Get the number of calendar months between the given dates.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param dateLeft - The later date\n * @param dateRight - The earlier date\n *\n * @returns The number of calendar months\n *\n * @example\n * // How many calendar months are between 31 January 2014 and 1 September 2014?\n * const result = differenceInCalendarMonths(\n * new Date(2014, 8, 1),\n * new Date(2014, 0, 31)\n * )\n * //=> 8\n */\nexport function differenceInCalendarMonths(dateLeft, dateRight) {\n const _dateLeft = toDate(dateLeft);\n const _dateRight = toDate(dateRight);\n\n const yearDiff = _dateLeft.getFullYear() - _dateRight.getFullYear();\n const monthDiff = _dateLeft.getMonth() - _dateRight.getMonth();\n\n return yearDiff * 12 + monthDiff;\n}\n\n// Fallback for modularized imports:\nexport default differenceInCalendarMonths;\n","import { toDate } from \"./toDate.mjs\";\n\n/**\n * @name endOfDay\n * @category Day Helpers\n * @summary Return the end of a day for the given date.\n *\n * @description\n * Return the end of a day for the given date.\n * The result will be in the local timezone.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The original date\n *\n * @returns The end of a day\n *\n * @example\n * // The end of a day for 2 September 2014 11:55:00:\n * const result = endOfDay(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Tue Sep 02 2014 23:59:59.999\n */\nexport function endOfDay(date) {\n const _date = toDate(date);\n _date.setHours(23, 59, 59, 999);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default endOfDay;\n","import { toDate } from \"./toDate.mjs\";\n\n/**\n * @name endOfMonth\n * @category Month Helpers\n * @summary Return the end of a month for the given date.\n *\n * @description\n * Return the end of a month for the given date.\n * The result will be in the local timezone.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The original date\n *\n * @returns The end of a month\n *\n * @example\n * // The end of a month for 2 September 2014 11:55:00:\n * const result = endOfMonth(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Tue Sep 30 2014 23:59:59.999\n */\nexport function endOfMonth(date) {\n const _date = toDate(date);\n const month = _date.getMonth();\n _date.setFullYear(_date.getFullYear(), month + 1, 0);\n _date.setHours(23, 59, 59, 999);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default endOfMonth;\n","import { endOfDay } from \"./endOfDay.mjs\";\nimport { endOfMonth } from \"./endOfMonth.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n/**\n * @name isLastDayOfMonth\n * @category Month Helpers\n * @summary Is the given date the last day of a month?\n *\n * @description\n * Is the given date the last day of a month?\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The date to check\n\n * @returns The date is the last day of a month\n *\n * @example\n * // Is 28 February 2014 the last day of a month?\n * const result = isLastDayOfMonth(new Date(2014, 1, 28))\n * //=> true\n */\nexport function isLastDayOfMonth(date) {\n const _date = toDate(date);\n return +endOfDay(_date) === +endOfMonth(_date);\n}\n\n// Fallback for modularized imports:\nexport default isLastDayOfMonth;\n","import { compareAsc } from \"./compareAsc.mjs\";\nimport { differenceInCalendarMonths } from \"./differenceInCalendarMonths.mjs\";\nimport { isLastDayOfMonth } from \"./isLastDayOfMonth.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n/**\n * @name differenceInMonths\n * @category Month Helpers\n * @summary Get the number of full months between the given dates.\n *\n * @description\n * Get the number of full months between the given dates using trunc as a default rounding method.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param dateLeft - The later date\n * @param dateRight - The earlier date\n *\n * @returns The number of full months\n *\n * @example\n * // How many full months are between 31 January 2014 and 1 September 2014?\n * const result = differenceInMonths(new Date(2014, 8, 1), new Date(2014, 0, 31))\n * //=> 7\n */\nexport function differenceInMonths(dateLeft, dateRight) {\n const _dateLeft = toDate(dateLeft);\n const _dateRight = toDate(dateRight);\n\n const sign = compareAsc(_dateLeft, _dateRight);\n const difference = Math.abs(\n differenceInCalendarMonths(_dateLeft, _dateRight),\n );\n let result;\n\n // Check for the difference of less than month\n if (difference < 1) {\n result = 0;\n } else {\n if (_dateLeft.getMonth() === 1 && _dateLeft.getDate() > 27) {\n // This will check if the date is end of Feb and assign a higher end of month date\n // to compare it with Jan\n _dateLeft.setDate(30);\n }\n\n _dateLeft.setMonth(_dateLeft.getMonth() - sign * difference);\n\n // Math.abs(diff in full months - diff in calendar months) === 1 if last calendar month is not full\n // If so, result must be decreased by 1 in absolute value\n let isLastMonthNotFull = compareAsc(_dateLeft, _dateRight) === -sign;\n\n // Check for cases of one full calendar month\n if (\n isLastDayOfMonth(toDate(dateLeft)) &&\n difference === 1 &&\n compareAsc(dateLeft, _dateRight) === 1\n ) {\n isLastMonthNotFull = false;\n }\n\n result = sign * (difference - Number(isLastMonthNotFull));\n }\n\n // Prevent negative zero\n return result === 0 ? 0 : result;\n}\n\n// Fallback for modularized imports:\nexport default differenceInMonths;\n","import { addMonths } from \"./addMonths.mjs\";\n\n/**\n * @name subMonths\n * @category Month Helpers\n * @summary Subtract the specified number of months from the given date.\n *\n * @description\n * Subtract the specified number of months from the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The date to be changed\n * @param amount - The amount of months to be subtracted.\n *\n * @returns The new date with the months subtracted\n *\n * @example\n * // Subtract 5 months from 1 February 2015:\n * const result = subMonths(new Date(2015, 1, 1), 5)\n * //=> Mon Sep 01 2014 00:00:00\n */\nexport function subMonths(date, amount) {\n return addMonths(date, -amount);\n}\n\n// Fallback for modularized imports:\nexport default subMonths;\n","import { differenceInCalendarDays } from \"./differenceInCalendarDays.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n/**\n * @name differenceInDays\n * @category Day Helpers\n * @summary Get the number of full days between the given dates.\n *\n * @description\n * Get the number of full day periods between two dates. Fractional days are\n * truncated towards zero.\n *\n * One \"full day\" is the distance between a local time in one day to the same\n * local time on the next or previous day. A full day can sometimes be less than\n * or more than 24 hours if a daylight savings change happens between two dates.\n *\n * To ignore DST and only measure exact 24-hour periods, use this instead:\n * `Math.trunc(differenceInHours(dateLeft, dateRight)/24)|0`.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param dateLeft - The later date\n * @param dateRight - The earlier date\n *\n * @returns The number of full days according to the local timezone\n *\n * @example\n * // How many full days are between\n * // 2 July 2011 23:00:00 and 2 July 2012 00:00:00?\n * const result = differenceInDays(\n * new Date(2012, 6, 2, 0, 0),\n * new Date(2011, 6, 2, 23, 0)\n * )\n * //=> 365\n *\n * @example\n * // How many full days are between\n * // 2 July 2011 23:59:00 and 3 July 2011 00:01:00?\n * const result = differenceInDays(\n * new Date(2011, 6, 3, 0, 1),\n * new Date(2011, 6, 2, 23, 59)\n * )\n * //=> 0\n *\n * @example\n * // How many full days are between\n * // 1 March 2020 0:00 and 1 June 2020 0:00 ?\n * // Note: because local time is used, the\n * // result will always be 92 days, even in\n * // time zones where DST starts and the\n * // period has only 92*24-1 hours.\n * const result = differenceInDays(\n * new Date(2020, 5, 1),\n * new Date(2020, 2, 1)\n * )\n * //=> 92\n */\nexport function differenceInDays(dateLeft, dateRight) {\n const _dateLeft = toDate(dateLeft);\n const _dateRight = toDate(dateRight);\n\n const sign = compareLocalAsc(_dateLeft, _dateRight);\n const difference = Math.abs(differenceInCalendarDays(_dateLeft, _dateRight));\n\n _dateLeft.setDate(_dateLeft.getDate() - sign * difference);\n\n // Math.abs(diff in full days - diff in calendar days) === 1 if last calendar day is not full\n // If so, result must be decreased by 1 in absolute value\n const isLastDayNotFull = Number(\n compareLocalAsc(_dateLeft, _dateRight) === -sign,\n );\n const result = sign * (difference - isLastDayNotFull);\n // Prevent negative zero\n return result === 0 ? 0 : result;\n}\n\n// Like `compareAsc` but uses local time not UTC, which is needed\n// for accurate equality comparisons of UTC timestamps that end up\n// having the same representation in local time, e.g. one hour before\n// DST ends vs. the instant that DST ends.\nfunction compareLocalAsc(dateLeft, dateRight) {\n const diff =\n dateLeft.getFullYear() - dateRight.getFullYear() ||\n dateLeft.getMonth() - dateRight.getMonth() ||\n dateLeft.getDate() - dateRight.getDate() ||\n dateLeft.getHours() - dateRight.getHours() ||\n dateLeft.getMinutes() - dateRight.getMinutes() ||\n dateLeft.getSeconds() - dateRight.getSeconds() ||\n dateLeft.getMilliseconds() - dateRight.getMilliseconds();\n\n if (diff < 0) {\n return -1;\n } else if (diff > 0) {\n return 1;\n // Return 0 if diff is 0; return NaN if diff is NaN\n } else {\n return diff;\n }\n}\n\n// Fallback for modularized imports:\nexport default differenceInDays;\n","import { toDate } from \"./toDate.mjs\";\nimport { constructFrom } from \"./constructFrom.mjs\";\n\n/**\n * @name addDays\n * @category Day Helpers\n * @summary Add the specified number of days to the given date.\n *\n * @description\n * Add the specified number of days to the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The date to be changed\n * @param amount - The amount of days to be added.\n *\n * @returns The new date with the days added\n *\n * @example\n * // Add 10 days to 1 September 2014:\n * const result = addDays(new Date(2014, 8, 1), 10)\n * //=> Thu Sep 11 2014 00:00:00\n */\nexport function addDays(date, amount) {\n const _date = toDate(date);\n if (isNaN(amount)) return constructFrom(date, NaN);\n if (!amount) {\n // If 0 days, no-op to avoid changing times in the hour before end of DST\n return _date;\n }\n _date.setDate(_date.getDate() + amount);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default addDays;\n","import { addDays } from \"./addDays.mjs\";\n\n/**\n * @name subDays\n * @category Day Helpers\n * @summary Subtract the specified number of days from the given date.\n *\n * @description\n * Subtract the specified number of days from the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The date to be changed\n * @param amount - The amount of days to be subtracted.\n *\n * @returns The new date with the days subtracted\n *\n * @example\n * // Subtract 10 days from 1 September 2014:\n * const result = subDays(new Date(2014, 8, 1), 10)\n * //=> Fri Aug 22 2014 00:00:00\n */\nexport function subDays(date, amount) {\n return addDays(date, -amount);\n}\n\n// Fallback for modularized imports:\nexport default subDays;\n","export function getRoundingMethod(method) {\n return (number) => {\n const round = method ? Math[method] : Math.trunc;\n const result = round(number);\n // Prevent negative zero\n return result === 0 ? 0 : result;\n };\n}\n","import { toDate } from \"./toDate.mjs\";\n\n/**\n * @name differenceInMilliseconds\n * @category Millisecond Helpers\n * @summary Get the number of milliseconds between the given dates.\n *\n * @description\n * Get the number of milliseconds between the given dates.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param dateLeft - The later date\n * @param dateRight - The earlier date\n *\n * @returns The number of milliseconds\n *\n * @example\n * // How many milliseconds are between\n * // 2 July 2014 12:30:20.600 and 2 July 2014 12:30:21.700?\n * const result = differenceInMilliseconds(\n * new Date(2014, 6, 2, 12, 30, 21, 700),\n * new Date(2014, 6, 2, 12, 30, 20, 600)\n * )\n * //=> 1100\n */\nexport function differenceInMilliseconds(dateLeft, dateRight) {\n return +toDate(dateLeft) - +toDate(dateRight);\n}\n\n// Fallback for modularized imports:\nexport default differenceInMilliseconds;\n","import { getRoundingMethod } from \"./_lib/getRoundingMethod.mjs\";\nimport { millisecondsInHour } from \"./constants.mjs\";\nimport { differenceInMilliseconds } from \"./differenceInMilliseconds.mjs\";\n\n/**\n * The {@link differenceInHours} function options.\n */\n\n/**\n * @name differenceInHours\n * @category Hour Helpers\n * @summary Get the number of hours between the given dates.\n *\n * @description\n * Get the number of hours between the given dates.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param dateLeft - The later date\n * @param dateRight - The earlier date\n * @param options - An object with options.\n *\n * @returns The number of hours\n *\n * @example\n * // How many hours are between 2 July 2014 06:50:00 and 2 July 2014 19:00:00?\n * const result = differenceInHours(\n * new Date(2014, 6, 2, 19, 0),\n * new Date(2014, 6, 2, 6, 50)\n * )\n * //=> 12\n */\nexport function differenceInHours(dateLeft, dateRight, options) {\n const diff =\n differenceInMilliseconds(dateLeft, dateRight) / millisecondsInHour;\n return getRoundingMethod(options?.roundingMethod)(diff);\n}\n\n// Fallback for modularized imports:\nexport default differenceInHours;\n","import { toDate } from \"./toDate.mjs\";\nimport { constructFrom } from \"./constructFrom.mjs\";\n\n/**\n * @name addMilliseconds\n * @category Millisecond Helpers\n * @summary Add the specified number of milliseconds to the given date.\n *\n * @description\n * Add the specified number of milliseconds to the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The date to be changed\n * @param amount - The amount of milliseconds to be added.\n *\n * @returns The new date with the milliseconds added\n *\n * @example\n * // Add 750 milliseconds to 10 July 2014 12:45:30.000:\n * const result = addMilliseconds(new Date(2014, 6, 10, 12, 45, 30, 0), 750)\n * //=> Thu Jul 10 2014 12:45:30.750\n */\nexport function addMilliseconds(date, amount) {\n const timestamp = +toDate(date);\n return constructFrom(date, timestamp + amount);\n}\n\n// Fallback for modularized imports:\nexport default addMilliseconds;\n","import { addMilliseconds } from \"./addMilliseconds.mjs\";\nimport { millisecondsInHour } from \"./constants.mjs\";\n\n/**\n * @name addHours\n * @category Hour Helpers\n * @summary Add the specified number of hours to the given date.\n *\n * @description\n * Add the specified number of hours to the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The date to be changed\n * @param amount - The amount of hours to be added.\n *\n * @returns The new date with the hours added\n *\n * @example\n * // Add 2 hours to 10 July 2014 23:00:00:\n * const result = addHours(new Date(2014, 6, 10, 23, 0), 2)\n * //=> Fri Jul 11 2014 01:00:00\n */\nexport function addHours(date, amount) {\n return addMilliseconds(date, amount * millisecondsInHour);\n}\n\n// Fallback for modularized imports:\nexport default addHours;\n","import { addHours } from \"./addHours.mjs\";\n\n/**\n * @name subHours\n * @category Hour Helpers\n * @summary Subtract the specified number of hours from the given date.\n *\n * @description\n * Subtract the specified number of hours from the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The date to be changed\n * @param amount - The amount of hours to be subtracted.\n *\n * @returns The new date with the hours subtracted\n *\n * @example\n * // Subtract 2 hours from 11 July 2014 01:00:00:\n * const result = subHours(new Date(2014, 6, 11, 1, 0), 2)\n * //=> Thu Jul 10 2014 23:00:00\n */\nexport function subHours(date, amount) {\n return addHours(date, -amount);\n}\n\n// Fallback for modularized imports:\nexport default subHours;\n","import { getRoundingMethod } from \"./_lib/getRoundingMethod.mjs\";\nimport { millisecondsInMinute } from \"./constants.mjs\";\nimport { differenceInMilliseconds } from \"./differenceInMilliseconds.mjs\";\n\n/**\n * The {@link differenceInMinutes} function options.\n */\n\n/**\n * @name differenceInMinutes\n * @category Minute Helpers\n * @summary Get the number of minutes between the given dates.\n *\n * @description\n * Get the signed number of full (rounded towards 0) minutes between the given dates.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param dateLeft - The later date\n * @param dateRight - The earlier date\n * @param options - An object with options.\n *\n * @returns The number of minutes\n *\n * @example\n * // How many minutes are between 2 July 2014 12:07:59 and 2 July 2014 12:20:00?\n * const result = differenceInMinutes(\n * new Date(2014, 6, 2, 12, 20, 0),\n * new Date(2014, 6, 2, 12, 7, 59)\n * )\n * //=> 12\n *\n * @example\n * // How many minutes are between 10:01:59 and 10:00:00\n * const result = differenceInMinutes(\n * new Date(2000, 0, 1, 10, 0, 0),\n * new Date(2000, 0, 1, 10, 1, 59)\n * )\n * //=> -1\n */\nexport function differenceInMinutes(dateLeft, dateRight, options) {\n const diff =\n differenceInMilliseconds(dateLeft, dateRight) / millisecondsInMinute;\n return getRoundingMethod(options?.roundingMethod)(diff);\n}\n\n// Fallback for modularized imports:\nexport default differenceInMinutes;\n","import { addMilliseconds } from \"./addMilliseconds.mjs\";\nimport { millisecondsInMinute } from \"./constants.mjs\";\n\n/**\n * @name addMinutes\n * @category Minute Helpers\n * @summary Add the specified number of minutes to the given date.\n *\n * @description\n * Add the specified number of minutes to the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The date to be changed\n * @param amount - The amount of minutes to be added.\n *\n * @returns The new date with the minutes added\n *\n * @example\n * // Add 30 minutes to 10 July 2014 12:00:00:\n * const result = addMinutes(new Date(2014, 6, 10, 12, 0), 30)\n * //=> Thu Jul 10 2014 12:30:00\n */\nexport function addMinutes(date, amount) {\n return addMilliseconds(date, amount * millisecondsInMinute);\n}\n\n// Fallback for modularized imports:\nexport default addMinutes;\n","import { addMinutes } from \"./addMinutes.mjs\";\n\n/**\n * @name subMinutes\n * @category Minute Helpers\n * @summary Subtract the specified number of minutes from the given date.\n *\n * @description\n * Subtract the specified number of minutes from the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The date to be changed\n * @param amount - The amount of minutes to be subtracted.\n *\n * @returns The new date with the minutes subtracted\n *\n * @example\n * // Subtract 30 minutes from 10 July 2014 12:00:00:\n * const result = subMinutes(new Date(2014, 6, 10, 12, 0), 30)\n * //=> Thu Jul 10 2014 11:30:00\n */\nexport function subMinutes(date, amount) {\n return addMinutes(date, -amount);\n}\n\n// Fallback for modularized imports:\nexport default subMinutes;\n","import { getRoundingMethod } from \"./_lib/getRoundingMethod.mjs\";\nimport { differenceInMilliseconds } from \"./differenceInMilliseconds.mjs\";\n\n/**\n * The {@link differenceInSeconds} function options.\n */\n\n/**\n * @name differenceInSeconds\n * @category Second Helpers\n * @summary Get the number of seconds between the given dates.\n *\n * @description\n * Get the number of seconds between the given dates.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param dateLeft - The later date\n * @param dateRight - The earlier date\n * @param options - An object with options.\n *\n * @returns The number of seconds\n *\n * @example\n * // How many seconds are between\n * // 2 July 2014 12:30:07.999 and 2 July 2014 12:30:20.000?\n * const result = differenceInSeconds(\n * new Date(2014, 6, 2, 12, 30, 20, 0),\n * new Date(2014, 6, 2, 12, 30, 7, 999)\n * )\n * //=> 12\n */\nexport function differenceInSeconds(dateLeft, dateRight, options) {\n const diff = differenceInMilliseconds(dateLeft, dateRight) / 1000;\n return getRoundingMethod(options?.roundingMethod)(diff);\n}\n\n// Fallback for modularized imports:\nexport default differenceInSeconds;\n","import { addMilliseconds } from \"./addMilliseconds.mjs\";\n\n/**\n * @name addSeconds\n * @category Second Helpers\n * @summary Add the specified number of seconds to the given date.\n *\n * @description\n * Add the specified number of seconds to the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The date to be changed\n * @param amount - The amount of seconds to be added.\n *\n * @returns The new date with the seconds added\n *\n * @example\n * // Add 30 seconds to 10 July 2014 12:45:00:\n * const result = addSeconds(new Date(2014, 6, 10, 12, 45, 0), 30)\n * //=> Thu Jul 10 2014 12:45:30\n */\nexport function addSeconds(date, amount) {\n return addMilliseconds(date, amount * 1000);\n}\n\n// Fallback for modularized imports:\nexport default addSeconds;\n","import { addSeconds } from \"./addSeconds.mjs\";\n\n/**\n * @name subSeconds\n * @category Second Helpers\n * @summary Subtract the specified number of seconds from the given date.\n *\n * @description\n * Subtract the specified number of seconds from the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The date to be changed\n * @param amount - The amount of seconds to be subtracted.\n *\n * @returns The new date with the seconds subtracted\n *\n * @example\n * // Subtract 30 seconds from 10 July 2014 12:45:00:\n * const result = subSeconds(new Date(2014, 6, 10, 12, 45, 0), 30)\n * //=> Thu Jul 10 2014 12:44:30\n */\nexport function subSeconds(date, amount) {\n return addSeconds(date, -amount);\n}\n\n// Fallback for modularized imports:\nexport default subSeconds;\n","import {\n\textent,\n\tmax,\n\tscaleBand,\n\tscaleLinear,\n\tscaleTime,\n\tscaleLog,\n\ttype ScaleTime,\n\ttype ScaleBand,\n\ttype ScaleLinear\n} from 'd3'\nimport { differenceInYears } from 'date-fns/differenceInYears'\nimport { addYears } from 'date-fns/addYears'\nimport { subYears } from 'date-fns/subYears'\nimport { differenceInMonths } from 'date-fns/differenceInMonths'\nimport { addMonths } from 'date-fns/addMonths'\nimport { subMonths } from 'date-fns/subMonths'\nimport { differenceInDays } from 'date-fns/differenceInDays'\nimport { addDays } from 'date-fns/addDays'\nimport { subDays } from 'date-fns/subDays'\nimport { differenceInHours } from 'date-fns/differenceInHours'\nimport { addHours } from 'date-fns/addHours'\nimport { subHours } from 'date-fns/subHours'\nimport { differenceInMinutes } from 'date-fns/differenceInMinutes'\nimport { addMinutes } from 'date-fns/addMinutes'\nimport { subMinutes } from 'date-fns/subMinutes'\nimport { differenceInSeconds } from 'date-fns/differenceInSeconds'\nimport { subSeconds } from 'date-fns/subSeconds'\nimport { addSeconds } from 'date-fns/addSeconds'\nimport { flatten, omit, uniq } from 'lodash-es'\nimport { getProperty } from '@/tools'\nimport { axis as axisConfigs } from '@/configuration'\nimport { Service } from './service'\nimport { AxisPositions, CartesianOrientations, ScaleTypes } from '@/interfaces/enums'\nimport { ThresholdOptions } from '@/interfaces/components'\n\nexport type ScaleFunction =\n\t| ScaleTime\n\t| ScaleBand\n\t| ScaleLinear\n\nexport class CartesianScales extends Service {\n\tprotected scaleTypes = {\n\t\ttop: null as ScaleTypes,\n\t\tright: null as ScaleTypes,\n\t\tbottom: null as ScaleTypes,\n\t\tleft: null as ScaleTypes\n\t}\n\n\tprotected scales = {\n\t\t// null or function\n\t\ttop: null as ScaleLinear,\n\t\tright: null as ScaleLinear,\n\t\tbottom: null as ScaleLinear,\n\t\tleft: null as ScaleLinear\n\t}\n\n\tprotected domainAxisPosition: AxisPositions\n\tprotected rangeAxisPosition: AxisPositions\n\tprotected secondaryDomainAxisPosition: AxisPositions\n\tprotected secondaryRangeAxisPosition: AxisPositions\n\n\tprotected dualAxes: boolean\n\n\tprotected orientation: CartesianOrientations\n\n\tgetDomainAxisPosition({ datum = null }: { datum?: any } = {}) {\n\t\tif (this.dualAxes && datum) {\n\t\t\tconst options = this.model.getOptions()\n\t\t\tconst { groupMapsTo } = options.data\n\t\t\tconst axesOptions = getProperty(options, 'axes', this.secondaryDomainAxisPosition)\n\t\t\tconst dataset = datum[groupMapsTo]\n\t\t\tif (\n\t\t\t\taxesOptions?.correspondingDatasets &&\n\t\t\t\taxesOptions.correspondingDatasets.includes(dataset)\n\t\t\t) {\n\t\t\t\treturn this.secondaryDomainAxisPosition\n\t\t\t}\n\t\t}\n\t\treturn this.domainAxisPosition\n\t}\n\n\tgetRangeAxisPosition({ datum = null, groups = null }: { datum?: any; groups?: any } = {}) {\n\t\tif (this.dualAxes) {\n\t\t\tconst options = this.model.getOptions()\n\t\t\tconst { groupMapsTo } = options.data\n\t\t\tconst axisOptions = getProperty(options, 'axes', this.secondaryRangeAxisPosition)\n\t\t\tlet dataset\n\t\t\tif (datum !== null) {\n\t\t\t\tdataset = datum[groupMapsTo]\n\t\t\t} else if (groups && groups.length > 0) {\n\t\t\t\tdataset = groups[0]\n\t\t\t}\n\t\t\tif (\n\t\t\t\taxisOptions?.correspondingDatasets &&\n\t\t\t\taxisOptions.correspondingDatasets.includes(dataset)\n\t\t\t) {\n\t\t\t\treturn this.secondaryRangeAxisPosition\n\t\t\t}\n\t\t}\n\t\treturn this.rangeAxisPosition\n\t}\n\n\tgetAxisOptions(position: AxisPositions) {\n\t\treturn getProperty(this.model.getOptions(), 'axes', position)\n\t}\n\n\tgetDomainAxisOptions() {\n\t\tconst domainAxisPosition = this.getDomainAxisPosition()\n\t\treturn this.getAxisOptions(domainAxisPosition)\n\t}\n\n\tgetRangeAxisOptions() {\n\t\tconst rangeAxisPosition = this.getRangeAxisPosition()\n\t\treturn this.getAxisOptions(rangeAxisPosition)\n\t}\n\n\tgetScaleLabel(position: AxisPositions) {\n\t\tconst axisOptions = this.getAxisOptions(position)\n\t\tconst title: string = axisOptions.title\n\t\tif (!title) {\n\t\t\tif (position === AxisPositions.BOTTOM || position === AxisPositions.TOP) {\n\t\t\t\treturn 'x-value'\n\t\t\t}\n\t\t\treturn 'y-value'\n\t\t}\n\t\treturn title\n\t}\n\n\tgetDomainLabel() {\n\t\treturn this.getScaleLabel(this.getDomainAxisPosition())\n\t}\n\n\tgetRangeLabel() {\n\t\treturn this.getScaleLabel(this.getRangeAxisPosition())\n\t}\n\n\tupdate() {\n\t\tthis.determineAxisDuality()\n\t\tthis.findDomainAndRangeAxes()\n\t\tthis.determineOrientation()\n\t\tconst axisPositions: AxisPositions[] = Object.keys(AxisPositions).map(\n\t\t\t(axisPositionKey: string) => AxisPositions[axisPositionKey as keyof typeof AxisPositions]\n\t\t)\n\t\taxisPositions.forEach(axisPosition => {\n\t\t\tthis.scales[axisPosition] = this.createScale(axisPosition) as ScaleLinear<\n\t\t\t\tnumber,\n\t\t\t\tnumber,\n\t\t\t\tnever\n\t\t\t>\n\t\t})\n\t}\n\n\tfindDomainAndRangeAxes() {\n\t\t// find main axes between (left & right) && (bottom & top)\n\t\tconst verticalAxesPositions = this.findVerticalAxesPositions()\n\t\tconst horizontalAxesPositions = this.findHorizontalAxesPositions()\n\n\t\t// Now we have horizontal & vertical main axes to choose domain & range axes from\n\t\tconst domainAndRangeAxesPositions = this.findDomainAndRangeAxesPositions(\n\t\t\tverticalAxesPositions,\n\t\t\thorizontalAxesPositions\n\t\t)\n\n\t\tthis.domainAxisPosition = domainAndRangeAxesPositions.primaryDomainAxisPosition\n\t\tthis.rangeAxisPosition = domainAndRangeAxesPositions.primaryRangeAxisPosition\n\n\t\tif (this.isDualAxes()) {\n\t\t\tthis.secondaryDomainAxisPosition = domainAndRangeAxesPositions.secondaryDomainAxisPosition\n\t\t\tthis.secondaryRangeAxisPosition = domainAndRangeAxesPositions.secondaryRangeAxisPosition\n\t\t}\n\t}\n\n\tdetermineOrientation() {\n\t\tif (\n\t\t\t(this.rangeAxisPosition === AxisPositions.LEFT ||\n\t\t\t\tthis.rangeAxisPosition === AxisPositions.RIGHT) &&\n\t\t\t(this.domainAxisPosition === AxisPositions.BOTTOM ||\n\t\t\t\tthis.domainAxisPosition === AxisPositions.TOP)\n\t\t) {\n\t\t\tthis.orientation = CartesianOrientations.VERTICAL\n\t\t} else {\n\t\t\tthis.orientation = CartesianOrientations.HORIZONTAL\n\t\t}\n\t}\n\n\tisDualAxes() {\n\t\treturn this.dualAxes\n\t}\n\n\t// if any of the axes objects have correspondingDatasets [] asserted we flag the chart as dual axes\n\t// it does not count as dual axes if it just has another axis turned on but is not actually using it to map a dataset\n\tdetermineAxisDuality() {\n\t\tconst options = this.model.getOptions()\n\t\tconst axesOptions = getProperty(options, 'axes')\n\n\t\tif (\n\t\t\t(axesOptions[AxisPositions.LEFT]?.correspondingDatasets &&\n\t\t\t\taxesOptions[AxisPositions.RIGHT]) ||\n\t\t\t(axesOptions[AxisPositions.RIGHT]?.correspondingDatasets &&\n\t\t\t\taxesOptions[AxisPositions.LEFT]) ||\n\t\t\t(axesOptions[AxisPositions.TOP]?.correspondingDatasets &&\n\t\t\t\taxesOptions[AxisPositions.BOTTOM]) ||\n\t\t\t(axesOptions[AxisPositions.BOTTOM]?.correspondingDatasets && axesOptions[AxisPositions.TOP])\n\t\t) {\n\t\t\tthis.dualAxes = true\n\t\t}\n\t}\n\n\tgetCustomDomainValuesByposition(axisPosition: AxisPositions) {\n\t\tconst domain = getProperty(this.model.getOptions(), 'axes', axisPosition, 'domain')\n\n\t\t// Check if domain is an array\n\t\tif (domain && !Array.isArray(domain)) {\n\t\t\tthrow new Error(`Domain in ${axisPosition} axis is not a valid array`)\n\t\t}\n\n\t\t// Determine number of elements passed in domain depending on scale types\n\t\tif (Array.isArray(domain)) {\n\t\t\tif (\n\t\t\t\t(this.scaleTypes[axisPosition] === ScaleTypes.LINEAR ||\n\t\t\t\t\tthis.scaleTypes[axisPosition] === ScaleTypes.TIME) &&\n\t\t\t\tdomain.length !== 2\n\t\t\t) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`There can only be 2 elements in domain for scale type: ${this.scaleTypes[axisPosition]}`\n\t\t\t\t)\n\t\t\t}\n\t\t}\n\n\t\treturn domain\n\t}\n\n\tgetOrientation() {\n\t\treturn this.orientation\n\t}\n\n\tgetScaleByPosition(axisPosition: AxisPositions) {\n\t\treturn this.scales[axisPosition]\n\t}\n\n\tgetScaleTypeByPosition(axisPosition: AxisPositions) {\n\t\treturn this.scaleTypes[axisPosition]\n\t}\n\n\tgetDomainAxisScaleType() {\n\t\tconst domainAxisPosition = this.getDomainAxisPosition()\n\t\treturn this.getScaleTypeByPosition(domainAxisPosition)\n\t}\n\n\tgetRangeAxisScaleType() {\n\t\tconst rangeAxisPosition = this.getRangeAxisPosition()\n\t\treturn this.getScaleTypeByPosition(rangeAxisPosition)\n\t}\n\n\tgetDomainScale() {\n\t\treturn this.scales[this.domainAxisPosition]\n\t}\n\n\tgetRangeScale() {\n\t\treturn this.scales[this.rangeAxisPosition]\n\t}\n\n\t// Find the main x-axis out of the 2 x-axis on the chart (when 2D axis is used)\n\tgetMainXAxisPosition() {\n\t\tconst possibleXAxisPositions = [AxisPositions.BOTTOM, AxisPositions.TOP]\n\n\t\treturn [this.domainAxisPosition, this.rangeAxisPosition].find(\n\t\t\tposition => possibleXAxisPositions.indexOf(position) > -1\n\t\t)\n\t}\n\n\t// Find the main y-axis out of the 2 y-axis on the chart (when 2D axis is used)\n\tgetMainYAxisPosition() {\n\t\tconst possibleYAxisPositions = [AxisPositions.LEFT, AxisPositions.RIGHT]\n\n\t\treturn [this.domainAxisPosition, this.rangeAxisPosition].find(\n\t\t\tposition => possibleYAxisPositions.indexOf(position) > -1\n\t\t)\n\t}\n\n\tgetMainXScale() {\n\t\treturn this.scales[this.getMainXAxisPosition()]\n\t}\n\n\tgetMainYScale() {\n\t\treturn this.scales[this.getMainYAxisPosition()]\n\t}\n\n\tgetValueFromScale(scale: any, scaleType: ScaleTypes, axisPosition: AxisPositions, datum: any) {\n\t\tconst options = this.model.getOptions()\n\t\tconst axesOptions = getProperty(options, 'axes')\n\t\tconst axisOptions = axesOptions[axisPosition]\n\t\tconst { mapsTo } = axisOptions\n\t\tconst value = getProperty(datum, mapsTo) !== null ? datum[mapsTo] : datum\n\t\tlet scaledValue: number\n\t\tswitch (scaleType) {\n\t\t\tcase ScaleTypes.LABELS:\n\t\t\t\tscaledValue = scale(value) + scale.step() / 2\n\t\t\t\tbreak\n\t\t\tcase ScaleTypes.TIME:\n\t\t\t\tscaledValue = scale(new Date(value))\n\t\t\t\tbreak\n\t\t\tdefault:\n\t\t\t\tscaledValue = scale(value)\n\t\t}\n\t\treturn scaledValue\n\t}\n\n\tgetBoundedScaledValues(datum: any): number[] {\n\t\tconst { bounds } = this.model.getOptions()\n\t\tconst axisPosition = this.getRangeAxisPosition({ datum })\n\t\tconst scale = this.scales[axisPosition]\n\n\t\tconst options = this.model.getOptions()\n\t\tconst axesOptions = getProperty(options, 'axes')\n\t\tconst axisOptions = axesOptions[axisPosition]\n\t\tconst { mapsTo } = axisOptions\n\t\tconst value = datum[mapsTo] !== undefined ? datum[mapsTo] : datum\n\n\t\tconst boundedValues = [\n\t\t\tscale(\n\t\t\t\tgetProperty(datum, bounds.upperBoundMapsTo) !== null\n\t\t\t\t\t? datum[bounds.upperBoundMapsTo]\n\t\t\t\t\t: value\n\t\t\t),\n\t\t\tscale(\n\t\t\t\tgetProperty(datum, bounds.lowerBoundMapsTo) !== null\n\t\t\t\t\t? datum[bounds.lowerBoundMapsTo]\n\t\t\t\t\t: value\n\t\t\t)\n\t\t]\n\n\t\treturn boundedValues\n\t}\n\n\tgetValueThroughAxisPosition(axisPosition: AxisPositions, datum: any) {\n\t\tconst scaleType = this.scaleTypes[axisPosition] as ScaleTypes\n\t\tconst scale = this.scales[axisPosition]\n\n\t\treturn this.getValueFromScale(scale, scaleType, axisPosition, datum)\n\t}\n\n\tgetDomainValue(d: string | object) {\n\t\tconst axisPosition = this.getDomainAxisPosition({ datum: d })\n\t\treturn this.getValueThroughAxisPosition(axisPosition, d)\n\t}\n\n\tgetRangeValue(d: number | string | object) {\n\t\tconst axisPosition = this.getRangeAxisPosition({ datum: d })\n\t\treturn this.getValueThroughAxisPosition(axisPosition, d)\n\t}\n\n\tgetMainXScaleType() {\n\t\treturn this.getScaleTypeByPosition(this.getMainXAxisPosition())\n\t}\n\n\tgetMainYScaleType() {\n\t\treturn this.getScaleTypeByPosition(this.getMainYAxisPosition())\n\t}\n\n\tgetDomainIdentifier(datum?: any) {\n\t\tconst options = this.model.getOptions()\n\t\treturn getProperty(options, 'axes', this.getDomainAxisPosition({ datum: datum }), 'mapsTo')\n\t}\n\n\tgetRangeIdentifier(datum?: any) {\n\t\tconst options = this.model.getOptions()\n\t\treturn getProperty(options, 'axes', this.getRangeAxisPosition({ datum: datum }), 'mapsTo')\n\t}\n\n\textendsDomain(axisPosition: AxisPositions, domain: any) {\n\t\tconst options = this.model.getOptions()\n\t\tconst axisOptions = getProperty(options, 'axes', axisPosition)\n\t\tif (axisOptions.scaleType === ScaleTypes.TIME) {\n\t\t\tconst spaceToAddToEdges = getProperty(options, 'timeScale', 'addSpaceOnEdges')\n\t\t\treturn addSpacingToTimeDomain(domain, spaceToAddToEdges)\n\t\t} else {\n\t\t\treturn addSpacingToContinuousDomain(domain, axisConfigs.paddingRatio, axisOptions.scaleType)\n\t\t}\n\t}\n\n\tprotected findVerticalAxesPositions() {\n\t\tconst options = this.model.getOptions()\n\t\tconst axesOptions = getProperty(options, 'axes')\n\t\tconst dualAxes = this.isDualAxes()\n\n\t\t// If right axis has been specified as `main`\n\t\tif (\n\t\t\t(getProperty(axesOptions, AxisPositions.LEFT) === null &&\n\t\t\t\tgetProperty(axesOptions, AxisPositions.RIGHT) !== null) ||\n\t\t\tgetProperty(axesOptions, AxisPositions.RIGHT, 'main') === true ||\n\t\t\t(dualAxes && getProperty(axesOptions, AxisPositions.LEFT, 'correspondingDatasets'))\n\t\t) {\n\t\t\treturn {\n\t\t\t\tprimary: AxisPositions.RIGHT,\n\t\t\t\tsecondary: AxisPositions.LEFT\n\t\t\t}\n\t\t}\n\n\t\treturn { primary: AxisPositions.LEFT, secondary: AxisPositions.RIGHT }\n\t}\n\n\tprotected findHorizontalAxesPositions() {\n\t\tconst options = this.model.getOptions()\n\t\tconst axesOptions = getProperty(options, 'axes')\n\t\tconst dualAxes = this.isDualAxes()\n\n\t\t// If top axis has been specified as `main`\n\t\tif (\n\t\t\t(getProperty(axesOptions, AxisPositions.BOTTOM) === null &&\n\t\t\t\tgetProperty(axesOptions, AxisPositions.TOP) !== null) ||\n\t\t\tgetProperty(axesOptions, AxisPositions.TOP, 'main') === true ||\n\t\t\t(dualAxes && getProperty(axesOptions, AxisPositions.BOTTOM, 'correspondingDatasets'))\n\t\t) {\n\t\t\treturn {\n\t\t\t\tprimary: AxisPositions.TOP,\n\t\t\t\tsecondary: AxisPositions.BOTTOM\n\t\t\t}\n\t\t}\n\n\t\treturn { primary: AxisPositions.BOTTOM, secondary: AxisPositions.TOP }\n\t}\n\n\tprotected findDomainAndRangeAxesPositions(\n\t\tverticalAxesPositions: any,\n\t\thorizontalAxesPositions: any\n\t) {\n\t\tconst options = this.model.getOptions()\n\n\t\tconst mainVerticalAxisOptions = getProperty(options, 'axes', verticalAxesPositions.primary)\n\t\tconst mainHorizontalAxisOptions = getProperty(options, 'axes', horizontalAxesPositions.primary)\n\n\t\tconst mainVerticalScaleType = mainVerticalAxisOptions.scaleType || ScaleTypes.LINEAR\n\t\tconst mainHorizontalScaleType = mainHorizontalAxisOptions.scaleType || ScaleTypes.LINEAR\n\n\t\tconst result = {\n\t\t\tprimaryDomainAxisPosition: null as AxisPositions,\n\t\t\tsecondaryDomainAxisPosition: null as AxisPositions,\n\t\t\tprimaryRangeAxisPosition: null as AxisPositions,\n\t\t\tsecondaryRangeAxisPosition: null as AxisPositions\n\t\t}\n\n\t\t// assign to to be a vertical chart by default\n\t\tresult.primaryDomainAxisPosition = horizontalAxesPositions.primary\n\t\tresult.primaryRangeAxisPosition = verticalAxesPositions.primary\n\t\t// secondary axes\n\t\tresult.secondaryDomainAxisPosition = horizontalAxesPositions.secondary\n\t\tresult.secondaryRangeAxisPosition = verticalAxesPositions.secondary\n\n\t\t// if neither the horizontal axes are label or time\n\t\t// and atleast one of the main vertical ones are labels or time then it should be horizontal\n\t\tif (\n\t\t\t(!(\n\t\t\t\tmainHorizontalScaleType === ScaleTypes.LABELS || mainHorizontalScaleType === ScaleTypes.TIME\n\t\t\t) &&\n\t\t\t\tmainVerticalScaleType === ScaleTypes.LABELS) ||\n\t\t\tmainVerticalScaleType === ScaleTypes.TIME\n\t\t) {\n\t\t\tresult.primaryDomainAxisPosition = verticalAxesPositions.primary\n\t\t\tresult.primaryRangeAxisPosition = horizontalAxesPositions.primary\n\t\t\t// secondary axes\n\t\t\tresult.secondaryDomainAxisPosition = verticalAxesPositions.secondary\n\t\t\tresult.secondaryRangeAxisPosition = horizontalAxesPositions.secondary\n\t\t}\n\n\t\treturn result\n\t}\n\n\tgetScaleDomain(axisPosition: AxisPositions) {\n\t\tconst options = this.model.getOptions()\n\t\tconst axisOptions = getProperty(options, 'axes', axisPosition)\n\t\tconst bounds = getProperty(options, 'bounds')\n\t\tconst { includeZero } = axisOptions\n\t\tconst scaleType = getProperty(axisOptions, 'scaleType') || ScaleTypes.LINEAR\n\n\t\tif (this.model.isDataEmpty()) {\n\t\t\treturn []\n\t\t}\n\n\t\tif (axisOptions.binned) {\n\t\t\tconst { bins } = this.model.getBinConfigurations()\n\n\t\t\treturn [0, max(bins, (d: any) => d.length)]\n\t\t} else if (axisOptions.limitDomainToBins) {\n\t\t\tconst { bins } = this.model.getBinConfigurations()\n\t\t\tconst stackKeys = this.model.getStackKeys({ bins })\n\n\t\t\treturn [stackKeys[0].split(':')[0], stackKeys[stackKeys.length - 1].split(':')[1]]\n\t\t}\n\n\t\tconst displayData = this.model.getDisplayData()\n\t\tconst { extendLinearDomainBy, mapsTo, percentage, thresholds } = axisOptions\n\t\tconst { reference: ratioReference, compareTo: ratioCompareTo } = axisConfigs.ratio\n\n\t\t// If domain is specified return that domain\n\t\tif (axisOptions.domain) {\n\t\t\tif (scaleType === ScaleTypes.LABELS) {\n\t\t\t\treturn axisOptions.domain\n\t\t\t} else if (scaleType === ScaleTypes.TIME) {\n\t\t\t\taxisOptions.domain = axisOptions.domain.map((d: any) =>\n\t\t\t\t\td.getTime === undefined ? new Date(d) : d\n\t\t\t\t)\n\t\t\t}\n\t\t\treturn this.extendsDomain(axisPosition, axisOptions.domain)\n\t\t}\n\n\t\t// Return [0, 100] for percentage axis scale\n\t\tif (percentage) {\n\t\t\treturn [0, 100]\n\t\t}\n\n\t\t// If scale is a LABELS scale, return some labels as the domain\n\t\tif (axisOptions && scaleType === ScaleTypes.LABELS) {\n\t\t\t// Get unique values\n\t\t\treturn uniq(displayData.map((d: any) => d[mapsTo]))\n\t\t}\n\n\t\t// Get the extent of the domain\n\t\tlet domain: any\n\t\tlet allDataValues: any\n\t\tconst dataGroupNames = this.model.getDataGroupNames()\n\n\t\tif (scaleType === ScaleTypes.LABELS_RATIO) {\n\t\t\treturn displayData.map((datum: any) => `${datum[ratioReference]}/${datum[ratioCompareTo]}`)\n\t\t} else if (scaleType === ScaleTypes.TIME) {\n\t\t\tallDataValues = displayData.map((datum: any) => +new Date(datum[mapsTo]))\n\t\t} else if (bounds && options.axes) {\n\t\t\tallDataValues = []\n\n\t\t\tdisplayData.forEach((datum: any) => {\n\t\t\t\tallDataValues.push(datum[mapsTo])\n\n\t\t\t\tif (datum[bounds.upperBoundMapsTo]) {\n\t\t\t\t\tallDataValues.push(datum[bounds.upperBoundMapsTo])\n\t\t\t\t}\n\t\t\t\tif (datum[bounds.lowerBoundMapsTo]) {\n\t\t\t\t\tallDataValues.push(datum[bounds.lowerBoundMapsTo])\n\t\t\t\t}\n\t\t\t})\n\t\t} else if (\n\t\t\taxisOptions.stacked === true &&\n\t\t\tdataGroupNames &&\n\t\t\taxisPosition === this.getRangeAxisPosition()\n\t\t) {\n\t\t\tconst { groupMapsTo } = options.data\n\t\t\tconst dataValuesGroupedByKeys = this.model.getDataValuesGroupedByKeys({\n\t\t\t\tgroups: dataGroupNames\n\t\t\t})\n\t\t\tconst nonStackedGroupsData = displayData.filter(\n\t\t\t\t(datum: any) => !dataGroupNames.includes(datum[groupMapsTo])\n\t\t\t)\n\n\t\t\tconst stackedValues: any[] = []\n\t\t\tdataValuesGroupedByKeys.forEach((dataValues: any) => {\n\t\t\t\tconst { ...numericalValues } = dataValues\n\n\t\t\t\tlet positiveSum = 0,\n\t\t\t\t\tnegativeSum = 0\n\t\t\t\tObject.values(omit(numericalValues, 'sharedStackKey')).forEach((value: number) => {\n\t\t\t\t\tif (!isNaN(value)) {\n\t\t\t\t\t\tif (value < 0) {\n\t\t\t\t\t\t\tnegativeSum += value\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tpositiveSum += value\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t\tstackedValues.push([negativeSum, positiveSum])\n\t\t\t})\n\n\t\t\tallDataValues = [\n\t\t\t\t...flatten(stackedValues),\n\t\t\t\t...nonStackedGroupsData.map((datum: any) => datum[mapsTo])\n\t\t\t]\n\t\t} else {\n\t\t\tallDataValues = []\n\n\t\t\tdisplayData.forEach((datum: any) => {\n\t\t\t\tconst value = datum[mapsTo]\n\t\t\t\tif (Array.isArray(value) && value.length === 2) {\n\t\t\t\t\tallDataValues.push(value[0])\n\t\t\t\t\tallDataValues.push(value[1])\n\t\t\t\t} else {\n\t\t\t\t\tif (extendLinearDomainBy) {\n\t\t\t\t\t\tallDataValues.push(Math.max(datum[mapsTo], datum[extendLinearDomainBy]))\n\t\t\t\t\t}\n\t\t\t\t\tallDataValues.push(value)\n\t\t\t\t}\n\t\t\t})\n\t\t}\n\n\t\t// Time can never be 0 and log of base 0 is -Infinity\n\t\tif (scaleType !== ScaleTypes.TIME && scaleType !== ScaleTypes.LOG && includeZero) {\n\t\t\tallDataValues.push(0)\n\t\t}\n\n\t\t// Add threshold values into the scale\n\t\tif (thresholds && thresholds.length > 0) {\n\t\t\tthresholds.forEach((threshold: any) => {\n\t\t\t\tconst thresholdValue = getProperty(threshold, 'value')\n\t\t\t\tif (thresholdValue !== null) allDataValues.push(thresholdValue)\n\t\t\t})\n\t\t}\n\n\t\tdomain = extent(allDataValues)\n\t\tdomain = this.extendsDomain(axisPosition, domain)\n\n\t\treturn domain\n\t}\n\n\tprotected createScale(axisPosition: AxisPositions) {\n\t\tconst options = this.model.getOptions()\n\t\tconst axisOptions = getProperty(options, 'axes', axisPosition)\n\n\t\tif (!axisOptions) {\n\t\t\treturn null\n\t\t}\n\n\t\tconst scaleType = getProperty(axisOptions, 'scaleType') || ScaleTypes.LINEAR\n\t\tthis.scaleTypes[axisPosition] = scaleType\n\n\t\tlet scale: ScaleFunction\n\t\tif (scaleType === ScaleTypes.TIME) {\n\t\t\tscale = scaleTime()\n\t\t} else if (scaleType === ScaleTypes.LOG) {\n\t\t\tscale = scaleLog().base(axisOptions.base || 10)\n\t\t} else if (scaleType === ScaleTypes.LABELS || scaleType === ScaleTypes.LABELS_RATIO) {\n\t\t\tscale = scaleBand()\n\t\t} else {\n\t\t\tscale = scaleLinear()\n\t\t}\n\n\t\tscale.domain(this.getScaleDomain(axisPosition))\n\n\t\treturn scale\n\t}\n\n\tgetDomainLowerBound(position: any): number {\n\t\tlet domainRange: number[]\n\t\tlet lowerBound = 0\n\n\t\t// get domain ranges based on orientations\n\t\tif (this.getOrientation() === CartesianOrientations.VERTICAL) {\n\t\t\tdomainRange = this.getMainYScale().domain() as number[]\n\t\t} else {\n\t\t\tdomainRange = this.getMainXScale().domain() as number[]\n\t\t}\n\n\t\tif (getProperty(this.model.getOptions(), 'axes', position, 'includeZero') === false) {\n\t\t\t// get domain lowerBound if all are positive values\n\t\t\tif (domainRange[0] > 0 && domainRange[1] > 0) {\n\t\t\t\tlowerBound = domainRange[0]\n\t\t\t}\n\t\t}\n\n\t\treturn lowerBound\n\t}\n\n\tgetHighestDomainThreshold(): null | {\n\t\tthreshold: ThresholdOptions\n\t\tscaleValue: number\n\t} {\n\t\tconst axesOptions = getProperty(this.model.getOptions(), 'axes')\n\t\tconst domainAxisPosition = this.getDomainAxisPosition()\n\n\t\tconst { thresholds } = axesOptions[domainAxisPosition]\n\n\t\t// Check if thresholds exist & is not empty\n\t\tif (!Array.isArray(thresholds) || (Array.isArray(thresholds) && !thresholds.length)) {\n\t\t\treturn null\n\t\t}\n\n\t\tconst domainScale = this.getDomainScale()\n\t\t// Find the highest threshold for the domain\n\t\tconst highestThreshold = thresholds.sort((a, b) => b.value - a.value)[0]\n\n\t\tconst scaleType = this.getScaleTypeByPosition(domainAxisPosition)\n\t\tif (\n\t\t\tscaleType === ScaleTypes.TIME &&\n\t\t\t(typeof highestThreshold.value === 'string' || highestThreshold.value.getTime === undefined)\n\t\t) {\n\t\t\thighestThreshold.value = new Date(highestThreshold.value)\n\t\t}\n\n\t\treturn {\n\t\t\tthreshold: highestThreshold,\n\t\t\tscaleValue: domainScale(highestThreshold.value)\n\t\t}\n\t}\n\n\tgetHighestRangeThreshold(): null | {\n\t\tthreshold: ThresholdOptions\n\t\tscaleValue: number\n\t} {\n\t\tconst axesOptions = getProperty(this.model.getOptions(), 'axes')\n\t\tconst rangeAxisPosition = this.getRangeAxisPosition()\n\n\t\tconst { thresholds } = axesOptions[rangeAxisPosition]\n\n\t\t// Check if thresholds exist & is not empty\n\t\tif (!Array.isArray(thresholds) || (Array.isArray(thresholds) && !thresholds.length)) {\n\t\t\treturn null\n\t\t}\n\n\t\tconst rangeScale = this.getRangeScale()\n\t\t// Find the highest threshold for the range\n\t\tconst highestThreshold = thresholds.sort((a, b) => b.value - a.value)[0]\n\n\t\treturn {\n\t\t\tthreshold: highestThreshold,\n\t\t\tscaleValue: rangeScale(highestThreshold.value)\n\t\t}\n\t}\n}\n\nfunction addSpacingToTimeDomain(domain: any, spaceToAddToEdges: number) {\n\tconst startDate = new Date(domain[0])\n\tconst endDate = new Date(domain[1])\n\n\tif (differenceInYears(endDate, startDate) > 1) {\n\t\treturn [subYears(startDate, spaceToAddToEdges), addYears(endDate, spaceToAddToEdges)]\n\t}\n\n\tif (differenceInMonths(endDate, startDate) > 1) {\n\t\treturn [subMonths(startDate, spaceToAddToEdges), addMonths(endDate, spaceToAddToEdges)]\n\t}\n\n\tif (differenceInDays(endDate, startDate) > 1) {\n\t\treturn [subDays(startDate, spaceToAddToEdges), addDays(endDate, spaceToAddToEdges)]\n\t}\n\n\tif (differenceInHours(endDate, startDate) > 1) {\n\t\treturn [subHours(startDate, spaceToAddToEdges), addHours(endDate, spaceToAddToEdges)]\n\t}\n\n\tif (differenceInMinutes(endDate, startDate) > 30) {\n\t\treturn [\n\t\t\tsubMinutes(startDate, spaceToAddToEdges * 30),\n\t\t\taddMinutes(endDate, spaceToAddToEdges * 30)\n\t\t]\n\t}\n\n\tif (differenceInMinutes(endDate, startDate) > 1) {\n\t\treturn [subMinutes(startDate, spaceToAddToEdges), addMinutes(endDate, spaceToAddToEdges)]\n\t}\n\n\tif (differenceInSeconds(endDate, startDate) > 15) {\n\t\treturn [\n\t\t\tsubSeconds(startDate, spaceToAddToEdges * 15),\n\t\t\taddSeconds(endDate, spaceToAddToEdges * 15)\n\t\t]\n\t}\n\n\tif (differenceInSeconds(endDate, startDate) > 1) {\n\t\treturn [subSeconds(startDate, spaceToAddToEdges), addSeconds(endDate, spaceToAddToEdges)]\n\t}\n\n\treturn [startDate, endDate]\n}\n\nfunction addSpacingToContinuousDomain(\n\t[lower, upper]: number[],\n\tpaddingRatio: number,\n\tscaleType?: ScaleTypes\n) {\n\tconst domainLength = upper - lower\n\tconst padding = domainLength * paddingRatio\n\n\t// If padding crosses 0, keep 0 as new upper bound\n\tconst newUpper = upper <= 0 && upper + padding > 0 ? 0 : upper + padding\n\t// If padding crosses 0, keep 0 as new lower bound\n\tlet newLower = lower >= 0 && lower - padding < 0 ? 0 : lower - padding\n\n\t// Log of base 0 or a negative number is -Infinity\n\tif (scaleType === ScaleTypes.LOG && newLower <= 0) {\n\t\tif (lower <= 0) {\n\t\t\tthrow Error('Data must have values greater than 0 if log scale type is used.')\n\t\t}\n\t\tnewLower = lower\n\t}\n\n\treturn [newLower, newUpper]\n}\n","import {\n\tcurveBasis,\n\tcurveBasisClosed,\n\tcurveBasisOpen,\n\tcurveBundle,\n\tcurveCardinal,\n\tcurveCardinalClosed,\n\tcurveCardinalOpen,\n\tcurveCatmullRom,\n\tcurveCatmullRomClosed,\n\tcurveCatmullRomOpen,\n\tcurveLinear,\n\tcurveLinearClosed,\n\tcurveMonotoneX,\n\tcurveMonotoneY,\n\tcurveNatural,\n\tcurveStep,\n\tcurveStepAfter,\n\tcurveStepBefore\n} from 'd3'\nimport { Service } from './service'\n\nexport class Curves extends Service {\n\tcurveTypes = {\n\t\tcurveLinear,\n\t\tcurveLinearClosed,\n\t\tcurveBasis,\n\t\tcurveBasisClosed,\n\t\tcurveBasisOpen,\n\t\tcurveBundle,\n\t\tcurveCardinal,\n\t\tcurveCardinalClosed,\n\t\tcurveCardinalOpen,\n\t\tcurveCatmullRom,\n\t\tcurveCatmullRomClosed,\n\t\tcurveCatmullRomOpen,\n\t\tcurveMonotoneX,\n\t\tcurveMonotoneY,\n\t\tcurveNatural,\n\t\tcurveStep,\n\t\tcurveStepAfter,\n\t\tcurveStepBefore\n\t}\n\n\tgetD3Curve() {\n\t\tlet curveName = 'curveLinear' as keyof typeof this.curveTypes\n\t\tconst curveOptions = this.model.getOptions().curve\n\n\t\t// Parse curve type whether the user provided a string\n\t\t// Or an object with more options\n\t\tif (curveOptions) {\n\t\t\tif (typeof curveOptions === 'string') {\n\t\t\t\t// curve: 'string'\n\t\t\t\tcurveName = curveOptions as keyof typeof this.curveTypes\n\t\t\t} else {\n\t\t\t\t// curve: { name: 'string' }\n\t\t\t\tcurveName = curveOptions.name\n\t\t\t}\n\t\t}\n\n\t\tif (this.curveTypes[curveName]) {\n\t\t\t// Grab correct d3 curve function\n\t\t\tlet curve = this.curveTypes[curveName] as any\n\n\t\t\t// Apply user-provided options to the d3 curve\n\t\t\tif (curveOptions) {\n\t\t\t\tObject.keys(curveOptions).forEach(optionName => {\n\t\t\t\t\tif (curve[optionName]) {\n\t\t\t\t\t\tcurve = curve[optionName](curveOptions[optionName])\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t}\n\n\t\t\treturn curve\n\t\t}\n\n\t\tconsole.warn(`The curve type '${curveName}' is invalid, using 'curveLinear' instead`)\n\t\treturn this.curveTypes['curveLinear']\n\t}\n}\n","import { extent } from 'd3'\nimport { getProperty } from '@/tools'\nimport { zoomBar as zoomBarConfigs } from '@/configuration'\nimport { AxisPositions, Events, ScaleTypes } from '@/interfaces/enums'\nimport { Service } from './service'\n\nimport type { ChartModelCartesian } from '../model'\n\nexport class Zoom extends Service {\n\tprotected model: ChartModelCartesian\n\n\tisZoomBarEnabled() {\n\t\t// CartesianScales service is only available in axis charts\n\t\tif (!this.services.cartesianScales) {\n\t\t\treturn false\n\t\t}\n\n\t\t// @todo - need to update this if zoom bar in other position (bottom, left, right) is supported\n\t\t// check configuration\n\t\tif (!getProperty(this.model.getOptions(), 'zoomBar', 'top', 'enabled')) {\n\t\t\treturn false\n\t\t}\n\n\t\t// @todo - Zoom Bar only supports main axis at BOTTOM axis and time scale for now\n\t\tthis.services.cartesianScales.findDomainAndRangeAxes() // need to do this before getMainXAxisPosition()\n\t\tconst mainXAxisPosition = this.services.cartesianScales.getMainXAxisPosition()\n\t\tconst mainXScaleType = getProperty(\n\t\t\tthis.model.getOptions(),\n\t\t\t'axes',\n\t\t\tmainXAxisPosition,\n\t\t\t'scaleType'\n\t\t)\n\n\t\treturn mainXAxisPosition === AxisPositions.BOTTOM && mainXScaleType === ScaleTypes.TIME\n\t}\n\n\t// get display data for zoom bar\n\t// basically it's sum of value grouped by time\n\tgetZoomBarData() {\n\t\tconst customZoomBarData = this.model.getZoomBarData()\n\n\t\t// if user already defines zoom bar data, use it\n\t\tif (customZoomBarData && customZoomBarData.length > 1) {\n\t\t\treturn customZoomBarData\n\t\t} else {\n\t\t\t// use displayData if not defined\n\t\t\treturn this.model.getDisplayData()\n\t\t}\n\t}\n\n\tgetDefaultZoomBarDomain(zoomBarData?: any) {\n\t\tif (!this.services.zoom) throw new Error('Services zoom not defined')\n\t\tconst allZoomBarData = zoomBarData || this.services.zoom.getZoomBarData()\n\t\tconst { cartesianScales } = this.services\n\t\tif (!cartesianScales) throw new Error('Services cartesianScales undefined')\n\t\tconst mainXAxisPosition = cartesianScales.getMainXAxisPosition()\n\t\tconst domainIdentifier = cartesianScales.getDomainIdentifier()\n\n\t\tconst customDomain = getProperty(this.model.getOptions(), 'axes', mainXAxisPosition, 'domain')\n\n\t\t// return custom domain if exists && valid\n\t\tif (Array.isArray(customDomain) && customDomain.length === 2) {\n\t\t\treturn customDomain\n\t\t}\n\n\t\t// default to full range with extended domain\n\t\tif (!mainXAxisPosition) throw new Error('Not defined: mainXAxisPosition')\n\t\treturn cartesianScales.extendsDomain(\n\t\t\tmainXAxisPosition,\n\t\t\textent(allZoomBarData, (d: any) => d[domainIdentifier])\n\t\t)\n\t}\n\n\thandleDomainChange(newDomain: any, configs = { dispatchEvent: true }) {\n\t\tthis.model.set({ zoomDomain: newDomain }, { animate: false })\n\t\tif (configs.dispatchEvent) {\n\t\t\tthis.services.events?.dispatchEvent(Events.ZoomDomain.CHANGE, {\n\t\t\t\tnewDomain\n\t\t\t})\n\t\t}\n\t}\n\n\tgetZoomRatio() {\n\t\treturn getProperty(this.model.getOptions(), 'zoomBar', 'zoomRatio')\n\t}\n\n\t// filter out data not inside zoom domain\n\t// to get better range value for axis label\n\tfilterDataForRangeAxis(displayData: object[], configs?: any) {\n\t\tconst zoomDomain = this.model.get('zoomDomain')\n\t\tconst mergedConfigs = Object.assign(\n\t\t\t{ stacked: false }, // default configs\n\t\t\tconfigs\n\t\t)\n\t\tconst shouldUpdateRangeAxis = getProperty(this.model.getOptions(), 'zoomBar', 'updateRangeAxis')\n\t\tif (this.isZoomBarEnabled() && shouldUpdateRangeAxis && zoomDomain) {\n\t\t\tconst domainIdentifier = mergedConfigs.stacked\n\t\t\t\t? 'sharedStackKey'\n\t\t\t\t: this.services.cartesianScales?.getDomainIdentifier()\n\t\t\tconst filteredData = displayData.filter(\n\t\t\t\t(datum: any) =>\n\t\t\t\t\tnew Date(datum[domainIdentifier]) >= zoomDomain[0] &&\n\t\t\t\t\tnew Date(datum[domainIdentifier]) <= zoomDomain[1]\n\t\t\t)\n\t\t\t// if no data in zoom domain, use all data to get full range value\n\t\t\t// so only return filteredData if length > 0\n\t\t\tif (filteredData.length > 0) {\n\t\t\t\treturn filteredData\n\t\t\t}\n\t\t}\n\t\t// return original data by default\n\t\treturn displayData\n\t}\n\n\tzoomIn(zoomRatio = this.getZoomRatio()) {\n\t\t// get current zoomDomain\n\t\tconst currentZoomDomain = this.model.get('zoomDomain')\n\t\tconst handleWidth = zoomBarConfigs.handleWidth\n\t\tconst xScale = this.services.cartesianScales?.getMainXScale().copy()\n\t\txScale.domain(this.getDefaultZoomBarDomain()) // reset domain to default full domain\n\n\t\t// use scale range (rather than domain) to calculate\n\t\t// current zoom bar handle x position\n\t\tconst currentX0 = xScale(currentZoomDomain[0])\n\t\tconst currentX1 = xScale(currentZoomDomain[1])\n\n\t\t// zoom bar handles are already too close\n\t\tif (currentX1 - currentX0 < handleWidth + 1) {\n\t\t\treturn\n\t\t}\n\t\tconst fullRange = xScale.range()\n\t\tconst gap = currentX1 - currentX0\n\t\tconst diff = Math.min(((fullRange[1] - fullRange[0]) / 2) * (zoomRatio / 2), gap / 2)\n\n\t\t// new zoom bar handle x position\n\t\tlet newX0 = currentX0 + diff\n\t\tlet newX1 = currentX1 - diff\n\t\t// if left handle becomes right side of right handle, just make them close to each other\n\t\tif (newX0 >= newX1) {\n\t\t\tnewX0 = currentX0 + gap / 2 - handleWidth / 2\n\t\t\tnewX1 = currentX1 - gap / 2 + handleWidth / 2\n\t\t}\n\n\t\tconst newDomain = [xScale.invert(newX0), xScale.invert(newX1)]\n\n\t\t// only if zoomDomain needs update\n\t\tif (\n\t\t\tcurrentZoomDomain[0].valueOf() !== newDomain[0].valueOf() ||\n\t\t\tcurrentZoomDomain[1].valueOf() !== newDomain[1].valueOf()\n\t\t) {\n\t\t\tthis.handleDomainChange(newDomain)\n\t\t}\n\t}\n\n\tzoomOut(zoomRatio = this.getZoomRatio()) {\n\t\t// get current zoomDomain\n\t\tconst currentZoomDomain = this.model.get('zoomDomain')\n\n\t\tif (!this.services.cartesianScales) throw new Error('Services cartesianScales undefined')\n\t\tconst xScale = this.services.cartesianScales.getMainXScale().copy()\n\n\t\txScale.domain(this.getDefaultZoomBarDomain()) // reset domain to default full domain\n\n\t\t// use scale range (rather than domain) to calculate\n\t\t// current zoom bar handle x position\n\t\tconst currentX0 = xScale(currentZoomDomain[0])\n\t\tconst currentX1 = xScale(currentZoomDomain[1])\n\n\t\tconst fullRange = xScale.range()\n\t\tconst diff = ((fullRange[1] - fullRange[0]) / 2) * (zoomRatio / 2)\n\n\t\t// new zoom bar handle x position\n\t\t// max to full range\n\t\tconst newX0 = Math.max(currentX0 - diff, fullRange[0])\n\t\tconst newX1 = Math.min(currentX1 + diff, fullRange[1])\n\n\t\tconst newDomain = [xScale.invert(newX0), xScale.invert(newX1)]\n\n\t\t// only if zoomDomain needs update\n\t\tif (\n\t\t\tcurrentZoomDomain[0].valueOf() !== newDomain[0].valueOf() ||\n\t\t\tcurrentZoomDomain[1].valueOf() !== newDomain[1].valueOf()\n\t\t) {\n\t\t\tthis.handleDomainChange(newDomain)\n\t\t}\n\t}\n\n\tresetZoomDomain() {\n\t\t// get current zoomDomain\n\t\tconst currentZoomDomain = this.model.get('zoomDomain')\n\t\tconst newDomain = this.getDefaultZoomBarDomain()\n\n\t\t// only if zoomDomain needs update\n\t\tif (\n\t\t\tcurrentZoomDomain[0].valueOf() !== newDomain[0].valueOf() ||\n\t\t\tcurrentZoomDomain[1].valueOf() !== newDomain[1].valueOf()\n\t\t) {\n\t\t\tthis.handleDomainChange(newDomain)\n\t\t}\n\t}\n\n\t// check if current zoom domain is already the min zoom domain\n\t// when toolbar is rendered, we don't render chart yet\n\t// don't depend on scale range\n\tisMinZoomDomain() {\n\t\t// get current zoomDomain\n\t\tconst currentZoomDomain = this.model.get('zoomDomain')\n\t\t// assume the max zoom domain is the default zoom bar domain\n\t\tconst maxZoomDomain = this.getDefaultZoomBarDomain()\n\t\tif (!currentZoomDomain || !maxZoomDomain) {\n\t\t\treturn false\n\t\t}\n\n\t\tconst currentZoomDomainPeriod = currentZoomDomain[1].valueOf() - currentZoomDomain[0].valueOf()\n\t\tconst maxZoomDomainPeriod = maxZoomDomain[1].valueOf() - maxZoomDomain[0].valueOf()\n\t\tconst minZoomRatio = getProperty(this.model.getOptions(), 'zoomBar', 'minZoomRatio')\n\t\t// if current zoom domain is already smaller than minZoomRatio\n\t\tif (currentZoomDomainPeriod / maxZoomDomainPeriod < minZoomRatio) {\n\t\t\treturn true\n\t\t}\n\n\t\treturn false\n\t}\n\n\t// check if current zoom domain is already the max zoom domain\n\tisMaxZoomDomain() {\n\t\t// get current zoom domain\n\t\tconst currentZoomDomain = this.model.get('zoomDomain')\n\t\t// assume the max zoom domain is the default zoom bar domain\n\t\tconst maxZoomDomain = this.getDefaultZoomBarDomain()\n\n\t\tif (\n\t\t\tcurrentZoomDomain &&\n\t\t\tmaxZoomDomain &&\n\t\t\tcurrentZoomDomain[0].valueOf() === maxZoomDomain[0].valueOf() &&\n\t\t\tcurrentZoomDomain[1].valueOf() === maxZoomDomain[1].valueOf()\n\t\t) {\n\t\t\treturn true\n\t\t}\n\n\t\treturn false\n\t}\n\n\tisEmptyState() {\n\t\treturn this.getZoomBarData().length === 0\n\t}\n\n\tisZoomBarLoading(position: any) {\n\t\treturn getProperty(this.model.getOptions(), 'zoomBar', position, 'loading')\n\t}\n\n\tisZoomBarLocked(position: any) {\n\t\treturn getProperty(this.model.getOptions(), 'zoomBar', position, 'locked')\n\t}\n}\n","import { Chart } from './chart'\nimport { getProperty } from './tools'\nimport { ChartModelCartesian } from '@/model/cartesian-charts'\nimport { AxisChartOptions } from '@/interfaces/charts'\nimport { ChartConfig } from '@/interfaces/model'\nimport {\n\tAxisPositions,\n\tLayoutAlignItems,\n\tLayoutDirection,\n\tLayoutGrowth,\n\tLegendOrientations,\n\tLegendPositions,\n\tRenderTypes,\n\tScaleTypes\n} from '@/interfaces/enums'\nimport { ChartBrush } from '@/components/axes/grid-brush'\nimport { ChartClip } from '@/components/axes/chart-clip'\nimport { Toolbar } from '@/components/axes/toolbar'\nimport { ZoomBar } from '@/components/axes/zoom-bar'\nimport { LayoutComponent } from '@/components/layout'\nimport { Spacer } from '@/components/layout/spacer'\nimport { Modal } from '@/components/essentials/modal'\nimport { Legend } from '@/components/essentials/legend'\nimport { Threshold } from '@/components/essentials/threshold'\nimport { Highlight } from '@/components/essentials/highlights'\nimport { Title } from '@/components/essentials/title'\nimport { AxisChartsTooltip } from '@/components/essentials/tooltip-axis'\nimport { CartesianScales } from '@/services/scales-cartesian'\nimport { Curves } from '@/services/curves'\nimport { Zoom } from '@/services/zoom'\n\nexport class AxisChart extends Chart {\n\tservices: any = Object.assign(this.services, {\n\t\tcartesianScales: CartesianScales,\n\t\tcurves: Curves,\n\t\tzoom: Zoom\n\t})\n\tmodel: ChartModelCartesian = new ChartModelCartesian(this.services)\n\n\tconstructor(holder: HTMLDivElement, chartConfigs: ChartConfig) {\n\t\tsuper(holder, chartConfigs)\n\t}\n\n\tprotected getAxisChartComponents(graphFrameComponents: any[], configs?: any) {\n\t\tconst options = this.model.getOptions()\n\t\tconst isZoomBarEnabled = getProperty(options, 'zoomBar', AxisPositions.TOP, 'enabled')\n\t\tconst toolbarEnabled = getProperty(options, 'toolbar', 'enabled')\n\n\t\tthis.services.cartesianScales.determineAxisDuality()\n\t\tthis.services.cartesianScales.findDomainAndRangeAxes() // need to do this before getMainXAxisPosition()\n\t\tthis.services.cartesianScales.determineOrientation()\n\n\t\tconst mainXAxisPosition = this.services.cartesianScales.getMainXAxisPosition()\n\t\tconst mainXScaleType = getProperty(options, 'axes', mainXAxisPosition, 'scaleType')\n\t\t// @todo - Zoom Bar only supports main axis at BOTTOM axis and time scale for now\n\t\tconst zoomBarEnabled =\n\t\t\tisZoomBarEnabled &&\n\t\t\tmainXAxisPosition === AxisPositions.BOTTOM &&\n\t\t\tmainXScaleType === ScaleTypes.TIME\n\n\t\t// @todo - should check if zoom bar in all axes are locked\n\t\tconst isZoomBarLocked = this.services.zoom.isZoomBarLocked(AxisPositions.TOP)\n\n\t\tconst titleAvailable = !!this.model.getOptions().title\n\t\tconst titleComponent = {\n\t\t\tid: 'title',\n\t\t\tcomponents: [new Title(this.model, this.services)],\n\t\t\tgrowth: LayoutGrowth.STRETCH\n\t\t}\n\n\t\tconst toolbarComponent = {\n\t\t\tid: 'toolbar',\n\t\t\tcomponents: [new Toolbar(this.model, this.services)],\n\t\t\tgrowth: LayoutGrowth.PREFERRED\n\t\t}\n\n\t\tconst headerComponent = {\n\t\t\tid: 'header',\n\t\t\tcomponents: [\n\t\t\t\tnew LayoutComponent(\n\t\t\t\t\tthis.model,\n\t\t\t\t\tthis.services,\n\t\t\t\t\t[\n\t\t\t\t\t\t// always add title to keep layout correct\n\t\t\t\t\t\ttitleComponent,\n\t\t\t\t\t\t...(toolbarEnabled ? [toolbarComponent] : [])\n\t\t\t\t\t],\n\t\t\t\t\t{\n\t\t\t\t\t\tdirection: LayoutDirection.ROW,\n\t\t\t\t\t\talignItems: LayoutAlignItems.CENTER\n\t\t\t\t\t}\n\t\t\t\t)\n\t\t\t],\n\t\t\tgrowth: LayoutGrowth.PREFERRED\n\t\t}\n\n\t\tconst legendComponent = {\n\t\t\tid: 'legend',\n\t\t\tcomponents: [new Legend(this.model, this.services)],\n\t\t\tgrowth: LayoutGrowth.PREFERRED\n\t\t}\n\n\t\t// if all zoom bars are locked, no need to add chart brush\n\t\tif (zoomBarEnabled && !isZoomBarLocked) {\n\t\t\tgraphFrameComponents.push(\n\t\t\t\tnew ChartClip(this.model, this.services),\n\t\t\t\tnew ChartBrush(this.model, this.services)\n\t\t\t)\n\t\t}\n\n\t\tgraphFrameComponents.push(new Threshold(this.model, this.services))\n\t\tgraphFrameComponents.push(new Highlight(this.model, this.services))\n\n\t\tconst graphFrameComponent = {\n\t\t\tid: 'graph-frame',\n\t\t\tcomponents: graphFrameComponents,\n\t\t\tgrowth: LayoutGrowth.STRETCH,\n\t\t\trenderType: RenderTypes.SVG\n\t\t}\n\n\t\tconst isLegendEnabled =\n\t\t\tgetProperty(configs, 'legend', 'enabled') !== false &&\n\t\t\tthis.model.getOptions().legend.enabled !== false\n\n\t\t// Decide the position of the legend in reference to the chart\n\t\tlet fullFrameComponentDirection = LayoutDirection.COLUMN\n\t\tif (isLegendEnabled) {\n\t\t\tconst legendPosition = getProperty(this.model.getOptions(), 'legend', 'position')\n\t\t\tif (legendPosition === LegendPositions.LEFT) {\n\t\t\t\tfullFrameComponentDirection = LayoutDirection.ROW\n\n\t\t\t\tif (!this.model.getOptions().legend.orientation) {\n\t\t\t\t\tthis.model.getOptions().legend.orientation = LegendOrientations.VERTICAL\n\t\t\t\t}\n\t\t\t} else if (legendPosition === LegendPositions.RIGHT) {\n\t\t\t\tfullFrameComponentDirection = LayoutDirection.ROW_REVERSE\n\n\t\t\t\tif (!this.model.getOptions().legend.orientation) {\n\t\t\t\t\tthis.model.getOptions().legend.orientation = LegendOrientations.VERTICAL\n\t\t\t\t}\n\t\t\t} else if (legendPosition === LegendPositions.BOTTOM) {\n\t\t\t\tfullFrameComponentDirection = LayoutDirection.COLUMN_REVERSE\n\t\t\t}\n\t\t}\n\n\t\tconst legendSpacerComponent = {\n\t\t\tid: 'spacer',\n\t\t\tcomponents: [new Spacer(this.model, this.services)],\n\t\t\tgrowth: LayoutGrowth.PREFERRED\n\t\t}\n\n\t\tconst fullFrameComponent = {\n\t\t\tid: 'full-frame',\n\t\t\tcomponents: [\n\t\t\t\tnew LayoutComponent(\n\t\t\t\t\tthis.model,\n\t\t\t\t\tthis.services,\n\t\t\t\t\t[\n\t\t\t\t\t\t...(isLegendEnabled ? [legendComponent] : []),\n\t\t\t\t\t\t...(isLegendEnabled ? [legendSpacerComponent] : []),\n\t\t\t\t\t\tgraphFrameComponent\n\t\t\t\t\t],\n\t\t\t\t\t{\n\t\t\t\t\t\tdirection: fullFrameComponentDirection\n\t\t\t\t\t}\n\t\t\t\t)\n\t\t\t],\n\t\t\tgrowth: LayoutGrowth.STRETCH\n\t\t}\n\n\t\tconst zoomBarComponent = {\n\t\t\tid: 'zoom-bar',\n\t\t\tcomponents: [new ZoomBar(this.model, this.services)],\n\t\t\tgrowth: LayoutGrowth.PREFERRED,\n\t\t\trenderType: RenderTypes.SVG\n\t\t}\n\n\t\tconst topLevelLayoutComponents = []\n\t\t// header component is required for either title or toolbar\n\t\tif (titleAvailable || toolbarEnabled) {\n\t\t\ttopLevelLayoutComponents.push(headerComponent)\n\n\t\t\tconst titleSpacerComponent = {\n\t\t\t\tid: 'spacer',\n\t\t\t\tcomponents: [\n\t\t\t\t\tnew Spacer(this.model, this.services, toolbarEnabled ? { size: 15 } : undefined)\n\t\t\t\t],\n\t\t\t\tgrowth: LayoutGrowth.PREFERRED\n\t\t\t}\n\n\t\t\ttopLevelLayoutComponents.push(titleSpacerComponent)\n\t\t}\n\t\tif (zoomBarEnabled) {\n\t\t\ttopLevelLayoutComponents.push(zoomBarComponent)\n\t\t}\n\t\ttopLevelLayoutComponents.push(fullFrameComponent)\n\n\t\treturn [\n\t\t\tnew AxisChartsTooltip(this.model, this.services),\n\t\t\tnew Modal(this.model, this.services),\n\t\t\tnew LayoutComponent(this.model, this.services, topLevelLayoutComponents, {\n\t\t\t\tdirection: LayoutDirection.COLUMN\n\t\t\t})\n\t\t]\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 { cloneDeep } from 'lodash-es'\nimport { AxisChart } from '@/axis-chart'\nimport { options } from '@/configuration'\nimport { mergeDefaultChartOptions } from '@/tools'\nimport type { ChartConfig } from '@/interfaces/model'\nimport type { AreaChartOptions } from '@/interfaces/charts'\nimport { Skeletons } from '@/interfaces/enums'\nimport type { Component } from '@/components/component'\nimport { Grid } from '@/components/axes/grid'\nimport { Area } from '@/components/graphs/area'\nimport { Line } from '@/components/graphs/line'\nimport { Ruler } from '@/components/axes/ruler'\nimport { Scatter } from '@/components/graphs/scatter'\nimport { TwoDimensionalAxes } from '@/components/axes/two-dimensional-axes'\nimport { Skeleton } from '@/components/graphs/skeleton'\n\nexport class AreaChart extends AxisChart {\n\tconstructor(holder: HTMLDivElement, chartConfigs: ChartConfig) {\n\t\tsuper(holder, chartConfigs)\n\n\t\t// Merge the default options for this chart\n\t\t// With the user provided options\n\t\tthis.model.setOptions(\n\t\t\tmergeDefaultChartOptions(cloneDeep(options.areaChart), chartConfigs.options)\n\t\t)\n\n\t\t// Initialize data, services, components etc.\n\t\tthis.init(holder, chartConfigs)\n\t}\n\n\t/**\n\t * Retrieves the components to be rendered inside the graph frame.\n\t *\n\t * @returns {Component[]} An array of components to be rendered.\n\t */\n\tgetComponents() {\n\t\tconst graphFrameComponents: Component[] = [\n\t\t\tnew TwoDimensionalAxes(this.model, this.services),\n\t\t\tnew Grid(this.model, this.services),\n\t\t\tnew Ruler(this.model, this.services),\n\t\t\tnew Line(this.model, this.services),\n\t\t\tnew Area(this.model, this.services),\n\t\t\tnew Scatter(this.model, this.services, {\n\t\t\t\tfadeInOnChartHolderMouseover: true,\n\t\t\t\thandleThresholds: true\n\t\t\t}),\n\t\t\tnew Skeleton(this.model, this.services, {\n\t\t\t\tskeleton: Skeletons.GRID\n\t\t\t})\n\t\t]\n\n\t\tconst components: Component[] = this.getAxisChartComponents(graphFrameComponents)\n\t\treturn components\n\t}\n}\n","import { ascending, min, max, quantile, scaleOrdinal } from 'd3'\nimport { getProperty } from '@/tools'\nimport { color as colorConfigs } from '@/configuration'\nimport { ChartModelCartesian } from './cartesian-charts'\n\n/** The charting model layer which includes mainly the chart data and options,\n * as well as some misc. information to be shared among components */\nexport class BoxplotChartModel extends ChartModelCartesian {\n\tconstructor(services: any) {\n\t\tsuper(services)\n\t}\n\n\tgetBoxQuartiles(d: any) {\n\t\treturn {\n\t\t\tq_25: quantile(d, 0.25),\n\t\t\tq_50: quantile(d, 0.5),\n\t\t\tq_75: quantile(d, 0.75)\n\t\t}\n\t}\n\n\tgetBoxplotData() {\n\t\tconst options = this.getOptions()\n\t\tconst { groupMapsTo } = options.data\n\n\t\tconst groupedData = this.getGroupedData()\n\n\t\t// Prepare the data for the box plots\n\t\tconst boxplotData = []\n\t\tfor (const { name: group, data } of groupedData) {\n\t\t\tconst rangeIdentifier = this.services.cartesianScales.getRangeIdentifier()\n\t\t\tconst values = data.map((d: any) => d[rangeIdentifier]).sort(ascending)\n\n\t\t\tconst record = {\n\t\t\t\t[groupMapsTo]: group,\n\t\t\t\tcounts: values,\n\t\t\t\tquartiles: this.getBoxQuartiles(values),\n\t\t\t\toutliers: null as any,\n\t\t\t\twhiskers: null as any\n\t\t\t}\n\n\t\t\tconst q1 = record.quartiles.q_25\n\t\t\tconst q3 = record.quartiles.q_75\n\n\t\t\tconst iqr = (q3 - q1) * 1.5\n\t\t\tconst irq1 = q1 - iqr\n\t\t\tconst irq3 = q3 + iqr\n\n\t\t\tconst outliers = []\n\t\t\tconst normalValues = []\n\n\t\t\tfor (const value of values) {\n\t\t\t\tif (value < irq1) {\n\t\t\t\t\toutliers.push(value)\n\t\t\t\t} else if (value > irq3) {\n\t\t\t\t\toutliers.push(value)\n\t\t\t\t} else {\n\t\t\t\t\tnormalValues.push(value)\n\t\t\t\t}\n\t\t\t}\n\n\t\t\trecord.outliers = outliers\n\n\t\t\tconst minNormalValue = min(normalValues)\n\t\t\tconst maxNormalValue = max(normalValues)\n\t\t\trecord.whiskers = {\n\t\t\t\tmin: minNormalValue\n\t\t\t\t\t? minNormalValue\n\t\t\t\t\t: min([record.quartiles.q_25, record.quartiles.q_50, record.quartiles.q_75]),\n\t\t\t\tmax: maxNormalValue\n\t\t\t\t\t? maxNormalValue\n\t\t\t\t\t: max([record.quartiles.q_25, record.quartiles.q_50, record.quartiles.q_75])\n\t\t\t}\n\n\t\t\tboxplotData.push(record)\n\t\t}\n\n\t\treturn boxplotData\n\t}\n\n\tgetTabularDataArray() {\n\t\tconst options = this.getOptions()\n\t\tconst { groupMapsTo } = options.data\n\t\tconst boxplotData = this.getBoxplotData()\n\t\tconst { number: numberFormatter, code: localeCode } = getProperty(options, 'locale')\n\n\t\tconst headers = ['Group', 'Minimum', 'Q1', 'Median', 'Q3', 'Maximum', 'IQR', 'Outlier(s)']\n\t\tconst cells = [\n\t\t\t...boxplotData.map(datum => {\n\t\t\t\tlet outliers = getProperty(datum, 'outliers')\n\t\t\t\tif (outliers === null || outliers.length === 0) {\n\t\t\t\t\toutliers = ['–']\n\t\t\t\t}\n\t\t\t\treturn [\n\t\t\t\t\tdatum[groupMapsTo],\n\t\t\t\t\tgetProperty(datum, 'whiskers', 'min') !== null\n\t\t\t\t\t\t? numberFormatter(getProperty(datum, 'whiskers', 'min'), localeCode)\n\t\t\t\t\t\t: '–',\n\t\t\t\t\tgetProperty(datum, 'quartiles', 'q_25') !== null\n\t\t\t\t\t\t? numberFormatter(getProperty(datum, 'quartiles', 'q_25'), localeCode)\n\t\t\t\t\t\t: '–',\n\t\t\t\t\tgetProperty(datum, 'quartiles', 'q_50') !== null\n\t\t\t\t\t\t? numberFormatter(getProperty(datum, 'quartiles', 'q_50'), localeCode)\n\t\t\t\t\t\t: '–',\n\t\t\t\t\tgetProperty(datum, 'quartiles', 'q_75') !== null\n\t\t\t\t\t\t? numberFormatter(getProperty(datum, 'quartiles', 'q_75'), localeCode)\n\t\t\t\t\t\t: '–',\n\t\t\t\t\tgetProperty(datum, 'whiskers', 'max') !== null\n\t\t\t\t\t\t? numberFormatter(getProperty(datum, 'whiskers', 'max'), localeCode)\n\t\t\t\t\t\t: '–',\n\t\t\t\t\tgetProperty(datum, 'quartiles', 'q_75') !== null &&\n\t\t\t\t\tgetProperty(datum, 'quartiles', 'q_25') !== null\n\t\t\t\t\t\t? (numberFormatter(\n\t\t\t\t\t\t\t\tgetProperty(datum, 'quartiles', 'q_75') - getProperty(datum, 'quartiles', 'q_25')\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tlocaleCode)\n\t\t\t\t\t\t: '–',\n\t\t\t\t\toutliers.map((d: any) => numberFormatter(d, localeCode)).join(',')\n\t\t\t\t]\n\t\t\t})\n\t\t]\n\n\t\treturn super.formatTable({ headers, cells })\n\t}\n\n\tprotected setColorClassNames() {\n\t\t// monochrome\n\t\tconst numberOfColors = 1\n\n\t\tconst colorPairingOptions = getProperty(this.getOptions(), 'color', 'pairing')\n\t\tlet pairingOption = getProperty(colorPairingOptions, 'option')\n\t\tconst colorPairingCounts = colorConfigs.pairingOptions\n\n\t\t// Use default palette if user choice is not in range\n\t\tpairingOption =\n\t\t\tpairingOption <= colorPairingCounts[`${numberOfColors}-color`] ? pairingOption : 1\n\n\t\t// Create color classes for graph, tooltip and stroke use\n\t\tconst colorPairing = this.allDataGroups.map(() => `${numberOfColors}-${pairingOption}-1`)\n\n\t\t// Create default color classnames\n\t\tthis.colorClassNames = scaleOrdinal().range(colorPairing).domain(this.allDataGroups)\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 { AxisChart } from '@/axis-chart'\nimport { options } from '@/configuration'\nimport { mergeDefaultChartOptions } from '@/tools'\nimport { BoxplotChartModel } from '@/model/boxplot'\nimport type { BoxplotChartOptions } from '@/interfaces/charts'\nimport type { ChartConfig } from '@/interfaces/model'\nimport { Skeletons } from '@/interfaces/enums'\nimport type { Component } from '@/components/component'\nimport { Grid } from '@/components/axes/grid'\nimport { Boxplot } from '@/components/graphs/boxplot'\nimport { TwoDimensionalAxes } from '@/components/axes/two-dimensional-axes'\nimport { ZeroLine } from '@/components/axes/zero-line'\nimport { Skeleton } from '@/components/graphs/skeleton'\n\nexport class BoxplotChart extends AxisChart {\n\tmodel = new BoxplotChartModel(this.services)\n\n\tconstructor(holder: HTMLDivElement, chartConfigs: ChartConfig) {\n\t\tsuper(holder, chartConfigs)\n\n\t\t// Merge the default options for this chart\n\t\t// With the user provided options\n\t\tthis.model.setOptions(mergeDefaultChartOptions(options.boxplotChart, chartConfigs.options))\n\n\t\t// Initialize data, services, components etc.\n\t\tthis.init(holder, chartConfigs)\n\t}\n\n\t/**\n\t * Retrieves the components to be rendered inside the graph frame.\n\t *\n\t * @returns {Component[]} An array of components to be rendered.\n\t */\n\tgetComponents() {\n\t\tconst graphFrameComponents: Component[] = [\n\t\t\tnew TwoDimensionalAxes(this.model, this.services),\n\t\t\tnew Grid(this.model, this.services),\n\t\t\tnew Boxplot(this.model, this.services),\n\t\t\tnew ZeroLine(this.model, this.services),\n\t\t\tnew Skeleton(this.model, this.services, {\n\t\t\t\tskeleton: Skeletons.VERT_OR_HORIZ\n\t\t\t})\n\t\t]\n\n\t\tconst components: Component[] = this.getAxisChartComponents(graphFrameComponents, {\n\t\t\tlegend: {\n\t\t\t\tenabled: false\n\t\t\t}\n\t\t})\n\t\treturn components\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 { AxisChart } from '@/axis-chart'\nimport { options } from '@/configuration'\nimport { mergeDefaultChartOptions } from '@/tools'\nimport type { ChartConfig } from '@/interfaces/model'\nimport { Skeletons } from '@/interfaces/enums'\nimport type { BubbleChartOptions } from '@/interfaces/charts'\nimport type { Component } from '@/components/component'\nimport { Grid } from '@/components/axes/grid'\nimport { Ruler } from '@/components/axes/ruler'\nimport { Bubble } from '@/components/graphs/bubble'\nimport { TwoDimensionalAxes } from '@/components/axes/two-dimensional-axes'\nimport { Skeleton } from '@/components/graphs/skeleton'\n\nexport class BubbleChart extends AxisChart {\n\tconstructor(holder: HTMLDivElement, chartConfigs: ChartConfig) {\n\t\tsuper(holder, chartConfigs)\n\n\t\t// Merge the default options for this chart\n\t\t// With the user provided options\n\t\tthis.model.setOptions(mergeDefaultChartOptions(options.bubbleChart, chartConfigs.options))\n\n\t\t// Initialize data, services, components etc.\n\t\tthis.init(holder, chartConfigs)\n\t}\n\n\t/**\n\t * Retrieves the components to be rendered inside the graph frame.\n\t *\n\t * @returns {Component[]} An array of components to be rendered.\n\t */\n\tgetComponents() {\n\t\tconst graphFrameComponents: Component[] = [\n\t\t\tnew TwoDimensionalAxes(this.model, this.services),\n\t\t\tnew Grid(this.model, this.services),\n\t\t\tnew Ruler(this.model, this.services),\n\t\t\tnew Bubble(this.model, this.services),\n\t\t\tnew Skeleton(this.model, this.services, {\n\t\t\t\tskeleton: Skeletons.GRID\n\t\t\t})\n\t\t]\n\n\t\tconst components: Component[] = this.getAxisChartComponents(graphFrameComponents)\n\t\treturn components\n\t}\n}\n","import { getProperty } from '@/tools'\nimport { ChartModelCartesian } from './cartesian-charts'\n\n/**\n * Bullet chart model layer\n */\nexport class BulletChartModel extends ChartModelCartesian {\n\tconstructor(services: any) {\n\t\tsuper(services)\n\t}\n\n\t/**\n\t * Determines the index of the performance area titles to use\n\t * @param datum\n\t * @returns number\n\t */\n\tgetMatchingRangeIndexForDatapoint(datum: any) {\n\t\tlet matchingRangeIndex\n\t\tfor (let i = datum.ranges.length - 1; i > 0; i--) {\n\t\t\tconst range = datum.ranges[i]\n\t\t\tif (datum.value >= range) {\n\t\t\t\tmatchingRangeIndex = i\n\n\t\t\t\treturn matchingRangeIndex\n\t\t\t}\n\t\t}\n\n\t\treturn 0\n\t}\n\n\tgetTabularDataArray() {\n\t\tconst displayData = this.getDisplayData()\n\t\tconst options = this.getOptions()\n\t\tconst { groupMapsTo } = options.data\n\t\tconst rangeIdentifier = this.services.cartesianScales.getRangeIdentifier()\n\t\tconst { number: numberFormatter, code: localeCode } = getProperty(options, 'locale')\n\n\t\tconst performanceAreaTitles = getProperty(options, 'bullet', 'performanceAreaTitles')\n\t\tconst headers = ['Title', 'Group', 'Value', 'Target', 'Percentage', 'Performance']\n\t\tconst cells = [\n\t\t\t...displayData.map((datum: any) => [\n\t\t\t\tdatum['title'],\n\t\t\t\tdatum[groupMapsTo],\n\t\t\t\tdatum['value'] === null ? '–' : numberFormatter(datum['value'], localeCode),\n\t\t\t\tgetProperty(datum, 'marker') === null\n\t\t\t\t\t? '–'\n\t\t\t\t\t: numberFormatter(datum['marker'], localeCode),\n\t\t\t\tgetProperty(datum, 'marker') === null\n\t\t\t\t\t? '–'\n\t\t\t\t\t: `${numberFormatter(Math.floor((datum[rangeIdentifier] / datum.marker) * 100), localeCode)}%`,\n\t\t\t\tperformanceAreaTitles[this.getMatchingRangeIndexForDatapoint(datum)]\n\t\t\t])\n\t\t]\n\n\t\treturn super.formatTable({ headers, cells })\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","import { AxisChart } from '@/axis-chart'\nimport { options } from '@/configuration'\nimport { mergeDefaultChartOptions } from '@/tools'\nimport { BulletChartModel } from '@/model/bullet'\nimport type { BulletChartOptions } from '@/interfaces/charts'\nimport type { ChartConfig } from '@/interfaces/model'\nimport { Skeletons } from '@/interfaces/enums'\nimport { Bullet } from '@/components/graphs/bullet'\nimport type { Component } from '@/components/component'\nimport { Grid } from '@/components/axes/grid'\nimport { TwoDimensionalAxes } from '@/components/axes/two-dimensional-axes'\nimport { Skeleton } from '@/components/graphs/skeleton'\n\nexport class BulletChart extends AxisChart {\n\tmodel = new BulletChartModel(this.services)\n\n\tconstructor(holder: HTMLDivElement, chartConfigs: ChartConfig) {\n\t\tsuper(holder, chartConfigs)\n\n\t\t// Merge the default options for this chart\n\t\t// With the user provided options\n\t\tthis.model.setOptions(mergeDefaultChartOptions(options.bulletChart, chartConfigs.options))\n\n\t\t// Initialize data, services, components etc.\n\t\tthis.init(holder, chartConfigs)\n\t}\n\n\t/**\n\t * Retrieves the components to be rendered inside the graph frame.\n\t *\n\t * @returns {Component[]} An array of components to be rendered.\n\t */\n\tgetComponents() {\n\t\tconst graphFrameComponents: Component[] = [\n\t\t\tnew TwoDimensionalAxes(this.model, this.services),\n\t\t\tnew Grid(this.model, this.services),\n\t\t\tnew Bullet(this.model, this.services),\n\t\t\tnew Skeleton(this.model, this.services, {\n\t\t\t\tskeleton: Skeletons.GRID\n\t\t\t})\n\t\t]\n\n\t\tconst components: Component[] = this.getAxisChartComponents(graphFrameComponents)\n\t\treturn components\n\t}\n}\n","import { extent, scaleLinear, scaleQuantize } from 'd3'\nimport { isEmpty } from 'lodash-es'\nimport { getProperty } from '@/tools'\n\nexport function getDomain(data: any) {\n\tconst limits = extent(data, (d: any) => d.value)\n\tconst domain = scaleLinear()\n\t\t.domain(limits as [number, number])\n\t\t.nice()\n\t\t.domain()\n\n\t// Ensuring limits start at 0 to make scale look more `nicer`\n\tif (domain[0] > 0) {\n\t\tdomain[0] = 0\n\t} else if (domain[0] === 0 && domain[1] === 0) {\n\t\t// Range cannot be between 0 and 0 (itself)\n\t\treturn [0, 1]\n\t}\n\n\t// Ensure the median of the range is 0 if domain extends into both negative & positive\n\tif (domain[0] < 0 && domain[1] > 0) {\n\t\tif (Math.abs(domain[0]) > domain[1]) {\n\t\t\tdomain[1] = Math.abs(domain[0])\n\t\t} else {\n\t\t\tdomain[0] = -domain[1]\n\t\t}\n\t}\n\n\treturn domain\n}\n\nexport function getColorScale(displayData: any, colorOptions: any) {\n\tconst customColors = getProperty(colorOptions, 'gradient', 'colors')\n\tconst customColorsEnabled = !isEmpty(customColors)\n\n\tlet colorPairingOption = getProperty(colorOptions, 'pairing', 'option')\n\n\t// If domain consists of negative and positive values, use diverging palettes\n\tconst domain = getDomain(displayData)\n\tconst colorScheme = domain[0] < 0 && domain[1] > 0 ? 'diverge' : 'mono'\n\n\t// Use default color pairing options if not in defined range\n\tif (colorPairingOption < 1 && colorPairingOption > 4 && colorScheme === 'mono') {\n\t\tcolorPairingOption = 1\n\t} else if (colorPairingOption < 1 && colorPairingOption > 2 && colorScheme === 'diverge') {\n\t\tcolorPairingOption = 1\n\t}\n\n\t// Uses CSS classes for fill\n\tconst colorPairing = customColorsEnabled ? customColors : []\n\n\tif (!customColorsEnabled) {\n\t\t// Add class names to list and the amount based on the color scheme\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\t\tfor (let i = 1; i < colorGroupingLength + 1; i++) {\n\t\t\tcolorPairing.push(`fill-${colorScheme}-${colorPairingOption}-${i}`)\n\t\t}\n\t}\n\n\t// Return generated color scale\n\treturn scaleQuantize()\n\t\t.domain(domain as [number, number])\n\t\t.range(colorPairing)\n}\n","// External Imports\nimport { isEmpty } from 'lodash-es'\n\n// Internal Imports\nimport { ChartModel } from './model'\nimport { getProperty } from '@/tools'\nimport { getColorScale } from '@/services/color-scale-utils'\n\n/**\n * Base thematic maps chart model layer\n */\nexport class ChoroplethModel extends ChartModel {\n\tprivate _colorScale: any = undefined\n\n\t// Holds a mapping of geometry objects to data objects\n\t// Allows us to access data faster\n\tprivate _matrix = {}\n\n\tconstructor(services: any) {\n\t\tsuper(services)\n\t}\n\n\t/**\n\t * @override\n\t * @param value\n\t * @returns string\n\t */\n\tgetFillColor(value: number) {\n\t\treturn this._colorScale(value)\n\t}\n\n\t/**\n\t * Helper function that will generate a dictionary\n\t */\n\tgetCombinedData() {\n\t\tif (isEmpty(this._matrix)) {\n\t\t\tconst options = this.getOptions()\n\t\t\tconst data = this.getDisplayData()\n\t\t\tif (!isEmpty(data) && !isEmpty(options.geoData.objects.countries)) {\n\t\t\t\t/**\n\t\t\t\t * @todo\n\t\t\t\t * We can either use name or id by default to generate this dictionary\n\t\t\t\t * Curently id & name are standard in geoJSON. Unfortunately, topojson does not have any standard\n\t\t\t\t * so feature objects can have any key. We suggest that they include name or id at the very least\n\t\t\t\t *\n\t\t\t\t * May need to provide users with the option to pass in keys to create dictionary with\n\t\t\t\t */\n\t\t\t\toptions.geoData.objects.countries.geometries.forEach(country => {\n\t\t\t\t\tthis._matrix[country.properties.NAME] = country\n\t\t\t\t})\n\n\t\t\t\tdata.forEach(value => {\n\t\t\t\t\tif (this._matrix[value.name]) {\n\t\t\t\t\t\tthis._matrix[value.name]['value'] = value.value || null\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconsole.warn(`Data point ${value} is missing geographical data.`)\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\n\t\treturn this._matrix\n\t}\n\n\t/**\n\t * Generate tabular data from display data\n\t * @returns Array\n\t */\n\tgetTabularDataArray() {\n\t\tconst displayData = this.getDisplayData()\n\t\tconst { number: numberFormatter, code: localeCode } = getProperty(this.getOptions(), 'locale')\n\n\t\tconst headers = ['Country ID', 'Country Name', 'Value']\n\t\tconst cells = [\n\t\t\t...displayData.map(datum => [\n\t\t\t\tdatum['id'] === null ? '–' : datum['id'],\n\t\t\t\tdatum['name'],\n\t\t\t\tdatum['value'] === null ? '–' : numberFormatter(datum['value'], localeCode)\n\t\t\t])\n\t\t]\n\n\t\treturn super.formatTable({ headers, cells })\n\t}\n\n\t// Uses quantize scale to return class names\n\tgetColorClassName(configs: { value?: number; originalClassName?: string }) {\n\t\treturn `${configs.originalClassName} ${this._colorScale(configs.value as number)}`\n\t}\n\n\tprotected setColorClassNames() {\n\t\tconst colorOptions = getProperty(this.getOptions(), 'color')\n\t\tthis._colorScale = getColorScale(this.getDisplayData(), colorOptions)\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 { 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 { TextAnchor, DominantBaseline } from '@/interfaces/enums'\n\nexport interface Point {\n\tx: number\n\ty: number\n}\n\nexport type Angle = number\n\nexport interface LabelAlignment {\n\ttextAnchor: TextAnchor\n\tdominantBaseline: DominantBaseline\n}\n\nexport function radialLabelPlacement(angleRadians: Angle): LabelAlignment {\n\tconst angle = mod(radToDeg(angleRadians), 360)\n\n\tif (isInRange(angle, [0, 10]) || isInRange(angle, [350, 0])) {\n\t\treturn {\n\t\t\ttextAnchor: TextAnchor.START,\n\t\t\tdominantBaseline: DominantBaseline.MIDDLE\n\t\t}\n\t} else if (isInRange(angle, [10, 80])) {\n\t\treturn {\n\t\t\ttextAnchor: TextAnchor.START,\n\t\t\tdominantBaseline: DominantBaseline.HANGING\n\t\t}\n\t} else if (isInRange(angle, [80, 100])) {\n\t\treturn {\n\t\t\ttextAnchor: TextAnchor.MIDDLE,\n\t\t\tdominantBaseline: DominantBaseline.HANGING\n\t\t}\n\t} else if (isInRange(angle, [100, 170])) {\n\t\treturn {\n\t\t\ttextAnchor: TextAnchor.END,\n\t\t\tdominantBaseline: DominantBaseline.HANGING\n\t\t}\n\t} else if (isInRange(angle, [170, 190])) {\n\t\treturn {\n\t\t\ttextAnchor: TextAnchor.END,\n\t\t\tdominantBaseline: DominantBaseline.MIDDLE\n\t\t}\n\t} else if (isInRange(angle, [190, 260])) {\n\t\treturn {\n\t\t\ttextAnchor: TextAnchor.END,\n\t\t\tdominantBaseline: DominantBaseline.BASELINE\n\t\t}\n\t} else if (isInRange(angle, [260, 280])) {\n\t\treturn {\n\t\t\ttextAnchor: TextAnchor.MIDDLE,\n\t\t\tdominantBaseline: DominantBaseline.BASELINE\n\t\t}\n\t} else {\n\t\t// 280 - 350\n\t\treturn {\n\t\t\ttextAnchor: TextAnchor.START,\n\t\t\tdominantBaseline: DominantBaseline.BASELINE\n\t\t}\n\t}\n}\n\nfunction mod(n: number, m: number) {\n\treturn ((n % m) + m) % m\n}\n\nfunction isInRange(x: number, [min, max]: [number, number]) {\n\treturn x >= min && x <= max\n}\n\nexport function radToDeg(rad: Angle): Angle {\n\treturn rad * (180 / Math.PI)\n}\n\nexport function degToRad(deg: Angle): Angle {\n\treturn deg * (Math.PI / 180)\n}\n\nexport function polarToCartesianCoords(a: Angle, r: number, t: Point = { x: 0, y: 0 }): Point {\n\tconst x = r * Math.cos(a) + t.x\n\tconst y = r * Math.sin(a) + t.y\n\n\t// NaN is rendered at coordinate 0 in browsers\n\t// By setting it to 0, further operations can be performed\n\treturn { x: isNaN(x) ? 0 : x, y: isNaN(y) ? 0 : y }\n}\n\n// Return the distance between a point (described with polar coordinates)\n// on a circumference and the vertical diameter.\n// If the point is on the left if the diameter, its distance is positive,\n// if it is on the right of the diameter, its distance is negative.\nexport function distanceBetweenPointOnCircAndVerticalDiameter(a: Angle, r: number) {\n\treturn r * Math.sin(a - Math.PI / 2)\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","import { Chart } from '@/chart'\nimport { options as configOptions } from '@/configuration'\nimport { getProperty, mergeDefaultChartOptions } from '@/tools'\nimport { ChoroplethModel } from '@/model/choropleth'\nimport type { ChoroplethChartOptions } from '@/interfaces/charts'\nimport type { ChartConfig } from '@/interfaces/model'\nimport { LayoutDirection, LayoutGrowth, RenderTypes, LayoutAlignItems } from '@/interfaces/enums'\nimport type { Component } from '@/components/component'\nimport { Choropleth } from '@/components/graphs/choropleth'\nimport { Modal } from '@/components/essentials/modal'\nimport { LayoutComponent } from '@/components/layout/layout'\nimport { ColorScaleLegend } from '@/components/essentials/color-scale-legend'\nimport { Title } from '@/components/essentials/title'\nimport { Spacer } from '@/components/layout/spacer'\nimport { Toolbar } from '@/components/axes/toolbar'\nimport { Tooltip } from '@/components/essentials/tooltip'\n\nexport class ChoroplethChart extends Chart {\n\tmodel = new ChoroplethModel(this.services)\n\n\tconstructor(holder: HTMLDivElement, chartConfigs: ChartConfig) {\n\t\tsuper(holder, chartConfigs)\n\n\t\t// Merge the default options for this chart\n\t\t// With the user provided options\n\t\tthis.model.setOptions(\n\t\t\tmergeDefaultChartOptions(configOptions.choroplethChart, chartConfigs.options)\n\t\t)\n\n\t\t// Initialize data, services, components etc.\n\t\tthis.init(holder, chartConfigs)\n\t}\n\n\t// Custom getChartComponents - Implements getChartComponents\n\t// Removes zoombar support and additional `features` that are not supported in heatmap\n\tprotected getChartComponents(graphFrameComponents: any[], configs?: any) {\n\t\tconst options = this.model.getOptions()\n\t\tconst toolbarEnabled = getProperty(options, 'toolbar', 'enabled')\n\n\t\tconst titleAvailable = !!this.model.getOptions().title\n\t\tconst titleComponent = {\n\t\t\tid: 'title',\n\t\t\tcomponents: [new Title(this.model, this.services)],\n\t\t\tgrowth: LayoutGrowth.STRETCH\n\t\t}\n\n\t\tconst toolbarComponent = {\n\t\t\tid: 'toolbar',\n\t\t\tcomponents: [new Toolbar(this.model, this.services)],\n\t\t\tgrowth: LayoutGrowth.PREFERRED\n\t\t}\n\n\t\tconst headerComponent = {\n\t\t\tid: 'header',\n\t\t\tcomponents: [\n\t\t\t\tnew LayoutComponent(\n\t\t\t\t\tthis.model,\n\t\t\t\t\tthis.services,\n\t\t\t\t\t[\n\t\t\t\t\t\t// always add title to keep layout correct\n\t\t\t\t\t\ttitleComponent,\n\t\t\t\t\t\t...(toolbarEnabled ? [toolbarComponent] : [])\n\t\t\t\t\t],\n\t\t\t\t\t{\n\t\t\t\t\t\tdirection: LayoutDirection.ROW,\n\t\t\t\t\t\talignItems: LayoutAlignItems.CENTER\n\t\t\t\t\t}\n\t\t\t\t)\n\t\t\t],\n\t\t\tgrowth: LayoutGrowth.PREFERRED\n\t\t}\n\n\t\tconst legendComponent = {\n\t\t\tid: 'legend',\n\t\t\tcomponents: [\n\t\t\t\tnew ColorScaleLegend(this.model, this.services, {\n\t\t\t\t\tchartType: 'choropleth'\n\t\t\t\t})\n\t\t\t],\n\t\t\tgrowth: LayoutGrowth.PREFERRED,\n\t\t\trenderType: RenderTypes.SVG\n\t\t}\n\n\t\tconst graphFrameComponent = {\n\t\t\tid: 'graph-frame',\n\t\t\tcomponents: graphFrameComponents,\n\t\t\tgrowth: LayoutGrowth.STRETCH,\n\t\t\trenderType: RenderTypes.SVG\n\t\t}\n\n\t\tconst isLegendEnabled =\n\t\t\tgetProperty(configs, 'legend', 'enabled') !== false &&\n\t\t\tthis.model.getOptions().legend.enabled !== false &&\n\t\t\tthis.model.getData().length > 0\n\n\t\t// Decide the position of the legend in reference to the chart\n\t\tconst fullFrameComponentDirection = LayoutDirection.COLUMN_REVERSE\n\n\t\tconst legendSpacerComponent = {\n\t\t\tid: 'spacer',\n\t\t\tcomponents: [new Spacer(this.model, this.services, { size: 15 })],\n\t\t\tgrowth: LayoutGrowth.PREFERRED\n\t\t}\n\n\t\tconst fullFrameComponent = {\n\t\t\tid: 'full-frame',\n\t\t\tcomponents: [\n\t\t\t\tnew LayoutComponent(\n\t\t\t\t\tthis.model,\n\t\t\t\t\tthis.services,\n\t\t\t\t\t[\n\t\t\t\t\t\t...(isLegendEnabled ? [legendComponent] : []),\n\t\t\t\t\t\t...(isLegendEnabled ? [legendSpacerComponent] : []),\n\t\t\t\t\t\tgraphFrameComponent\n\t\t\t\t\t],\n\t\t\t\t\t{\n\t\t\t\t\t\tdirection: fullFrameComponentDirection\n\t\t\t\t\t}\n\t\t\t\t)\n\t\t\t],\n\t\t\tgrowth: LayoutGrowth.STRETCH\n\t\t}\n\n\t\tconst topLevelLayoutComponents = []\n\t\t// header component is required for either title or toolbar\n\t\tif (titleAvailable || toolbarEnabled) {\n\t\t\ttopLevelLayoutComponents.push(headerComponent)\n\n\t\t\tconst titleSpacerComponent = {\n\t\t\t\tid: 'spacer',\n\t\t\t\tcomponents: [\n\t\t\t\t\tnew Spacer(this.model, this.services, toolbarEnabled ? { size: 15 } : undefined)\n\t\t\t\t],\n\t\t\t\tgrowth: LayoutGrowth.PREFERRED\n\t\t\t}\n\n\t\t\ttopLevelLayoutComponents.push(titleSpacerComponent)\n\t\t}\n\t\ttopLevelLayoutComponents.push(fullFrameComponent)\n\n\t\treturn [\n\t\t\tnew Tooltip(this.model, this.services),\n\t\t\tnew Modal(this.model, this.services),\n\t\t\tnew LayoutComponent(this.model, this.services, topLevelLayoutComponents, {\n\t\t\t\tdirection: LayoutDirection.COLUMN\n\t\t\t})\n\t\t]\n\t}\n\n\t/**\n\t * Retrieves the components to be rendered inside the graph frame.\n\t *\n\t * @returns {Component[]} An array of components to be rendered.\n\t */\n\tgetComponents() {\n\t\tconst graphFrameComponents: Component[] = [new Choropleth(this.model, this.services)]\n\n\t\tconst components: Component[] = this.getChartComponents(graphFrameComponents)\n\t\treturn components\n\t}\n}\n","import { merge } from 'lodash-es'\nimport { getProperty, updateLegendAdditionalItems } from '@/tools'\nimport { ChartModel } from './model'\nimport { LegendItemType } from '@/interfaces/enums'\n\n/** The charting model layer which includes mainly the chart data and options,\n * as well as some misc. information to be shared among components */\nexport class CirclePackChartModel extends ChartModel {\n\tparentNode = false\n\n\tconstructor(services: any) {\n\t\tsuper(services)\n\t\tthis.set({ depth: 2 }, { skipUpdate: true })\n\t}\n\n\tsetData(newData: any) {\n\t\tsuper.setData(newData)\n\t\tthis.setDataGroups()\n\t\tif (newData.length === 1) {\n\t\t\tthis.parentNode = true\n\t\t}\n\t\tthis.setZoom()\n\t}\n\n\tsetOptions(newOptions: any) {\n\t\tconst options = this.getOptions()\n\t\tconst zoomOptions = merge({}, newOptions, this.getZoomOptions(newOptions))\n\t\tupdateLegendAdditionalItems(options, zoomOptions)\n\n\t\tconst depth = this.getHierarchyLevel()\n\t\tconst userProvidedDepth = getProperty(options, 'circlePack', 'depth')\n\n\t\tthis.set({\n\t\t\toptions: merge(options, zoomOptions),\n\t\t\tdepth: userProvidedDepth && userProvidedDepth < 4 ? userProvidedDepth : depth\n\t\t})\n\t}\n\n\tgetZoomOptions(options?: any) {\n\t\tif (!this.getDisplayData()) {\n\t\t\treturn {}\n\t\t}\n\t\t// uses the user provided options and data to determine if there is zoom in this CP chart\n\t\tconst displayData = this.getDisplayData()\n\t\tconst zoomOptions = options ? options : this.getOptions()\n\t\tconst data =\n\t\t\tdisplayData.length === 1 && getProperty(displayData, 0, 'children')\n\t\t\t\t? getProperty(displayData, 0, 'children')\n\t\t\t\t: displayData\n\n\t\tlet depth = this.getHierarchyLevel()\n\t\t// check the data depth\n\t\tdata.some((datum: any) => {\n\t\t\tif (datum.children) {\n\t\t\t\tif (datum.children.some((item: any) => item.children)) {\n\t\t\t\t\tdepth = 3\n\t\t\t\t\treturn false\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\n\t\tif (getProperty(zoomOptions, 'canvasZoom', 'enabled') === true && depth > 2) {\n\t\t\treturn {\n\t\t\t\tlegend: {\n\t\t\t\t\tadditionalItems: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttype: LegendItemType.ZOOM,\n\t\t\t\t\t\t\tname: 'Click to zoom'\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\t\treturn null\n\t}\n\n\tsetZoom(options?: any) {\n\t\tthis.setOptions(this.getZoomOptions(options))\n\t}\n\n\t// update the hierarchy level\n\tupdateHierarchyLevel(depth: number) {\n\t\tthis.set({ depth: depth })\n\t}\n\n\tgetHierarchyLevel() {\n\t\treturn this.get('depth')\n\t}\n\n\thasParentNode() {\n\t\treturn this.parentNode\n\t}\n\n\t// set the datagroup name on the items that are it's children\n\tsetDataGroups() {\n\t\tconst data = this.getData()\n\t\tconst options = this.getOptions()\n\t\tconst { groupMapsTo } = options.data\n\n\t\tconst newData = data.map((depthOne: any) => {\n\t\t\tconst groupName = depthOne[groupMapsTo]\n\t\t\treturn this.setChildrenDataGroup(depthOne, groupName)\n\t\t})\n\n\t\tthis.set(\n\t\t\t{\n\t\t\t\tdata: newData\n\t\t\t},\n\t\t\t{ skipUpdate: true }\n\t\t)\n\t}\n\n\t// sets name recursively down the node tree\n\tprotected setChildrenDataGroup(node: any, name: any) {\n\t\tif (node.children) {\n\t\t\treturn {\n\t\t\t\t...node,\n\t\t\t\tdataGroupName: name,\n\t\t\t\tchildren: node.children.map((child: any) => {\n\t\t\t\t\treturn this.setChildrenDataGroup(child, name)\n\t\t\t\t})\n\t\t\t}\n\t\t} else {\n\t\t\treturn { ...node, dataGroupName: name }\n\t\t}\n\t}\n\n\tgetTabularDataArray() {\n\t\tconst displayData = this.getDisplayData()\n\t\tconst { number: numberFormatter, code: localeCode } = getProperty(this.getOptions(), 'locale')\n\n\t\tconst headers = ['Child', 'Parent', 'Value']\n\t\tconst cells = []\n\n\t\tdisplayData.forEach((datum: any) => {\n\t\t\tlet value = datum.value ? datum.value : 0\n\t\t\tif (datum.children) {\n\t\t\t\t// Call recursive function\n\t\t\t\tvalue += this.getChildrenDatums(datum.children, datum.name, cells, 0)\n\t\t\t}\n\t\t\tcells.push(['–', datum.name, numberFormatter(value, localeCode)])\n\t\t})\n\n\t\treturn super.formatTable({ headers, cells })\n\t}\n\n\t/**\n\t * Recursively determine the relationship between all the nested elements in the child\n\t * @private\n\t * @param {any} children - The children nodes to process.\n\t * @param {any} parent - The parent node associated with the children.\n\t * @param {string[][]} [result=[]] - An array to accumulate the resulting data.\n\t * @param {number} [totalSum=0] - The running total sum of values processed.\n\t * @returns {number} Sum.\n\t */\n\tprivate getChildrenDatums(children: any, parent: any, result: string[][] = [], totalSum = 0) {\n\t\tconst grandParent = parent\n\t\tconst { number: numberFormatter, code: localeCode } = getProperty(this.getOptions(), 'locale')\n\n\t\tchildren.forEach((child: any) => {\n\t\t\tconst parentWithinIteration = child.name\n\t\t\tlet sum = 0\n\n\t\t\tif (child.children) {\n\t\t\t\tif (child.children.length > 0) {\n\t\t\t\t\tif (typeof child.value === 'number') {\n\t\t\t\t\t\ttotalSum += child.value\n\t\t\t\t\t}\n\n\t\t\t\t\tsum += this.getChildrenDatums(child.children, parentWithinIteration, result, sum)\n\t\t\t\t\tresult.push([parentWithinIteration, grandParent, numberFormatter(sum, localeCode)])\n\t\t\t\t\ttotalSum += sum\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tlet value = 0\n\t\t\t\tif (typeof child.value === 'number') {\n\t\t\t\t\tvalue = child.value\n\t\t\t\t\ttotalSum += child.value\n\t\t\t\t}\n\t\t\t\tresult.push([child.name, grandParent, numberFormatter(value, localeCode)])\n\t\t\t}\n\t\t})\n\n\t\treturn totalSum\n\t}\n}\n","import { Chart } from '@/chart'\nimport { options } from '@/configuration'\nimport { mergeDefaultChartOptions } from '@/tools'\nimport { CirclePackChartModel } from '@/model/circle-pack'\nimport type { ChartConfig } from '@/interfaces/model'\nimport type { CirclePackChartOptions } from '@/interfaces/charts'\nimport type { Component } from '@/components/component'\nimport { CirclePack } from '@/components/graphs/circle-pack'\n\nexport class CirclePackChart extends Chart {\n\tmodel = new CirclePackChartModel(this.services)\n\n\tconstructor(holder: HTMLDivElement, chartConfigs: ChartConfig) {\n\t\tsuper(holder, chartConfigs)\n\n\t\t// Merge the default options for this chart\n\t\t// With the user provided options\n\t\tthis.model.setOptions(mergeDefaultChartOptions(options.circlePackChart, chartConfigs.options))\n\n\t\t// Initialize data, services, components etc.\n\t\tthis.init(holder, chartConfigs)\n\t}\n\n\t/**\n\t * Retrieves the components to be rendered inside the graph frame.\n\t *\n\t * @returns {Component[]} An array of components to be rendered.\n\t */\n\tgetComponents() {\n\t\tconst graphFrameComponents: Component[] = [new CirclePack(this.model, this.services)]\n\n\t\t// get the base chart components and export with tooltip\n\t\tconst components: Component[] = this.getChartComponents(graphFrameComponents)\n\t\treturn components\n\t}\n}\n","import { camelCase, flatten, merge } from 'lodash-es'\nimport { AxisChart } from '@/axis-chart'\nimport { options as configOptions } from '@/configuration'\nimport { mergeDefaultChartOptions } from '@/tools'\nimport type { ChartConfig } from '@/interfaces/model'\nimport { ChartTypes, Skeletons } from '@/interfaces/enums'\nimport type { ComboChartOptions } from '@/interfaces/charts'\nimport type { Component } from '@/components/component'\nimport { Grid } from '@/components/axes/grid'\nimport { TwoDimensionalAxes } from '@/components/axes/two-dimensional-axes'\nimport { Line } from '@/components/graphs/line'\nimport { Skeleton } from '@/components/graphs/skeleton'\nimport { SimpleBar } from '@/components/graphs/bar-simple'\nimport { GroupedBar } from '@/components/graphs/bar-grouped'\nimport { StackedRuler } from '@/components/axes/ruler-stacked'\nimport { Area } from '@/components/graphs/area'\nimport { Ruler } from '@/components/axes/ruler'\nimport { Scatter } from '@/components/graphs/scatter'\nimport { ZeroLine } from '@/components/axes/zero-line'\nimport { StackedArea } from '@/components/graphs/area-stacked'\nimport { StackedBar } from '@/components/graphs/bar-stacked'\nimport { StackedScatter } from '@/components/graphs/scatter-stacked'\n\nconst graphComponentsMap = {\n\t[ChartTypes.LINE]: [Line, Scatter],\n\t[ChartTypes.SCATTER]: [Scatter],\n\t[ChartTypes.AREA]: [Area, Line, Scatter],\n\t[ChartTypes.STACKED_AREA]: [StackedArea, Line, StackedScatter, StackedRuler],\n\t[ChartTypes.SIMPLE_BAR]: [SimpleBar],\n\t[ChartTypes.GROUPED_BAR]: [GroupedBar, ZeroLine],\n\t[ChartTypes.STACKED_BAR]: [StackedBar, StackedRuler]\n}\n\nexport class ComboChart extends AxisChart {\n\tconstructor(holder: HTMLDivElement, chartConfigs: ChartConfig) {\n\t\tsuper(holder, chartConfigs)\n\n\t\t// Merge the default options for this chart\n\t\t// With the user provided options\n\t\tconst chartOptions = mergeDefaultChartOptions(configOptions.comboChart, chartConfigs.options)\n\n\t\t// Warn user if no comboChartTypes defined\n\t\t// Use skeleton chart instead\n\t\tif (!chartConfigs.options.comboChartTypes) {\n\t\t\tconsole.error('No comboChartTypes defined for the Combo Chart!')\n\t\t\t// add a default chart to get an empty chart\n\t\t\tchartOptions.comboChartTypes = [{ type: ChartTypes.LINE, correspondingDatasets: [] }]\n\t\t}\n\n\t\t// set the global options\n\t\tthis.model.setOptions(chartOptions)\n\n\t\t// Initialize data, services, components etc.\n\t\tthis.init(holder, chartConfigs)\n\t}\n\n\tgetGraphComponents() {\n\t\tconst { comboChartTypes }: { comboChartTypes: Component[] } = this.model.getOptions()\n\t\tlet counter = 0\n\t\tconst graphComponents: Component[] = comboChartTypes\n\t\t\t.map((graph: any) => {\n\t\t\t\tconst type = graph.type\n\t\t\t\tlet options: any\n\n\t\t\t\t// initializes the components using input strings with the base configs for each chart\n\t\t\t\tif (typeof graph.type === 'string') {\n\t\t\t\t\t// check if it is in the components map\n\t\t\t\t\t// if it isn't then it is not a valid carbon chart to use in combo\n\t\t\t\t\tif (!Object.keys(graphComponentsMap).includes(graph.type)) {\n\t\t\t\t\t\tconsole.error(\n\t\t\t\t\t\t\t`Invalid chart type \"${graph.type}\" specified for combo chart. Please refer to the ComboChart tutorial for more guidance.`\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\tlet stacked = false\n\t\t\t\t\tconst key = `${camelCase(graph.type)}Chart` as keyof typeof configOptions\n\t\t\t\t\toptions = merge({}, configOptions[key], this.model.getOptions(), graph.options)\n\t\t\t\t\t// if we are creating a stacked area, the contained Line chart needs to know it is stacked\n\t\t\t\t\tif (graph.type === ChartTypes.STACKED_AREA) {\n\t\t\t\t\t\tstacked = true\n\t\t\t\t\t}\n\t\t\t\t\treturn graphComponentsMap[graph.type as keyof typeof graphComponentsMap].map(\n\t\t\t\t\t\t(Component: any) =>\n\t\t\t\t\t\t\tnew Component(this.model, this.services, {\n\t\t\t\t\t\t\t\tgroups: graph.correspondingDatasets,\n\t\t\t\t\t\t\t\tid: counter++,\n\t\t\t\t\t\t\t\toptions: options,\n\t\t\t\t\t\t\t\tstacked\n\t\t\t\t\t\t\t})\n\t\t\t\t\t)\n\t\t\t\t} else {\n\t\t\t\t\t// user has imported a type or custom component to instantiate\n\t\t\t\t\toptions = merge({}, this.model.getOptions(), graph.options)\n\t\t\t\t\treturn new type(this.model, this.services, {\n\t\t\t\t\t\tgroups: graph.correspondingDatasets,\n\t\t\t\t\t\tid: counter++,\n\t\t\t\t\t\toptions: options\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t})\n\t\t\t.filter((item: any) => item !== null)\n\n\t\treturn flatten(graphComponents)\n\t}\n\n\t/**\n\t * Retrieves the components to be rendered inside the graph frame.\n\t *\n\t * @returns {Component[]} An array of components to be rendered.\n\t */\n\tgetComponents() {\n\t\tconst { comboChartTypes } = this.model.getOptions()\n\t\t// don't add the regular ruler if stacked ruler is added\n\t\tconst stackedRulerEnabled = comboChartTypes.some(\n\t\t\t(chartObject: any) =>\n\t\t\t\tchartObject.type === ChartTypes.STACKED_BAR || chartObject.type === ChartTypes.STACKED_AREA\n\t\t)\n\n\t\t// Specify what to render inside the graph-frame\n\t\tconst graphFrameComponents = [\n\t\t\tnew TwoDimensionalAxes(this.model, this.services),\n\t\t\tnew Grid(this.model, this.services),\n\t\t\tnew Skeleton(this.model, this.services, {\n\t\t\t\tskeleton: Skeletons.GRID\n\t\t\t}),\n\t\t\t...(stackedRulerEnabled ? [] : [new Ruler(this.model, this.services)]),\n\t\t\t...this.getGraphComponents()\n\t\t]\n\n\t\tconst components: Component[] = this.getAxisChartComponents(graphFrameComponents)\n\n\t\treturn components\n\t}\n}\n","import { ChartModel } from './model'\nimport { getProperty } from '@/tools'\n\n/** The charting model layer which includes mainly the chart data and options,\n * as well as some misc. information to be shared among components */\nexport class PieChartModel extends ChartModel {\n\tconstructor(services: any) {\n\t\tsuper(services)\n\t}\n\n\tgetTabularData(data: any) {\n\t\tconst tabularData = super.getTabularData(data)\n\n\t\t// if the data was changed to tabular format\n\t\t// update the group to the key so the slices render with the correct tooltips and colors\n\t\tif (data !== tabularData) {\n\t\t\t// If a label was set for the overall dataset, reassign it to key value\n\t\t\ttabularData.forEach((d: any) => {\n\t\t\t\tif (d.key && d.key !== d.group) {\n\t\t\t\t\td.group = d.key\n\t\t\t\t}\n\t\t\t})\n\t\t}\n\n\t\treturn tabularData\n\t}\n\n\tgetTabularDataArray() {\n\t\tconst displayData = this.getDisplayData()\n\t\tconst options = this.getOptions()\n\t\tconst { groupMapsTo } = options.data\n\t\tconst { valueMapsTo } = options.pie\n\t\tconst { number: numberFormatter, code: localeCode } = getProperty(options, 'locale')\n\n\t\tconst headers = ['Group', 'Value']\n\t\tconst cells = [\n\t\t\t...displayData.map((datum: any) => [\n\t\t\t\tdatum[groupMapsTo],\n\t\t\t\tdatum[valueMapsTo] === null ? '–' : numberFormatter(datum[valueMapsTo], localeCode)\n\t\t\t])\n\t\t]\n\n\t\treturn super.formatTable({ headers, cells })\n\t}\n\n\tsanitize(data: any) {\n\t\tconst tabularData = this.getTabularData(data)\n\n\t\t// Sort data based on value\n\t\treturn tabularData.sort((a, b) => b.value - a.value)\n\t}\n}\n","import { Chart } from '@/chart'\nimport { options } from '@/configuration'\nimport { mergeDefaultChartOptions } from '@/tools'\nimport { PieChartModel } from '@/model/pie'\nimport type { ChartConfig } from '@/interfaces/model'\nimport type { PieChartOptions } from '@/interfaces/charts'\nimport { Skeletons } from '@/interfaces/enums'\nimport type { Component } from '@/components/component'\nimport { Pie } from '@/components/graphs/pie'\nimport { Skeleton } from '@/components/graphs/skeleton'\n\nexport class PieChart extends Chart {\n\tmodel = new PieChartModel(this.services)\n\n\t// TODO - Optimize the use of \"extending\"\n\tconstructor(\n\t\tholder: HTMLDivElement,\n\t\tchartConfigs: ChartConfig,\n\t\textending = false\n\t) {\n\t\tsuper(holder, chartConfigs)\n\n\t\t// TODO - Optimize the use of \"extending\"\n\t\tif (extending) {\n\t\t\treturn\n\t\t}\n\n\t\t// Merge the default options for this chart\n\t\t// With the user provided options\n\t\tthis.model.setOptions(mergeDefaultChartOptions(options.pieChart, chartConfigs.options))\n\n\t\t// Initialize data, services, components etc.\n\t\tthis.init(holder, chartConfigs)\n\t}\n\n\t/**\n\t * Retrieves the components to be rendered inside the graph frame.\n\t *\n\t * @returns {Component[]} An array of components to be rendered.\n\t */\n\tgetComponents() {\n\t\tconst graphFrameComponents: Component[] = [\n\t\t\tnew Pie(this.model, this.services),\n\t\t\tnew Skeleton(this.model, this.services, {\n\t\t\t\tskeleton: Skeletons.PIE\n\t\t\t})\n\t\t]\n\n\t\t// get the base chart components and export with tooltip\n\t\tconst components: Component[] = this.getChartComponents(graphFrameComponents)\n\t\treturn components\n\t}\n}\n","import { PieChart } from './pie'\nimport { options } from '@/configuration'\nimport { mergeDefaultChartOptions } from '@/tools'\nimport type { ChartConfig } from '@/interfaces/model'\nimport type { PieChartOptions } from '@/interfaces/charts'\nimport { Skeletons } from '@/interfaces/enums'\nimport type { Component } from '@/components/component'\nimport { Donut } from '@/components/graphs/donut'\nimport { Skeleton } from '@/components/graphs/skeleton'\n\nexport class DonutChart extends PieChart {\n\tconstructor(holder: HTMLDivElement, chartConfigs: ChartConfig) {\n\t\tsuper(holder, chartConfigs, true)\n\n\t\t// Merge the default options for this chart\n\t\t// With the user provided options\n\t\tthis.model.setOptions(mergeDefaultChartOptions(options.donutChart, chartConfigs.options))\n\n\t\t// Initialize data, services, components etc.\n\t\tthis.init(holder, chartConfigs)\n\t}\n\n\t/**\n\t * Retrieves the components to be rendered inside the graph frame.\n\t *\n\t * @returns {Component[]} An array of components to be rendered.\n\t */\n\tgetComponents() {\n\t\tconst graphFrameComponents: Component[] = [\n\t\t\tnew Donut(this.model, this.services),\n\t\t\tnew Skeleton(this.model, this.services, {\n\t\t\t\tskeleton: Skeletons.DONUT\n\t\t\t})\n\t\t]\n\n\t\tconst components: Component[] = this.getChartComponents(graphFrameComponents)\n\t\treturn components\n\t}\n}\n","import { ChartModel } from './model'\nimport { getProperty } from '@/tools'\n\n/**\n * The gauge chart model layer\n */\nexport class GaugeChartModel extends ChartModel {\n\tconstructor(services: any) {\n\t\tsuper(services)\n\t}\n\n\tgetDataGroups() {\n\t\treturn super.getDataGroups().filter((item: any) => item.name !== 'delta')\n\t}\n\n\tgetTabularDataArray() {\n\t\tconst displayData = this.getDisplayData()\n\t\tconst options = this.getOptions()\n\t\tconst { groupMapsTo } = options.data\n\t\tconst { number: numberFormatter, code: localeCode } = getProperty(this.getOptions(), 'locale')\n\n\t\tconst headers = ['Group', 'Value']\n\t\tconst cells = [\n\t\t\t...displayData.map((datum: any) => [\n\t\t\t\tdatum[groupMapsTo],\n\t\t\t\tdatum['value'] === null ? '–' : numberFormatter(datum['value'], localeCode)\n\t\t\t])\n\t\t]\n\n\t\treturn super.formatTable({ headers, cells })\n\t}\n}\n","import { Chart } from '@/chart'\nimport { options } from '@/configuration'\nimport { mergeDefaultChartOptions } from '@/tools'\nimport type { ChartConfig } from '@/interfaces/model'\nimport type { GaugeChartOptions } from '@/interfaces/charts'\nimport { GaugeChartModel } from '@/model/gauge'\nimport type { Component } from '@/components/component'\nimport { Gauge } from '@/components/graphs/gauge'\n\nexport class GaugeChart extends Chart {\n\tmodel = new GaugeChartModel(this.services)\n\tconstructor(holder: HTMLDivElement, chartConfigs: ChartConfig) {\n\t\tsuper(holder, chartConfigs)\n\n\t\t// Merge the default options for this chart\n\t\t// With the user provided options\n\t\tthis.model.setOptions(mergeDefaultChartOptions(options.gaugeChart, chartConfigs.options))\n\n\t\t// Initialize data, services, components etc.\n\t\tthis.init(holder, chartConfigs)\n\t}\n\n\t/**\n\t * Retrieves the components to be rendered inside the graph frame.\n\t *\n\t * @returns {Component[]} An array of components to be rendered.\n\t */\n\tgetComponents() {\n\t\tconst graphFrameComponents: Component[] = [new Gauge(this.model, this.services)]\n\n\t\tconst components: Component[] = this.getChartComponents(graphFrameComponents)\n\n\t\treturn components\n\t}\n}\n","import { AxisChart } from '@/axis-chart'\nimport { options } from '@/configuration'\nimport { mergeDefaultChartOptions } from '@/tools'\nimport type { BarChartOptions } from '@/interfaces/charts'\nimport type { ChartConfig } from '@/interfaces/model'\nimport { Skeletons } from '@/interfaces/enums'\nimport type { Component } from '@/components/component'\nimport { Grid } from '@/components/axes/grid'\nimport { TwoDimensionalAxes } from '@/components/axes/two-dimensional-axes'\nimport { ZeroLine } from '@/components/axes/zero-line'\nimport { Skeleton } from '@/components/graphs/skeleton'\nimport { GroupedBar } from '@/components/graphs/bar-grouped'\n\nexport class GroupedBarChart extends AxisChart {\n\tconstructor(holder: HTMLDivElement, chartConfigs: ChartConfig) {\n\t\tsuper(holder, chartConfigs)\n\n\t\t// Merge the default options for this chart\n\t\t// With the user provided options\n\t\tthis.model.setOptions(mergeDefaultChartOptions(options.groupedBarChart, chartConfigs.options))\n\n\t\t// Initialize data, services, components etc.\n\t\tthis.init(holder, chartConfigs)\n\t}\n\n\t/**\n\t * Retrieves the components to be rendered inside the graph frame.\n\t *\n\t * @returns {Component[]} An array of components to be rendered.\n\t */\n\tgetComponents() {\n\t\tconst graphFrameComponents: Component[] = [\n\t\t\tnew TwoDimensionalAxes(this.model, this.services),\n\t\t\tnew Grid(this.model, this.services),\n\t\t\tnew GroupedBar(this.model, this.services),\n\t\t\tnew ZeroLine(this.model, this.services),\n\t\t\tnew Skeleton(this.model, this.services, {\n\t\t\t\tskeleton: Skeletons.VERT_OR_HORIZ\n\t\t\t})\n\t\t]\n\n\t\tconst components: Component[] = this.getAxisChartComponents(graphFrameComponents)\n\t\treturn components\n\t}\n}\n","import { extent, scaleQuantize, scaleLinear } from 'd3'\nimport { cloneDeep, isEmpty } from 'lodash-es'\nimport { getProperty } from '@/tools'\nimport { AxisFlavor, ScaleTypes } from '@/interfaces/enums'\nimport { getColorScale } from '@/services'\nimport { ChartModelCartesian } from './cartesian-charts'\n\n/** The gauge chart model layer */\nexport class HeatmapModel extends ChartModelCartesian {\n\taxisFlavor = AxisFlavor.HOVERABLE\n\tprivate _colorScale: any = undefined\n\n\t// List of unique ranges and domains\n\tprivate _domains: any[] = []\n\tprivate _ranges: any[] = []\n\n\tprivate _matrix: any = {}\n\n\tconstructor(services: any) {\n\t\tsuper(services)\n\n\t\t// Check which scale types are being used\n\t\tconst axis = getProperty(this.getOptions(), 'axes')\n\n\t\t// Need to check options since scale service hasn't been instantiated\n\t\tif (\n\t\t\t(!!getProperty(axis, 'left', 'scaleType') &&\n\t\t\t\tgetProperty(axis, 'left', 'scaleType') !== ScaleTypes.LABELS) ||\n\t\t\t(!!getProperty(axis, 'right', 'scaleType') &&\n\t\t\t\tgetProperty(axis, 'right', 'scaleType') !== ScaleTypes.LABELS) ||\n\t\t\t(!!getProperty(axis, 'top', 'scaleType') &&\n\t\t\t\tgetProperty(axis, 'top', 'scaleType') !== ScaleTypes.LABELS) ||\n\t\t\t(!!getProperty(axis, 'bottom', 'scaleType') &&\n\t\t\t\tgetProperty(axis, 'bottom', 'scaleType') !== ScaleTypes.LABELS)\n\t\t) {\n\t\t\tthrow Error('Heatmap only supports label scaletypes.')\n\t\t}\n\t}\n\n\t/**\n\t * Get min and maximum value of the display data\n\t * @returns Array consisting of smallest and largest values in data\n\t */\n\tgetValueDomain() {\n\t\tconst limits = extent(this.getDisplayData(), (d: any) => d.value)\n\t\tconst domain = scaleLinear()\n\t\t\t.domain(limits as [number, number])\n\t\t\t.nice()\n\t\t\t.domain()\n\n\t\t// Ensuring limits start at 0 to make scale look more `nicer`\n\t\tif (domain[0] > 0) {\n\t\t\tdomain[0] = 0\n\t\t} else if (domain[0] === 0 && domain[1] === 0) {\n\t\t\t// Range cannot be between 0 and 0 (itself)\n\t\t\treturn [0, 1]\n\t\t}\n\n\t\t// Ensure the median of the range is 0 if domain extends into both negative & positive\n\t\tif (domain[0] < 0 && domain[1] > 0) {\n\t\t\tif (Math.abs(domain[0]) > domain[1]) {\n\t\t\t\tdomain[1] = Math.abs(domain[0])\n\t\t\t} else {\n\t\t\t\tdomain[0] = -domain[1]\n\t\t\t}\n\t\t}\n\n\t\treturn domain\n\t}\n\n\t/**\n\t * @override\n\t * @param value\n\t * @returns string\n\t */\n\tgetFillColor(value: number) {\n\t\treturn this._colorScale(value)\n\t}\n\n\t/**\n\t * Generate a list of all unique domains\n\t * @returns String[]\n\t */\n\tgetUniqueDomain(): string[] {\n\t\tif (isEmpty(this._domains)) {\n\t\t\tconst displayData = this.getDisplayData()\n\t\t\tconst { cartesianScales } = this.services\n\n\t\t\tconst domainIdentifier = cartesianScales.getDomainIdentifier()\n\t\t\tconst mainXAxisPosition = cartesianScales.getMainXAxisPosition()\n\t\t\tconst customDomain = cartesianScales.getCustomDomainValuesByposition(mainXAxisPosition)\n\n\t\t\t// Use user defined domain if specified\n\t\t\tif (customDomain) {\n\t\t\t\treturn customDomain\n\t\t\t}\n\n\t\t\t// Get unique axis values & create a matrix\n\t\t\tthis._domains = Array.from(\n\t\t\t\tnew Set(\n\t\t\t\t\tdisplayData.map((d: any) => {\n\t\t\t\t\t\treturn d[domainIdentifier]\n\t\t\t\t\t})\n\t\t\t\t)\n\t\t\t)\n\t\t}\n\n\t\treturn this._domains\n\t}\n\n\t/**\n\t * Generates a list of all unique ranges\n\t * @returns String[]\n\t */\n\tgetUniqueRanges(): string[] {\n\t\tif (isEmpty(this._ranges)) {\n\t\t\tconst displayData = this.getDisplayData()\n\t\t\tconst { cartesianScales } = this.services\n\n\t\t\tconst rangeIdentifier = cartesianScales.getRangeIdentifier()\n\t\t\tconst mainYAxisPosition = cartesianScales.getMainYAxisPosition()\n\t\t\tconst customDomain = cartesianScales.getCustomDomainValuesByposition(mainYAxisPosition)\n\n\t\t\t// Use user defined domain if specified\n\t\t\tif (customDomain) {\n\t\t\t\treturn customDomain\n\t\t\t}\n\n\t\t\t// Get unique axis values & create a matrix\n\t\t\tthis._ranges = Array.from(\n\t\t\t\tnew Set(\n\t\t\t\t\tdisplayData.map((d: any) => {\n\t\t\t\t\t\treturn d[rangeIdentifier]\n\t\t\t\t\t})\n\t\t\t\t)\n\t\t\t)\n\t\t}\n\n\t\treturn this._ranges\n\t}\n\n\t/**\n\t * Generates a matrix (If doesn't exist) and returns it\n\t * @returns Object\n\t */\n\tgetMatrix() {\n\t\tif (isEmpty(this._matrix)) {\n\t\t\tconst uniqueDomain = this.getUniqueDomain()\n\t\t\tconst uniqueRange = this.getUniqueRanges()\n\n\t\t\tconst domainIdentifier = this.services.cartesianScales.getDomainIdentifier()\n\t\t\tconst rangeIdentifier = this.services.cartesianScales.getRangeIdentifier()\n\n\t\t\t// Create a column\n\t\t\tconst range: any = {}\n\t\t\tuniqueRange.forEach((ran: any) => {\n\t\t\t\t// Initialize matrix to empty state\n\t\t\t\trange[ran] = {\n\t\t\t\t\tvalue: null,\n\t\t\t\t\tindex: -1\n\t\t\t\t}\n\t\t\t})\n\n\t\t\t// Complete the matrix by cloning the column to all domains\n\t\t\tuniqueDomain.forEach((dom: any) => {\n\t\t\t\tthis._matrix[dom] = cloneDeep(range)\n\t\t\t})\n\n\t\t\t// Fill in user passed data\n\t\t\tthis.getDisplayData().forEach((d: any, i: number) => {\n\t\t\t\tthis._matrix[d[domainIdentifier]][d[rangeIdentifier]] = {\n\t\t\t\t\tvalue: d['value'],\n\t\t\t\t\tindex: i\n\t\t\t\t}\n\t\t\t})\n\t\t}\n\n\t\treturn this._matrix\n\t}\n\n\t/**\n\t * Sets the data for the current instance.\n\t *\n\t * This method sanitizes the provided data, generates data groups,\n\t * and updates the instance's state with the sanitized data and data groups.\n\t * It also resets the `_domains`, `_ranges`, and `_matrix` attributes to their empty states.\n\t *\n\t * @param {any} newData - The new data to be set. This data will be cloned and sanitized.\n\t * @returns {any} - The sanitized version of the provided data.\n\t */\n\tsetData(newData: any) {\n\t\tconst sanitizedData = this.sanitize(cloneDeep(newData))\n\t\tconst dataGroups = this.generateDataGroups(sanitizedData)\n\n\t\tthis.set({\n\t\t\tdata: sanitizedData,\n\t\t\tdataGroups\n\t\t})\n\n\t\t// Set attributes to empty\n\t\tthis._domains = []\n\t\tthis._ranges = []\n\t\tthis._matrix = {}\n\n\t\treturn sanitizedData\n\t}\n\n\t/**\n\t * Converts Object matrix into a single array\n\t * @returns object[]\n\t */\n\tgetMatrixAsArray(): object[] {\n\t\tif (isEmpty(this._matrix)) {\n\t\t\tthis.getMatrix()\n\t\t}\n\n\t\tconst uniqueDomain = this.getUniqueDomain()\n\t\tconst uniqueRange = this.getUniqueRanges()\n\n\t\tconst domainIdentifier = this.services.cartesianScales.getDomainIdentifier()\n\t\tconst rangeIdentifier = this.services.cartesianScales.getRangeIdentifier()\n\n\t\tconst arr: any[] = []\n\t\tuniqueDomain.forEach(domain => {\n\t\t\tuniqueRange.forEach(range => {\n\t\t\t\tconst element: any = {\n\t\t\t\t\tvalue: this._matrix[domain][range].value,\n\t\t\t\t\tindex: this._matrix[domain][range].index\n\t\t\t\t}\n\t\t\t\telement[domainIdentifier] = domain\n\t\t\t\telement[rangeIdentifier] = range\n\t\t\t\tarr.push(element)\n\t\t\t})\n\t\t})\n\n\t\treturn arr\n\t}\n\n\t/**\n\t * Generate tabular data from display data\n\t * @returns Array\n\t */\n\tgetTabularDataArray() {\n\t\tconst displayData = this.getDisplayData()\n\t\tconst { primaryDomain, primaryRange } = this.assignRangeAndDomains()\n\t\tconst { number: numberFormatter, code: localeCode } = getProperty(this.getOptions(), 'locale')\n\t\tlet domainValueFormatter: any\n\n\t\tconst headers = [primaryDomain.label, primaryRange.label, 'Value']\n\t\tconst cells = [\n\t\t\t...displayData.map((datum: any) => [\n\t\t\t\tdatum[primaryDomain.identifier] === null\n\t\t\t\t\t? '–'\n\t\t\t\t\t: domainValueFormatter\n\t\t\t\t\t\t? domainValueFormatter(datum[primaryDomain.identifier])\n\t\t\t\t\t\t: datum[primaryDomain.identifier],\n\n\t\t\t\tdatum[primaryRange.identifier] === null ? '–' : datum[primaryRange.identifier],\n\t\t\t\tdatum['value'] === null ? '–' : numberFormatter(datum['value'], localeCode)\n\t\t\t])\n\t\t]\n\n\t\treturn super.formatTable({ headers, cells })\n\t}\n\n\t// Uses quantize scale to return class names\n\tgetColorClassName(configs: { value?: number; originalClassName?: string }) {\n\t\treturn `${configs.originalClassName} ${this._colorScale(configs.value as number)}`\n\t}\n\n\tprotected setColorClassNames() {\n\t\tconst options = this.getOptions()\n\n\t\tconst customColors = getProperty(options, 'color', 'gradient', 'colors')\n\t\tconst customColorsEnabled = !isEmpty(customColors)\n\n\t\tlet colorPairingOption = getProperty(options, 'color', 'pairing', 'option')\n\n\t\t// If domain consists of negative and positive values, use diverging palettes\n\t\tconst domain = this.getValueDomain()\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\t// Uses css classes for fill\n\t\tconst colorPairing = customColorsEnabled ? customColors : []\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\t// Carbon charts has 11 colors for a single monochromatic palette & 17 for a divergent palette\n\t\t\tconst colorGroupingLength = colorScheme === 'diverge' ? 17 : 11\n\t\t\tfor (let i = 1; i < colorGroupingLength + 1; i++) {\n\t\t\t\tcolorPairing.push(`fill-${colorScheme}-${colorPairingOption}-${i}`)\n\t\t\t}\n\t\t}\n\n\t\t// Save scale type\n\t\tthis._colorScale = scaleQuantize()\n\t\t\t.domain(domain as [number, number])\n\t\t\t.range(colorPairing)\n\t\tconst colorOptions = getProperty(this.getOptions(), 'color')\n\t\tthis._colorScale = getColorScale(this.getDisplayData(), colorOptions)\n\t}\n}\n","import { AxisChart } from '@/axis-chart'\nimport { options as configOptions } from '@/configuration'\nimport { getProperty, mergeDefaultChartOptions } from '@/tools'\nimport { HeatmapModel } from '@/model/heatmap'\nimport type { HeatmapChartOptions } from '@/interfaces/charts'\nimport type { ChartConfig } from '@/interfaces/model'\nimport { LayoutDirection, LayoutGrowth, RenderTypes, LayoutAlignItems } from '@/interfaces/enums'\nimport type { Component } from '@/components/component'\nimport { Heatmap } from '@/components/graphs/heatmap'\nimport { TwoDimensionalAxes } from '@/components/axes/two-dimensional-axes'\nimport { Modal } from '@/components/essentials/modal'\nimport { LayoutComponent } from '@/components/layout/layout'\nimport { ColorScaleLegend } from '@/components/essentials/color-scale-legend'\nimport { Title } from '@/components/essentials/title'\nimport { AxisChartsTooltip } from '@/components/essentials/tooltip-axis'\nimport { Spacer } from '@/components/layout/spacer'\nimport { Toolbar } from '@/components/axes/toolbar'\n\nexport class HeatmapChart extends AxisChart {\n\tmodel = new HeatmapModel(this.services)\n\n\tconstructor(holder: HTMLDivElement, chartConfigs: ChartConfig) {\n\t\tsuper(holder, chartConfigs)\n\n\t\t// Merge the default options for this chart\n\t\t// With the user provided options\n\t\tthis.model.setOptions(\n\t\t\tmergeDefaultChartOptions(configOptions.heatmapChart, chartConfigs.options)\n\t\t)\n\n\t\t// Initialize data, services, components etc.\n\t\tthis.init(holder, chartConfigs)\n\t}\n\n\t// Custom getChartComponents - Implements getChartComponents\n\t// Removes zoombar support and additional `features` that are not supported in heatmap\n\tprotected getAxisChartComponents(graphFrameComponents: any[], configs?: any) {\n\t\tconst options = this.model.getOptions()\n\t\tconst toolbarEnabled = getProperty(options, 'toolbar', 'enabled')\n\n\t\tthis.services.cartesianScales.determineAxisDuality()\n\t\tthis.services.cartesianScales.findDomainAndRangeAxes() // need to do this before getMainXAxisPosition()\n\t\tthis.services.cartesianScales.determineOrientation()\n\n\t\tconst titleAvailable = !!this.model.getOptions().title\n\t\tconst titleComponent = {\n\t\t\tid: 'title',\n\t\t\tcomponents: [new Title(this.model, this.services)],\n\t\t\tgrowth: LayoutGrowth.STRETCH\n\t\t}\n\n\t\tconst toolbarComponent = {\n\t\t\tid: 'toolbar',\n\t\t\tcomponents: [new Toolbar(this.model, this.services)],\n\t\t\tgrowth: LayoutGrowth.PREFERRED\n\t\t}\n\n\t\tconst headerComponent = {\n\t\t\tid: 'header',\n\t\t\tcomponents: [\n\t\t\t\tnew LayoutComponent(\n\t\t\t\t\tthis.model,\n\t\t\t\t\tthis.services,\n\t\t\t\t\t[\n\t\t\t\t\t\t// always add title to keep layout correct\n\t\t\t\t\t\ttitleComponent,\n\t\t\t\t\t\t...(toolbarEnabled ? [toolbarComponent] : [])\n\t\t\t\t\t],\n\t\t\t\t\t{\n\t\t\t\t\t\tdirection: LayoutDirection.ROW,\n\t\t\t\t\t\talignItems: LayoutAlignItems.CENTER\n\t\t\t\t\t}\n\t\t\t\t)\n\t\t\t],\n\t\t\tgrowth: LayoutGrowth.PREFERRED\n\t\t}\n\n\t\tconst legendComponent = {\n\t\t\tid: 'legend',\n\t\t\tcomponents: [\n\t\t\t\tnew ColorScaleLegend(this.model, this.services, {\n\t\t\t\t\tchartType: 'heatmap'\n\t\t\t\t})\n\t\t\t],\n\t\t\tgrowth: LayoutGrowth.PREFERRED,\n\t\t\trenderType: RenderTypes.SVG\n\t\t}\n\n\t\tconst graphFrameComponent = {\n\t\t\tid: 'graph-frame',\n\t\t\tcomponents: graphFrameComponents,\n\t\t\tgrowth: LayoutGrowth.STRETCH,\n\t\t\trenderType: RenderTypes.SVG\n\t\t}\n\n\t\tconst isLegendEnabled =\n\t\t\tgetProperty(configs, 'legend', 'enabled') !== false &&\n\t\t\tthis.model.getOptions().legend.enabled !== false &&\n\t\t\tthis.model.getData().length > 0\n\n\t\t// Decide the position of the legend in reference to the chart\n\t\tconst fullFrameComponentDirection = LayoutDirection.COLUMN_REVERSE\n\n\t\tconst legendSpacerComponent = {\n\t\t\tid: 'spacer',\n\t\t\tcomponents: [new Spacer(this.model, this.services, { size: 15 })],\n\t\t\tgrowth: LayoutGrowth.PREFERRED\n\t\t}\n\n\t\tconst fullFrameComponent = {\n\t\t\tid: 'full-frame',\n\t\t\tcomponents: [\n\t\t\t\tnew LayoutComponent(\n\t\t\t\t\tthis.model,\n\t\t\t\t\tthis.services,\n\t\t\t\t\t[\n\t\t\t\t\t\t...(isLegendEnabled ? [legendComponent] : []),\n\t\t\t\t\t\t...(isLegendEnabled ? [legendSpacerComponent] : []),\n\t\t\t\t\t\tgraphFrameComponent\n\t\t\t\t\t],\n\t\t\t\t\t{\n\t\t\t\t\t\tdirection: fullFrameComponentDirection\n\t\t\t\t\t}\n\t\t\t\t)\n\t\t\t],\n\t\t\tgrowth: LayoutGrowth.STRETCH\n\t\t}\n\n\t\tconst topLevelLayoutComponents: any[] = []\n\t\t// header component is required for either title or toolbar\n\t\tif (titleAvailable || toolbarEnabled) {\n\t\t\ttopLevelLayoutComponents.push(headerComponent)\n\n\t\t\tconst titleSpacerComponent = {\n\t\t\t\tid: 'spacer',\n\t\t\t\tcomponents: [\n\t\t\t\t\tnew Spacer(this.model, this.services, toolbarEnabled ? { size: 15 } : undefined)\n\t\t\t\t],\n\t\t\t\tgrowth: LayoutGrowth.PREFERRED\n\t\t\t}\n\n\t\t\ttopLevelLayoutComponents.push(titleSpacerComponent)\n\t\t}\n\t\ttopLevelLayoutComponents.push(fullFrameComponent)\n\n\t\treturn [\n\t\t\tnew AxisChartsTooltip(this.model, this.services),\n\t\t\tnew Modal(this.model, this.services),\n\t\t\tnew LayoutComponent(this.model, this.services, topLevelLayoutComponents, {\n\t\t\t\tdirection: LayoutDirection.COLUMN\n\t\t\t})\n\t\t]\n\t}\n\n\t/**\n\t * Retrieves the components to be rendered inside the graph frame.\n\t *\n\t * @returns {Component[]} An array of components to be rendered.\n\t */\n\tgetComponents() {\n\t\tconst graphFrameComponents: Component[] = [\n\t\t\tnew TwoDimensionalAxes(this.model, this.services),\n\t\t\tnew Heatmap(this.model, this.services)\n\t\t]\n\n\t\tconst components: Component[] = this.getAxisChartComponents(graphFrameComponents)\n\t\treturn components\n\t}\n}\n","// Internal Imports\nimport { ChartModelCartesian } from './cartesian-charts'\nimport { getProperty } from '@/tools'\nimport { get } from 'lodash-es'\n\n/**\n * this is intended for binned type of charts\n * */\nexport class ChartModelBinned extends ChartModelCartesian {\n\tgetTabularDataArray() {\n\t\tconst options = this.getOptions()\n\t\tconst { groupMapsTo } = options.data\n\t\tconst { number: numberFormatter, code: localeCode } = getProperty(this.getOptions(), 'locale')\n\t\tconst binnedStackedData = this.getBinnedStackedData()\n\n\t\tconst headers = [\n\t\t\tget(options, 'bins.rangeLabel') || 'Range',\n\t\t\t...binnedStackedData.map(datum => get(datum, `0.${groupMapsTo}`))\n\t\t]\n\t\tconst cells = [\n\t\t\t...get(binnedStackedData, 0).map((d, i) => [\n\t\t\t\t`${numberFormatter(Number(get(d, 'data.x0')), localeCode)} – ${numberFormatter(\n\t\t\t\t\tNumber(get(d, 'data.x1')),\n\t\t\t\t\tlocaleCode\n\t\t\t\t)}`,\n\t\t\t\t...binnedStackedData.map(datum =>\n\t\t\t\t\tnumberFormatter(get(datum[i], `data.${get(datum[i], groupMapsTo)}`), localeCode)\n\t\t\t\t)\n\t\t\t])\n\t\t]\n\n\t\treturn super.formatTable({ headers, cells })\n\t}\n}\n","import { AxisChart } from '@/axis-chart'\nimport { options } from '@/configuration'\nimport { mergeDefaultChartOptions } from '@/tools'\nimport { ChartModelBinned } from '@/model/binned-charts'\nimport type { HistogramChartOptions } from '@/interfaces/charts'\nimport type { ChartConfig } from '@/interfaces/model'\nimport type { Component } from '@/components/component'\nimport { Grid } from '@/components/axes/grid'\nimport { TwoDimensionalAxes } from '@/components/axes/two-dimensional-axes'\nimport { Histogram } from '@/components/graphs/histogram'\nimport { BinnedRuler } from '@/components/axes/ruler-binned'\n\nexport class HistogramChart extends AxisChart {\n\tmodel = new ChartModelBinned(this.services)\n\n\tconstructor(holder: HTMLDivElement, chartConfigs: ChartConfig) {\n\t\tsuper(holder, chartConfigs)\n\n\t\t// Merge the default options for this chart\n\t\t// With the user provided options\n\t\tthis.model.setOptions(mergeDefaultChartOptions(options.histogramChart, chartConfigs.options))\n\n\t\t// Initialize data, services, components etc.\n\t\tthis.init(holder, chartConfigs)\n\n\t\tthis.update()\n\t}\n\n\t/**\n\t * Retrieves the components to be rendered inside the graph frame.\n\t *\n\t * @returns {Component[]} An array of components to be rendered.\n\t */\n\tgetComponents() {\n\t\tconst graphFrameComponents: Component[] = [\n\t\t\tnew TwoDimensionalAxes(this.model, this.services),\n\t\t\tnew Grid(this.model, this.services),\n\t\t\tnew BinnedRuler(this.model, this.services),\n\t\t\tnew Histogram(this.model, this.services)\n\t\t]\n\n\t\tconst components: Component[] = this.getAxisChartComponents(graphFrameComponents)\n\n\t\treturn components\n\t}\n}\n","import { AxisChart } from '@/axis-chart'\nimport { options } from '@/configuration'\nimport { mergeDefaultChartOptions } from '@/tools'\nimport type { ChartConfig } from '@/interfaces/model'\nimport type { LineChartOptions } from '@/interfaces/charts'\nimport type { Component } from '@/components/component'\nimport { Grid } from '@/components/axes/grid'\nimport { Ruler } from '@/components/axes/ruler'\nimport { Line } from '@/components/graphs/line'\nimport { Scatter } from '@/components/graphs/scatter'\nimport { TwoDimensionalAxes } from '@/components/axes/two-dimensional-axes'\nimport { ZeroLine } from '@/components/axes/zero-line'\nimport { SkeletonLines } from '@/components/graphs/skeleton-lines'\n\nexport class LineChart extends AxisChart {\n\tconstructor(holder: HTMLDivElement, chartConfigs: ChartConfig) {\n\t\tsuper(holder, chartConfigs)\n\n\t\t// Merge the default options for this chart\n\t\t// With the user provided options\n\t\tthis.model.setOptions(mergeDefaultChartOptions(options.lineChart, chartConfigs.options))\n\n\t\t// Initialize data, services, components etc.\n\t\tthis.init(holder, chartConfigs)\n\t}\n\n\t/**\n\t * Retrieves the components to be rendered inside the graph frame.\n\t *\n\t * @returns {Component[]} An array of components to be rendered.\n\t */\n\tgetComponents() {\n\t\tconst graphFrameComponents: Component[] = [\n\t\t\tnew TwoDimensionalAxes(this.model, this.services),\n\t\t\tnew Grid(this.model, this.services),\n\t\t\tnew Ruler(this.model, this.services),\n\t\t\tnew Line(this.model, this.services),\n\t\t\tnew Scatter(this.model, this.services, { handleThresholds: true }),\n\t\t\tnew SkeletonLines(this.model, this.services),\n\t\t\tnew ZeroLine(this.model, this.services)\n\t\t]\n\n\t\tconst components: Component[] = this.getAxisChartComponents(graphFrameComponents)\n\t\treturn components\n\t}\n}\n","import { AxisChart } from '@/axis-chart'\nimport { options } from '@/configuration'\nimport { mergeDefaultChartOptions } from '@/tools'\nimport type { ChartConfig } from '@/interfaces/model'\nimport type { LollipopChartOptions } from '@/interfaces/charts'\nimport { Skeletons } from '@/interfaces/enums'\nimport type { Component } from '@/components/component'\nimport { Grid } from '@/components/axes/grid'\nimport { Ruler } from '@/components/axes/ruler'\nimport { Scatter } from '@/components/graphs/scatter'\nimport { Lollipop } from '@/components/graphs/lollipop'\nimport { TwoDimensionalAxes } from '@/components/axes/two-dimensional-axes'\nimport { Skeleton } from '@/components/graphs/skeleton'\n\nexport class LollipopChart extends AxisChart {\n\tconstructor(holder: HTMLDivElement, chartConfigs: ChartConfig) {\n\t\tsuper(holder, chartConfigs)\n\n\t\t// Merge the default options for this chart\n\t\t// With the user provided options\n\t\tthis.model.setOptions(mergeDefaultChartOptions(options.lollipopChart, chartConfigs.options))\n\n\t\t// Initialize data, services, components etc.\n\t\tthis.init(holder, chartConfigs)\n\t}\n\n\t/**\n\t * Retrieves the components to be rendered inside the graph frame.\n\t *\n\t * @returns {Component[]} An array of components to be rendered.\n\t */\n\tgetComponents() {\n\t\tconst graphFrameComponents: Component[] = [\n\t\t\tnew TwoDimensionalAxes(this.model, this.services),\n\t\t\tnew Grid(this.model, this.services),\n\t\t\tnew Ruler(this.model, this.services),\n\t\t\tnew Lollipop(this.model, this.services),\n\t\t\tnew Scatter(this.model, this.services),\n\t\t\tnew Skeleton(this.model, this.services, {\n\t\t\t\tskeleton: Skeletons.GRID\n\t\t\t})\n\t\t]\n\n\t\tconst components: Component[] = this.getAxisChartComponents(graphFrameComponents)\n\t\treturn components\n\t}\n}\n","import { getProperty } from '@/tools'\nimport { ChartModel } from './model'\nimport { ChartTabularData } from '@/interfaces/model'\n\n/** The meter chart model layer which extends some of the data setting options.\n * Meter only uses 1 dataset\n * */\n\nexport class MeterChartModel extends ChartModel {\n\tconstructor(services: any) {\n\t\tsuper(services)\n\t}\n\n\tgetMaximumDomain(data: any) {\n\t\tconst max = data.reduce((accumulator: number, datum: any) => accumulator + datum.value, 0)\n\t\treturn max\n\t}\n\n\t/**\n\t * Use a provided color for the bar or default to carbon color if no status provided.\n\t * Defaults to carbon color otherwise.\n\t * @param group dataset group label\n\t */\n\tgetFillColor(group: string) {\n\t\tconst options = this.getOptions()\n\t\tconst userProvidedScale = getProperty(options, 'color', 'scale')\n\t\tconst status = this.getStatus()\n\t\t// user provided a fill color or there isn't a status we can use the colorScale\n\t\tif (userProvidedScale || !status) {\n\t\t\treturn super.getFillColor(group)\n\t\t} else {\n\t\t\treturn null\n\t\t}\n\t}\n\n\t/**\n\t * Get the associated status for the data by checking the ranges\n\t */\n\tgetStatus() {\n\t\tconst options = this.getOptions()\n\t\tconst dataValues = getProperty(this.getDisplayData())\n\n\t\tconst totalValue =\n\t\t\tdataValues?.reduce((previous: any, current: any) => {\n\t\t\t\treturn previous + current.value\n\t\t\t}, 0) ?? 0\n\n\t\t// use max value if the percentage is bigger than 100%\n\t\tconst boundedValue = getProperty(options, 'meter', 'proportional')\n\t\t\t? totalValue\n\t\t\t: totalValue > 100\n\t\t\t\t? 100\n\t\t\t\t: totalValue\n\n\t\t// user needs to supply ranges\n\t\tconst allRanges = getProperty(options, 'meter', 'status', 'ranges')\n\n\t\tif (allRanges) {\n\t\t\tconst result = allRanges.filter(\n\t\t\t\t(step: any) => step.range[0] <= boundedValue && boundedValue <= step.range[1]\n\t\t\t)\n\t\t\tif (result.length > 0) {\n\t\t\t\treturn result[0].status\n\t\t\t}\n\t\t}\n\n\t\treturn null\n\t}\n\n\tgetTabularDataArray() {\n\t\tconst displayData = this.getDisplayData()\n\t\tconst options = this.getOptions()\n\t\tconst { groupMapsTo } = options.data\n\t\tconst status = this.getStatus()\n\t\tconst proportional = getProperty(options, 'meter', 'proportional')\n\t\tconst { number: numberFormatter, code: localeCode } = getProperty(this.getOptions(), 'locale')\n\n\t\tlet headers = []\n\t\tlet cells: ChartTabularData = []\n\t\tlet domainMax: number\n\t\t// Display the appropriate columns and fields depending on the type of meter\n\t\tif (proportional === null) {\n\t\t\tdomainMax = 100\n\t\t\tconst datum = displayData[0]\n\t\t\theaders = ['Group', 'Value', ...(status ? ['Status'] : [])]\n\t\t\tcells = [\n\t\t\t\t[\n\t\t\t\t\tdatum[groupMapsTo],\n\t\t\t\t\tdatum['value'] === null ? '–' : numberFormatter(datum['value'], localeCode),\n\t\t\t\t\t...(status ? [status] : [])\n\t\t\t\t]\n\t\t\t]\n\t\t} else {\n\t\t\tconst total = getProperty(proportional, 'total')\n\t\t\tdomainMax = total ? total : this.getMaximumDomain(displayData)\n\t\t\theaders = ['Group', 'Value', 'Percentage of total']\n\t\t\tcells = [\n\t\t\t\t...displayData.map((datum: any) => {\n\t\t\t\t\tlet value\n\t\t\t\t\tdatum['value'] !== null && datum['value'] !== undefined\n\t\t\t\t\t\t? (value = Number(datum['value']))\n\t\t\t\t\t\t: (value = 0)\n\t\t\t\t\tconst percentValue = Number(((datum['value'] / domainMax) * 100).toFixed(2))\n\t\t\t\t\treturn [\n\t\t\t\t\t\tdatum[groupMapsTo],\n\t\t\t\t\t\tdatum['value'] === null ? '–' : numberFormatter(value, localeCode),\n\t\t\t\t\t\tnumberFormatter(percentValue, localeCode) + ' %'\n\t\t\t\t\t]\n\t\t\t\t})\n\t\t\t]\n\t\t}\n\n\t\treturn super.formatTable({ headers, cells })\n\t}\n}\n","import { cloneDeep, merge } from 'lodash-es'\nimport { Chart } from '@/chart'\nimport { options as configOptions } from '@/configuration'\nimport { getProperty } from '@/tools'\nimport { MeterChartModel } from '@/model/meter'\nimport type { ChartConfig } from '@/interfaces/model'\nimport type { MeterChartOptions } from '@/interfaces/charts'\nimport { LayoutGrowth, LayoutDirection, RenderTypes } from '@/interfaces/enums'\nimport type { Component } from '@/components/component'\nimport { LayoutComponent } from '@/components/layout'\nimport { Meter } from '@/components/graphs/meter'\nimport { MeterTitle } from '@/components/essentials/title-meter'\nimport { Spacer } from '@/components/layout/spacer'\n\nexport class MeterChart extends Chart {\n\tmodel = new MeterChartModel(this.services)\n\n\tconstructor(holder: HTMLDivElement, chartConfigs: ChartConfig) {\n\t\tsuper(holder, chartConfigs)\n\n\t\t// use prop meter options or regular meter options\n\t\tconst options = chartConfigs.options.meter?.proportional\n\t\t\t? merge(cloneDeep(configOptions.proportionalMeterChart), chartConfigs.options)\n\t\t\t: merge(cloneDeep(configOptions.meterChart), chartConfigs.options)\n\n\t\t// Merge the default options for this chart\n\t\t// With the user provided options\n\t\tthis.model.setOptions(options)\n\n\t\t// Initialize data, services, components etc.\n\t\tthis.init(holder, chartConfigs)\n\t}\n\n\t/**\n\t * Retrieves the components to be rendered inside the graph frame.\n\t *\n\t * @returns {Component[]} An array of components to be rendered.\n\t */\n\tgetComponents() {\n\t\tconst showLabels = getProperty(this.model.getOptions(), 'meter', 'showLabels')\n\t\tconst meterComponents = [\n\t\t\t...(showLabels\n\t\t\t\t? [\n\t\t\t\t\t\t// Meter has a unique dataset title within the graph\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tid: 'meter-title',\n\t\t\t\t\t\t\tcomponents: [new MeterTitle(this.model, this.services)],\n\t\t\t\t\t\t\tgrowth: LayoutGrowth.STRETCH,\n\t\t\t\t\t\t\trenderType: RenderTypes.SVG\n\t\t\t\t\t\t},\n\t\t\t\t\t\t// Create the title spacer\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tid: 'spacer',\n\t\t\t\t\t\t\tcomponents: [\n\t\t\t\t\t\t\t\tnew Spacer(this.model, this.services, {\n\t\t\t\t\t\t\t\t\tsize: 8\n\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\tgrowth: LayoutGrowth.STRETCH\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t: []),\n\t\t\t// Specify what to render inside the graph only\n\t\t\t{\n\t\t\t\tid: 'meter-graph',\n\t\t\t\tcomponents: [new Meter(this.model, this.services)],\n\t\t\t\tgrowth: LayoutGrowth.STRETCH,\n\t\t\t\trenderType: RenderTypes.SVG\n\t\t\t}\n\t\t]\n\n\t\t// the graph frame for meter includes the custom title (and spacer)\n\t\tconst graphFrame: Component[] = [\n\t\t\tnew LayoutComponent(this.model, this.services, meterComponents, {\n\t\t\t\tdirection: LayoutDirection.COLUMN\n\t\t\t})\n\t\t]\n\n\t\t// add the meter title as a top level component\n\t\tconst components: Component[] = this.getChartComponents(graphFrame, {\n\t\t\tgraphFrameRenderType: RenderTypes.HTML\n\t\t})\n\n\t\treturn components\n\t}\n}\n","import { getProperty } from '@/tools'\nimport { ChartModelCartesian } from './cartesian-charts'\n\n/** The charting model layer which includes mainly the chart data and options,\n * as well as some misc. information to be shared among components */\nexport class RadarChartModel extends ChartModelCartesian {\n\tconstructor(services: any) {\n\t\tsuper(services)\n\t}\n\n\tgetTabularDataArray() {\n\t\tconst options = this.getOptions()\n\t\tconst groupedData = this.getGroupedData()\n\t\tconst { angle, value } = getProperty(options, 'radar', 'axes')\n\t\tconst { number: numberFormatter, code: localeCode } = getProperty(options, 'locale')\n\n\t\tconst additionalHeaders = getProperty(groupedData, '0', 'data').map((d: any) => d[angle])\n\t\tconst headers = ['Group', ...additionalHeaders]\n\t\tconst cells = [\n\t\t\t...groupedData.map(datum => {\n\t\t\t\treturn [\n\t\t\t\t\tdatum['name'],\n\t\t\t\t\t...additionalHeaders.map((_: any, i: number) =>\n\t\t\t\t\t\tgetProperty(datum, 'data', i, value) !== null\n\t\t\t\t\t\t\t? numberFormatter(getProperty(datum, 'data', i, value), localeCode)\n\t\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 super.formatTable({ headers, cells })\n\t}\n}\n","import { Chart } from '@/chart'\nimport { options } from '@/configuration'\nimport { mergeDefaultChartOptions } from '@/tools'\nimport { RadarChartModel } from '@/model/radar'\nimport type { ChartConfig } from '@/interfaces/model'\nimport type { RadarChartOptions } from '@/interfaces/charts'\nimport type { Component } from '@/components/component'\nimport { Radar } from '@/components/graphs/radar'\n\nexport class RadarChart extends Chart {\n\tmodel = new RadarChartModel(this.services)\n\n\tconstructor(holder: HTMLDivElement, chartConfigs: ChartConfig) {\n\t\tsuper(holder, chartConfigs)\n\n\t\t// Merge the default options for this chart\n\t\t// With the user provided options\n\t\tthis.model.setOptions(mergeDefaultChartOptions(options.radarChart, chartConfigs.options))\n\n\t\t// Initialize data, services, components etc.\n\t\tthis.init(holder, chartConfigs)\n\t}\n\n\t/**\n\t * Retrieves the components to be rendered inside the graph frame.\n\t *\n\t * @returns {Component[]} An array of components to be rendered.\n\t */\n\tgetComponents() {\n\t\tconst graphFrameComponents: Component[] = [new Radar(this.model, this.services)]\n\n\t\t// get the base chart components and export with tooltip\n\t\tconst components: Component[] = this.getChartComponents(graphFrameComponents)\n\t\treturn components\n\t}\n}\n","import { AxisChart } from '@/axis-chart'\nimport { options } from '@/configuration'\nimport { mergeDefaultChartOptions } from '@/tools'\nimport type { ChartConfig } from '@/interfaces/model'\nimport type { ScatterChartOptions } from '@/interfaces/charts'\nimport { Skeletons } from '@/interfaces/enums'\nimport type { Component } from '@/components/component'\nimport { Grid } from '@/components/axes/grid'\nimport { Ruler } from '@/components/axes/ruler'\nimport { Scatter } from '@/components/graphs/scatter'\nimport { TwoDimensionalAxes } from '@/components/axes/two-dimensional-axes'\nimport { Skeleton } from '@/components/graphs/skeleton'\n\nexport class ScatterChart extends AxisChart {\n\tconstructor(holder: HTMLDivElement, chartConfigs: ChartConfig) {\n\t\tsuper(holder, chartConfigs)\n\n\t\t// Merge the default options for this chart\n\t\t// With the user provided options\n\t\tthis.model.setOptions(mergeDefaultChartOptions(options.scatterChart, chartConfigs.options))\n\n\t\t// Initialize data, services, components etc.\n\t\tthis.init(holder, chartConfigs)\n\t}\n\n\t/**\n\t * Retrieves the components to be rendered inside the graph frame.\n\t *\n\t * @returns {Component[]} An array of components to be rendered.\n\t */\n\tgetComponents() {\n\t\tconst graphFrameComponents: Component[] = [\n\t\t\tnew TwoDimensionalAxes(this.model, this.services),\n\t\t\tnew Grid(this.model, this.services),\n\t\t\tnew Ruler(this.model, this.services),\n\t\t\tnew Scatter(this.model, this.services),\n\t\t\tnew Skeleton(this.model, this.services, {\n\t\t\t\tskeleton: Skeletons.GRID\n\t\t\t})\n\t\t]\n\n\t\tconst components: Component[] = this.getAxisChartComponents(graphFrameComponents)\n\t\treturn components\n\t}\n}\n","import { ChartModel } from './model'\n\n/**\n * The tree chart model layer\n */\nexport class TreeChartModel extends ChartModel {\n\tconstructor(services: any) {\n\t\tsuper(services)\n\t}\n\n\t/**\n\t * Retrieves and formats tabular data from the display data.\n\t *\n\t * @returns {any[]} An object containing the headers and cells of the tabular data.\n\t */\n\tgetTabularDataArray() {\n\t\tconst displayData = this.getDisplayData()\n\n\t\tconst headers = ['Child', 'Parent']\n\t\tconst cells = []\n\t\tdisplayData.forEach((datum: any) => {\n\t\t\t// Call recursive function\n\t\t\tthis.getChildrenDatums(datum, cells)\n\t\t\tcells.push([datum.name, '–'])\n\t\t})\n\n\t\treturn super.formatTable({ headers, cells })\n\t}\n\n\t/**\n\t * Determine the child parent relationship in nested data\n\t * @private\n\t * @param {any} datum - The datum node to process.\n\t * @param {any[]} [result=[]] - An array to accumulate the resulting data.\n\t * @returns {any[]} The accumulated result array.\n\t */\n\tprivate getChildrenDatums(datum: any, result: any[] = []) {\n\t\t// Check to see if datum has children before iterating through it\n\t\tif (datum.children) {\n\t\t\tif (datum.children.length > 0) {\n\t\t\t\tdatum.children.forEach((child: any) => {\n\t\t\t\t\tthis.getChildrenDatums(child, result)\n\t\t\t\t\tresult.push([child.name, datum.name])\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\t}\n}\n","import { Chart } from '@/chart'\nimport { options } from '@/configuration'\nimport { mergeDefaultChartOptions } from '@/tools'\nimport { TreeChartModel } from '@/model/tree'\nimport type { ChartConfig } from '@/interfaces/model'\nimport type { TreeChartOptions } from '@/interfaces/charts'\nimport type { Component } from '@/components/component'\nimport { Tree } from '@/components/graphs/tree'\n\nexport class TreeChart extends Chart {\n\tmodel = new TreeChartModel(this.services)\n\n\tconstructor(holder: HTMLDivElement, chartConfigs: ChartConfig) {\n\t\tsuper(holder, chartConfigs)\n\n\t\t// Merge the default options for this chart\n\t\t// With the user provided options\n\t\tthis.model.setOptions(mergeDefaultChartOptions(options.treeChart, chartConfigs.options))\n\n\t\t// Initialize data, services, components etc.\n\t\tthis.init(holder, chartConfigs)\n\t}\n\n\t/**\n\t * Retrieves the components to be rendered inside the graph frame.\n\t *\n\t * @returns {Component[]} An array of components to be rendered.\n\t */\n\tgetComponents() {\n\t\tconst graphFrameComponents: Component[] = [new Tree(this.model, this.services)]\n\n\t\t// get the base chart components and export with tooltip\n\t\tconst components: Component[] = this.getChartComponents(graphFrameComponents, {\n\t\t\texcludeLegend: true\n\t\t})\n\t\treturn components\n\t}\n}\n","import { getProperty } from '@/tools'\nimport { ChartModel } from './model'\n\n/**\n * The treemap chart model layer\n */\nexport class TreemapChartModel extends ChartModel {\n\tconstructor(services: any) {\n\t\tsuper(services)\n\t}\n\n\tgetTabularDataArray() {\n\t\tconst displayData = this.getDisplayData()\n\t\tconst { number: numberFormatter, code: localeCode } = getProperty(this.getOptions(), 'locale')\n\n\t\tconst headers = ['Child', 'Group', 'Value']\n\t\tconst cells = []\n\t\tdisplayData.forEach((datum: any) => {\n\t\t\tif (Array.isArray(datum.children)) {\n\t\t\t\tdatum.children.forEach((child: any) => {\n\t\t\t\t\tcells.push([\n\t\t\t\t\t\tchild.name,\n\t\t\t\t\t\tdatum.name,\n\t\t\t\t\t\tchild.value === null ? '–' : numberFormatter(child.value, localeCode)\n\t\t\t\t\t])\n\t\t\t\t})\n\t\t\t} else if (getProperty(datum.name) !== null && getProperty(datum.value)) {\n\t\t\t\tcells.push(['–', datum.name, numberFormatter(datum.value, localeCode)])\n\t\t\t}\n\t\t})\n\n\t\treturn super.formatTable({ headers, cells })\n\t}\n}\n","import { Chart } from '@/chart'\nimport { options } from '@/configuration'\nimport { mergeDefaultChartOptions } from '@/tools'\nimport { TreemapChartModel } from '@/model/treemap'\nimport type { ChartConfig } from '@/interfaces/model'\nimport type { TreemapChartOptions } from '@/interfaces/charts'\nimport type { Component } from '@/components/component'\nimport { Treemap } from '@/components/graphs/treemap'\n\nexport class TreemapChart extends Chart {\n\tmodel = new TreemapChartModel(this.services)\n\n\tconstructor(holder: HTMLDivElement, chartConfigs: ChartConfig) {\n\t\tsuper(holder, chartConfigs)\n\n\t\t// Merge the default options for this chart\n\t\t// With the user provided options\n\t\tthis.model.setOptions(mergeDefaultChartOptions(options.treemapChart, chartConfigs.options))\n\n\t\t// Initialize data, services, components etc.\n\t\tthis.init(holder, chartConfigs)\n\t}\n\n\t/**\n\t * Retrieves the components to be rendered inside the graph frame.\n\t *\n\t * @returns {Component[]} An array of components to be rendered.\n\t */\n\tgetComponents() {\n\t\tconst graphFrameComponents: Component[] = [new Treemap(this.model, this.services)]\n\n\t\t// get the base chart components and export with tooltip\n\t\tconst components: Component[] = this.getChartComponents(graphFrameComponents)\n\t\treturn components\n\t}\n}\n","import { AxisChart } from '@/axis-chart'\nimport { options } from '@/configuration'\nimport { mergeDefaultChartOptions } from '@/tools'\nimport type { ChartConfig } from '@/interfaces/model'\nimport { Skeletons } from '@/interfaces/enums'\nimport type { BarChartOptions } from '@/interfaces/charts'\nimport type { Component } from '@/components/component'\nimport { Grid } from '@/components/axes/grid'\nimport { TwoDimensionalAxes } from '@/components/axes/two-dimensional-axes'\nimport { Skeleton } from '@/components/graphs/skeleton'\nimport { ZeroLine } from '@/components/axes/zero-line'\nimport { SimpleBar } from '@/components/graphs/bar-simple'\n\nexport class SimpleBarChart extends AxisChart {\n\tconstructor(holder: HTMLDivElement, chartConfigs: ChartConfig) {\n\t\tsuper(holder, chartConfigs)\n\n\t\t// Merge the default options for this chart\n\t\t// With the user provided options\n\t\tthis.model.setOptions(mergeDefaultChartOptions(options.simpleBarChart, chartConfigs.options))\n\n\t\t// Initialize data, services, components etc.\n\t\tthis.init(holder, chartConfigs)\n\t}\n\n\t/**\n\t * Retrieves the components to be rendered inside the graph frame.\n\t *\n\t * @returns {Component[]} An array of components to be rendered.\n\t */\n\tgetComponents() {\n\t\tconst graphFrameComponents: Component[] = [\n\t\t\tnew TwoDimensionalAxes(this.model, this.services),\n\t\t\tnew Grid(this.model, this.services),\n\t\t\tnew SimpleBar(this.model, this.services),\n\t\t\tnew ZeroLine(this.model, this.services),\n\t\t\tnew Skeleton(this.model, this.services, {\n\t\t\t\tskeleton: Skeletons.VERT_OR_HORIZ\n\t\t\t})\n\t\t]\n\n\t\tconst components: Component[] = this.getAxisChartComponents(graphFrameComponents)\n\t\treturn components\n\t}\n}\n","import { AxisChart } from '@/axis-chart'\nimport { options } from '@/configuration'\nimport { mergeDefaultChartOptions } from '@/tools'\nimport type { Component } from '@/components/component'\nimport type { ChartConfig } from '@/interfaces/model'\nimport type { AreaChartOptions } from '@/interfaces/charts'\nimport { Skeletons } from '@/interfaces/enums'\nimport { Grid } from '@/components/axes/grid'\nimport { StackedArea } from '@/components/graphs/area-stacked'\nimport { StackedRuler } from '@/components/axes/ruler-stacked'\nimport { TwoDimensionalAxes } from '@/components/axes/two-dimensional-axes'\nimport { Line } from '@/components/graphs/line'\nimport { StackedScatter } from '@/components/graphs/scatter-stacked'\nimport { Skeleton } from '@/components/graphs/skeleton'\n\nexport class StackedAreaChart extends AxisChart {\n\tconstructor(holder: HTMLDivElement, chartConfigs: ChartConfig) {\n\t\tsuper(holder, chartConfigs)\n\n\t\t// Merge the default options for this chart\n\t\t// With the user provided options\n\t\tthis.model.setOptions(mergeDefaultChartOptions(options.stackedAreaChart, chartConfigs.options))\n\n\t\t// Initialize data, services, components etc.\n\t\tthis.init(holder, chartConfigs)\n\t}\n\n\t/**\n\t * Retrieves the components to be rendered inside the graph frame.\n\t *\n\t * @returns {Component[]} An array of components to be rendered.\n\t */\n\tgetComponents() {\n\t\tconst graphFrameComponents: Component[] = [\n\t\t\tnew TwoDimensionalAxes(this.model, this.services),\n\t\t\tnew Grid(this.model, this.services),\n\t\t\tnew StackedRuler(this.model, this.services),\n\t\t\tnew StackedArea(this.model, this.services),\n\t\t\tnew Line(this.model, this.services, { stacked: true }),\n\t\t\tnew StackedScatter(this.model, this.services, {\n\t\t\t\tfadeInOnChartHolderMouseover: true,\n\t\t\t\thandleThresholds: true,\n\t\t\t\tstacked: true\n\t\t\t}),\n\t\t\tnew Skeleton(this.model, this.services, {\n\t\t\t\tskeleton: Skeletons.GRID\n\t\t\t})\n\t\t]\n\n\t\tconst components: Component[] = this.getAxisChartComponents(graphFrameComponents)\n\t\treturn components\n\t}\n}\n","import { AxisChart } from '@/axis-chart'\nimport { options } from '@/configuration'\nimport { mergeDefaultChartOptions } from '@/tools'\nimport type { ChartConfig } from '@/interfaces/model'\nimport { Skeletons } from '@/interfaces/enums'\nimport type { BarChartOptions } from '@/interfaces/charts'\nimport type { Component } from '@/components/component'\nimport { Grid } from '@/components/axes/grid'\nimport { StackedBar } from '@/components/graphs/bar-stacked'\nimport { StackedRuler } from '@/components/axes/ruler-stacked'\nimport { TwoDimensionalAxes } from '@/components/axes/two-dimensional-axes'\nimport { ZeroLine } from '@/components/axes/zero-line'\nimport { Skeleton } from '@/components/graphs/skeleton'\n\nexport class StackedBarChart extends AxisChart {\n\tconstructor(holder: HTMLDivElement, chartConfigs: ChartConfig) {\n\t\tsuper(holder, chartConfigs)\n\n\t\t// Merge the default options for this chart\n\t\t// With the user provided options\n\t\tthis.model.setOptions(mergeDefaultChartOptions(options.stackedBarChart, chartConfigs.options))\n\n\t\t// Initialize data, services, components etc.\n\t\tthis.init(holder, chartConfigs)\n\t}\n\n\t/**\n\t * Retrieves the components to be rendered inside the graph frame.\n\t *\n\t * @returns {Component[]} An array of components to be rendered.\n\t */\n\tgetComponents() {\n\t\tconst graphFrameComponents: Component[] = [\n\t\t\tnew TwoDimensionalAxes(this.model, this.services),\n\t\t\tnew Grid(this.model, this.services),\n\t\t\tnew StackedRuler(this.model, this.services),\n\t\t\tnew StackedBar(this.model, this.services),\n\t\t\tnew Skeleton(this.model, this.services, {\n\t\t\t\tskeleton: Skeletons.VERT_OR_HORIZ\n\t\t\t}),\n\t\t\tnew ZeroLine(this.model, this.services)\n\t\t]\n\n\t\tconst components: Component[] = this.getAxisChartComponents(graphFrameComponents)\n\t\treturn components\n\t}\n}\n","import { getProperty } from '@/tools'\nimport { ChartModel } from './model'\n\n/** The charting model layer which includes mainly the chart data and options,\n * as well as some misc. information to be shared among components */\nexport class WordCloudModel extends ChartModel {\n\tconstructor(services: any) {\n\t\tsuper(services)\n\t}\n\n\tgetTabularDataArray() {\n\t\tconst displayData = this.getDisplayData()\n\t\tconst options = this.getOptions()\n\t\tconst { fontSizeMapsTo, wordMapsTo } = options.wordCloud\n\t\tconst { groupMapsTo } = options.data\n\t\tconst { code: localeCode, number: numberFormatter } = getProperty(options, 'locale')\n\n\t\tconst headers = [options.tooltip.wordLabel, 'Group', options.tooltip.valueLabel]\n\t\tconst cells = [\n\t\t\t...displayData.map((datum: any) => [\n\t\t\t\tdatum[wordMapsTo],\n\t\t\t\tdatum[groupMapsTo],\n\t\t\t\tnumberFormatter(datum[fontSizeMapsTo], localeCode)\n\t\t\t])\n\t\t]\n\n\t\treturn super.formatTable({ headers, cells })\n\t}\n}\n","import { Chart } from '@/chart'\nimport { options } from '@/configuration'\nimport { mergeDefaultChartOptions } from '@/tools'\nimport { WordCloudModel } from '@/model/wordcloud'\nimport type { ChartConfig } from '@/interfaces/model'\nimport type { WordCloudChartOptions } from '@/interfaces/charts'\nimport type { WorldCloudChartOptions } from '@/interfaces'\nimport { Skeletons } from '@/interfaces/enums'\nimport type { Component } from '@/components/component'\nimport { Skeleton } from '@/components/graphs/skeleton'\nimport { WordCloud } from '@/components/graphs/wordcloud'\n\nexport class WordCloudChart extends Chart {\n\tmodel = new WordCloudModel(this.services)\n\n\tconstructor(\n\t\tholder: HTMLDivElement,\n\t\tchartConfigs: ChartConfig\n\t) {\n\t\tsuper(holder, chartConfigs)\n\n\t\t// Merge the default options for this chart\n\t\t// With the user provided options\n\t\tthis.model.setOptions(mergeDefaultChartOptions(options.wordCloudChart, chartConfigs.options))\n\n\t\t// Initialize data, services, components etc.\n\t\tthis.init(holder, chartConfigs)\n\t}\n\n\t/**\n\t * Retrieves the components to be rendered inside the graph frame.\n\t *\n\t * @returns {Component[]} An array of components to be rendered.\n\t */\n\tgetComponents() {\n\t\tconst graphFrameComponents: Component[] = [\n\t\t\tnew WordCloud(this.model, this.services),\n\t\t\tnew Skeleton(this.model, this.services, {\n\t\t\t\tskeleton: Skeletons.PIE\n\t\t\t})\n\t\t]\n\n\t\t// get the base chart components and export with tooltip\n\t\tconst components: Component[] = this.getChartComponents(graphFrameComponents)\n\t\treturn components\n\t}\n}\n"],"names":["ascending","a","b","descending","bisector","f","compare1","compare2","delta","d","x","zero","left","lo","hi","mid","right","center","i","number","numbers","values","valueof","value","bisectRight","count","extent","min","max","index","Adder","p","j","y","InternMap","entries","key","keyof","intern_get","intern_set","intern_delete","_intern","_key","identity","compareDefined","compare","ascendingDefined","array","slice","constant","e10","e5","e2","tickSpec","start","stop","step","power","error","factor","i1","i2","inc","ticks","reverse","n","tickIncrement","tickStep","nice","prestep","thresholdSturges","bin","domain","threshold","sturges","histogram","data","xz","x0","x1","tz","tn","m","bins","bisect","_","quickselect","k","z","s","sd","newLeft","newRight","t","swap","quantile","i0","value0","value1","flatten","arrays","merge","range","identity$7","top","bottom","epsilon","translateX","translateY","scale","offset","entering","axis","orient","tickArguments","tickValues","tickFormat","tickSizeInner","tickSizeOuter","tickPadding","transform","context","format","spacing","range0","range1","position","selection","path","tick","tickExit","tickEnter","line","text","axisTop","axisRight","axisBottom","axisLeft","noop","dispatch","Dispatch","parseTypenames","typenames","types","name","typename","callback","T","get","set","copy","type","that","args","c","xhtml","namespaces","namespace","prefix","creatorInherit","document","uri","creatorFixed","fullname","creator","none","selector","selection_select","select","groups","subgroups","group","subgroup","node","subnode","Selection","empty","selectorAll","arrayAll","selection_selectAll","parents","matcher","childMatcher","find","childFind","match","childFirst","selection_selectChild","filter","children","childrenFilter","selection_selectChildren","selection_filter","sparse","update","selection_enter","EnterNode","parent","datum","child","next","constant$7","bindIndex","enter","exit","groupLength","dataLength","bindKey","nodeByKeyValue","keyValues","keyValue","selection_data","bind","arraylike","enterGroup","updateGroup","exitGroup","previous","selection_exit","selection_join","onenter","onupdate","onexit","selection_merge","groups0","groups1","m0","m1","merges","group0","group1","selection_order","selection_sort","compareNode","sortgroups","sortgroup","selection_call","selection_nodes","selection_node","selection_size","size","selection_empty","selection_each","attrRemove","attrRemoveNS","attrConstant","attrConstantNS","attrFunction","v","attrFunctionNS","selection_attr","defaultView","styleRemove","styleConstant","priority","styleFunction","selection_style","styleValue","propertyRemove","propertyConstant","propertyFunction","selection_property","classArray","string","classList","ClassList","classedAdd","names","list","classedRemove","classedTrue","classedFalse","classedFunction","selection_classed","textRemove","textConstant","textFunction","selection_text","htmlRemove","htmlConstant","htmlFunction","selection_html","raise","selection_raise","lower","selection_lower","selection_append","create","constantNull","selection_insert","before","remove","selection_remove","selection_cloneShallow","clone","selection_cloneDeep","selection_clone","deep","selection_datum","contextListener","listener","event","onRemove","on","o","onAdd","options","selection_on","dispatchEvent","params","window","dispatchConstant","dispatchFunction","selection_dispatch","selection_iterator","root","selection_selection","sourceEvent","pointer","svg","point","rect","nonpassivecapture","noevent$1","dragDisable","view","noevent","yesdrag","noclick","define","constructor","factory","prototype","extend","definition","Color","darker","brighter","reI","reN","reP","reHex","reRgbInteger","reRgbPercent","reRgbaInteger","reRgbaPercent","reHslPercent","reHslaPercent","named","color","channels","color_formatHex","color_formatHex8","color_formatHsl","color_formatRgb","hslConvert","l","rgbn","Rgb","rgba","hsla","r","g","rgbConvert","rgb","opacity","clampi","clampa","rgb_formatHex","rgb_formatHex8","rgb_formatRgb","hex","h","Hsl","hsl","m2","hsl2rgb","clamph","clampt","constant$6","linear","exponential","gamma","nogamma","interpolateRgb","rgbGamma","end","colorRgb","numberArray","isNumberArray","genericArray","nb","na","date$1","interpolateNumber","object$1","reA","reB","one","interpolateString","bi","am","bm","bs","q","interpolate$1","date","object","interpolateRound","degrees","decompose","e","scaleX","scaleY","skewX","svgNode","parseCss","parseSvg","interpolateTransform","parse","pxComma","pxParen","degParen","pop","translate","xa","ya","xb","yb","rotate","interpolateTransformCss","interpolateTransformSvg","quantize$1","interpolator","samples","frame","timeout","interval","pokeDelay","taskHead","taskTail","clockLast","clockNow","clockSkew","clock","setFrame","now","clearNow","Timer","timer","delay","time","sleep","timerFlush","wake","nap","poke","t0","t1","t2","elapsed","emptyOn","emptyTween","CREATED","SCHEDULED","STARTING","STARTED","RUNNING","ENDING","ENDED","schedule","id","timing","schedules","init","self","tween","interrupt","active","selection_interrupt","tweenRemove","tween0","tween1","tweenFunction","transition_tween","tweenValue","transition","interpolate","string00","string1","interpolate0","string0","string10","transition_attr","attrInterpolate","attrInterpolateNS","attrTweenNS","attrTween","transition_attrTween","delayFunction","delayConstant","transition_delay","durationFunction","durationConstant","transition_duration","easeConstant","transition_ease","easeVarying","transition_easeVarying","transition_filter","Transition","transition_merge","onFunction","on0","on1","sit","transition_on","removeFunction","transition_remove","transition_select","transition_selectAll","inherit","transition_selection","styleNull","style","styleMaybeRemove","listener0","transition_style","styleInterpolate","styleTween","transition_styleTween","transition_text","textInterpolate","textTween","transition_textTween","transition_transition","id0","id1","newId","transition_end","resolve","reject","cancel","selection_prototype","cubicInOut","defaultTiming","easeCubicInOut","selection_transition","constant$5","BrushEvent","target","mode","nopropagation","MODE_DRAG","MODE_SPACE","MODE_HANDLE","MODE_CENTER","abs","number1","number2","X","xy","Y","cursors","flipX","flipY","signsX","signsY","defaultFilter","defaultExtent","defaultTouchable","local","brushX","brush","dim","touchable","keys","listeners","handleSize","touchending","overlay","initialize","handle","redraw","started","touchmoved","touchended","emitter","state","emit","selection0","selection1","clean","Emitter","signX","signY","W","w0","w1","N","n0","n1","E","e0","e1","S","s0","s1","dx","dy","moving","shifting","lockX","lockY","points","pts","move","moved","ended","keydowned","keyupped","point0","dragEnable","pi","tau","tauEpsilon","append","strings","appendRound","digits","Path$1","y1","x2","y2","y0","x21","y21","x01","y01","l01_2","x20","y20","l21_2","l20_2","l21","l01","t01","t21","a0","a1","ccw","cw","da","w","formatDecimal","formatDecimalParts","coefficient","exponent","formatGroup","grouping","thousands","width","length","formatNumerals","numerals","re","formatSpecifier","specifier","FormatSpecifier","formatTrim","out","prefixExponent","formatPrefixAuto","formatRounded","formatTypes","identity$5","map","prefixes","formatLocale$1","locale","currencyPrefix","currencySuffix","decimal","percent","minus","nan","newFormat","fill","align","sign","symbol","comma","precision","trim","suffix","formatType","maybeSuffix","valuePrefix","valueSuffix","valueNegative","padding","formatPrefix","defaultLocale","formatLocale","precisionFixed","precisionPrefix","precisionRound","epsilon2","halfPi","quarterPi","radians","atan","atan2","cos","exp","log","sin","sqrt","tan","acos","asin","streamGeometry","geometry","stream","streamGeometryType","streamObjectType","features","coordinates","streamLine","streamPolygon","geometries","closed","coordinate","geoStream","spherical","cartesian","lambda","phi","cosPhi","cartesianDot","cartesianCross","cartesianAddInPlace","cartesianScale","vector","cartesianNormalizeInPlace","compose","rotationIdentity","rotateRadians","deltaLambda","deltaPhi","deltaGamma","rotationLambda","rotationPhiGamma","forwardRotationLambda","rotation","cosDeltaPhi","sinDeltaPhi","cosDeltaGamma","sinDeltaGamma","forward","circleStream","radius","direction","cosRadius","sinRadius","circleRadius","clipBuffer","lines","result","pointEqual","Intersection","other","entry","clipRejoin","segments","compareIntersection","startInside","subject","clip","segment","p0","p1","link","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","code","intersect","two","pa","pb","n2","n2n2","n1n2","determinant","c1","c2","n1xn2","B","u","uu","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$4","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","geoPath","projection","pointRadius","projectionStream","contextStream","pathArea","pathMeasure","pathBounds","pathCentroid","transformer","methods","TransformStream","fit","fitBounds","fitExtent","fitSize","fitWidth","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","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","clipExtent","reclip","equirectangularRaw","geoEquirectangular","conicEquidistantRaw","cy0","gy","nx","geoConicEquidistant","A1","A2","A3","A4","M","iterations","equalEarthRaw","l2","l6","fy","fpy","geoEqualEarth","naturalEarth1Raw","phi4","geoNaturalEarth1","defaultSeparation","meanX","meanXReduce","maxY","maxYReduce","leafLeft","leafRight","d3Cluster","separation","nodeSize","cluster","previousNode","node_count","node_each","node_eachBefore","nodes","node_eachAfter","node_find","node_sum","node_sort","node_path","ancestor","leastCommonAncestor","aNodes","bNodes","node_ancestors","node_descendants","node_leaves","leaves","node_links","links","node_iterator","hierarchy","mapChildren","objectChildren","Node","childs","computeHeight","node_copy","copyData","optional","required","constantZero","constant$4","lcg","array$1","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","A","C","place","intersects","score","circle","packSiblingsRandom","aa","sj","sk","pack","defaultRadius","D3Pack","radiusLeaf","packChildrenRandom","translateChild","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","sumValue","minValue","maxValue","newRatio","minRatio","beta","squarify","custom","d3Treemap","tile","round","paddingStack","paddingInner","paddingTop","paddingRight","paddingBottom","paddingLeft","treemap","positionNode","initRange","implicit","ordinal","unknown","band","ordinalRange","bandwidth","paddingOuter","rescale","sequence","constants","unit","normalize","clamper","bimap","d0","polymap","source","interpolateValue","untransform","clamp","piecewise","output","input","continuous","linearish","maxIter","transformLog","transformExp","transformLogn","transformExpn","pow10","powp","base","logp","reflect","loggish","logs","pows","quantize","timeInterval","floori","offseti","field","test","millisecond","durationSecond","durationMinute","durationHour","durationDay","durationWeek","durationMonth","durationYear","second","timeMinute","timeHour","timeDay","utcDay","timeWeekday","timeSunday","timeMonday","timeTuesday","timeWednesday","timeThursday","timeFriday","timeSaturday","utcWeekday","utcSunday","utcMonday","utcTuesday","utcWednesday","utcThursday","utcFriday","utcSaturday","timeMonth","timeYear","utcYear","ticker","year","month","week","day","hour","minute","tickIntervals","tickInterval","timeTicks","timeTickInterval","localDate","utcDate","newDate","locale_dateTime","locale_date","locale_time","locale_periods","locale_weekdays","locale_shortWeekdays","locale_months","locale_shortMonths","periodRe","formatRe","periodLookup","formatLookup","weekdayRe","weekdayLookup","shortWeekdayRe","shortWeekdayLookup","monthRe","monthLookup","shortMonthRe","shortMonthLookup","formats","formatShortWeekday","formatWeekday","formatShortMonth","formatMonth","formatDayOfMonth","formatMicroseconds","formatYearISO","formatFullYearISO","formatHour24","formatHour12","formatDayOfYear","formatMilliseconds","formatMonthNumber","formatMinutes","formatPeriod","formatQuarter","formatUnixTimestamp","formatUnixTimestampSeconds","formatSeconds","formatWeekdayNumberMonday","formatWeekNumberSunday","formatWeekNumberISO","formatWeekdayNumberSunday","formatWeekNumberMonday","formatYear","formatFullYear","formatZone","formatLiteralPercent","utcFormats","formatUTCShortWeekday","formatUTCWeekday","formatUTCShortMonth","formatUTCMonth","formatUTCDayOfMonth","formatUTCMicroseconds","formatUTCYearISO","formatUTCFullYearISO","formatUTCHour24","formatUTCHour12","formatUTCDayOfYear","formatUTCMilliseconds","formatUTCMonthNumber","formatUTCMinutes","formatUTCPeriod","formatUTCQuarter","formatUTCSeconds","formatUTCWeekdayNumberMonday","formatUTCWeekNumberSunday","formatUTCWeekNumberISO","formatUTCWeekdayNumberSunday","formatUTCWeekNumberMonday","formatUTCYear","formatUTCFullYear","formatUTCZone","parses","parseShortWeekday","parseWeekday","parseShortMonth","parseMonth","parseLocaleDateTime","parseDayOfMonth","parseMicroseconds","parseYear","parseFullYear","parseHour24","parseDayOfYear","parseMilliseconds","parseMonthNumber","parseMinutes","parsePeriod","parseQuarter","parseUnixTimestamp","parseUnixTimestampSeconds","parseSeconds","parseWeekdayNumberMonday","parseWeekNumberSunday","parseWeekNumberISO","parseWeekdayNumberSunday","parseWeekNumberMonday","parseLocaleDate","parseLocaleTime","parseZone","parseLiteralPercent","pad","pads","newParse","Z","parseSpecifier","numberRe","percentRe","requoteRe","requote","dISO","dow","UTCdISO","timeFormat","calendar","formatMillisecond","formatSecond","formatMinute","formatHour","formatDay","formatWeek","timeWeek","timeSecond","constant$3","withPath","shape","Path","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","Linear","curveLinear","defined","curve","pointX","pointY","defined0","area$1","x0z","y0z","arealine","identity$2","pie$1","sortValues","sort","pie","arcs","curveRadialLinear","curveRadial","Radial","radial","lineRadial","lineRadial$1","Bump","bumpX","linkSource","linkTarget","argv","linkHorizontal","noop$2","Basis","curveBasis","BasisClosed","curveBasisClosed","BasisOpen","curveBasisOpen","Bundle","curveBundle","bundle","Cardinal","tension","curveCardinal","cardinal","CardinalClosed","curveCardinalClosed","CardinalOpen","curveCardinalOpen","CatmullRom","x23","y23","curveCatmullRom","catmullRom","CatmullRomClosed","curveCatmullRomClosed","CatmullRomOpen","curveCatmullRomOpen","LinearClosed","curveLinearClosed","slope3","h0","h1","slope2","MonotoneX","MonotoneY","ReflectContext","monotoneX","monotoneY","Natural","px","controlPoints","py","curveNatural","Step","curveStep","stepBefore","stepAfter","none$1","series","order","stackValue","stackSeries","stack","orderNone","offsetNone","sz","oz","stackOffsetDiverging","yp","yn","Transform","location","freeGlobal","freeSelf","Symbol","objectProto","hasOwnProperty","nativeObjectToString","symToStringTag","getRawTag","isOwn","tag","unmasked","objectToString","nullTag","undefinedTag","baseGetTag","isObjectLike","symbolTag","isSymbol","arrayMap","iteratee","isArray","INFINITY","symbolProto","symbolToString","baseToString","reWhitespace","trimmedEndIndex","reTrimStart","baseTrim","isObject","NAN","reIsBadHex","reIsBinary","reIsOctal","freeParseInt","toNumber","isBinary","asyncTag","funcTag","genTag","proxyTag","isFunction","coreJsData","maskSrcKey","uid","isMasked","func","funcProto","funcToString","toSource","reRegExpChar","reIsHostCtor","reIsNative","baseIsNative","pattern","getValue","getNative","WeakMap","objectCreate","baseCreate","proto","apply","thisArg","copyArray","HOT_COUNT","HOT_SPAN","nativeNow","shortOut","lastCalled","stamp","remaining","defineProperty","baseSetToString","setToString","arrayEach","baseFindIndex","predicate","fromIndex","fromRight","baseIsNaN","strictIndexOf","baseIndexOf","arrayIncludes","MAX_SAFE_INTEGER","reIsUint","isIndex","baseAssignValue","eq","assignValue","objValue","copyObject","props","customizer","isNew","newValue","nativeMax","overRest","otherArgs","baseRest","isLength","isArrayLike","isIterateeCall","createAssigner","assigner","sources","guard","isPrototype","Ctor","baseTimes","argsTag","baseIsArguments","propertyIsEnumerable","isArguments","stubFalse","freeExports","exports","freeModule","moduleExports","Buffer","nativeIsBuffer","isBuffer","arrayTag","boolTag","dateTag","errorTag","mapTag","numberTag","objectTag","regexpTag","setTag","stringTag","weakMapTag","arrayBufferTag","dataViewTag","float32Tag","float64Tag","int8Tag","int16Tag","int32Tag","uint8Tag","uint8ClampedTag","uint16Tag","uint32Tag","typedArrayTags","baseIsTypedArray","baseUnary","freeProcess","nodeUtil","nodeIsTypedArray","isTypedArray","arrayLikeKeys","inherited","isArr","isArg","isBuff","isType","skipIndexes","overArg","arg","nativeKeys","baseKeys","nativeKeysIn","baseKeysIn","isProto","keysIn","reIsDeepProp","reIsPlainProp","isKey","nativeCreate","hashClear","hashDelete","HASH_UNDEFINED","hashGet","hashHas","hashSet","Hash","listCacheClear","assocIndexOf","arrayProto","splice","listCacheDelete","lastIndex","listCacheGet","listCacheHas","listCacheSet","ListCache","Map","mapCacheClear","isKeyable","getMapData","mapCacheDelete","mapCacheGet","mapCacheHas","mapCacheSet","MapCache","FUNC_ERROR_TEXT","memoize","resolver","memoized","MAX_MEMOIZE_SIZE","memoizeCapped","rePropName","reEscapeChar","stringToPath","quote","subString","toString","castPath","toKey","baseGet","defaultValue","arrayPush","spreadableSymbol","isFlattenable","baseFlatten","isStrict","flatRest","getPrototype","objectCtorString","isPlainObject","baseSlice","castSlice","rsAstralRange","rsComboMarksRange","reComboHalfMarksRange","rsComboSymbolsRange","rsComboRange","rsVarRange","rsZWJ","reHasUnicode","hasUnicode","asciiToArray","rsAstral","rsCombo","rsFitz","rsModifier","rsNonAstral","rsRegional","rsSurrPair","reOptMod","rsOptVar","rsOptJoin","rsSeq","rsSymbol","reUnicode","unicodeToArray","stringToArray","createCaseFirst","methodName","strSymbols","chr","trailing","upperFirst","capitalize","arrayReduce","accumulator","initAccum","basePropertyOf","deburredLetters","deburrLetter","reLatin","reComboMark","deburr","reAsciiWord","asciiWords","reHasUnicodeWord","hasUnicodeWord","rsDingbatRange","rsLowerRange","rsMathOpRange","rsNonCharRange","rsPunctuationRange","rsSpaceRange","rsUpperRange","rsBreakRange","rsApos","rsBreak","rsDigits","rsDingbat","rsLower","rsMisc","rsUpper","rsMiscLower","rsMiscUpper","rsOptContrLower","rsOptContrUpper","rsOrdLower","rsOrdUpper","rsEmoji","reUnicodeWord","unicodeWords","words","reApos","createCompounder","camelCase","word","baseClamp","upper","stackClear","stackDelete","stackGet","stackHas","LARGE_ARRAY_SIZE","stackSet","pairs","Stack","baseAssign","baseAssignIn","allocUnsafe","cloneBuffer","isDeep","arrayFilter","resIndex","stubArray","nativeGetSymbols","getSymbols","copySymbols","getSymbolsIn","copySymbolsIn","baseGetAllKeys","keysFunc","symbolsFunc","getAllKeys","getAllKeysIn","DataView","Promise","Set","promiseTag","dataViewCtorString","mapCtorString","promiseCtorString","setCtorString","weakMapCtorString","getTag","ctorString","initCloneArray","Uint8Array","cloneArrayBuffer","arrayBuffer","cloneDataView","dataView","reFlags","cloneRegExp","regexp","symbolValueOf","cloneSymbol","cloneTypedArray","typedArray","initCloneByTag","initCloneObject","baseIsMap","nodeIsMap","isMap","baseIsSet","nodeIsSet","isSet","CLONE_DEEP_FLAG","CLONE_FLAT_FLAG","CLONE_SYMBOLS_FLAG","cloneableTags","baseClone","bitmask","isFlat","isFull","isFunc","stacked","subValue","cloneDeep","setCacheAdd","setCacheHas","SetCache","arraySome","cacheHas","COMPARE_PARTIAL_FLAG","COMPARE_UNORDERED_FLAG","equalArrays","equalFunc","isPartial","arrLength","othLength","arrStacked","othStacked","seen","arrValue","othValue","compared","othIndex","mapToArray","setToArray","equalByTag","convert","equalObjects","objProps","objLength","othProps","objStacked","skipCtor","objCtor","othCtor","baseIsEqualDeep","objIsArr","othIsArr","objTag","othTag","objIsObj","othIsObj","isSameTag","objIsWrapped","othIsWrapped","objUnwrapped","othUnwrapped","baseIsEqual","baseIsMatch","matchData","srcValue","isStrictComparable","getMatchData","matchesStrictComparable","baseMatches","baseHasIn","hasPath","hasFunc","hasIn","baseMatchesProperty","baseProperty","basePropertyDeep","property","baseIteratee","arrayAggregator","setter","createBaseFor","iterable","baseFor","baseForOwn","createBaseEach","eachFunc","collection","baseEach","baseAggregator","createAggregator","initializer","nativeMin","debounce","wait","lastArgs","lastThis","maxWait","timerId","lastCallTime","lastInvokeTime","leading","maxing","invokeFunc","leadingEdge","timerExpired","remainingWait","timeSinceLastCall","timeSinceLastInvoke","timeWaiting","shouldInvoke","trailingEdge","flush","debounced","isInvoking","assignMergeValue","isArrayLikeObject","safeGet","toPlainObject","baseMergeDeep","srcIndex","mergeFunc","isCommon","isTyped","baseMerge","baseDelay","last","baseMap","flatMapDeep","fromPairs","pair","groupBy","isEmpty","isEqual","kebabCase","baseUnset","customOmitClone","omit","paths","baseSome","some","createSet","baseUniq","comparator","includes","outer","computed","seenIndex","unionBy","uniq","Chart","Modal","Model","Toolbar","ZoomBar","ZoomDomain","CanvasZoom","Axis","Area","WordCloud","Pie","Gauge","Bar","Boxplot","Scatter","Line","Radar","Tree","Treemap","Tooltip","Threshold","Legend","CirclePack","Alluvial","Meter","Heatmap","Choropleth","Events","RenderTypes","ChartTheme","ColorClassNameTypes","AxisPositions","ZoomBarTypes","TruncationTypes","CartesianOrientations","ScaleTypes","LegendPositions","Alignments","LegendOrientations","TreeTypes","LayoutDirection","LayoutGrowth","LayoutAlignItems","CalloutDirections","Skeletons","TextAnchor","DominantBaseline","GaugeTypes","ArrowDirections","Statuses","TickRotations","ChartTypes","ToolbarControlTypes","AxisTitleOrientations","LegendItemType","ColorLegendType","DividerStatus","AxisFlavor","Projection","carbonPrefix","canvasZoomSettings","circlePack","boxplot","legend","meter","radar","alluvial","heatmap","spacers","tooltips","transitions","zoomBar","defaultLegendAdditionalItems","debounceWithD3MousePosition","fn","holder","mergeDefaultChartOptions","defaultOptions","providedOptions","clonedDefaultOptions","providedAxesNames","_a","axisName","providedAxisOptions","identifier","scaleType","updateLegendAdditionalItems","getTranslationValues","elementRef","translateRegex","transformStr","transforms","getTransformOffsets","xyString","convertValueToPercentage","item","fullData","entireValue","percentage","accum","val","truncateLabel","fullText","truncationType","numCharacter","defaultAdditionalItems","getProperty","userProvidedAdditionalItems","providedTypes","defaultTypes","updatedDefaultItems","propPath","prop","flipSVGCoordinatesBasedOnOrientation","verticalCoordinates","orientation","generateSVGPathString","flipDomainAndRangeBasedOnOrientation","buildFormatLongFn","buildLocalizeFn","valuesArray","defaultWidth","buildMatchFn","matchPattern","matchResult","matchedString","parsePatterns","findIndex","findKey","rest","buildMatchPatternFn","parseResult","toDate","argument","argStr","getDefaultOptions","startOfWeek","weekStartsOn","_b","_d","_c","_date","diff","formatDistanceLocale","formatDistance","token","tokenValue","formatRelativeLocale","formatRelative","_baseDate","_options","eraValues","quarterValues","monthValues","dayValues","dayPeriodValues","formattingDayPeriodValues","localize","dirtyNumber","rem100","quarter","matchOrdinalNumberPattern","parseOrdinalNumberPattern","matchEraPatterns","parseEraPatterns","matchQuarterPatterns","parseQuarterPatterns","matchMonthPatterns","parseMonthPatterns","matchDayPatterns","parseDayPatterns","matchDayPeriodPatterns","parseDayPeriodPatterns","dateFormats","timeFormats","dateTimeFormats","formatLong","enUS","standardTruncationOptions","language","preformattedLocaleValue","grid","ruler","baseTooltip","axes","timeScale","localeObject","isFullScreenEnabled","chart","thematicChart","axisChart","baseBarChart","simpleBarChart","groupedBarChart","stackedBarChart","boxplotChart","scatterChart","lollipopChart","lineChart","areaChart","stackedAreaChart","bubbleChart","chartSize","smallerChartDimension","bulletChart","histogramChart","wordCloudChart","pieChart","gaugeChart","donutChart","meterChart","proportionalMeterChart","radarChart","comboChart","treeChart","treemapChart","circlePackChart","alluvialChart","heatmapChart","choroplethChart","millisecondsInWeek","millisecondsInDay","millisecondsInMinute","millisecondsInHour","startOfDay","getTimezoneOffsetInMilliseconds","differenceInCalendarDays","dateLeft","dateRight","startOfDayLeft","startOfDayRight","timestampLeft","timestampRight","constructFrom","startOfYear","cleanDate","getDayOfYear","startOfISOWeek","getISOWeekYear","fourthOfJanuaryOfNextYear","startOfNextYear","fourthOfJanuaryOfThisYear","startOfThisYear","startOfISOWeekYear","fourthOfJanuary","getISOWeek","getWeekYear","firstWeekContainsDate","firstWeekOfNextYear","firstWeekOfThisYear","startOfWeekYear","firstWeek","getWeek","addLeadingZeros","targetLength","lightFormatters","signedYear","dayPeriodEnumValue","numberOfDigits","milliseconds","fractionalSeconds","dayPeriodEnum","formatters","era","signedWeekYear","weekYear","twoDigitYear","isoWeekYear","isoWeek","dayOfYear","dayOfWeek","localDayOfWeek","isoDayOfWeek","hours","_localize","timezoneOffset","formatTimezoneWithOptionalMinutes","formatTimezone","formatTimezoneShort","timestamp","delimiter","absOffset","minutes","dateLongFormatter","timeLongFormatter","longFormatters","datePattern","timePattern","dateTimeFormat","dayOfYearTokenRE","weekYearTokenRE","throwTokens","isProtectedDayOfYearToken","isProtectedWeekYearToken","warnOrThrowProtectedError","_message","message","isDate","isValid","formattingTokensRegExp","longFormattingTokensRegExp","escapedStringRegExp","doubleQuoteRegExp","unescapedLatinCharacterRegExp","formatStr","_f","_e","_h","_g","originalDate","parts","substring","firstCharacter","longFormatter","cleanEscapedString","formatterOptions","part","formatter","matched","TimeIntervalNames","TIME_INTERVALS","isTickPrimary","allTicks","showDayName","isFirstTick","hasANewWeekStarted","isFirstQuarter","previousTick","isDayOfMonthChanged","isMonthChanged","isYearChanged","formatTick","timeScaleOptions","localeOptions","intervalConsideringAlsoShowDayNameOption","primary","secondary","primaryTickFlag","formatString","localeCode","optionsObject","formatterType","formatArr","num","getTimeformats","getConsecutiveDifferences","elements","elem","closestTimeIntervalName","duration","nearestIndex","deltaNearest","oldNearestSpan","currentSpan","computeTimeIntervalName","intervalOverride","differences","minDifference","H","previousTimestamp","currentMonth","previousMonth","formatDateTillMilliSeconds","_sanitizeCsvCell","cellContent","_trimmedCell","ChartModel","services","headers","cells","dateFormatter","numberFormatter","tableHeadingFormatter","tableCellFormatter","cartesianScales","domainScaleType","domainValueFormatter","allData","dataGroups","groupMapsTo","axesOptions","mapsTo","ACTIVE","legendConfigs","dataGroup","newData","sanitizedData","mainXPos","domainIdentifier","axisOptions","axisBins","histogramConfigs","areBinsDefined","d3Bin","binsWidth","binsDomain","groupsKeys","histogramData","aggregateDataByGroup","dataGroupNames","dataValuesGroupedByKeys","element","displayData","groupedData","groupName","stackKeys","axisPosition","dateA","dateB","binStart","binEnd","correspondingValues","correspondingBin","dataGroupName","binItem","correspondingDatum","rangeIdentifier","divergent","maxByKey","denominator","newState","configs","newConfig","newOptions","animate","changedLabel","DISABLED","hasDeactivatedItems","activeItems","indexToChange","updatedActiveItems","activeItem","defaultFilled","defaultFillColor","defaultStrokeColor","userProvidedScale","colorPairingTag","className","tabularData","datasets","labels","dataset","datasetLabel","correspondingLabel","updatedDatum","csvString","column","fileName","customFilename","uniqueDataGroups","getStatus","colorPairingOptions","numberOfVariants","pairingOption","colorPairingCounts","colorConfigs","numberOfColors","colorPairing","scaleOrdinal","resolveUrl","url","baseUrl","doc","uuid","counter","toArray","arrayLike","arr","styleProperty","getNodeWidth","leftBorder","rightBorder","getNodeHeight","topBorder","bottomBorder","getImageSize","targetNode","getPixelRatio","FINAL_PROCESS","canvasDimensionLimit","checkCanvasDimensions","canvas","createImage","img","svgToDataURL","html","nodeToDataURL","xmlns","foreignObject","isInstanceOfElement","instance","nodePrototype","formatCSSText","content","formatCSSProperties","getPseudoElementStyle","pseudo","cssText","clonePseudoElement","nativeNode","clonedNode","styleElement","clonePseudoElements","WOFF","JPEG","mimes","getExtension","getMimeType","extension","getContentFromDataUrl","dataURL","isDataUrl","makeDataUrl","mimeType","fetchAsDataURL","process","res","blob","reader","getCacheKey","contentType","includeQueryParams","resourceToDataURL","resourceUrl","cacheKey","msg","cloneCanvasElement","cloneVideoElement","video","ctx","poster","cloneIFrameElement","iframe","cloneNode","cloneSingleNode","isSlotElement","cloneChildren","deferred","clonedChild","cloneCSSStyle","targetStyle","sourceStyle","cloneInputValue","cloneSelectValue","clonedSelect","selectedOption","decorate","ensureSVGSymbols","uses","processedDefs","exist","ns","defs","isRoot","URL_REGEX","URL_WITH_FORMAT_REGEX","FONT_SRC_REGEX","toRegex","escaped","parseURLs","urls","raw","quotation","embed","resourceURL","baseURL","getContentFromUrl","resolvedURL","filterPreferredFontFormat","str","preferredFontFormat","src","shouldEmbed","embedResources","filteredCSSText","css","embedProp","propName","propValue","cssString","embedBackground","embedImageNode","isImageElement","image","embedChildren","deferreds","embedImages","applyStyle","manual","cssFetchCache","fetchCSS","embedFonts","regexUrl","loadFonts","loc","parseCSS","commentsRegex","keyframesRegex","matches","importRegex","combinedCSSRegex","unifiedRegex","getCSSRules","styleSheets","ret","sheet","importIndex","metadata","rule","inline","err","getWebFontRules","cssRules","parseWebFontRules","getWebFontCSS","rules","embedWebFonts","styleNode","sytleContent","toSvg","toCanvas","canvasWidth","canvasHeight","toPng","toJpeg","Service","model","newObj","CSS_VERIFIER_ELEMENT_CLASSNAME","DOMUtils","svgSelector","finalDimensions","validateAndSetDimensions","dimensions","dimensionKey","dimension","dimensionNumber","attrDimensions","svgElement","bbox","bboxDimensions","boundingRect","boundingRectDimensions","clientDimensions","nativeDimensions","query","querySections","elementToAppend","byViewPort","elementOffset","childRect","baseRect","originalID","chartsprefix","mainContainer","holderElement","theme","holderSelection","dataUrl","isFullScreen","chartHeight","chartSVGSelector","childrenHeight","childSVG","containerWidth","containerHeight","resizeCallback","Component","chartprefix","oldParent","idSelector","container","chartClipId","chartClipRectSelection","setPrototypeOf","isFrozen","getPrototypeOf","getOwnPropertyDescriptor","freeze","seal","construct","fun","thisValue","Func","arrayForEach","unapply","arrayPop","stringToLowerCase","stringToString","stringMatch","stringReplace","stringIndexOf","stringTrim","objectHasOwnProperty","regExpTest","typeErrorCreate","unconstruct","_len","_len2","_key2","addToSet","transformCaseFunc","lcElement","cleanArray","newObject","lookupGetter","desc","fallbackValue","html$1","svg$1","svgFilters","svgDisallowed","mathMl$1","mathMlDisallowed","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","ATTR_NAME","policyName","scriptUrl","createDOMPurify","DOMPurify","originalDocument","currentScript","DocumentFragment","HTMLTemplateElement","Element","NodeFilter","NamedNodeMap","HTMLFormElement","DOMParser","ElementPrototype","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","_initDocument","dirty","leadingWhitespace","dirtyPayload","body","_createNodeIterator","_isClobbered","elm","_isNode","_executeHook","entryPoint","currentNode","hook","_sanitizeElements","_isBasicCustomElement","parentNode","childNodes","childCount","childClone","expr","_isValidAttribute","lcTag","lcName","_sanitizeAttributes","attributes","hookEvent","attr","namespaceURI","attrValue","_sanitizeShadowDOM","fragment","shadowNode","shadowIterator","importedNode","returnNode","nodeIterator","serializedHTML","hookFunction","purify","sanitizeHtml","sanitizeSVG","svgContent","sanitizeText","_Toolbar","bodyOnClickHandler","buttonList","overflowMenuItemList","toolbarControls","button","enteringToolbarControls","hoveredElement","overflowMenuControls","enteringOverflowMenuControls","show","currentItemIndex","previousItemIndex","previousItemNode","nextItemIndex","nextItemNode","overflowMenuItems","menuItem","keyEvent","control","numberOfIcons","controls","overflowSpecificControls","overflowList","controlConfig","isFullScreenMode","moreOptions","controlType","isZoomBarEnabled","exportAsCSV","exportAsJPG","exportAsPNG","zoomIn","zoomOut","resetZoom","makeFullScreen","exitFullScreen","showAsTable","_LayoutComponent","component","growth","horizontal","updatedBoxes","itemComponent","isRenderingSVG","matchingElementDimensions","matchingElementWidth","elementWidth","allUpdatedBoxes","LayoutComponent","Spacer","spacerConfigs","settings","settings_1","_createClass","Constructor","protoProps","staticProps","_classCallCheck","_toConsumableArray","_arrayWithoutHoles","_iterableToArray","_unsupportedIterableToArray","_nonIterableSpread","minLen","_arrayLikeToArray","iter","len","arr2","mixin","mixinfns","Class","mixinfn","_class","_typeof","obj","_defineProperties","descriptor","_inherits","subClass","superClass","_setPrototypeOf","_createSuper","Derived","hasNativeReflectConstruct","_isNativeReflectConstruct","Super","_getPrototypeOf","NewTarget","_possibleConstructorReturn","call","_assertThisInitialized","createComponent","ToMix","CreateComponent","_ToMix","_super","_this","_get","receiver","_superPropBase","handles","Handles","_this2","eventedState","EventedState","detail","eventNameSuffix","eventStart","fireOnNode","canceled","changeStateArgs","eventMatches","currentTarget","closest","getLaunchingDetails","evt","launchingElement","launchingEvent","eventedShowHideState","EventedShowHideState","evtOrElem","initComponentByLauncher","InitComponentByLauncher","effectiveOptions","launcher","_mixin","focusWrapNode","handleTransitionEnd","transitionEnd","focusableItem","hasFocusin","focusinEventName","_this3","closeButton","CarbonModalComponent","title","downloadAsCSV","tableArray","heading","Title","maxWidth","untruncatedTitle","tspanLength","titleString","substringIndex","Roles","legendOptions","alignment","legendOrientation","userProvidedOrder","legendItems","addedLegendItems","legendClickable","checkboxRadius","addedCheckboxes","allCheckboxes","status","additionalItemsOption","additionalItems","addedAdditionalItems","previousType","indexOfItem","additionalItem","legendOrder","dataA","dataB","definedOrderIndex","itemConfig","iconData","stroke","lineConfig","zoomEnter","truncationOptions","truncationThreshold","truncationNumCharacter","addedLegendItemsText","_sanitizedLabel","truncation","hoveredItem","hoveredItemData","clickedItemData","ChartClip","mainXScale","mainYScale","xScaleStart","xScaleEnd","yScaleEnd","yScaleStart","clipRect","CanvasChartClip","PLACEMENTS","defaultPositions","referenceOffset","referenceRect","windowRef","Position","positions","offsets","margins","targetRect","relativeRect","reference","placement","offsetFunction","targetBottom","targetRight","placements","containerFunction","positionFunction","weightedPlacements","pos","box","hiddenHeight","hiddenWidth","hiddenArea","visibleArea","visiblePercent","positionAt","defaultHTML","formattedItems","tooltipTextContainer","labelHTML","items","labelIconSize","label","valueFormatter","isTooltipEnabled","newOffset","holderWidth","holderHeight","isTopZoomBarEnabled","noWrap","hasCustomPlacements","bestPlacementOption","horizontalOffset","tooltipConfigs","defaultOffset","hoveredPos","bestPos","mouseRelativePos","zoombarType","zoombarHeight","zoomBarConfigs","focal","canvasElements","zoomSettings","zoomLevel","eventType","eventDetail","newEvent","Files","filename","anchor","href","GradientUtils","lg","need3Stops","stops","Transitions","transitionConfigs","chartConfigs","serviceName","serviceObj","ChartEvents","pendingTransitions","promises","transitionID","graphFrameComponents","toolbarEnabled","legendComponent","isZoomEnabled","titleAvailable","titleComponent","toolbarComponent","headerComponent","graphFrameComponent","isLegendEnabled","fullFrameComponentDirection","legendPosition","legendSpacerComponent","fullFrameComponent","topLevelLayoutComponents","titleSpacerComponent","ChartModelCartesian","isDualAxes","scales","primaryDomain","primaryRange","secondaryDomain","secondaryRange","definedZoomBarData","newZoomBarData","zoomBarNormalizedValues","allDates","keysToCheck","axisPositionKey","axisMapsTo","AlluvialChartModel","justify","ascendingSourceBreadth","ascendingBreadth","ascendingTargetBreadth","defaultId","defaultNodes","graph","defaultLinks","nodeById","computeLinkBreadths","Sankey","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","isGradientAllowed","nodePadding","alluvialConfigs","nodeAlignment","sankeyJustify","sankeyLeft","sankeyRight","d3Sankey","nodeCoordinates","elementID","textWidth","gradient","textNode","debouncedLineHighlight","allLinks","strokeColor","nodeMatrix","titleContainer","titleMatrix","visited","AlluvialChart","_ChartBrush","frontSelectionArea","backdrop","brushArea","d3Selection","mainXScaleType","frontSelection","zoomDomain","updateSelectionDash","selectionWidth","dashArray","dashCount","totalRightDash","brushEventHandler","updateZoomDomain","startPoint","endPoint","xScale","scaleTime","newDomain","brushed","zoomRatio","clickedX","leftPoint","rightPoint","ChartBrush","isTopZoomBarLoading","isTopZoomBarLocked","highlight","axesLeftMargin","axesMargins","zoomBarData","defaultDomain","oldInitialZoomDomain","newInitialZoomDomain","startHighlight","endHighlight","labelMapTo","selected","brushEventListener","zoomBarEventType","handleWidth","handleHeight","handleXDiff","handleBarWidth","handleBarHeight","handleBarXDiff","handleYBarDiff","handleBars","querySelector","clipId","mainXAxisPosition","mainYAxisPosition","mainYScaleType","accessorFunction","xAccessor","yAccessor","areaGenerator","areaGraph","zoomBarClipPath","newDatum","startX","endX","skeletonClass","baselineGenerator","thresholdData","thresholdAxisGroups","thresholdAxisGroupsMerge","thresholdGroups","thresholdGroupsEnter","yScale","isScaleTypeLabels","getDomainValue","getRangeValue","getXValue","getYValue","fillColor","isVertical","formattedValue","Highlight","highlightData","highlightAxisGroups","highlightAxisGroupsMerge","highlightGroups","highlightGroupsEnter","highlightStartMapsTo","highlightEndMapsTo","labelMapsTo","AxisChartsTooltip","dualAxes","domainLabel","rangeLabel","domainValue","compareAsc","_dateLeft","_dateRight","differenceInCalendarYears","differenceInYears","difference","isLastYearNotFull","addMonths","amount","dayOfMonth","endOfDesiredMonth","daysInMonth","addYears","subYears","differenceInCalendarMonths","yearDiff","monthDiff","endOfDay","endOfMonth","isLastDayOfMonth","differenceInMonths","isLastMonthNotFull","subMonths","differenceInDays","compareLocalAsc","isLastDayNotFull","addDays","subDays","getRoundingMethod","method","differenceInMilliseconds","differenceInHours","addMilliseconds","addHours","subHours","differenceInMinutes","addMinutes","subMinutes","differenceInSeconds","addSeconds","subSeconds","CartesianScales","domainAxisPosition","rangeAxisPosition","verticalAxesPositions","horizontalAxesPositions","domainAndRangeAxesPositions","possibleXAxisPositions","possibleYAxisPositions","scaledValue","spaceToAddToEdges","addSpacingToTimeDomain","addSpacingToContinuousDomain","axisConfigs","mainVerticalAxisOptions","mainHorizontalAxisOptions","mainVerticalScaleType","mainHorizontalScaleType","includeZero","extendLinearDomainBy","thresholds","ratioReference","ratioCompareTo","allDataValues","nonStackedGroupsData","stackedValues","dataValues","numericalValues","positiveSum","negativeSum","thresholdValue","scaleLog","scaleBand","scaleLinear","domainRange","lowerBound","domainScale","highestThreshold","rangeScale","startDate","endDate","paddingRatio","newUpper","newLower","Curves","curveMonotoneX","curveMonotoneY","curveStepAfter","curveStepBefore","curveName","curveOptions","optionName","Zoom","customZoomBarData","allZoomBarData","customDomain","mergedConfigs","shouldUpdateRangeAxis","filteredData","currentZoomDomain","currentX0","currentX1","fullRange","gap","newX0","newX1","maxZoomDomain","currentZoomDomainPeriod","maxZoomDomainPeriod","minZoomRatio","AxisChart","zoomBarEnabled","isZoomBarLocked","zoomBarComponent","Grid","isXGridEnabled","isYGridEnabled","xGrid","mainXPosition","numberOfTicks","yGrid","mainYPosition","mousePos","gridlinesX","floor","ceiling","line1","line2","lineSpacing","gridElement","userSpecifiedThreshold","translations","backdropRect","areaConfigs","eventsFragment","boundsEnabled","upperBoundRangeValue","includeZeroInRangeValue","_domain","upperBound","isGradientEnabled","areas","chartMainContainer","strokePathElement","colorValue","sparklineColorObject","sparklineColorObjectKeys","enteringAreas","lineConfigs","events","curves","lineGenerator","groupData","THRESHOLD","pointIsWithinThreshold","Ruler","isRulerEnabled","tooltipData","mouseCoordinate","rulerLine","dataPointElements","pointsWithinLine","dataPointsMatchingRulerLine","currentValue","sampleAccumValue","distanceToCurrentValue","distanceToAccumValue","domainValuesMatchingRulerLine","elementsToHighlight","sampleMatch","mouseMoveCallback","debounceThreshold","mousePosition","fadeInOnChartHolderMouseover","scatterData","circlesToStyle","handleThresholds","xThreshold","yThreshold","xValue","yValue","filled","fillOpacity","classNamesNeeded","isFilled","isAxisVisible","startPosition","endPosition","axisFunction","axisRefExists","axisRef","invisibleAxisRef","isTimeScaleType","isVerticalAxis","axisScaleType","isDataLoading","numberOfTicksProvided","userProvidedTickValues","isNumberOfTicksProvided","fakeTick","fakeTickText","tickHeight","addSpaceOnEdges","tempScale","userProvidedFormatter","defaultFormattedValue","validTicks","userProvidedTickValue","tickTimestamp","discreteDomain","isDataEmpty","axisTitleRef","titleOrientation","titleHeight","axisRefSelection","shouldRotateTicks","tickRotation","mockTextPiece","averageLetterWidth","lastStartPosition","xTransformation","axisTickLabels","tick_html","tickSize","spaceRatio","numberOfTicksFit","HoverAxis","rectangle","TwoDimensionalAxes","axisPositions","axisComponent","childKey","marginKey","Skeleton","showShimmerEffect","xRange","yRange","ticksNumber","ticksValues","xGridG","yGridG","shimmer","arcPathGenerator","tcx","pieConfigs","tcy","skeletonAreaShape","gradientId","stopBgShimmerClass","stopShimmerClass","linearGradient","repeat","easeLinear","AreaChart","BoxplotChartModel","boxplotData","record","q3","iqr","irq1","irq3","outliers","normalValues","minNormalValue","maxNormalValue","isInVerticalOrientation","gridSize","boxWidth","boxGroups","boxGroupsEnter","allBoxGroups","boxplotConfigs","outlier","circlesEnter","ZeroLine","minDomainValue","maxDomainValue","drawZeroLine","yPosition","lineCoordinates","BoxplotChart","Bubble","radiusMapsTo","allRadii","radiusDataIsValid","radiusScale","bubbleOptions","BubbleChart","BulletChartModel","matchingRangeIndex","performanceAreaTitles","Bullet","rangeScaleStart","rangeScaleEnd","rangeScaleDomainMax","renderRangeBoxes","rangeBoxData","rangeBoxes","renderBars","bars","renderTargetLines","renderTargetQuartiles","quartilesData","barValue","lineHeight","BulletChart","getDomain","limits","getColorScale","colorOptions","customColors","customColorsEnabled","colorPairingOption","colorScheme","colorGroupingLength","scaleQuantize","ChoroplethModel","country","feature","topology","properties","transformPoint","stitch","stitchedArcs","fragmentByStart","fragmentByEnd","fragments","emptyIndex","ends","fg","gf","dp","planarRingArea","mergeArcs","objects","polygonsByArc","polygons","extract","neighbors","ki","BinnedRuler","correspondingDomainValue","sampleMatchData","activeDataGroupNames","tooltipDataGroups","rulerPosition","StackedRuler","ColorScaleLegend","xDimensions","availableSpace","colorScaleType","useDefaultBarWidth","barWidth","legendGroupElement","axisElement","legendTitleGroup","quant","linearScale","legendAxis","rangeStart","stopLengthPercentage","colorScaleBand","MeterTitle","meterTitle","titleElement","datasetsTotal","total","breakdownFormatter","totalValue","totalFormatter","totalString","meterConfigs","statusGroup","icon","innerIcon","dataValue","tspan","proportional","totalWidth","percentageWidth","statusWidth","numberOfDatapoints","chartWidth","spacingFactor","circlePackConfigs","hierarchyLevel","canvasZoomEnabled","d3Hierarchy","nodeData","enteringCircles","originalClass","childData","chartSvg","canvasSelection","disabled","zoomable","childrenData","parentValue","arcTween","arcFunc","valueMapsTo","pieLayoutData","renderLabels","labelData","enteringLabels","calloutData","marginedRadius","deg","textLength","totalSlices","sliceAngleDeg","labelTranslateX","labelTranslateY","xOffset","yOffset","pieTranslateX","pieTranslateY","callouts","enteringCallouts","xPosition","Donut","donutTitle","d3Ref","donutCenterFigure","interpolateFunction","localeNumberFormatter","ARROW_UP_PATH_STRING","ARROW_DOWN_PATH_STRING","arcSize","valueRatio","rotationAngle","currentAngle","arcValue","gaugeTranslateX","arcType","valueFontSize","deltaFontSize","numberSpacing","showPercentageSymbol","numbersYPosition","numbersGroup","fontSize","valueNumberGroup","valueNumber","numericValue","valueNumberWidth","symbolFontSize","gaugeSymbol","symbolWidth","symbolHeight","arrowSize","deltaGroup","deltaNumber","deltaNumberWidth","arrowEnabled","deltaArrow","deltaArrowSelection","arcWidth","GroupedBar","allDataLabels","barGroups","allBarGroups","translateBy","rangeAxis","zoomx0","zoomx1","activeData","totalGroupPadding","ref","providedWidth","providedMaxWidth","numOfActiveDataGroups","ranges","domains","minimum","maximum","uniqueDomain","uniqueRange","matrixArray","patternID","rectangles","domainIdentifierFill","parentTag","xBandwidth","yBandwidth","dividerStatus","heatmapConfigs","totalLabel","cell","nullState","Histogram","groupIdentifier","binnedStackedData","rangeScaleLabel","Lollipop","allLines","prevX","domainMax","stackedData","userProvidedHeight","valued","peakValue","peakData","peak","radialLabelPlacement","angleRadians","mod","radToDeg","isInRange","rad","polarToCartesianCoords","distanceBetweenPointOnCircAndVerticalDiameter","tmpTick","tmpTickText","completeBlankData","radarConfigs","xLabelPadding","yLabelPadding","yTicksNumber","minRange","xAxisRectHeight","margin","centerPointMinValue","yTicks","colorScale","dataForColorScale","radialLineGenerator","horizSpaceNeededByEachXLabel","tickWidth","distanceFromDiameter","yAxisUpdate","shapeData","alignmentXOffset","selectionUpdate","svgDimensions","alignmentOffset","axisLine","dots","itemsToHighlight","SimpleBar","yScaleDomainStart","SkeletonLines","isSparkline","sparklineSkeleton","StackedArea","StackedBar","stackData","barIsNegative","matchingDataPoint","numberOfDomainValues","StackedScatter","circleGroups","hoveredX","hoveredY","groupDataIndex","dataIndex","rangeValue","stackedRangeValue","datapoint","tooltipDatapoint","NODE_OFFSET","longestLabel","longestLabelInChildren","mockLabel","mockLabelWidth","rootTitle","mockRootTitleWidth","mockLongestLabelWidth","updateHeight","nodeGroups","nodeGroup","nodeGroupsEnter","linkPaths","linkGroup","linkPathsEnter","diagonal","descendants","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","colorName","colorShades","colorShadeLevel","textFillColor","correspondingLeaf","correspondingLeafFill","cl","d3Color","colorShade","lightness","uidCounter","windowLocation","leafGroups","leaf","allLeafGroups","rects","leafID","addedText","clipPathID","customColor","RADIANS","SPIRALS","archimedeanSpiral","rectangularSpiral","ch","d3Cloud","cloudText","font","cloudFont","cloudFontSize","fontStyle","cloudFontNormal","fontWeight","cloudRotate","cloudPadding","spiral","cloud","cloudCanvas","functor","contextAndRatio","getContext","board","zeroArray","tags","cloudSprite","cloudBounds","startY","maxDelta","dt","dxdy","collideRects","cloudCollide","sprite","sw","lx","msx","di","maxh","metrics","sr","wcr","wsr","hcr","hsr","pixels","w32","seenRow","fontSizeScale","fontSizeMapsTo","wordMapsTo","layout","draw","textGroup","allText","allOccurences","sizeDataIsValid","debouncedHighlight","allWords","GeoProjection","geoData","withData","withoutData","withoutDataMerge","json","projectionScale","geo","missingBorders","Events.Choropleth","Events.Tooltip","ChoroplethChart","configOptions","CirclePackChartModel","zoomOptions","userProvidedDepth","depthOne","totalSum","grandParent","parentWithinIteration","CirclePackChart","graphComponentsMap","ComboChart","chartOptions","comboChartTypes","graphComponents","stackedRulerEnabled","chartObject","PieChartModel","PieChart","extending","DonutChart","GaugeChartModel","GaugeChart","GroupedBarChart","HeatmapModel","ran","dom","HeatmapChart","ChartModelBinned","HistogramChart","LineChart","LollipopChart","MeterChartModel","boundedValue","allRanges","percentValue","MeterChart","meterComponents","graphFrame","RadarChartModel","additionalHeaders","RadarChart","ScatterChart","TreeChartModel","TreeChart","TreemapChartModel","TreemapChart","SimpleBarChart","StackedAreaChart","StackedBarChart","WordCloudModel","WordCloudChart"],"mappings":"kOAAe,SAASA,GAAUC,EAAGC,EAAG,CACtC,OAAOD,GAAK,MAAQC,GAAK,KAAO,IAAMD,EAAIC,EAAI,GAAKD,EAAIC,EAAI,EAAID,GAAKC,EAAI,EAAI,GAC9E,CCFe,SAASC,GAAWF,EAAGC,EAAG,CACvC,OAAOD,GAAK,MAAQC,GAAK,KAAO,IAC5BA,EAAID,EAAI,GACRC,EAAID,EAAI,EACRC,GAAKD,EAAI,EACT,GACN,CCHe,SAASG,GAASC,EAAG,CAClC,IAAIC,EAAUC,EAAUC,EAOpBH,EAAE,SAAW,GACfC,EAAWN,GACXO,EAAW,CAACE,EAAGC,IA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,EACA,KAAM,MACP,EACA,YAAa,CACZ,QAAS,CACR,WAAY,CACX,MAAO,QACP,IAAK,UACL,KAAM,UACN,OAAQ,UACR,UAAW,KACZ,CACD,EACA,UAAW,CACV,EAAG,CACF,KAAM,UACN,OAAQ,UACR,UAAW,KACZ,CACD,EACA,KAAM,MACP,EACA,OAAQ,CACP,QAAS,CACR,cAAe,CACd,MAAO,QACP,IAAK,UACL,KAAM,UACN,UAAW,KACZ,CACD,EACA,UAAW,CACV,OAAQ,CACP,KAAM,UACN,UAAW,KACZ,CACD,EACA,KAAM,MACP,EACA,MAAO,CACN,QAAS,CACR,QAAS,CACR,MAAO,QACP,IAAK,SACN,CACD,EACA,UAAW,CACV,EAAG,CACF,IAAK,SACN,CACD,EACA,KAAM,MACP,EACA,OAAQ,CACP,QAAS,CACR,aAAc,CACb,QAAS,QACT,MAAO,QACP,IAAK,SACN,CACD,EACA,UAAW,CACV,IAAK,CACJ,QAAS,OACV,CACD,EACA,KAAM,MACP,EACA,QAAS,CACR,QAAS,CACR,WAAY,CACX,MAAO,QACP,KAAM,SACP,CACD,EACA,UAAW,CACV,IAAK,CACJ,MAAO,OACR,CACD,EACA,KAAM,MACP,EACA,UAAW,CACV,QAAS,CAAC,EACV,UAAW,CAAC,EACZ,KAAM,MACP,EACA,OAAQ,CACP,QAAS,CACR,KAAM,CACL,KAAM,SACP,CACD,EACA,UAAW,CACV,KAAM,CACL,KAAM,SACP,CACD,EACA,KAAM,MACP,CACD,EACA,aAAc,CACb,MAAO,QACP,MAAO,QACP,MAAO,CACN,MAAO,EACR,EACA,WAAY,CACX,MAAO,yBACP,cAAe,iBAChB,EACA,QAAS,CACR,YAAa,gBACb,YAAa,gBACb,YAAa,gBACb,OAAQ,UACR,QAAS,WACT,UAAW,aACX,YAAa,eACb,eAAgB,kBAChB,eAAgB,kBAChB,YAAa,eACd,CACD,CACD,EAKM4vD,GAAwB,CAC7B,QAAS,GACT,SAAU3B,GAAgB,OAC1B,UAAW,GACX,WAA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,CAAU,EAChBp1H,EAAMoqE,CAAW,EACjBR,EAAgB5pE,EAAMm1H,CAAc,EAAGvtD,CAAU,CAAA,CACjD,CAAA,EAGF,OAAO,MAAM,YAAY,CAAE,QAAA6B,EAAS,MAAAC,CAAO,CAAA,CAC5C,CACD,CChBO,MAAMiwD,WAAuBlnE,EAAM,CAGzC,YACC2E,EACAshC,EACC,CACD,MAAMthC,EAAQshC,CAAY,EANnB,KAAA,MAAA,IAAIghC,GAAe,KAAK,QAAQ,EAUvC,KAAK,MAAM,WAAWriE,GAAyBzwD,GAAQ,eAAgB8xF,EAAa,OAAO,CAAC,EAGvF,KAAA,KAAKthC,EAAQshC,CAAY,CAC/B,CAOA,eAAgB,CACf,MAAMO,EAAoC,CACzC,IAAI/lC,GAAU,KAAK,MAAO,KAAK,QAAQ,EACvC,IAAI6/C,GAAS,KAAK,MAAO,KAAK,SAAU,CACvC,SAAU19C,GAAU,GAAA,CACpB,CAAA,EAKK,OADyB,KAAK,mBAAmB4jC,CAAoB,CAE7E,CACD","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,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,356,357,358,359,360,361,362,363,364,365,366,367,368,369,370,371,372,373,374,375,376,377,378,379,380,381,382,383,384,385,386,387,388,389,390,391,392,393,394,395,396,397,398,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,420,421,422,423,424,425,426,427,428,429,430,431,432,433,434,435,436,437,438,439,440,441,442,443,444,445,446,447,448,449,450,451,452,453,454,455,456,457,458,459,460,461,462,463,464,465,466,467,468,469,470,471,472,473,474,475,476,477,478,479,480,481,482,483,484,485,486,487,488,489,490,491,492,493,494,495,496,497,502,503,504,505,506,507,508,509,510,511,512,513,514,516,517,518,519,520,521,522,523,524,525,526,527,528,529,530,531,532,533,534,535,536,537,541,542,543,544,545,546,547,548,549,550,554,559,560,561,562,563,564,565,566,567,568,569,576,586,587,588,589,590,591,592,593,594,595,596,597,605,606,607,608,609,610,611,612,613,614,615,616,617,618,619,620,621,622,623,624,625,626,627,628,629,630,631,657,658,659,660,661,662,685,687,688]}