UNPKG

ag-charts-core

Version:

Advanced Charting / Charts supporting Javascript / Typescript / React / Angular / Vue

1,415 lines (1,395 loc) 341 kB
"use strict"; var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; var __hasOwnProp = Object.prototype.hasOwnProperty; var __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: true }); }; var __copyProps = (to, from3, except, desc) => { if (from3 && typeof from3 === "object" || typeof from3 === "function") { for (let key of __getOwnPropNames(from3)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, { get: () => from3[key], enumerable: !(desc = __getOwnPropDesc(from3, key)) || desc.enumerable }); } return to; }; var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); var __decorateClass = (decorators, target, key, kind) => { var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target; for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result; if (kind && result) __defProp(target, key, result); return result; }; // packages/ag-charts-core/src/main.ts var main_exports = {}; __export(main_exports, { AGGREGATION_INDEX_SELECTED: () => AGGREGATION_INDEX_SELECTED, AGGREGATION_INDEX_UNSET: () => AGGREGATION_INDEX_UNSET, AGGREGATION_INDEX_X_MAX: () => AGGREGATION_INDEX_X_MAX, AGGREGATION_INDEX_X_MIN: () => AGGREGATION_INDEX_X_MIN, AGGREGATION_INDEX_Y_MAX: () => AGGREGATION_INDEX_Y_MAX, AGGREGATION_INDEX_Y_MIN: () => AGGREGATION_INDEX_Y_MIN, AGGREGATION_MAX_POINTS: () => AGGREGATION_MAX_POINTS, AGGREGATION_MIN_RANGE: () => AGGREGATION_MIN_RANGE, AGGREGATION_SPAN: () => AGGREGATION_SPAN, AGGREGATION_THRESHOLD: () => AGGREGATION_THRESHOLD, AbstractModuleInstance: () => AbstractModuleInstance, ActionOnSet: () => ActionOnSet, AgDocument: () => AgDocument, AsyncAwaitQueue: () => AsyncAwaitQueue, BASE_FONT_SIZE: () => BASE_FONT_SIZE, BREAK_TRANSFORM_CHAIN: () => BREAK_TRANSFORM_CHAIN, BaseProperties: () => BaseProperties, Border: () => Border, CANVAS_HEIGHT: () => CANVAS_HEIGHT, CANVAS_TO_BUFFER_DEFAULTS: () => CANVAS_TO_BUFFER_DEFAULTS, CANVAS_WIDTH: () => CANVAS_WIDTH, CARTESIAN_AXIS_TYPE: () => CARTESIAN_AXIS_TYPE, CARTESIAN_POSITION: () => CARTESIAN_POSITION, CallbackCache: () => CallbackCache, ChangeDetectableProperties: () => ChangeDetectableProperties, ChartAxisDirection: () => ChartAxisDirection, ChartUpdateType: () => ChartUpdateType, CleanupRegistry: () => CleanupRegistry, Color: () => Color, ConfiguredCanvasMixin: () => ConfiguredCanvasMixin, DEFAULT_ANNOTATION_HANDLE_FILL: () => DEFAULT_ANNOTATION_HANDLE_FILL, DEFAULT_ANNOTATION_STATISTICS_COLOR: () => DEFAULT_ANNOTATION_STATISTICS_COLOR, DEFAULT_ANNOTATION_STATISTICS_DIVIDER_STROKE: () => DEFAULT_ANNOTATION_STATISTICS_DIVIDER_STROKE, DEFAULT_ANNOTATION_STATISTICS_DOWN_FILL: () => DEFAULT_ANNOTATION_STATISTICS_DOWN_FILL, DEFAULT_ANNOTATION_STATISTICS_DOWN_STROKE: () => DEFAULT_ANNOTATION_STATISTICS_DOWN_STROKE, DEFAULT_ANNOTATION_STATISTICS_FILL: () => DEFAULT_ANNOTATION_STATISTICS_FILL, DEFAULT_ANNOTATION_STATISTICS_STROKE: () => DEFAULT_ANNOTATION_STATISTICS_STROKE, DEFAULT_CAPTION_ALIGNMENT: () => DEFAULT_CAPTION_ALIGNMENT, DEFAULT_CAPTION_LAYOUT_STYLE: () => DEFAULT_CAPTION_LAYOUT_STYLE, DEFAULT_FIBONACCI_STROKES: () => DEFAULT_FIBONACCI_STROKES, DEFAULT_FINANCIAL_CHARTS_ANNOTATION_BACKGROUND_FILL: () => DEFAULT_FINANCIAL_CHARTS_ANNOTATION_BACKGROUND_FILL, DEFAULT_FINANCIAL_CHARTS_ANNOTATION_COLOR: () => DEFAULT_FINANCIAL_CHARTS_ANNOTATION_COLOR, DEFAULT_POLAR_SERIES_STROKE: () => DEFAULT_POLAR_SERIES_STROKE, DEFAULT_SHADOW_COLOUR: () => DEFAULT_SHADOW_COLOUR, DEFAULT_SPARKLINE_CROSSHAIR_STROKE: () => DEFAULT_SPARKLINE_CROSSHAIR_STROKE, DEFAULT_TEXTBOX_COLOR: () => DEFAULT_TEXTBOX_COLOR, DEFAULT_TEXTBOX_FILL: () => DEFAULT_TEXTBOX_FILL, DEFAULT_TEXTBOX_STROKE: () => DEFAULT_TEXTBOX_STROKE, DEFAULT_TEXT_ANNOTATION_COLOR: () => DEFAULT_TEXT_ANNOTATION_COLOR, DEFAULT_TOOLBAR_POSITION: () => DEFAULT_TOOLBAR_POSITION, DIRECTION_SWAP_AXES: () => DIRECTION_SWAP_AXES, Debug: () => debugLogger_exports, DebugMetrics: () => debugMetrics_exports, DeclaredSceneChangeDetection: () => DeclaredSceneChangeDetection, DeclaredSceneObjectChangeDetection: () => DeclaredSceneObjectChangeDetection, Deprecated: () => Deprecated, DeprecatedAndRenamedTo: () => DeprecatedAndRenamedTo, EllipsisChar: () => EllipsisChar, ErrorType: () => ErrorType, EventEmitter: () => EventEmitter, FILL_GRADIENT_BLANK_DEFAULTS: () => FILL_GRADIENT_BLANK_DEFAULTS, FILL_GRADIENT_CONIC_SERIES_DEFAULTS: () => FILL_GRADIENT_CONIC_SERIES_DEFAULTS, FILL_GRADIENT_LINEAR_DEFAULTS: () => FILL_GRADIENT_LINEAR_DEFAULTS, FILL_GRADIENT_LINEAR_HIERARCHY_DEFAULTS: () => FILL_GRADIENT_LINEAR_HIERARCHY_DEFAULTS, FILL_GRADIENT_LINEAR_KEYED_DEFAULTS: () => FILL_GRADIENT_LINEAR_KEYED_DEFAULTS, FILL_GRADIENT_LINEAR_SINGLE_DEFAULTS: () => FILL_GRADIENT_LINEAR_SINGLE_DEFAULTS, FILL_GRADIENT_RADIAL_DEFAULTS: () => FILL_GRADIENT_RADIAL_DEFAULTS, FILL_GRADIENT_RADIAL_REVERSED_DEFAULTS: () => FILL_GRADIENT_RADIAL_REVERSED_DEFAULTS, FILL_GRADIENT_RADIAL_REVERSED_SERIES_DEFAULTS: () => FILL_GRADIENT_RADIAL_REVERSED_SERIES_DEFAULTS, FILL_GRADIENT_RADIAL_SERIES_DEFAULTS: () => FILL_GRADIENT_RADIAL_SERIES_DEFAULTS, FILL_IMAGE_BLANK_DEFAULTS: () => FILL_IMAGE_BLANK_DEFAULTS, FILL_IMAGE_DEFAULTS: () => FILL_IMAGE_DEFAULTS, FILL_PATTERN_BLANK_DEFAULTS: () => FILL_PATTERN_BLANK_DEFAULTS, FILL_PATTERN_DEFAULTS: () => FILL_PATTERN_DEFAULTS, FILL_PATTERN_HIERARCHY_DEFAULTS: () => FILL_PATTERN_HIERARCHY_DEFAULTS, FILL_PATTERN_KEYED_DEFAULTS: () => FILL_PATTERN_KEYED_DEFAULTS, FILL_PATTERN_SINGLE_DEFAULTS: () => FILL_PATTERN_SINGLE_DEFAULTS, FONT_SIZE: () => FONT_SIZE, FONT_SIZE_RATIO: () => FONT_SIZE_RATIO, Graph: () => Graph, IS_DARK_THEME: () => IS_DARK_THEME, InterpolationProperties: () => InterpolationProperties, LABEL_BOXING_DEFAULTS: () => LABEL_BOXING_DEFAULTS, LEGEND_CONTAINER_THEME: () => LEGEND_CONTAINER_THEME, LRUCache: () => LRUCache, LineSplitter: () => LineSplitter, Logger: () => logger_exports, MARKER_SERIES_HIGHLIGHT_STYLE: () => MARKER_SERIES_HIGHLIGHT_STYLE, MULTI_SERIES_HIGHLIGHT_STYLE: () => MULTI_SERIES_HIGHLIGHT_STYLE, MementoCaretaker: () => MementoCaretaker, ModuleRegistry: () => moduleRegistry_exports, ModuleType: () => ModuleType, ObserveChanges: () => ObserveChanges, PALETTE_ALT_DOWN_FILL: () => PALETTE_ALT_DOWN_FILL, PALETTE_ALT_DOWN_STROKE: () => PALETTE_ALT_DOWN_STROKE, PALETTE_ALT_NEUTRAL_FILL: () => PALETTE_ALT_NEUTRAL_FILL, PALETTE_ALT_NEUTRAL_STROKE: () => PALETTE_ALT_NEUTRAL_STROKE, PALETTE_ALT_UP_FILL: () => PALETTE_ALT_UP_FILL, PALETTE_ALT_UP_STROKE: () => PALETTE_ALT_UP_STROKE, PALETTE_DOWN_FILL: () => PALETTE_DOWN_FILL, PALETTE_DOWN_STROKE: () => PALETTE_DOWN_STROKE, PALETTE_NEUTRAL_FILL: () => PALETTE_NEUTRAL_FILL, PALETTE_NEUTRAL_STROKE: () => PALETTE_NEUTRAL_STROKE, PALETTE_UP_FILL: () => PALETTE_UP_FILL, PALETTE_UP_STROKE: () => PALETTE_UP_STROKE, PART_WHOLE_HIGHLIGHT_STYLE: () => PART_WHOLE_HIGHLIGHT_STYLE, POLAR_AXIS_SHAPE: () => POLAR_AXIS_SHAPE, POLAR_AXIS_TYPE: () => POLAR_AXIS_TYPE, Padding: () => Padding, ParallelStateMachine: () => ParallelStateMachine, PolarZIndexMap: () => PolarZIndexMap, PropertiesArray: () => PropertiesArray, Property: () => addFakeTransformToInstanceProperty, ProxyOnWrite: () => ProxyOnWrite, ProxyProperty: () => ProxyProperty, ProxyPropertyOnWrite: () => ProxyPropertyOnWrite, ReactiveState: () => ReactiveState, SAFE_FILLS_OPERATION: () => SAFE_FILLS_OPERATION, SAFE_FILL_OPERATION: () => SAFE_FILL_OPERATION, SAFE_RANGE2_OPERATION: () => SAFE_RANGE2_OPERATION, SAFE_STROKE_FILL_OPERATION: () => SAFE_STROKE_FILL_OPERATION, SEGMENTATION_DEFAULTS: () => SEGMENTATION_DEFAULTS, SERIES_SELECTION_THEME: () => SERIES_SELECTION_THEME, SINGLE_SERIES_HIGHLIGHT_STYLE: () => SINGLE_SERIES_HIGHLIGHT_STYLE, SKIP_JS_BUILTINS: () => SKIP_JS_BUILTINS, ScaleAlignment: () => ScaleAlignment, SceneArrayChangeDetection: () => SceneArrayChangeDetection, SceneChangeDetection: () => SceneChangeDetection, SceneObjectChangeDetection: () => SceneObjectChangeDetection, SceneRefChangeDetection: () => SceneRefChangeDetection, SeriesContentZIndexMap: () => SeriesContentZIndexMap, SeriesZIndexMap: () => SeriesZIndexMap, SimpleCache: () => SimpleCache, SpanJoin: () => SpanJoin, StateMachine: () => StateMachine, StateMachineProperty: () => StateMachineProperty, TRIPLE_EQ: () => TRIPLE_EQ, TextMeasurer: () => TextMeasurer, TickIntervals: () => TickIntervals, TrimCharsRegex: () => TrimCharsRegex, TrimEdgeGuard: () => TrimEdgeGuard, UNIT_MAX: () => UNIT_MAX, UNIT_MIN: () => UNIT_MIN, UnknownError: () => UnknownError, ValidationError: () => ValidationError, Vec2: () => vector_exports, Vec4: () => vector4_exports, Vertex: () => Vertex, WeakCache: () => WeakCache, ZIndexMap: () => ZIndexMap, addEscapeEventListener: () => addEscapeEventListener, addFakeTransformToInstanceProperty: () => addFakeTransformToInstanceProperty, addMouseCloseListener: () => addMouseCloseListener, addObserverToInstanceProperty: () => addObserverToInstanceProperty, addOverrideFocusVisibleEventListener: () => addOverrideFocusVisibleEventListener, addTouchCloseListener: () => addTouchCloseListener, addTransformToInstanceProperty: () => addTransformToInstanceProperty, aggregationBucketForDatum: () => aggregationBucketForDatum, aggregationDatumMatchesIndex: () => aggregationDatumMatchesIndex, aggregationDomain: () => aggregationDomain, aggregationIndexForXRatio: () => aggregationIndexForXRatio, aggregationRangeFittingPoints: () => aggregationRangeFittingPoints, aggregationXRatioForDatumIndex: () => aggregationXRatioForDatumIndex, aggregationXRatioForXValue: () => aggregationXRatioForXValue, and: () => and, angleBetween: () => angleBetween, angularPadding: () => angularPadding, appendEllipsis: () => appendEllipsis, applySkiaPatches: () => applySkiaPatches, arcDistanceSquared: () => arcDistanceSquared, areScalingEqual: () => areScalingEqual, array: () => array, arrayLength: () => arrayLength, arrayOf: () => arrayOf, arrayOfDefs: () => arrayOfDefs, arraysEqual: () => arraysEqual, assignIfNotStrictlyEqual: () => assignIfNotStrictlyEqual, attachDescription: () => attachDescription, attachListener: () => attachListener, autoSizedLabelOptionsDefs: () => autoSizedLabelOptionsDefs, barHighlightOptionsDef: () => barHighlightOptionsDef, bezier2DDistance: () => bezier2DDistance, bezier2DExtrema: () => bezier2DExtrema, boolean: () => boolean, borderOptionsDef: () => borderOptionsDef, boxCollides: () => boxCollides, boxContains: () => boxContains, boxEmpty: () => boxEmpty, boxesEqual: () => boxesEqual, buildDateFormatter: () => buildDateFormatter, cachedTextMeasurer: () => cachedTextMeasurer, calcLineHeight: () => calcLineHeight, calculatePlacement: () => calculatePlacement, callWithContext: () => callWithContext, callback: () => callback, callbackDefs: () => callbackDefs, callbackOf: () => callbackOf, ceilTo: () => ceilTo, checkDatum: () => checkDatum, circularSliceArray: () => circularSliceArray, clamp: () => clamp, clampArray: () => clampArray, clipLines: () => clipLines, clipSpanX: () => clipSpanX, coerceTextValue: () => coerceTextValue, collapseSpanToPoint: () => collapseSpanToPoint, collectAggregationLevels: () => collectAggregationLevels, collectSparseSelection: () => collectSparseSelection, color: () => color, colorScaleOptionsDef: () => colorScaleOptionsDef, colorStopsOrderValidator: () => colorStopsOrderValidator, colorUnion: () => colorUnion, commonChartOptionsDefs: () => commonChartOptionsDefs, commonSeriesOptionsDefs: () => commonSeriesOptionsDefs, commonSeriesThemeableOptionsDefs: () => commonSeriesThemeableOptionsDefs, compactAggregationIndices: () => compactAggregationIndices, compareDates: () => compareDates, computeColorBins: () => computeColorBins, computeExtremesAggregation: () => computeExtremesAggregation, computeExtremesAggregationPartial: () => computeExtremesAggregationPartial, constant: () => constant, contextMenuItemsArray: () => contextMenuItemsArray, countFractionDigits: () => countFractionDigits, countLines: () => countLines, createAggregationIndices: () => createAggregationIndices, createButton: () => createButton, createCanvasContext: () => createCanvasContext, createCheckbox: () => createCheckbox, createDeprecationWarning: () => createDeprecationWarning, createDynamicContext: () => createDynamicContext, createElement: () => createElement, createElementId: () => createElementId, createIcon: () => createIcon, createId: () => createId, createIdsGenerator: () => createIdsGenerator, createNumberFormatter: () => createNumberFormatter, createSelect: () => createSelect, createSvgElement: () => createSvgElement, createTextArea: () => createTextArea, createTicks: () => createTicks, date: () => date, dateToNumber: () => dateToNumber, dateTruncationForDomain: () => dateTruncationForDomain, datesSortOrder: () => datesSortOrder, debounce: () => debounce, decodeIntervalValue: () => decodeIntervalValue, deepClone: () => deepClone, deepFreeze: () => deepFreeze, defaultEpoch: () => defaultEpoch, defined: () => defined, definedZoomState: () => definedZoomState, deprecated: () => deprecated, deriveNormalizedStops: () => deriveNormalizedStops, diffArrays: () => diffArrays, discreteColorStops: () => discreteColorStops, distribute: () => distribute, downloadUrl: () => downloadUrl, dropFirstWhile: () => dropFirstWhile, dropLastWhile: () => dropLastWhile, durationDay: () => durationDay, durationHour: () => durationHour, durationMinute: () => durationMinute, durationMonth: () => durationMonth, durationSecond: () => durationSecond, durationWeek: () => durationWeek, durationYear: () => durationYear, easeIn: () => easeIn, easeInOut: () => easeInOut, easeInOutQuad: () => easeInOutQuad, easeInQuad: () => easeInQuad, easeOut: () => easeOut, easeOutQuad: () => easeOutQuad, encodedToTimestamp: () => encodedToTimestamp, enterprise: () => enterprise, enterpriseRegistry: () => enterpriseRegistry, entries: () => entries, errorBarOptionsDefs: () => errorBarOptionsDefs, errorBarThemeableOptionsDefs: () => errorBarThemeableOptionsDefs, estimateTickCount: () => estimateTickCount, evaluateBezier: () => evaluateBezier, every: () => every, expandLegendPosition: () => expandLegendPosition, extent: () => extent, extractDecoratedProperties: () => extractDecoratedProperties, extractDomain: () => extractDomain, fillCssOptionsDef: () => fillCssOptionsDef, fillGradientDefaults: () => fillGradientDefaults, fillImageDefaults: () => fillImageDefaults, fillOptionsDef: () => fillOptionsDef, fillPatternDefaults: () => fillPatternDefaults, findDiscreteColorBinLabel: () => findDiscreteColorBinLabel, findMaxIndex: () => findMaxIndex, findMaxValue: () => findMaxValue, findMinIndex: () => findMinIndex, findMinMax: () => findMinMax, findMinValue: () => findMinValue, findRangeExtent: () => findRangeExtent, first: () => first, flush: () => flush, focusCursorAtEnd: () => focusCursorAtEnd, fontFamilyFull: () => fontFamilyFull, fontOptionsDef: () => fontOptionsDef, fontWeight: () => fontWeight, formatColorBinLabel: () => formatColorBinLabel, formatColorScaleBinLabel: () => formatColorScaleBinLabel, formatNumber: () => formatNumber, formatObjectValidator: () => formatObjectValidator, formatPercent: () => formatPercent, formatValue: () => formatValue, fromPairs: () => fromPairs, generateUUID: () => generateUUID, geoJson: () => geoJson, getAngleRatioRadians: () => getAngleRatioRadians, getAttribute: () => getAttribute, getDOMMatrix: () => getDOMMatrix, getDocument: () => getDocument, getElementBBox: () => getElementBBox, getIconClassNames: () => getIconClassNames, getImage: () => getImage, getLastFocus: () => getLastFocus, getMaxInnerRectSize: () => getMaxInnerRectSize, getMidpointsForIndices: () => getMidpointsForIndices, getMinOuterRectSize: () => getMinOuterRectSize, getOffscreenCanvas: () => getOffscreenCanvas, getPath: () => getPath, getPath2D: () => getPath2D, getPrevNextKeys: () => getPrevNextKeys, getResizeObserver: () => getResizeObserver, getSequentialColors: () => getSequentialColors, getTickTimeInterval: () => getTickTimeInterval, getWindow: () => getWindow, googleFont: () => googleFont, gradientColorStops: () => gradientColorStops, gradientStrict: () => gradientStrict, graphemeSegments: () => graphemeSegments, greaterThan: () => greaterThan, groupBy: () => groupBy, guardTextEdges: () => guardTextEdges, hasNoModifiers: () => hasNoModifiers, hasRequiredInPath: () => hasRequiredInPath, highlightOptionsDef: () => highlightOptionsDef, htmlElement: () => htmlElement, inRange: () => inRange, initRovingTabIndex: () => initRovingTabIndex, insertListItemsSorted: () => insertListItemsSorted, instanceOf: () => instanceOf, interpolationOptionsDefs: () => interpolationOptionsDefs, intervalAgo: () => intervalAgo, intervalCeil: () => intervalCeil, intervalEpoch: () => intervalEpoch, intervalExtent: () => intervalExtent, intervalFloor: () => intervalFloor, intervalHierarchy: () => intervalHierarchy, intervalMilliseconds: () => intervalMilliseconds, intervalNext: () => intervalNext, intervalPrevious: () => intervalPrevious, intervalRange: () => intervalRange, intervalRangeCount: () => intervalRangeCount, intervalRangeNumeric: () => intervalRangeNumeric, intervalRangeStartIndex: () => intervalRangeStartIndex, intervalStep: () => intervalStep, intervalUnit: () => intervalUnit, inverseEaseOut: () => inverseEaseOut, isArray: () => isArray, isBetweenAngles: () => isBetweenAngles, isBoolean: () => isBoolean, isButtonClickEvent: () => isButtonClickEvent, isColor: () => isColor, isContinuous: () => isContinuous, isDate: () => isDate, isDecoratedObject: () => isDecoratedObject, isDefined: () => isDefined, isDenseInterval: () => isDenseInterval, isDirectionRtl: () => isDirectionRtl, isDocumentFragment: () => isDocumentFragment, isElement: () => isElement, isEmptyObject: () => isEmptyObject, isEnumKey: () => isEnumKey, isEnumValue: () => isEnumValue, isFiniteNumber: () => isFiniteNumber, isFunction: () => isFunction, isGradientFill: () => isGradientFill, isGradientFillArray: () => isGradientFillArray, isGradientOrPatternFill: () => isGradientOrPatternFill, isHTMLElement: () => isHTMLElement, isHtmlElement: () => isHtmlElement, isImageFill: () => isImageFill, isInputPending: () => isInputPending, isInteger: () => isInteger, isKeyOf: () => isKeyOf, isNegative: () => isNegative, isNode: () => isNode, isNumber: () => isNumber, isNumberEqual: () => isNumberEqual, isNumberObject: () => isNumberObject, isObject: () => isObject, isObjectLike: () => isObjectLike, isObjectWithProperty: () => isObjectWithProperty, isObjectWithStringProperty: () => isObjectWithStringProperty, isPatternFill: () => isPatternFill, isPlainObject: () => isPlainObject, isPointLabelDatum: () => isPointLabelDatum, isProperties: () => isProperties, isRegExp: () => isRegExp, isScaleValid: () => isScaleValid, isSegmentTruncated: () => isSegmentTruncated, isString: () => isString, isStringFillArray: () => isStringFillArray, isStringObject: () => isStringObject, isSymbol: () => isSymbol, isTextTruncated: () => isTextTruncated, isTimeInterval: () => isTimeInterval, isTimeIntervalUnit: () => isTimeIntervalUnit, isTruncated: () => isTruncated, isUnitTimeCategoryScaling: () => isUnitTimeCategoryScaling, isValidDate: () => isValidDate, isValidNumberFormat: () => isValidNumberFormat, iterate: () => iterate, joinFormatted: () => joinFormatted, jsonApply: () => jsonApply, jsonDiff: () => jsonDiff, jsonPropertyCompare: () => jsonPropertyCompare, jsonWalk: () => jsonWalk, kebabCase: () => kebabCase, labelBoxOptionsDef: () => labelBoxOptionsDef, legendPositionValidator: () => legendPositionValidator, lessThan: () => lessThan, lessThanOrEqual: () => lessThanOrEqual, levenshteinDistance: () => levenshteinDistance, lineDashOptionsDef: () => lineDashOptionsDef, lineDistanceSquared: () => lineDistanceSquared, lineHighlightOptionsDef: () => lineHighlightOptionsDef, lineSegmentOptions: () => lineSegmentOptions, lineSegmentation: () => lineSegmentation, linear: () => linear, linearGaugeSeriesOptionsDef: () => linearGaugeSeriesOptionsDef, linearGaugeSeriesThemeableOptionsDef: () => linearGaugeSeriesThemeableOptionsDef, linearGaugeTargetOptionsDef: () => linearGaugeTargetOptionsDef, linearPoints: () => linearPoints, listDecoratedProperties: () => listDecoratedProperties, lowestGranularityForInterval: () => lowestGranularityForInterval, lowestGranularityUnitForTicks: () => lowestGranularityUnitForTicks, lowestGranularityUnitForValue: () => lowestGranularityUnitForValue, makeAccessibleClickListener: () => makeAccessibleClickListener, mapValues: () => mapValues, markerOptionsDefs: () => markerOptionsDefs, markerStyleOptionsDefs: () => markerStyleOptionsDefs, measureTextSegments: () => measureTextSegments, memo: () => memo, merge: () => merge, mergeArrayDefaults: () => mergeArrayDefaults, mergeDefaults: () => mergeDefaults, modulus: () => modulus, multiSeriesHighlightOptionsDef: () => multiSeriesHighlightOptionsDef, nearestSquared: () => nearestSquared, nearestSquaredInContainer: () => nearestSquaredInContainer, nextPowerOf2: () => nextPowerOf2, niceTicksDomain: () => niceTicksDomain, normalisedExtentWithMetadata: () => normalisedExtentWithMetadata, normalisedTimeExtentWithMetadata: () => normalisedTimeExtentWithMetadata, normalizeAngle180: () => normalizeAngle180, normalizeAngle360: () => normalizeAngle360, normalizeAngle360FromDegrees: () => normalizeAngle360FromDegrees, normalizeAngle360Inclusive: () => normalizeAngle360Inclusive, number: () => number, numberFormatValidator: () => numberFormatValidator, numberMin: () => numberMin, numberRange: () => numberRange, object: () => object, objectsEqual: () => objectsEqual, objectsEqualWith: () => objectsEqualWith, optionsDefs: () => optionsDefs, or: () => or, overflowStrategy: () => overflowStrategy, padding: () => padding, paddingOptions: () => paddingOptions, parseColor: () => parseColor, parseNumberFormat: () => parseNumberFormat, partialAssign: () => partialAssign, pause: () => pause, pick: () => pick, pickDirectionZoom: () => pickDirectionZoom, placeLabels: () => placeLabels, populateBucketSelectedFromSparse: () => populateBucketSelectedFromSparse, populateBucketSelectedFromSparseSplit: () => populateBucketSelectedFromSparseSplit, positiveNumber: () => positiveNumber, positiveNumberNonZero: () => positiveNumberNonZero, preserveArabicJoining: () => preserveArabicJoining, previousPowerOf2: () => previousPowerOf2, radialGaugeSeriesOptionsDef: () => radialGaugeSeriesOptionsDef, radialGaugeSeriesThemeableOptionsDef: () => radialGaugeSeriesThemeableOptionsDef, radialGaugeTargetOptionsDef: () => radialGaugeTargetOptionsDef, range: () => range, rangeValidator: () => rangeValidator, ratio: () => ratio, readIntegratedWrappedValue: () => readIntegratedWrappedValue, record: () => record, required: () => required, rescaleSpan: () => rescaleSpan, rescaleVisibleRange: () => rescaleVisibleRange, resetIds: () => resetIds, resolveStopPositions: () => resolveStopPositions, rotatePoint: () => rotatePoint, roundTo: () => roundTo, safeCall: () => safeCall, selectionContainmentValidator: () => selectionContainmentValidator, selectionOptionsDef: () => selectionOptionsDef, seriesLabelOptionsDefs: () => seriesLabelOptionsDefs, seriesTooltipRangeValidator: () => seriesTooltipRangeValidator, setAttribute: () => setAttribute, setAttributes: () => setAttributes, setDocument: () => setDocument, setElementBBox: () => setElementBBox, setElementStyle: () => setElementStyle, setElementStyles: () => setElementStyles, setPath: () => setPath, setWindow: () => setWindow, shadowOptionsDefs: () => shadowOptionsDefs, shallowClone: () => shallowClone, shapeHighlightOptionsDef: () => shapeHighlightOptionsDef, shapeSegmentOptions: () => shapeSegmentOptions, shapeSegmentation: () => shapeSegmentation, shapeSelectionOptionsDef: () => shapeSelectionOptionsDef, shapeValidator: () => shapeValidator, simpleMemorize: () => simpleMemorize, simpleMemorize2: () => simpleMemorize2, smoothPoints: () => smoothPoints, solveBezier: () => solveBezier, sortAndUniqueDates: () => sortAndUniqueDates, sortBasedOnArray: () => sortBasedOnArray, spanRange: () => spanRange, splitBezier2D: () => splitBezier2D, stepPoints: () => stepPoints, stopPageScrolling: () => stopPageScrolling, strictObjectKeys: () => strictObjectKeys, strictUnion: () => strictUnion, string: () => string, stringLength: () => stringLength, stringifyValue: () => stringifyValue, strokeOptionsDef: () => strokeOptionsDef, textAlign: () => textAlign, textOrSegments: () => textOrSegments, textWrap: () => textWrap, themeOperator: () => themeOperator, throttle: () => throttle, tickFormat: () => tickFormat, tickStep: () => tickStep, timeInterval: () => timeInterval, timeIntervalUnit: () => timeIntervalUnit, toArray: () => toArray, toDegrees: () => toDegrees, toFontString: () => toFontString, toIterable: () => toIterable, toPlainText: () => toPlainText, toRadians: () => toRadians, toTextString: () => toTextString, toTimeInterval: () => toTimeInterval, toZoomState: () => toZoomState, toolbarButtonOptionsDefs: () => toolbarButtonOptionsDefs, tooltipOptionsDefs: () => tooltipOptionsDefs, tooltipOptionsDefsWithArea: () => tooltipOptionsDefsWithArea, transformIntegratedCategoryValue: () => transformIntegratedCategoryValue, truncateLine: () => truncateLine, typeUnion: () => typeUnion, undocumented: () => undocumented, unguardTextEdges: () => unguardTextEdges, union: () => union, unionSymbol: () => unionSymbol, unique: () => unique, validate: () => validate, withTimeout: () => withTimeout, without: () => without, wrapLines: () => wrapLines, wrapText: () => wrapText, wrapTextOrSegments: () => wrapTextOrSegments, wrapTextSegments: () => wrapTextSegments }); module.exports = __toCommonJS(main_exports); // packages/ag-charts-core/src/modules/moduleDefinition.ts var ModuleType = /* @__PURE__ */ ((ModuleType2) => { ModuleType2["Chart"] = "chart"; ModuleType2["Axis"] = "axis"; ModuleType2["Series"] = "series"; ModuleType2["Plugin"] = "plugin"; ModuleType2["AxisPlugin"] = "axis:plugin"; ModuleType2["SeriesPlugin"] = "series:plugin"; ModuleType2["Preset"] = "preset"; return ModuleType2; })(ModuleType || {}); // packages/ag-charts-core/src/types/scales.ts function extractDomain(value) { return value.domain; } var ScaleAlignment = /* @__PURE__ */ ((ScaleAlignment2) => { ScaleAlignment2[ScaleAlignment2["Leading"] = 0] = "Leading"; ScaleAlignment2[ScaleAlignment2["Trailing"] = 1] = "Trailing"; ScaleAlignment2[ScaleAlignment2["Interpolate"] = 2] = "Interpolate"; return ScaleAlignment2; })(ScaleAlignment || {}); // packages/ag-charts-core/src/structures/eventEmitter.ts var EventEmitter = class { constructor() { this.events = /* @__PURE__ */ new Map(); } /** * Registers an event listener. * @param eventName The event name to listen for. * @param listener The callback to be invoked on the event. * @returns A function to unregister the listener. */ on(eventName, listener) { if (!this.events.has(eventName)) { this.events.set(eventName, /* @__PURE__ */ new Set()); } this.events.get(eventName)?.add(listener); return () => this.off(eventName, listener); } /** * Unregisters an event listener. * @param eventName The event name to stop listening for. * @param listener The callback to be removed. */ off(eventName, listener) { const eventListeners = this.events.get(eventName); if (eventListeners) { eventListeners.delete(listener); if (eventListeners.size === 0) { this.events.delete(eventName); } } } /** * Emits an event to all registered listeners. * @param eventName The name of the event to emit. * @param event The event payload. */ emit(eventName, event) { const listeners = this.events.get(eventName); if (listeners) { for (const callback2 of listeners) { callback2(event); } } } /** * Clears all listeners for a specific event or all events if no event name is provided. * @param eventName (Optional) The name of the event to clear listeners for. If not provided, all listeners for all events are cleared. */ clear(eventName) { if (eventName) { this.events.delete(eventName); } else { this.events.clear(); } } }; // packages/ag-charts-core/src/structures/lruCache.ts var LRUCache = class { constructor(maxCacheSize) { this.maxCacheSize = maxCacheSize; this.store = /* @__PURE__ */ new Map(); if (maxCacheSize <= 0) { throw new Error("LRUCache size must be greater than 0"); } } get(key) { if (!this.store.has(key)) return; const value = this.store.get(key); this.store.delete(key); this.store.set(key, value); return value; } has(key) { return this.store.has(key); } set(key, value) { this.store.set(key, value); if (this.store.size > this.maxCacheSize) { this.store.delete(this.store.keys().next().value); } return value; } clear() { this.store.clear(); } }; // packages/ag-charts-core/src/logging/debugLogger.ts var debugLogger_exports = {}; __export(debugLogger_exports, { Time: () => Time, check: () => check, create: () => create, inDevelopmentMode: () => inDevelopmentMode }); // packages/ag-charts-core/src/utils/data/arrays.ts function toArray(value) { if (value === void 0) { return []; } return Array.isArray(value) ? value : [value]; } function unique(array2) { return Array.from(new Set(array2)); } function groupBy(array2, iteratee) { return array2.reduce((result, item) => { const groupKey = iteratee(item); result[groupKey] ?? (result[groupKey] = []); result[groupKey].push(item); return result; }, {}); } function arraysEqual(a, b) { if (a == null || b == null || a.length !== b.length) { return false; } for (let i = 0; i < a.length; i++) { if (Array.isArray(a[i]) && Array.isArray(b[i])) { if (!arraysEqual(a[i], b[i])) { return false; } } else if (a[i] !== b[i]) { return false; } } return true; } function circularSliceArray(data, size, offset = 0) { if (data.length === 0) { return []; } const result = []; for (let i = 0; i < size; i++) { result.push(data.at((i + offset) % data.length)); } return result; } function sortBasedOnArray(baseArray, orderArray) { const orderMap = /* @__PURE__ */ new Map(); for (const [index, item] of orderArray.entries()) { orderMap.set(item, index); } return baseArray.sort((a, b) => { const indexA = orderMap.get(a) ?? Infinity; const indexB = orderMap.get(b) ?? Infinity; return indexA - indexB; }); } function dropFirstWhile(array2, cond) { let i = 0; while (i < array2.length && cond(array2[i])) { i += 1; } const deleteCount = i; if (deleteCount !== 0) array2.splice(0, deleteCount); } function dropLastWhile(array2, cond) { let i = array2.length - 1; while (i >= 0 && cond(array2[i])) { i -= 1; } const deleteCount = array2.length - 1 - i; if (deleteCount !== 0) array2.splice(array2.length - deleteCount, deleteCount); } function distribute(min, max, maxCount) { const values = [min]; const step = Math.round((max - min) / (maxCount - 1)); if (step > 0) { for (let i = min + step; i < max; i += step) { const length2 = values.push(i); if (length2 >= maxCount - 1) break; } } values.push(max); return values; } // packages/ag-charts-core/src/utils/dom/globalsProxy.ts var verifiedGlobals = {}; if (typeof globalThis.window !== "undefined") { verifiedGlobals.window = globalThis.window; } if (typeof document !== "undefined") { verifiedGlobals.document = document; } else if (typeof globalThis.global !== "undefined") { verifiedGlobals.document = globalThis.document; } function getDocument(propertyName) { return propertyName ? verifiedGlobals.document?.[propertyName] : verifiedGlobals.document; } function getWindow(propertyName) { return propertyName ? verifiedGlobals.window?.[propertyName] : verifiedGlobals.window; } function setDocument(document2) { verifiedGlobals.document = document2; } function setWindow(window) { verifiedGlobals.window = window; } function getOffscreenCanvas() { return verifiedGlobals.window?.OffscreenCanvas ?? globalThis.OffscreenCanvas; } function getPath2D() { return verifiedGlobals.window?.Path2D ?? globalThis.Path2D; } function getDOMMatrix() { return verifiedGlobals.window?.DOMMatrix ?? globalThis.DOMMatrix; } function getImage() { return verifiedGlobals.window?.Image ?? globalThis.Image; } function getResizeObserver() { return verifiedGlobals.window?.ResizeObserver ?? globalThis.ResizeObserver; } var ELEMENT_NODE = 1; var DOCUMENT_FRAGMENT_NODE = 11; function isNode(obj) { return obj != null && typeof obj.nodeType === "number"; } function isElement(obj) { return obj != null && obj.nodeType === ELEMENT_NODE; } function isDocumentFragment(obj) { return obj != null && obj.nodeType === DOCUMENT_FRAGMENT_NODE; } function isHTMLElement(obj) { return obj != null && obj.nodeType === ELEMENT_NODE && "style" in obj; } // packages/ag-charts-core/src/logging/logger.ts var logger_exports = {}; __export(logger_exports, { error: () => error, errorOnce: () => errorOnce, log: () => log, logGroup: () => logGroup, reset: () => reset, table: () => table, warn: () => warn, warnOnce: () => warnOnce }); var doOnceCache = /* @__PURE__ */ new Set(); function log(...logContent) { console.log(...logContent); } function warn(message, ...logContent) { console.warn(`AG Charts - ${message}`, ...logContent); } function error(message, ...logContent) { if (typeof message === "object") { console.error(`AG Charts error`, message, ...logContent); } else { console.error(`AG Charts - ${message}`, ...logContent); } } function table(...logContent) { console.table(...logContent); } function guardOnce(messageOrError, prefix, cb) { let message; if (messageOrError instanceof Error) { message = messageOrError.message; } else if (typeof messageOrError === "string") { message = messageOrError; } else if (typeof messageOrError === "object") { message = JSON.stringify(messageOrError); } else { message = String(messageOrError); } const cacheKey = `${prefix}: ${message}`; if (doOnceCache.has(cacheKey)) return; cb(messageOrError); doOnceCache.add(cacheKey); } function warnOnce(messageOrError, ...logContent) { guardOnce(messageOrError, "Logger.warn", (message) => warn(message, ...logContent)); } function errorOnce(messageOrError, ...logContent) { guardOnce(messageOrError, "Logger.error", (message) => error(message, ...logContent)); } function reset() { doOnceCache.clear(); } function isPromise(value) { return typeof value === "object" && value !== null && "then" in value; } function logGroup(name, cb) { console.groupCollapsed(name); let syncCleanup = true; try { const result = cb(); if (isPromise(result)) { syncCleanup = false; return result.finally(() => { console.groupEnd(); }); } return result; } finally { if (syncCleanup) { console.groupEnd(); } } } // packages/ag-charts-core/src/logging/debugLogger.ts var LongTimePeriodThreshold = 2e3; var timeOfLastLog = Date.now(); function logTimeGap() { const timeSinceLastLog = Date.now() - timeOfLastLog; if (timeSinceLastLog > LongTimePeriodThreshold) { const prettyDuration = (Math.floor(timeSinceLastLog / 100) / 10).toFixed(1); log(`**** ${prettyDuration}s since last log message ****`); } timeOfLastLog = Date.now(); } function create(...debugSelectors) { const resultFn = (...logContent) => { if (check(...debugSelectors)) { if (typeof logContent[0] === "function") { logContent = toArray(logContent[0]()); } logTimeGap(); log(...logContent); } }; return Object.assign(resultFn, { check: () => check(...debugSelectors), group: (name, cb) => { if (check(...debugSelectors)) { return logGroup(name, cb); } return cb(); } }); } function check(...debugSelectors) { if (debugSelectors.length === 0) { debugSelectors.push(true); } const chartDebug = toArray(getWindow("agChartsDebug")); return chartDebug.some((selector) => debugSelectors.includes(selector)); } function inDevelopmentMode(fn) { if (check("dev")) { return fn(); } } function Time(name, opts = {}) { const { logResult = true, logStack = false, logArgs = false, logData } = opts; return function(_target, _propertyKey, descriptor) { const method = descriptor.value; descriptor.value = function(...args) { const start2 = performance.now(); const result = method.apply(this, args); const duration = performance.now() - start2; const logMessage = { duration }; if (logResult) logMessage.result = result; if (logArgs) logMessage.args = args; if (logStack) logMessage.stack = new Error("Stack trace for timing debug").stack; if (logData) logMessage.logData = logData(this); log(name, logMessage); return result; }; }; } // packages/ag-charts-core/src/logging/debugMetrics.ts var debugMetrics_exports = {}; __export(debugMetrics_exports, { flush: () => flush, record: () => record }); var metrics = /* @__PURE__ */ new Map(); function record(key, value) { if (!check("scene:stats:verbose")) return; metrics.set(key, value); } function flush() { const result = Object.fromEntries(metrics); metrics.clear(); return result; } // packages/ag-charts-core/src/modules/enterpriseRegistry.ts var enterpriseRegistry = {}; // packages/ag-charts-core/src/modules/moduleRegistry.ts var moduleRegistry_exports = {}; __export(moduleRegistry_exports, { RegistryMode: () => RegistryMode, getAxisModule: () => getAxisModule, getChartModule: () => getChartModule, getPresetModule: () => getPresetModule, getSeriesModule: () => getSeriesModule, hasModule: () => hasModule, ifRegistryChanged: () => ifRegistryChanged, isEnterprise: () => isEnterprise, isIntegrated: () => isIntegrated, isModuleType: () => isModuleType, isUmd: () => isUmd, listModules: () => listModules, listModulesByType: () => listModulesByType, register: () => register, registerModules: () => registerModules, reset: () => reset2, setRegistryMode: () => setRegistryMode }); // packages/ag-charts-core/src/modules/registryMode.ts var RegistryMode = /* @__PURE__ */ ((RegistryMode2) => { RegistryMode2["Enterprise"] = "enterprise"; RegistryMode2["Integrated"] = "integrated"; RegistryMode2["UMD"] = "umd"; return RegistryMode2; })(RegistryMode || {}); var registeredModes = /* @__PURE__ */ new Set(); function setRegistryMode(registryFlag) { registeredModes.add(registryFlag); } function clearRegistryModes() { registeredModes.clear(); } function isEnterprise() { return registeredModes.has("enterprise" /* Enterprise */); } function isIntegrated() { return registeredModes.has("integrated" /* Integrated */); } function isUmd() { return registeredModes.has("umd" /* UMD */); } // packages/ag-charts-core/src/modules/moduleRegistry.ts var registeredModules = /* @__PURE__ */ new Map(); var registryRevision = 0; function registerModuleDefinition(def) { registeredModules.set(def.name, def); registryRevision++; if (def.dependencies) { for (const dependency of def.dependencies) { register(dependency); } } } function ifRegistryChanged(lastSeen, callback2) { if (registryRevision !== lastSeen) { callback2(); } return registryRevision; } function register(def) { const existingDefinition = registeredModules.get(def.name); if (!existingDefinition) { registerModuleDefinition(def); return; } if (existingDefinition.version === def.version) { if (!existingDefinition.enterprise && def.enterprise) { registerModuleDefinition(def); } return; } throw new Error( [ `AG Charts - Module '${def.name}' already registered with different version:`, `${existingDefinition.version} vs ${def.version}`, ``, `Check your package.json for conflicting dependencies - depending on your package manager`, `one of these commands may help:`, `- npm ls ag-charts-community`, `- yarn why ag-charts-community` ].join("\n") ); } function registerModules(definitions) { for (const definition of definitions.flat()) { register(definition); } } function reset2() { clearRegistryModes(); registeredModules.clear(); registryRevision++; } function hasModule(moduleName) { return registeredModules.has(moduleName); } function* listModules() { for (const definition of registeredModules.values()) { yield definition; } } function* listModulesByType(moduleType) { for (const definition of registeredModules.values()) { if (isModuleType(moduleType, definition)) { yield definition; } } } function getAxisModule(moduleName) { const definition = registeredModules.get(moduleName); if (isModuleType("axis" /* Axis */, definition)) { return definition; } } function getChartModule(moduleName) { const definition = registeredModules.get(moduleName); if (isModuleType("chart" /* Chart */, definition)) { return definition; } throw new Error( `AG Charts - Unknown chart type; Check options are correctly structured and series types are specified` ); } function getPresetModule(moduleName) { const definition = registeredModules.get(moduleName); if (isModuleType("preset" /* Preset */, definition)) { return definition; } } function getSeriesModule(moduleName) { const definition = registeredModules.get(moduleName); if (isModuleType("series" /* Series */, definition)) { return definition; } } function isModuleType(moduleType, definition) { return definition?.type === moduleType; } // packages/ag-charts-core/src/state/cleanupRegistry.ts var CleanupRegistry = class { constructor() { this.callbacks = /* @__PURE__ */ new Set(); } flush() { for (const cb of this.callbacks) { cb(); } this.callbacks.clear(); } merge(registry) { for (const cb of registry.callbacks) { this.callbacks.add(cb); } } register(...callbacks) { for (const cb of callbacks) { if (!cb) continue; this.callbacks.add(cb); } } }; // packages/ag-charts-core/src/modules/moduleInstance.ts var AbstractModuleInstance = class { constructor() { this.cleanup = new CleanupRegistry(); } destroy() { this.cleanup.flush(); } }; // packages/ag-charts-core/src/module/dynamicContext.ts function asDynamicContext(impl) { return impl; } var state = /* @__PURE__ */ new WeakMap(); function internal(impl) { const s = state.get(impl); if (!s) throw new Error("AG Charts - DynamicContext: missing internal state."); return s; } var DynamicContextImpl = class _DynamicContextImpl { constructor(parent) { const s = { cleanup: new CleanupRegistry(), self: asDynamicContext(this), resolving: /* @__PURE__ */ new Set(), children: /* @__PURE__ */ new Set(), refs: /* @__PURE__ */ new Set(), parent, destroyed: false }; state.set(this, s); if (parent) { internal(parent).children.add(this); } } get cleanup() { return internal(this).cleanup; } constant(name, value) { this.assertNotDestroyed(); Object.defineProperty(this, name, { value, configurable: true, enumerable: true }); return internal(this).self; } ref(name, value) { this.assertNotDestroyed(); const s = internal(this); s.refs.add(name); Object.defineProperty(this, name, { value, configurable: true, enumerable: true }); return s.self; } service(name, fn) { this.assertNotDestroyed(); Object.defineProperty(this, name, { configurable: true, enumerable: true, get: () => { const value = this.resolve(name, fn); Object.defineProperty(this, name, { value, configurable: true, enumerable: true }); return value; } }); return internal(this).self; } factory(name, fn) { this.assertNotDestroyed(); Object.defineProperty(this, name, { configurable: true, enumerable: true, get: () => this.resolve(name, fn) }); return internal(this).self; } has(name) { return name in this; } child() { const c = new _DynamicContextImpl(this); Object.setPrototypeOf(c, this); return asDynamicContext(c); } destroy() { const s = internal(this); if (s.destroyed) return; s.destroyed = true; for (const c of s.children) { c.destroy(); } s.children.clear(); const keys = Object.keys(this); for (let i = keys.length - 1; i >= 0; i--) { const key = keys[i]; if (s.refs.has(key)) continue; const descriptor = Object.getOwnPropertyDescriptor(this, key); if (descriptor?.value != null && typeof descriptor.value === "object") { descriptor.value.destroy?.(); } } s.cleanup.flush(); if (s.parent) { internal(s.parent).children.delete(this); } } resolve(name, fn) { const s = internal(this); if (s.destroyed) { throw new Error(`AG Charts - DynamicContext: cannot resolve '${name}' on a destroyed context.`); } if (s.resolving.has(name)) { throw new Error(`AG Charts - DynamicContext: circular dependency detected while resolving '${name}'.`); } s.resolving.add(name); try { return fn(s.self); } finally { s.resolving.delete(name); } } assertNotDestroyed() { if (internal(this).destroyed) { throw new Error("AG Charts - DynamicContext: cannot register on a destroyed context."); } } }; function createDynamicContext() { return asDynamicContext(new DynamicContextImpl()); } // packages/ag-charts-core/src/utils/data/numbers.ts function clamp(min, value, max) { return Math.min(max, Math.max(min, value)); } function inRange(value, range2, epsilon = 1e-10) { return value >= range2[0] - epsilon && value <= range2[1] + epsilon; } function isNumberEqual(a, b, epsilon = 1e-10) { return a === b || Math.abs(a - b) < epsilon; } function isNegative(value) { return Math.sign(value) === -1 || Object.is(value, -0); } function isInteger(value) { return value % 1 === 0; } function roundTo(value, decimals = 2) { const base = 10 ** decimals; return Math.round(value * base) / base; } function ceilTo(value, decimals = 2) { const base = 10 ** decimals; return Math.ceil(value * base) / base; } function modulus(n, m) { return Math.floor(n % m + (n < 0 ? Math.abs(m) : 0)); } function countFractionDigits(value) { if (Math.floor(value) === value) { return 0; } let valueString = String(value); let exponent = 0; if (value < 1e-6 || value >= 1e21) { let exponentString; [valueString, exponentString] = valueString.split("e"); if (exponentString != null) { exponent = Number(exponentString); } } const decimalPlaces2 = valueString.split(".")[1]?.length ?? 0; return Math.max(decimalPlaces2 - exponent, 0); } // packages/ag-charts-core/src/scale/colorScaleUtil.ts function findNextDefinedStop(fills, from3) { for (let j = from3 + 1; j < fills.length; j++) { if (fills[j]?.stop != null) return j; } return fills.length - 1; } function resolveStopPositions(fills, d0, d1, isDiscrete) { const stops = new Array(fills.length); let previousDefinedStopIndex = 0; let nextDefinedStopIndex = -1; for (let i = 0; i < fills.length; i++) { if (i >= nextDefinedStopIndex) { nextDefinedStopIndex = findNextDefinedStop(fills, i); } const stop = fills[i]?.stop; if (stop == null) { const stop0 = fills[previousDefinedStopIndex]?.stop; const stop1 = fills[nextDefinedStopIndex]?.stop; const value0 = stop0 ?? d0; const value1 = stop1 ?? d1; const offset = isDiscrete && stop0 == null ? 1 : 0; stops[i] = value0 + (value1 - value0) * (i - previousDefinedStopIndex + offset) / (nextDefinedStopIndex - previousDefinedStopIndex + offset); } else { stops[i] = stop; previousDefinedStopIndex = i; } } return stops; } function formatColorScaleBinLabel(bin, index, bins, formatValueFn) { if (bin.name != null) { return bin.name; } const isLast = index === bins.length - 1; if (Number.isInteger(bin.start) && Number.isInteger(bin.end) && !isLast && bin.en