@cloudscape-design/chart-components 1.0.88 → 1.0.89
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/core/chart-api/chart-extra-axis-titles.js +2 -2
- package/core/chart-api/chart-extra-axis-titles.js.map +1 -1
- package/core/chart-api/chart-extra-context.d.ts +5 -4
- package/core/chart-api/chart-extra-context.js +5 -6
- package/core/chart-api/chart-extra-context.js.map +1 -1
- package/core/chart-api/chart-extra-highlight.js +14 -16
- package/core/chart-api/chart-extra-highlight.js.map +1 -1
- package/core/chart-api/chart-extra-legend.js +3 -3
- package/core/chart-api/chart-extra-legend.js.map +1 -1
- package/core/chart-api/chart-extra-navigation.js +1 -1
- package/core/chart-api/chart-extra-navigation.js.map +1 -1
- package/core/chart-api/chart-extra-nodata.js +3 -3
- package/core/chart-api/chart-extra-nodata.js.map +1 -1
- package/core/chart-api/chart-extra-pointer.d.ts +2 -1
- package/core/chart-api/chart-extra-pointer.js +2 -3
- package/core/chart-api/chart-extra-pointer.js.map +1 -1
- package/core/chart-api/chart-extra-tooltip.js +3 -3
- package/core/chart-api/chart-extra-tooltip.js.map +1 -1
- package/core/chart-api/index.js +4 -5
- package/core/chart-api/index.js.map +1 -1
- package/core/components/core-tooltip.js +3 -4
- package/core/components/core-tooltip.js.map +1 -1
- package/core/utils.d.ts +11 -10
- package/core/utils.js +3 -3
- package/core/utils.js.map +1 -1
- package/internal/components/series-marker/render-marker.d.ts +2 -1
- package/internal/components/series-marker/render-marker.js.map +1 -1
- package/internal/environment.js +1 -1
- package/internal/environment.json +1 -1
- package/internal/generated/styles/tokens.d.ts +4 -0
- package/internal/generated/styles/tokens.js +4 -0
- package/internal/generated/theming/index.cjs +132 -0
- package/internal/generated/theming/index.cjs.d.ts +36 -0
- package/internal/generated/theming/index.d.ts +36 -0
- package/internal/generated/theming/index.js +132 -0
- package/internal/manifest.json +1 -1
- package/internal/utils/highcharts.d.ts +40 -0
- package/internal/utils/highcharts.js +55 -0
- package/internal/utils/highcharts.js.map +1 -0
- package/package.json +1 -1
- package/pie-chart/chart-inner-area.js +5 -5
- package/pie-chart/chart-inner-area.js.map +1 -1
- package/internal/utils/chart-series.d.ts +0 -16
- package/internal/utils/chart-series.js +0 -27
- package/internal/utils/chart-series.js.map +0 -1
- package/internal/utils/series-data.d.ts +0 -3
- package/internal/utils/series-data.js +0 -18
- package/internal/utils/series-data.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chart-extra-navigation.js","sourceRoot":"","sources":["../../../../src/core/chart-api/chart-extra-navigation.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAItC,OAAO,EACL,WAAW,EACX,QAAQ,EACR,SAAS,IAAI,gBAAgB,EAC7B,OAAO,GACR,MAAM,+CAA+C,CAAC;AAEvD,OAAO,KAAK,MAAM,MAAM,6BAA6B,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AACtE,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAElE,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAGpE,0FAA0F;AAC1F,qEAAqE;AACrE,MAAM,oBAAoB,GAAG,IAAI,CAAC;AA6BlC,uFAAuF;AACvF,kGAAkG;AAClG,+FAA+F;AAC/F,0GAA0G;AAC1G,4GAA4G;AAC5G,MAAM,OAAO,oBAAoB;IAY/B,YAAY,OAA0B,EAAE,QAAsC;QAR9E,0GAA0G;QAC1G,iHAAiH;QACjH,gHAAgH;QAChH,4BAA4B;QACpB,uBAAkB,GAAuB,IAAI,CAAC;QAC9C,iBAAY,GAAwB,IAAI,CAAC;QACzC,gBAAW,GAAG,KAAK,CAAC;QAY5B,oHAAoH;QACpH,0GAA0G;QAC1G,yFAAyF;QAClF,mBAAc,GAAG,CAAC,OAA2B,EAAE,EAAE;YACtD,IAAI,IAAI,CAAC,kBAAkB,EAAE,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3B,GAAG,MAAM,CAAC,sBAAsB;aACjC,CAAC,CAAC;QACL,CAAC,CAAC;QAxCA,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;IAsBM,IAAI;QACT,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE,CAAC;IAC9B,CAAC;IAEM,OAAO;QACZ,IAAI,CAAC,YAAY,CAAC,UAAU,EAAE,CAAC;IACjC,CAAC;CAYF;AAED,yFAAyF;AACzF,sEAAsE;AACtE,SAAS,2BAA2B,CAAC,KAAuB;IAC1D,MAAM,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC;IACnE,OAAO,KAAK,CAAC,MAAM,CAAC,IAAI,KAAK,KAAK,IAAI,KAAK,CAAC;AAC9C,CAAC;AAED,SAAS,YAAY,CAAC,KAAgB,EAAE,UAAkB,EAAE,KAAa;IACvE,OAAO,WAAW,CAAC,UAAU,GAAG,KAAK,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC;AAChE,CAAC;AAED,SAAS,gBAAgB,CAAC,KAAgB,EAAE,UAAkB,EAAE,KAAa;IAC3E,OAAO,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,UAAU,GAAG,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,oBAAoB,CAAC,CAAC,CAAC,CAAC;AACvH,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type Highcharts from \"highcharts\";\n\nimport {\n circleIndex,\n getIsRtl,\n handleKey as toolkitHandleKey,\n KeyCode,\n} from \"@cloudscape-design/component-toolkit/internal\";\n\nimport * as Styles from \"../../internal/chart-styles\";\nimport { SVGRendererPool } from \"../../internal/utils/renderer-utils\";\nimport { isPointVisible } from \"../../internal/utils/series-data\";\nimport { Rect } from \"../interfaces\";\nimport { getGroupRect, getPointRect, isXThreshold } from \"../utils\";\nimport { ChartExtraContext } from \"./chart-extra-context\";\n\n// In charts with many data points one can navigate faster by using Page Down/Up keys that\n// navigate PAGE_SIZE_PERCENTAGE of the points forwards or backwards.\nconst PAGE_SIZE_PERCENTAGE = 0.05;\n\nexport interface ChartExtraNavigationHandlers {\n onFocusChart(): void;\n onFocusPoint(point: Highcharts.Point, group: readonly Highcharts.Point[]): void;\n onFocusGroup(group: readonly Highcharts.Point[]): void;\n onBlur(): void;\n onActivatePoint(point: Highcharts.Point, group: readonly Highcharts.Point[]): void;\n onActivateGroup(group: readonly Highcharts.Point[]): void;\n // Returns true if a tooltip was dismissed, false otherwise.\n // Used by ESC handlers to decide whether to also navigate.\n onDismissHoverTooltip(): boolean;\n}\n\nexport type FocusedState = FocusedStateChart | FocusedStateGroup | FocusedStatePoint;\n\ninterface FocusedStateChart {\n type: \"chart\";\n}\ninterface FocusedStateGroup {\n type: \"group\";\n group: readonly Highcharts.Point[];\n}\ninterface FocusedStatePoint {\n type: \"point\";\n point: Highcharts.Point;\n group: readonly Highcharts.Point[];\n}\n\n// Navigation controller handles focus behavior and keyboard navigation for all charts.\n// When the chart is first focused, the focus lands on the chart plot. Once navigation is engaged,\n// the focus can land either on the group of points matched by X value, or on a specific point.\n// The focused X value and point are stored so that navigating back to the chart will focus the previously\n// focused point. If the stored point no longer belongs to the chart the focus falls back to the chart plot.\nexport class ChartExtraNavigation {\n private context: ChartExtraContext;\n private handlers: ChartExtraNavigationHandlers;\n private focusOutline: FocusOutline;\n // The application element is a dom element with role=\"application\", rendered right before the chart plot.\n // When the application element is in focus, the keyboard navigation is possible. Upon using navigation commands,\n // we bring the visible focus state to the chart elements, such as points and groups of points. The last visible\n // focus state is persisted.\n private applicationElement: null | HTMLElement = null;\n private focusedState: null | FocusedState = null;\n private ignoreFocus = false;\n\n constructor(context: ChartExtraContext, handlers: ChartExtraNavigationHandlers) {\n this.context = context;\n this.handlers = handlers;\n this.focusOutline = new FocusOutline(context);\n }\n\n public onChartDestroy() {\n this.focusOutline.destroy();\n }\n\n // This function is used as React ref on the application element, positioned right before the chart plot in the DOM.\n // Once the element reference is obtained, we assign the required event listeners directly to the element.\n // That is done for simplicity to avoid passing React event handlers down to the element.\n public setApplication = (element: null | HTMLElement) => {\n if (this.applicationElement) {\n this.applicationElement.removeEventListener(\"focus\", this.onFocus);\n this.applicationElement.removeEventListener(\"blur\", this.onBlur);\n this.applicationElement.removeEventListener(\"keydown\", this.onKeyDown);\n }\n\n if (this.context.settings.keyboardNavigationEnabled || !element) {\n this.applicationElement = element;\n }\n\n if (this.applicationElement) {\n this.applicationElement.addEventListener(\"focus\", this.onFocus);\n this.applicationElement.addEventListener(\"blur\", this.onBlur);\n this.applicationElement.addEventListener(\"keydown\", this.onKeyDown);\n }\n };\n\n // Casting focus to the application element brings the visible focus state to the chart or last focused\n // chart point or group of points. This is used to restore focus after the tooltip is dismissed.\n public focusApplication(point: null | Highcharts.Point, group: readonly Highcharts.Point[]) {\n if (this.context.settings.keyboardNavigationEnabled) {\n this.focusedState = point ? { type: \"point\", point, group } : { type: \"group\", group };\n this.applicationElement?.focus();\n }\n }\n\n public announceChart(ariaLabel: string) {\n this.announce({ role: \"application\", \"aria-label\": ariaLabel });\n }\n\n public announceElement(ariaLabel: string, pinned: boolean) {\n this.announce({ role: \"button\", \"aria-label\": ariaLabel, \"aria-haspopup\": true, \"aria-expanded\": pinned });\n }\n\n // Every time the chart focus is obtained or a navigation action is performed, this needs to be announced\n // to screen-readers. The announcement is made by updating the application element with the attributes of\n // the visually focused element (chart, point, or group), and re-focusing it.\n private announce(elementAttributes: React.ButtonHTMLAttributes<unknown>) {\n if (this.applicationElement) {\n // Remove prev attributes.\n for (const attributeName of this.applicationElement.getAttributeNames()) {\n if (attributeName === \"role\" || attributeName.slice(0, 4) === \"aria\") {\n this.applicationElement.removeAttribute(attributeName);\n }\n }\n // Copy new attributes.\n for (const [attributeName, attributeValue] of Object.entries(elementAttributes)) {\n this.applicationElement.setAttribute(attributeName, `${attributeValue}`);\n }\n // Temporarily disable focus/blur event handlers to not respond to the next programmatically\n // cast focus event, which has the only purpose of making the application element announced to\n // the assistive software.\n this.ignoreFocus = true;\n // Re-attach and re-focus application element to trigger a screen-reader announcement.\n const container = this.applicationElement.parentElement!;\n container.removeChild(this.applicationElement);\n container.appendChild(this.applicationElement);\n this.applicationElement.focus({ preventScroll: true });\n // Remove focus lock. The blur and focus events should have already occurred at this point.\n setTimeout(() => (this.ignoreFocus = false), 0);\n }\n }\n\n // Upon obtaining focus, we show the visible focus state and announce the previously focused element\n // (chart, point, or group). If the previously focused point or group is no longer available, the focus\n // is shown for their respective parent.\n private onFocus = () => {\n if (!this.ignoreFocus) {\n if (!this.focusedState || this.focusedState.type === \"chart\") {\n this.focusChart();\n } else if (this.focusedState.type === \"group\") {\n this.focusGroup(this.focusedState.group);\n } else {\n this.focusPoint(this.focusedState.point, this.focusedState.group);\n }\n }\n };\n\n private onBlur = () => {\n if (!this.ignoreFocus) {\n this.focusOutline.hide();\n this.handlers.onBlur();\n }\n };\n\n private onKeyDown = (event: KeyboardEvent) => {\n // The `handleKey` helper we use does not prevent the default keys behavior, so we do it here for\n // all used keyboard commands. We also stop propagation to prevent the global escape handler in\n // chart-core.tsx from interfering with navigation - when keyboard navigation is active, this\n // handler is the authoritative one for all navigation keys.\n if (\n [\n KeyCode.up,\n KeyCode.down,\n KeyCode.left,\n KeyCode.right,\n KeyCode.enter,\n KeyCode.escape,\n KeyCode.pageUp,\n KeyCode.pageDown,\n KeyCode.home,\n KeyCode.end,\n ].includes(event.keyCode)\n ) {\n event.preventDefault();\n event.stopPropagation();\n }\n // We execute different actions depending on the current focus target (chart, group, or point).\n // It is expected, that the focused element is still available in the chart.\n if (this.focusedState && this.focusedState.type === \"group\") {\n this.onKeyDownGroup(event, this.focusedState.group);\n } else if (this.focusedState && this.focusedState.type === \"point\") {\n this.onKeyDownPoint(event, this.focusedState.point, this.focusedState.group);\n } else {\n this.onKeyDownChart(event);\n }\n };\n\n private onKeyDownChart = (event: KeyboardEvent) => {\n handleKey(event, {\n onActivate: () => this.moveToFirstGroup(),\n onEscape: () => this.handlers.onDismissHoverTooltip(),\n onInlineStart: () => this.moveToLastGroup(),\n onInlineEnd: () => this.moveToFirstGroup(),\n onBlockStart: () => this.moveToLastGroup(),\n onBlockEnd: () => this.moveToFirstGroup(),\n onHome: () => this.moveToFirstGroup(),\n onEnd: () => this.moveToLastGroup(),\n });\n };\n\n private onKeyDownGroup = (event: KeyboardEvent, group: readonly Highcharts.Point[]) => {\n const i = !!this.context.chart().inverted;\n handleKey(event, {\n onActivate: () => this.activateGroup(group),\n onEscape: () => {\n if (!this.handlers.onDismissHoverTooltip()) {\n this.moveToChart();\n }\n },\n onInlineStart: () => (i ? this.moveToFirstInGroup(group) : this.moveToPrevGroup(group)),\n onInlineEnd: () => (i ? this.moveToLastInGroup(group) : this.moveToNextGroup(group)),\n onBlockStart: () => (i ? this.moveToPrevGroup(group) : this.moveToLastInGroup(group)),\n onBlockEnd: () => (i ? this.moveToNextGroup(group) : this.moveToFirstInGroup(group)),\n onPageDown: () => this.moveToNextPageGroup(group),\n onPageUp: () => this.moveToPrevPageGroup(group),\n onHome: () => this.moveToFirstGroup(),\n onEnd: () => this.moveToLastGroup(),\n });\n };\n\n private onKeyDownPoint = (event: KeyboardEvent, point: Highcharts.Point, group: readonly Highcharts.Point[]) => {\n const i = !!this.context.chart().inverted;\n handleKey(event, {\n onActivate: () => this.activatePoint(point, group),\n onEscape: () => {\n if (!this.handlers.onDismissHoverTooltip()) {\n this.moveToParentGroup(point);\n }\n },\n onInlineEnd: () => (i ? this.moveToPrevInGroup(point) : this.moveToNextInSeries(point)),\n onInlineStart: () => (i ? this.moveToNextInGroup(point) : this.moveToPrevInSeries(point)),\n onBlockEnd: () => (i ? this.moveToNextInSeries(point) : this.moveToNextInGroup(point)),\n onBlockStart: () => (i ? this.moveToPrevInSeries(point) : this.moveToPrevInGroup(point)),\n onPageDown: () => this.moveToNextPageInSeries(point),\n onPageUp: () => this.moveToPrevPageInSeries(point),\n onHome: () => this.moveToFirstInSeries(point),\n onEnd: () => this.moveToLastInSeries(point),\n });\n };\n\n private moveToFirstGroup() {\n this.focusGroup(this.findFirstGroup());\n }\n\n private moveToLastGroup() {\n this.focusGroup(this.findLastGroup());\n }\n\n private moveToNextGroup(group: readonly Highcharts.Point[]) {\n const nextGroup = group[0] ? this.findNextGroup(group[0]) : [];\n this.focusGroup(nextGroup);\n }\n\n private moveToPrevGroup(group: readonly Highcharts.Point[]) {\n const prevGroup = group[0] ? this.findPrevGroup(group[0]) : [];\n this.focusGroup(prevGroup);\n }\n\n private moveToParentGroup(point: Highcharts.Point) {\n const group = this.findMatchingGroup(point);\n if (group.length > 0 && group[0].series.type !== \"pie\") {\n this.focusGroup(group);\n } else {\n this.focusChart();\n }\n }\n\n private moveToChart() {\n this.focusChart();\n }\n\n private moveToFirstInGroup(group: readonly Highcharts.Point[]) {\n const points = group.filter((p) => !isXThreshold(p.series));\n this.focusPoint(points[0], group);\n }\n\n private moveToLastInGroup(group: readonly Highcharts.Point[]) {\n const points = group.filter((p) => !isXThreshold(p.series));\n this.focusPoint(points[points.length - 1], group);\n }\n\n private moveToPrevInGroup(point: Highcharts.Point) {\n const points = this.findMatchingGroup(point).filter((p) => !isXThreshold(p.series));\n const pointIndex = points.indexOf(point);\n this.focusPoint(points[circleIndex(pointIndex - 1, [0, points.length - 1])], points);\n }\n\n private moveToNextInGroup(point: Highcharts.Point) {\n const points = this.findMatchingGroup(point).filter((p) => !isXThreshold(p.series));\n const pointIndex = points.indexOf(point);\n this.focusPoint(points[circleIndex(pointIndex + 1, [0, points.length - 1])], points);\n }\n\n private moveToFirstInSeries(point: Highcharts.Point) {\n const firstPoint = this.findFirstPointInSeries(point);\n if (firstPoint) {\n this.focusPoint(firstPoint, this.findMatchingGroup(firstPoint));\n } else {\n this.focusChart();\n }\n }\n\n private moveToLastInSeries(point: Highcharts.Point) {\n const lastPoint = this.findLastPointInSeries(point);\n if (lastPoint) {\n this.focusPoint(lastPoint, this.findMatchingGroup(lastPoint));\n } else {\n this.focusChart();\n }\n }\n\n private moveToNextInSeries(point: Highcharts.Point) {\n const nextPoint = this.findNextPointInSeries(point);\n if (nextPoint) {\n this.focusPoint(nextPoint, this.findMatchingGroup(nextPoint));\n } else {\n this.focusChart();\n }\n }\n\n private moveToPrevInSeries(point: Highcharts.Point) {\n const prevPoint = this.findPrevPointInSeries(point);\n if (prevPoint) {\n this.focusPoint(prevPoint, this.findMatchingGroup(prevPoint));\n } else {\n this.focusChart();\n }\n }\n\n private moveToNextPageGroup(group: readonly Highcharts.Point[]) {\n const nextPageGroup = group[0] ? this.findNextPageGroup(group[0]) : [];\n this.focusGroup(nextPageGroup);\n }\n\n private moveToPrevPageGroup(group: readonly Highcharts.Point[]) {\n const prevPageGroup = group[0] ? this.findPrevPageGroup(group[0]) : [];\n this.focusGroup(prevPageGroup);\n }\n\n private moveToNextPageInSeries(point: Highcharts.Point) {\n const nextPagePoint = this.findNextPagePointInSeries(point);\n if (nextPagePoint) {\n this.focusPoint(nextPagePoint, this.findMatchingGroup(nextPagePoint));\n } else {\n this.focusChart();\n }\n }\n\n private moveToPrevPageInSeries(point: Highcharts.Point) {\n const prevPagePoint = this.findPrevPagePointInSeries(point);\n if (prevPagePoint) {\n this.focusPoint(prevPagePoint, this.findMatchingGroup(prevPagePoint));\n } else {\n this.focusChart();\n }\n }\n\n private activateGroup(group: readonly Highcharts.Point[]) {\n this.handlers.onActivateGroup(group);\n }\n\n private activatePoint(point: Highcharts.Point, group: readonly Highcharts.Point[]) {\n this.handlers.onActivatePoint(point, group);\n }\n\n private focusChart = () => {\n this.focusedState = { type: \"chart\" };\n this.focusOutline.chart();\n this.handlers.onFocusChart();\n };\n\n private focusGroup(group: readonly Highcharts.Point[]) {\n // When the chart is re-focused, the group that was focused before might no longer be valid if its\n // points are no longer visible or were destroyed by Highcharts. In that case we focus the chart as\n // a fallback.\n const visiblePoints = group.filter(isPointVisible);\n if (visiblePoints.length === 0) {\n this.focusChart();\n }\n // In pie charts we only focus points, so moving focus to points and groups is equivalent.\n else if (visiblePoints[0].series.type === \"pie\") {\n this.focusPoint(visiblePoints[0] ?? null, group);\n }\n // When focusing a group we draw the focus outline around the corresponding group rect, including\n // all points of that group.\n else {\n this.focusedState = { type: \"group\", group: visiblePoints };\n this.focusOutline.group(getGroupRect(visiblePoints));\n this.handlers.onFocusGroup(visiblePoints);\n }\n }\n\n private focusPoint(point: null | Highcharts.Point, group: readonly Highcharts.Point[]) {\n // When the chart is re-focused, the point that was focused before might no longer be valid it became\n // hidden or was destroyed by Highcharts. In that case we focus the point's parent group as a fallback.\n if (!point || !isPointVisible(point)) {\n this.focusGroup(group);\n }\n // When focusing a point we draw the focus outline around its corresponding rect, but with different offsets,\n // depending on the point's series type.\n else {\n this.focusedState = { type: \"point\", point, group };\n this.focusOutline.point(getPointRect(point), point);\n this.handlers.onFocusPoint(point, group);\n }\n }\n\n private get allX(): number[] {\n return this.context.derived.allX;\n }\n\n // Returns all series data points to navigate by. When a series is linked with other series - the method returns\n // all points from the linked series.\n private getSeriesPoints(series: Highcharts.Series): Highcharts.Point[] {\n return this.context.derived.getSeriesPoints(series);\n }\n\n private getPointsByX = (x: number): Highcharts.Point[] => {\n return this.context.derived.getPointsByX(x);\n };\n\n private findMatchingGroup = (point: Highcharts.Point): Highcharts.Point[] => {\n return this.getPointsByX(point.x);\n };\n\n private findFirstGroup = (): Highcharts.Point[] => {\n return this.getPointsByX(this.allX[0]);\n };\n\n private findLastGroup = (): Highcharts.Point[] => {\n return this.getPointsByX(this.allX[this.allX.length - 1]);\n };\n\n private findNextGroup = (point: Highcharts.Point): Highcharts.Point[] => {\n const nextIndex = getNextIndex(this.allX, this.allX.indexOf(point.x), 1);\n return this.getPointsByX(this.allX[nextIndex]);\n };\n\n private findPrevGroup = (point: Highcharts.Point): Highcharts.Point[] => {\n const nextIndex = getNextIndex(this.allX, this.allX.indexOf(point.x), -1);\n return this.getPointsByX(this.allX[nextIndex]);\n };\n\n private findNextPageGroup = (point: Highcharts.Point): Highcharts.Point[] => {\n const nextIndex = getNextPageIndex(this.allX, this.allX.indexOf(point.x), 1);\n return this.getPointsByX(this.allX[nextIndex]);\n };\n\n private findPrevPageGroup = (point: Highcharts.Point): Highcharts.Point[] => {\n const nextIndex = getNextPageIndex(this.allX, this.allX.indexOf(point.x), -1);\n return this.getPointsByX(this.allX[nextIndex]);\n };\n\n private findFirstPointInSeries = (point: Highcharts.Point): null | Highcharts.Point => {\n const seriesPoints = this.getSeriesPoints(point.series);\n return seriesPoints[0] ?? null;\n };\n\n private findLastPointInSeries = (point: Highcharts.Point): null | Highcharts.Point => {\n const seriesPoints = this.getSeriesPoints(point.series);\n return seriesPoints[seriesPoints.length - 1] ?? null;\n };\n\n private findNextPointInSeries = (point: Highcharts.Point): null | Highcharts.Point => {\n const seriesPoints = this.getSeriesPoints(point.series);\n const delta = !shouldInvertPointsDirection(point) ? 1 : -1;\n const pointIndex = seriesPoints.indexOf(point);\n const nextIndex = getNextIndex(seriesPoints, pointIndex, delta);\n return seriesPoints[nextIndex] ?? null;\n };\n\n private findPrevPointInSeries = (point: Highcharts.Point): null | Highcharts.Point => {\n const seriesPoints = this.getSeriesPoints(point.series);\n const delta = !shouldInvertPointsDirection(point) ? -1 : 1;\n const pointIndex = seriesPoints.indexOf(point);\n const nextIndex = getNextIndex(seriesPoints, pointIndex, delta);\n return seriesPoints[nextIndex] ?? null;\n };\n\n private findNextPagePointInSeries = (point: Highcharts.Point): null | Highcharts.Point => {\n const seriesPoints = this.getSeriesPoints(point.series);\n const delta = !shouldInvertPointsDirection(point) ? 1 : -1;\n const pointIndex = seriesPoints.indexOf(point);\n const nextIndex = getNextPageIndex(seriesPoints, pointIndex, delta);\n return seriesPoints[nextIndex] ?? null;\n };\n\n private findPrevPagePointInSeries = (point: Highcharts.Point): null | Highcharts.Point => {\n const seriesPoints = this.getSeriesPoints(point.series);\n const delta = !shouldInvertPointsDirection(point) ? -1 : 1;\n const pointIndex = seriesPoints.indexOf(point);\n const nextIndex = getNextPageIndex(seriesPoints, pointIndex, delta);\n return seriesPoints[nextIndex] ?? null;\n };\n}\n\nfunction handleKey(\n event: KeyboardEvent,\n handlers: {\n onActivate?: () => void;\n onBlockEnd?: () => void;\n onBlockStart?: () => void;\n onDefault?: () => void;\n onEnd?: () => void;\n onEscape?: () => void;\n onHome?: () => void;\n onInlineEnd?: () => void;\n onInlineStart?: () => void;\n onPageDown?: () => void;\n onPageUp?: () => void;\n },\n) {\n if (!event.currentTarget) {\n return;\n }\n if (!(event.currentTarget instanceof HTMLElement) && !(event.currentTarget instanceof SVGElement)) {\n return;\n }\n toolkitHandleKey({ keyCode: event.keyCode, currentTarget: event.currentTarget }, handlers);\n}\n\n// A helper class to draw the focus outline around given chart elements.\nclass FocusOutline {\n private context: ChartExtraContext;\n private elementsPool = new SVGRendererPool();\n\n constructor(context: ChartExtraContext) {\n this.context = context;\n }\n\n public chart = () => {\n const [x, y, width, height] = [\n this.context.chart().plotLeft,\n this.context.chart().plotTop,\n this.context.chart().plotWidth,\n this.context.chart().plotHeight,\n ];\n this.rect({ x, y, width, height }, Styles.focusOutlineOffsets.chart);\n };\n\n public group = (rect: Rect) => {\n this.rect(rect, Styles.focusOutlineOffsets.group);\n };\n\n public point = (rect: Rect, point: Highcharts.Point) => {\n const offsetByType = Styles.focusOutlineOffsets.pointByType[point.series.type];\n const offset = offsetByType ?? Styles.focusOutlineOffsets.point;\n this.rect(rect, offset);\n };\n\n public hide() {\n this.elementsPool.hideAll();\n }\n\n public destroy() {\n this.elementsPool.destroyAll();\n }\n\n private rect = ({ x, y, width, height }: Rect, offset: number) => {\n this.elementsPool.hideAll();\n this.elementsPool.rect(this.context.chart().renderer, {\n x: x - offset,\n y: y - offset,\n width: width + offset * 2,\n height: height + offset * 2,\n ...Styles.navigationFocusOutline,\n });\n };\n}\n\n// We do not invert the direction of pie segments when RTL, but swap the left/right keys.\n// To offset for that, the prev/next points direction is swapped, too.\nfunction shouldInvertPointsDirection(point: Highcharts.Point) {\n const isRTL = getIsRtl(point.series.chart.container.parentElement);\n return point.series.type === \"pie\" && isRTL;\n}\n\nfunction getNextIndex(array: unknown[], pointIndex: number, delta: -1 | 1): number {\n return circleIndex(pointIndex + delta, [0, array.length - 1]);\n}\n\nfunction getNextPageIndex(array: unknown[], pointIndex: number, delta: -1 | 1): number {\n return Math.min(array.length - 1, Math.max(0, pointIndex + delta * Math.round(array.length * PAGE_SIZE_PERCENTAGE)));\n}\n"]}
|
|
1
|
+
{"version":3,"file":"chart-extra-navigation.js","sourceRoot":"","sources":["../../../../src/core/chart-api/chart-extra-navigation.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAItC,OAAO,EACL,WAAW,EACX,QAAQ,EACR,SAAS,IAAI,gBAAgB,EAC7B,OAAO,GACR,MAAM,+CAA+C,CAAC;AAEvD,OAAO,KAAK,MAAM,MAAM,6BAA6B,CAAC;AACtD,OAAO,EAAE,cAAc,EAAc,MAAM,iCAAiC,CAAC;AAC7E,OAAO,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAEtE,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAGpE,0FAA0F;AAC1F,qEAAqE;AACrE,MAAM,oBAAoB,GAAG,IAAI,CAAC;AA6BlC,uFAAuF;AACvF,kGAAkG;AAClG,+FAA+F;AAC/F,0GAA0G;AAC1G,4GAA4G;AAC5G,MAAM,OAAO,oBAAoB;IAY/B,YAAY,OAA0B,EAAE,QAAsC;QAR9E,0GAA0G;QAC1G,iHAAiH;QACjH,gHAAgH;QAChH,4BAA4B;QACpB,uBAAkB,GAAuB,IAAI,CAAC;QAC9C,iBAAY,GAAwB,IAAI,CAAC;QACzC,gBAAW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G,MAAM;gBACb,CAAC,EAAE,CAAC,GAAG,MAAM;gBACb,KAAK,EAAE,KAAK,GAAG,MAAM,GAAG,CAAC;gBACzB,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,CAAC;gBAC3B,GAAG,MAAM,CAAC,sBAAsB;aACjC,CAAC,CAAC;QACL,CAAC,CAAC;QAxCA,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;IAsBM,IAAI;QACT,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE,CAAC;IAC9B,CAAC;IAEM,OAAO;QACZ,IAAI,CAAC,YAAY,CAAC,UAAU,EAAE,CAAC;IACjC,CAAC;CAYF;AAED,yFAAyF;AACzF,sEAAsE;AACtE,SAAS,2BAA2B,CAAC,KAAuB;IAC1D,MAAM,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC;IACnE,OAAO,KAAK,CAAC,MAAM,CAAC,IAAI,KAAK,KAAK,IAAI,KAAK,CAAC;AAC9C,CAAC;AAED,SAAS,YAAY,CAAC,KAAgB,EAAE,UAAkB,EAAE,KAAa;IACvE,OAAO,WAAW,CAAC,UAAU,GAAG,KAAK,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC;AAChE,CAAC;AAED,SAAS,gBAAgB,CAAC,KAAgB,EAAE,UAAkB,EAAE,KAAa;IAC3E,OAAO,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,UAAU,GAAG,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,oBAAoB,CAAC,CAAC,CAAC,CAAC;AACvH,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type Highcharts from \"highcharts\";\n\nimport {\n circleIndex,\n getIsRtl,\n handleKey as toolkitHandleKey,\n KeyCode,\n} from \"@cloudscape-design/component-toolkit/internal\";\n\nimport * as Styles from \"../../internal/chart-styles\";\nimport { isPointVisible, SafeSeries } from \"../../internal/utils/highcharts\";\nimport { SVGRendererPool } from \"../../internal/utils/renderer-utils\";\nimport { Rect } from \"../interfaces\";\nimport { getGroupRect, getPointRect, isXThreshold } from \"../utils\";\nimport { ChartExtraContext } from \"./chart-extra-context\";\n\n// In charts with many data points one can navigate faster by using Page Down/Up keys that\n// navigate PAGE_SIZE_PERCENTAGE of the points forwards or backwards.\nconst PAGE_SIZE_PERCENTAGE = 0.05;\n\nexport interface ChartExtraNavigationHandlers {\n onFocusChart(): void;\n onFocusPoint(point: Highcharts.Point, group: readonly Highcharts.Point[]): void;\n onFocusGroup(group: readonly Highcharts.Point[]): void;\n onBlur(): void;\n onActivatePoint(point: Highcharts.Point, group: readonly Highcharts.Point[]): void;\n onActivateGroup(group: readonly Highcharts.Point[]): void;\n // Returns true if a tooltip was dismissed, false otherwise.\n // Used by ESC handlers to decide whether to also navigate.\n onDismissHoverTooltip(): boolean;\n}\n\nexport type FocusedState = FocusedStateChart | FocusedStateGroup | FocusedStatePoint;\n\ninterface FocusedStateChart {\n type: \"chart\";\n}\ninterface FocusedStateGroup {\n type: \"group\";\n group: readonly Highcharts.Point[];\n}\ninterface FocusedStatePoint {\n type: \"point\";\n point: Highcharts.Point;\n group: readonly Highcharts.Point[];\n}\n\n// Navigation controller handles focus behavior and keyboard navigation for all charts.\n// When the chart is first focused, the focus lands on the chart plot. Once navigation is engaged,\n// the focus can land either on the group of points matched by X value, or on a specific point.\n// The focused X value and point are stored so that navigating back to the chart will focus the previously\n// focused point. If the stored point no longer belongs to the chart the focus falls back to the chart plot.\nexport class ChartExtraNavigation {\n private context: ChartExtraContext;\n private handlers: ChartExtraNavigationHandlers;\n private focusOutline: FocusOutline;\n // The application element is a dom element with role=\"application\", rendered right before the chart plot.\n // When the application element is in focus, the keyboard navigation is possible. Upon using navigation commands,\n // we bring the visible focus state to the chart elements, such as points and groups of points. The last visible\n // focus state is persisted.\n private applicationElement: null | HTMLElement = null;\n private focusedState: null | FocusedState = null;\n private ignoreFocus = false;\n\n constructor(context: ChartExtraContext, handlers: ChartExtraNavigationHandlers) {\n this.context = context;\n this.handlers = handlers;\n this.focusOutline = new FocusOutline(context);\n }\n\n public onChartDestroy() {\n this.focusOutline.destroy();\n }\n\n // This function is used as React ref on the application element, positioned right before the chart plot in the DOM.\n // Once the element reference is obtained, we assign the required event listeners directly to the element.\n // That is done for simplicity to avoid passing React event handlers down to the element.\n public setApplication = (element: null | HTMLElement) => {\n if (this.applicationElement) {\n this.applicationElement.removeEventListener(\"focus\", this.onFocus);\n this.applicationElement.removeEventListener(\"blur\", this.onBlur);\n this.applicationElement.removeEventListener(\"keydown\", this.onKeyDown);\n }\n\n if (this.context.settings.keyboardNavigationEnabled || !element) {\n this.applicationElement = element;\n }\n\n if (this.applicationElement) {\n this.applicationElement.addEventListener(\"focus\", this.onFocus);\n this.applicationElement.addEventListener(\"blur\", this.onBlur);\n this.applicationElement.addEventListener(\"keydown\", this.onKeyDown);\n }\n };\n\n // Casting focus to the application element brings the visible focus state to the chart or last focused\n // chart point or group of points. This is used to restore focus after the tooltip is dismissed.\n public focusApplication(point: null | Highcharts.Point, group: readonly Highcharts.Point[]) {\n if (this.context.settings.keyboardNavigationEnabled) {\n this.focusedState = point ? { type: \"point\", point, group } : { type: \"group\", group };\n this.applicationElement?.focus();\n }\n }\n\n public announceChart(ariaLabel: string) {\n this.announce({ role: \"application\", \"aria-label\": ariaLabel });\n }\n\n public announceElement(ariaLabel: string, pinned: boolean) {\n this.announce({ role: \"button\", \"aria-label\": ariaLabel, \"aria-haspopup\": true, \"aria-expanded\": pinned });\n }\n\n // Every time the chart focus is obtained or a navigation action is performed, this needs to be announced\n // to screen-readers. The announcement is made by updating the application element with the attributes of\n // the visually focused element (chart, point, or group), and re-focusing it.\n private announce(elementAttributes: React.ButtonHTMLAttributes<unknown>) {\n if (this.applicationElement) {\n // Remove prev attributes.\n for (const attributeName of this.applicationElement.getAttributeNames()) {\n if (attributeName === \"role\" || attributeName.slice(0, 4) === \"aria\") {\n this.applicationElement.removeAttribute(attributeName);\n }\n }\n // Copy new attributes.\n for (const [attributeName, attributeValue] of Object.entries(elementAttributes)) {\n this.applicationElement.setAttribute(attributeName, `${attributeValue}`);\n }\n // Temporarily disable focus/blur event handlers to not respond to the next programmatically\n // cast focus event, which has the only purpose of making the application element announced to\n // the assistive software.\n this.ignoreFocus = true;\n // Re-attach and re-focus application element to trigger a screen-reader announcement.\n const container = this.applicationElement.parentElement!;\n container.removeChild(this.applicationElement);\n container.appendChild(this.applicationElement);\n this.applicationElement.focus({ preventScroll: true });\n // Remove focus lock. The blur and focus events should have already occurred at this point.\n setTimeout(() => (this.ignoreFocus = false), 0);\n }\n }\n\n // Upon obtaining focus, we show the visible focus state and announce the previously focused element\n // (chart, point, or group). If the previously focused point or group is no longer available, the focus\n // is shown for their respective parent.\n private onFocus = () => {\n if (!this.ignoreFocus) {\n if (!this.focusedState || this.focusedState.type === \"chart\") {\n this.focusChart();\n } else if (this.focusedState.type === \"group\") {\n this.focusGroup(this.focusedState.group);\n } else {\n this.focusPoint(this.focusedState.point, this.focusedState.group);\n }\n }\n };\n\n private onBlur = () => {\n if (!this.ignoreFocus) {\n this.focusOutline.hide();\n this.handlers.onBlur();\n }\n };\n\n private onKeyDown = (event: KeyboardEvent) => {\n // The `handleKey` helper we use does not prevent the default keys behavior, so we do it here for\n // all used keyboard commands. We also stop propagation to prevent the global escape handler in\n // chart-core.tsx from interfering with navigation - when keyboard navigation is active, this\n // handler is the authoritative one for all navigation keys.\n if (\n [\n KeyCode.up,\n KeyCode.down,\n KeyCode.left,\n KeyCode.right,\n KeyCode.enter,\n KeyCode.escape,\n KeyCode.pageUp,\n KeyCode.pageDown,\n KeyCode.home,\n KeyCode.end,\n ].includes(event.keyCode)\n ) {\n event.preventDefault();\n event.stopPropagation();\n }\n // We execute different actions depending on the current focus target (chart, group, or point).\n // It is expected, that the focused element is still available in the chart.\n if (this.focusedState && this.focusedState.type === \"group\") {\n this.onKeyDownGroup(event, this.focusedState.group);\n } else if (this.focusedState && this.focusedState.type === \"point\") {\n this.onKeyDownPoint(event, this.focusedState.point, this.focusedState.group);\n } else {\n this.onKeyDownChart(event);\n }\n };\n\n private onKeyDownChart = (event: KeyboardEvent) => {\n handleKey(event, {\n onActivate: () => this.moveToFirstGroup(),\n onEscape: () => this.handlers.onDismissHoverTooltip(),\n onInlineStart: () => this.moveToLastGroup(),\n onInlineEnd: () => this.moveToFirstGroup(),\n onBlockStart: () => this.moveToLastGroup(),\n onBlockEnd: () => this.moveToFirstGroup(),\n onHome: () => this.moveToFirstGroup(),\n onEnd: () => this.moveToLastGroup(),\n });\n };\n\n private onKeyDownGroup = (event: KeyboardEvent, group: readonly Highcharts.Point[]) => {\n const i = !!this.context.chart().inverted;\n handleKey(event, {\n onActivate: () => this.activateGroup(group),\n onEscape: () => {\n if (!this.handlers.onDismissHoverTooltip()) {\n this.moveToChart();\n }\n },\n onInlineStart: () => (i ? this.moveToFirstInGroup(group) : this.moveToPrevGroup(group)),\n onInlineEnd: () => (i ? this.moveToLastInGroup(group) : this.moveToNextGroup(group)),\n onBlockStart: () => (i ? this.moveToPrevGroup(group) : this.moveToLastInGroup(group)),\n onBlockEnd: () => (i ? this.moveToNextGroup(group) : this.moveToFirstInGroup(group)),\n onPageDown: () => this.moveToNextPageGroup(group),\n onPageUp: () => this.moveToPrevPageGroup(group),\n onHome: () => this.moveToFirstGroup(),\n onEnd: () => this.moveToLastGroup(),\n });\n };\n\n private onKeyDownPoint = (event: KeyboardEvent, point: Highcharts.Point, group: readonly Highcharts.Point[]) => {\n const i = !!this.context.chart().inverted;\n handleKey(event, {\n onActivate: () => this.activatePoint(point, group),\n onEscape: () => {\n if (!this.handlers.onDismissHoverTooltip()) {\n this.moveToParentGroup(point);\n }\n },\n onInlineEnd: () => (i ? this.moveToPrevInGroup(point) : this.moveToNextInSeries(point)),\n onInlineStart: () => (i ? this.moveToNextInGroup(point) : this.moveToPrevInSeries(point)),\n onBlockEnd: () => (i ? this.moveToNextInSeries(point) : this.moveToNextInGroup(point)),\n onBlockStart: () => (i ? this.moveToPrevInSeries(point) : this.moveToPrevInGroup(point)),\n onPageDown: () => this.moveToNextPageInSeries(point),\n onPageUp: () => this.moveToPrevPageInSeries(point),\n onHome: () => this.moveToFirstInSeries(point),\n onEnd: () => this.moveToLastInSeries(point),\n });\n };\n\n private moveToFirstGroup() {\n this.focusGroup(this.findFirstGroup());\n }\n\n private moveToLastGroup() {\n this.focusGroup(this.findLastGroup());\n }\n\n private moveToNextGroup(group: readonly Highcharts.Point[]) {\n const nextGroup = group[0] ? this.findNextGroup(group[0]) : [];\n this.focusGroup(nextGroup);\n }\n\n private moveToPrevGroup(group: readonly Highcharts.Point[]) {\n const prevGroup = group[0] ? this.findPrevGroup(group[0]) : [];\n this.focusGroup(prevGroup);\n }\n\n private moveToParentGroup(point: Highcharts.Point) {\n const group = this.findMatchingGroup(point);\n if (group.length > 0 && group[0].series.type !== \"pie\") {\n this.focusGroup(group);\n } else {\n this.focusChart();\n }\n }\n\n private moveToChart() {\n this.focusChart();\n }\n\n private moveToFirstInGroup(group: readonly Highcharts.Point[]) {\n const points = group.filter((p) => !isXThreshold(p.series));\n this.focusPoint(points[0], group);\n }\n\n private moveToLastInGroup(group: readonly Highcharts.Point[]) {\n const points = group.filter((p) => !isXThreshold(p.series));\n this.focusPoint(points[points.length - 1], group);\n }\n\n private moveToPrevInGroup(point: Highcharts.Point) {\n const points = this.findMatchingGroup(point).filter((p) => !isXThreshold(p.series));\n const pointIndex = points.indexOf(point);\n this.focusPoint(points[circleIndex(pointIndex - 1, [0, points.length - 1])], points);\n }\n\n private moveToNextInGroup(point: Highcharts.Point) {\n const points = this.findMatchingGroup(point).filter((p) => !isXThreshold(p.series));\n const pointIndex = points.indexOf(point);\n this.focusPoint(points[circleIndex(pointIndex + 1, [0, points.length - 1])], points);\n }\n\n private moveToFirstInSeries(point: Highcharts.Point) {\n const firstPoint = this.findFirstPointInSeries(point);\n if (firstPoint) {\n this.focusPoint(firstPoint, this.findMatchingGroup(firstPoint));\n } else {\n this.focusChart();\n }\n }\n\n private moveToLastInSeries(point: Highcharts.Point) {\n const lastPoint = this.findLastPointInSeries(point);\n if (lastPoint) {\n this.focusPoint(lastPoint, this.findMatchingGroup(lastPoint));\n } else {\n this.focusChart();\n }\n }\n\n private moveToNextInSeries(point: Highcharts.Point) {\n const nextPoint = this.findNextPointInSeries(point);\n if (nextPoint) {\n this.focusPoint(nextPoint, this.findMatchingGroup(nextPoint));\n } else {\n this.focusChart();\n }\n }\n\n private moveToPrevInSeries(point: Highcharts.Point) {\n const prevPoint = this.findPrevPointInSeries(point);\n if (prevPoint) {\n this.focusPoint(prevPoint, this.findMatchingGroup(prevPoint));\n } else {\n this.focusChart();\n }\n }\n\n private moveToNextPageGroup(group: readonly Highcharts.Point[]) {\n const nextPageGroup = group[0] ? this.findNextPageGroup(group[0]) : [];\n this.focusGroup(nextPageGroup);\n }\n\n private moveToPrevPageGroup(group: readonly Highcharts.Point[]) {\n const prevPageGroup = group[0] ? this.findPrevPageGroup(group[0]) : [];\n this.focusGroup(prevPageGroup);\n }\n\n private moveToNextPageInSeries(point: Highcharts.Point) {\n const nextPagePoint = this.findNextPagePointInSeries(point);\n if (nextPagePoint) {\n this.focusPoint(nextPagePoint, this.findMatchingGroup(nextPagePoint));\n } else {\n this.focusChart();\n }\n }\n\n private moveToPrevPageInSeries(point: Highcharts.Point) {\n const prevPagePoint = this.findPrevPagePointInSeries(point);\n if (prevPagePoint) {\n this.focusPoint(prevPagePoint, this.findMatchingGroup(prevPagePoint));\n } else {\n this.focusChart();\n }\n }\n\n private activateGroup(group: readonly Highcharts.Point[]) {\n this.handlers.onActivateGroup(group);\n }\n\n private activatePoint(point: Highcharts.Point, group: readonly Highcharts.Point[]) {\n this.handlers.onActivatePoint(point, group);\n }\n\n private focusChart = () => {\n this.focusedState = { type: \"chart\" };\n this.focusOutline.chart();\n this.handlers.onFocusChart();\n };\n\n private focusGroup(group: readonly Highcharts.Point[]) {\n // When the chart is re-focused, the group that was focused before might no longer be valid if its\n // points are no longer visible or were destroyed by Highcharts. In that case we focus the chart as\n // a fallback.\n const visiblePoints = group.filter(isPointVisible);\n if (visiblePoints.length === 0) {\n this.focusChart();\n }\n // In pie charts we only focus points, so moving focus to points and groups is equivalent.\n else if (visiblePoints[0].series.type === \"pie\") {\n this.focusPoint(visiblePoints[0] ?? null, group);\n }\n // When focusing a group we draw the focus outline around the corresponding group rect, including\n // all points of that group.\n else {\n this.focusedState = { type: \"group\", group: visiblePoints };\n this.focusOutline.group(getGroupRect(visiblePoints));\n this.handlers.onFocusGroup(visiblePoints);\n }\n }\n\n private focusPoint(point: null | Highcharts.Point, group: readonly Highcharts.Point[]) {\n // When the chart is re-focused, the point that was focused before might no longer be valid it became\n // hidden or was destroyed by Highcharts. In that case we focus the point's parent group as a fallback.\n if (!point || !isPointVisible(point)) {\n this.focusGroup(group);\n }\n // When focusing a point we draw the focus outline around its corresponding rect, but with different offsets,\n // depending on the point's series type.\n else {\n this.focusedState = { type: \"point\", point, group };\n this.focusOutline.point(getPointRect(point), point);\n this.handlers.onFocusPoint(point, group);\n }\n }\n\n private get allX(): number[] {\n return this.context.derived.allX;\n }\n\n // Returns all series data points to navigate by. When a series is linked with other series - the method returns\n // all points from the linked series.\n private getSeriesPoints(series: SafeSeries): Highcharts.Point[] {\n return this.context.derived.getSeriesPoints(series);\n }\n\n private getPointsByX = (x: number): Highcharts.Point[] => {\n return this.context.derived.getPointsByX(x);\n };\n\n private findMatchingGroup = (point: Highcharts.Point): Highcharts.Point[] => {\n return this.getPointsByX(point.x);\n };\n\n private findFirstGroup = (): Highcharts.Point[] => {\n return this.getPointsByX(this.allX[0]);\n };\n\n private findLastGroup = (): Highcharts.Point[] => {\n return this.getPointsByX(this.allX[this.allX.length - 1]);\n };\n\n private findNextGroup = (point: Highcharts.Point): Highcharts.Point[] => {\n const nextIndex = getNextIndex(this.allX, this.allX.indexOf(point.x), 1);\n return this.getPointsByX(this.allX[nextIndex]);\n };\n\n private findPrevGroup = (point: Highcharts.Point): Highcharts.Point[] => {\n const nextIndex = getNextIndex(this.allX, this.allX.indexOf(point.x), -1);\n return this.getPointsByX(this.allX[nextIndex]);\n };\n\n private findNextPageGroup = (point: Highcharts.Point): Highcharts.Point[] => {\n const nextIndex = getNextPageIndex(this.allX, this.allX.indexOf(point.x), 1);\n return this.getPointsByX(this.allX[nextIndex]);\n };\n\n private findPrevPageGroup = (point: Highcharts.Point): Highcharts.Point[] => {\n const nextIndex = getNextPageIndex(this.allX, this.allX.indexOf(point.x), -1);\n return this.getPointsByX(this.allX[nextIndex]);\n };\n\n private findFirstPointInSeries = (point: Highcharts.Point): null | Highcharts.Point => {\n const seriesPoints = this.getSeriesPoints(point.series);\n return seriesPoints[0] ?? null;\n };\n\n private findLastPointInSeries = (point: Highcharts.Point): null | Highcharts.Point => {\n const seriesPoints = this.getSeriesPoints(point.series);\n return seriesPoints[seriesPoints.length - 1] ?? null;\n };\n\n private findNextPointInSeries = (point: Highcharts.Point): null | Highcharts.Point => {\n const seriesPoints = this.getSeriesPoints(point.series);\n const delta = !shouldInvertPointsDirection(point) ? 1 : -1;\n const pointIndex = seriesPoints.indexOf(point);\n const nextIndex = getNextIndex(seriesPoints, pointIndex, delta);\n return seriesPoints[nextIndex] ?? null;\n };\n\n private findPrevPointInSeries = (point: Highcharts.Point): null | Highcharts.Point => {\n const seriesPoints = this.getSeriesPoints(point.series);\n const delta = !shouldInvertPointsDirection(point) ? -1 : 1;\n const pointIndex = seriesPoints.indexOf(point);\n const nextIndex = getNextIndex(seriesPoints, pointIndex, delta);\n return seriesPoints[nextIndex] ?? null;\n };\n\n private findNextPagePointInSeries = (point: Highcharts.Point): null | Highcharts.Point => {\n const seriesPoints = this.getSeriesPoints(point.series);\n const delta = !shouldInvertPointsDirection(point) ? 1 : -1;\n const pointIndex = seriesPoints.indexOf(point);\n const nextIndex = getNextPageIndex(seriesPoints, pointIndex, delta);\n return seriesPoints[nextIndex] ?? null;\n };\n\n private findPrevPagePointInSeries = (point: Highcharts.Point): null | Highcharts.Point => {\n const seriesPoints = this.getSeriesPoints(point.series);\n const delta = !shouldInvertPointsDirection(point) ? -1 : 1;\n const pointIndex = seriesPoints.indexOf(point);\n const nextIndex = getNextPageIndex(seriesPoints, pointIndex, delta);\n return seriesPoints[nextIndex] ?? null;\n };\n}\n\nfunction handleKey(\n event: KeyboardEvent,\n handlers: {\n onActivate?: () => void;\n onBlockEnd?: () => void;\n onBlockStart?: () => void;\n onDefault?: () => void;\n onEnd?: () => void;\n onEscape?: () => void;\n onHome?: () => void;\n onInlineEnd?: () => void;\n onInlineStart?: () => void;\n onPageDown?: () => void;\n onPageUp?: () => void;\n },\n) {\n if (!event.currentTarget) {\n return;\n }\n if (!(event.currentTarget instanceof HTMLElement) && !(event.currentTarget instanceof SVGElement)) {\n return;\n }\n toolkitHandleKey({ keyCode: event.keyCode, currentTarget: event.currentTarget }, handlers);\n}\n\n// A helper class to draw the focus outline around given chart elements.\nclass FocusOutline {\n private context: ChartExtraContext;\n private elementsPool = new SVGRendererPool();\n\n constructor(context: ChartExtraContext) {\n this.context = context;\n }\n\n public chart = () => {\n const [x, y, width, height] = [\n this.context.chart().plotLeft,\n this.context.chart().plotTop,\n this.context.chart().plotWidth,\n this.context.chart().plotHeight,\n ];\n this.rect({ x, y, width, height }, Styles.focusOutlineOffsets.chart);\n };\n\n public group = (rect: Rect) => {\n this.rect(rect, Styles.focusOutlineOffsets.group);\n };\n\n public point = (rect: Rect, point: Highcharts.Point) => {\n const offsetByType = Styles.focusOutlineOffsets.pointByType[point.series.type];\n const offset = offsetByType ?? Styles.focusOutlineOffsets.point;\n this.rect(rect, offset);\n };\n\n public hide() {\n this.elementsPool.hideAll();\n }\n\n public destroy() {\n this.elementsPool.destroyAll();\n }\n\n private rect = ({ x, y, width, height }: Rect, offset: number) => {\n this.elementsPool.hideAll();\n this.elementsPool.rect(this.context.chart().renderer, {\n x: x - offset,\n y: y - offset,\n width: width + offset * 2,\n height: height + offset * 2,\n ...Styles.navigationFocusOutline,\n });\n };\n}\n\n// We do not invert the direction of pie segments when RTL, but swap the left/right keys.\n// To offset for that, the prev/next points direction is swapped, too.\nfunction shouldInvertPointsDirection(point: Highcharts.Point) {\n const isRTL = getIsRtl(point.series.chart.container.parentElement);\n return point.series.type === \"pie\" && isRTL;\n}\n\nfunction getNextIndex(array: unknown[], pointIndex: number, delta: -1 | 1): number {\n return circleIndex(pointIndex + delta, [0, array.length - 1]);\n}\n\nfunction getNextPageIndex(array: unknown[], pointIndex: number, delta: -1 | 1): number {\n return Math.min(array.length - 1, Math.max(0, pointIndex + delta * Math.round(array.length * PAGE_SIZE_PERCENTAGE)));\n}\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
import AsyncStore from "../../internal/utils/async-store";
|
|
4
|
-
import { getChartSeries } from "../../internal/utils/
|
|
4
|
+
import { getChartSeries, getSeriesData } from "../../internal/utils/highcharts";
|
|
5
5
|
// Chart helper that implements custom nodata behaviors.
|
|
6
6
|
export class ChartExtraNodata extends AsyncStore {
|
|
7
7
|
constructor(context) {
|
|
@@ -33,13 +33,13 @@ export class ChartExtraNodata extends AsyncStore {
|
|
|
33
33
|
function findAllSeriesWithData(chart) {
|
|
34
34
|
// When a series becomes hidden, Highcharts no longer computes the data array, so the series.data is empty.
|
|
35
35
|
// That is why we assert the data from series.options instead.
|
|
36
|
-
return getChartSeries(chart
|
|
36
|
+
return getChartSeries(chart).filter((s) => {
|
|
37
37
|
const data = "data" in s.options && s.options.data && Array.isArray(s.options.data) ? s.options.data : [];
|
|
38
38
|
return data.some((i) => i !== null && (typeof i === "object" && "y" in i ? i.y !== null : true));
|
|
39
39
|
});
|
|
40
40
|
}
|
|
41
41
|
function findAllVisibleSeries(chart) {
|
|
42
42
|
const allSeriesWithData = findAllSeriesWithData(chart);
|
|
43
|
-
return allSeriesWithData.filter((s) => s.visible && (s.type !== "pie" || s.
|
|
43
|
+
return allSeriesWithData.filter((s) => s.visible && (s.type !== "pie" || getSeriesData(s).some((d) => d.y !== null && d.visible)));
|
|
44
44
|
}
|
|
45
45
|
//# sourceMappingURL=chart-extra-nodata.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chart-extra-nodata.js","sourceRoot":"","sources":["../../../../src/core/chart-api/chart-extra-nodata.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;
|
|
1
|
+
{"version":3,"file":"chart-extra-nodata.js","sourceRoot":"","sources":["../../../../src/core/chart-api/chart-extra-nodata.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,UAAU,MAAM,kCAAkC,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,aAAa,EAAa,MAAM,iCAAiC,CAAC;AAW3F,wDAAwD;AACxD,MAAM,OAAO,gBAAiB,SAAQ,UAA+B;IAGnE,YAAY,OAA0B;QACpC,KAAK,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,CAAC;QAIhD,kBAAa,GAAG,GAAG,EAAE;YAC1B,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,aAAa,EAAE,CAAC;gBACzC,OAAO;YACT,CAAC;YACD,MAAM,iBAAiB,GAAG,qBAAqB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YAC5D,MAAM,aAAa,GAAG,oBAAoB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YACvD,8GAA8G;YAC9G,IAAI,aAAa,CAAC,MAAM,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OAAO,CAAC,KAAK,QAAQ,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;IACnG,CAAC,CAAC,CAAC;AACL,CAAC;AAED,SAAS,oBAAoB,CAAC,KAAgB;IAC5C,MAAM,iBAAiB,GAAG,qBAAqB,CAAC,KAAK,CAAC,CAAC;IACvD,OAAO,iBAAiB,CAAC,MAAM,CAC7B,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,IAAI,CAAC,CAAC,CAAC,IAAI,KAAK,KAAK,IAAI,aAAa,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,IAAI,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,CAClG,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport AsyncStore from \"../../internal/utils/async-store\";\nimport { getChartSeries, getSeriesData, SafeChart } from \"../../internal/utils/highcharts\";\nimport { ChartExtraContext } from \"./chart-extra-context\";\n\n// The reactive state is used to propagate updates to the corresponding no-data React component.\n// It can be used by other components to assert if the chart is in no-data state (by checking if container is present).\nexport interface ReactiveNodataState {\n visible: boolean;\n style: React.CSSProperties;\n noMatch: boolean;\n}\n\n// Chart helper that implements custom nodata behaviors.\nexport class ChartExtraNodata extends AsyncStore<ReactiveNodataState> {\n private context: ChartExtraContext;\n\n constructor(context: ChartExtraContext) {\n super({ visible: false, style: {}, noMatch: false });\n this.context = context;\n }\n\n public onChartRender = () => {\n if (!this.context.settings.noDataEnabled) {\n return;\n }\n const allSeriesWithData = findAllSeriesWithData(this.chart);\n const visibleSeries = findAllVisibleSeries(this.chart);\n // The no-data is not shown when there is at least one series or point (for pie series) non-empty and visible.\n if (visibleSeries.length > 0) {\n this.set(() => ({ visible: false, style: {}, noMatch: false }));\n } else {\n this.set(() => ({ visible: true, style: this.getContainerStyle(), noMatch: allSeriesWithData.length > 0 }));\n }\n };\n\n private getContainerStyle(): React.CSSProperties {\n const blockOffset = this.chart.chartHeight - this.chart.plotHeight;\n return { insetBlockEnd: `${blockOffset}px` };\n }\n\n private get chart() {\n return this.context.chart();\n }\n}\n\nfunction findAllSeriesWithData(chart: SafeChart) {\n // When a series becomes hidden, Highcharts no longer computes the data array, so the series.data is empty.\n // That is why we assert the data from series.options instead.\n return getChartSeries(chart).filter((s) => {\n const data = \"data\" in s.options && s.options.data && Array.isArray(s.options.data) ? s.options.data : [];\n return data.some((i) => i !== null && (typeof i === \"object\" && \"y\" in i ? i.y !== null : true));\n });\n}\n\nfunction findAllVisibleSeries(chart: SafeChart) {\n const allSeriesWithData = findAllSeriesWithData(chart);\n return allSeriesWithData.filter(\n (s) => s.visible && (s.type !== \"pie\" || getSeriesData(s).some((d) => d.y !== null && d.visible)),\n );\n}\n"]}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type Highcharts from "highcharts";
|
|
2
|
+
import { SafeChart } from "../../internal/utils/highcharts";
|
|
2
3
|
import { ChartExtraContext } from "./chart-extra-context";
|
|
3
4
|
export interface ChartExtraPointerHandlers {
|
|
4
5
|
onPointHover(point: Highcharts.Point): void;
|
|
@@ -15,7 +16,7 @@ export declare class ChartExtraPointer {
|
|
|
15
16
|
private tooltipHovered;
|
|
16
17
|
private hoverLostCall;
|
|
17
18
|
constructor(context: ChartExtraContext, handlers: ChartExtraPointerHandlers);
|
|
18
|
-
onChartLoad: (chart:
|
|
19
|
+
onChartLoad: (chart: SafeChart) => void;
|
|
19
20
|
onChartDestroy: () => void;
|
|
20
21
|
onSeriesPointMouseOver: (point: Highcharts.Point) => void;
|
|
21
22
|
onSeriesPointMouseOut: () => void;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
-
import { getChartSeries } from "../../internal/utils/
|
|
4
|
-
import { isPointVisible } from "../../internal/utils/series-data";
|
|
3
|
+
import { getChartSeries, isPointVisible } from "../../internal/utils/highcharts";
|
|
5
4
|
import { DebouncedCall } from "../../internal/utils/utils";
|
|
6
5
|
const HOVER_LOST_DELAY = 25;
|
|
7
6
|
// Chart helper that implements pointer events (click and hover).
|
|
@@ -52,7 +51,7 @@ export class ChartExtraPointer {
|
|
|
52
51
|
this.onChartMousemove = (event) => {
|
|
53
52
|
const chart = this.context.chart();
|
|
54
53
|
// In pie charts there is no support for groups - only a single point can be hovered at a time.
|
|
55
|
-
if (getChartSeries(chart
|
|
54
|
+
if (getChartSeries(chart).some((s) => s.type === "pie")) {
|
|
56
55
|
return;
|
|
57
56
|
}
|
|
58
57
|
// The plotX and plotY are pointer coordinates, normalized against the chart plot.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chart-extra-pointer.js","sourceRoot":"","sources":["../../../../src/core/chart-api/chart-extra-pointer.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAItC,OAAO,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AACnE,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAG3D,MAAM,gBAAgB,GAAG,EAAE,CAAC;AAU5B,iEAAiE;AACjE,MAAM,OAAO,iBAAiB;IAQ5B,YAAY,OAA0B,EAAE,QAAmC;QALnE,iBAAY,GAA4B,IAAI,CAAC;QAC7C,iBAAY,GAA8B,IAAI,CAAC;QAC/C,mBAAc,GAAG,KAAK,CAAC;QACvB,kBAAa,GAAG,IAAI,aAAa,EAAE,CAAC;QAOrC,gBAAW,GAAG,CAAC,KAAuB,EAAE,EAAE;YAC/C,KAAK,CAAC,SAAS,CAAC,gBAAgB,CAAC,WAAW,EAAE,IAA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AC,CAAC;gBAC5C,IAAI,CAAC,gBAAgB,EAAE,CAAC;YAC1B,CAAC;QACH,CAAC,CAAC;QAEF,8FAA8F;QAC9F,0FAA0F;QAC1F,yCAAyC;QACjC,eAAU,GAAG,GAAG,EAAE;YACxB,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,GAAG,EAAE;gBAC3B,IAAI,CAAC,IAAI,CAAC,YAAY,IAAI,CAAC,IAAI,CAAC,YAAY,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE,CAAC;oBACrE,IAAI,CAAC,QAAQ,CAAC,WAAW,EAAE,CAAC;oBAC5B,IAAI,CAAC,gBAAgB,EAAE,CAAC;gBAC1B,CAAC;YACH,CAAC,EAAE,gBAAgB,CAAC,CAAC;QACvB,CAAC,CAAC;QAEM,qBAAgB,GAAG,GAAG,EAAE;YAC9B,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC,SAAS,CAAC;YACjD,IAAI,SAAS,EAAE,CAAC;gBACd,MAAM,KAAK,GAAG,IAAI,CAAC,YAAY,IAAI,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC;gBAC7E,SAAS,CAAC,KAAK,CAAC,MAAM,GAAG,KAAK,CAAC;YACjC,CAAC;QACH,CAAC,CAAC;QAlKA,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC3B,CAAC;CAiKF","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type Highcharts from \"highcharts\";\n\nimport { getChartSeries } from \"../../internal/utils/chart-series\";\nimport { isPointVisible } from \"../../internal/utils/series-data\";\nimport { DebouncedCall } from \"../../internal/utils/utils\";\nimport { ChartExtraContext } from \"./chart-extra-context\";\n\nconst HOVER_LOST_DELAY = 25;\n\nexport interface ChartExtraPointerHandlers {\n onPointHover(point: Highcharts.Point): void;\n onGroupHover(group: Highcharts.Point[]): void;\n onHoverLost(): void;\n onPointClick(point: Highcharts.Point): void;\n onGroupClick(group: Highcharts.Point[]): void;\n}\n\n// Chart helper that implements pointer events (click and hover).\nexport class ChartExtraPointer {\n private context: ChartExtraContext;\n private handlers: ChartExtraPointerHandlers;\n private hoveredPoint: null | Highcharts.Point = null;\n private hoveredGroup: null | Highcharts.Point[] = null;\n private tooltipHovered = false;\n private hoverLostCall = new DebouncedCall();\n\n constructor(context: ChartExtraContext, handlers: ChartExtraPointerHandlers) {\n this.context = context;\n this.handlers = handlers;\n }\n\n public onChartLoad = (chart: Highcharts.Chart) => {\n chart.container.addEventListener(\"mousemove\", this.onChartMousemove);\n chart.container.addEventListener(\"mouseout\", this.onChartMouseout);\n };\n\n public onChartDestroy = () => {\n this.context.chartOrNull?.container?.removeEventListener(\"mousemove\", this.onChartMousemove);\n this.context.chartOrNull?.container?.removeEventListener(\"mouseout\", this.onChartMouseout);\n };\n\n // This event is triggered by Highcharts when the cursor is over a Highcharts point. We leave this to\n // Highcharts because it includes computation of complex shape intersections, such as pie chart segments.\n // When triggered, we set the given point as hovered, and it takes precedence over hovered groups.\n public onSeriesPointMouseOver = (point: Highcharts.Point) => {\n this.setHoveredPoint(point);\n };\n\n // When the pointer leaves a point, it does not necessarily mean the hover state needs to be cleared, as another\n // point or group can be hovered next. If it does not happen, the on-hover-lost handler is called after a short delay.\n public onSeriesPointMouseOut = () => {\n this.hoveredPoint = null;\n this.clearHover();\n };\n\n // We clear hover state when the pointer is moved outside the chart, unless it is moved inside the tooltip.\n // Wo do, hover, clear the point and group hover state so that if the pointer leaves chart from the tooltip,\n // the on-hover-lost handler is still called.\n public onMouseEnterTooltip = () => {\n this.tooltipHovered = true;\n this.hoveredPoint = null;\n this.hoveredGroup = null;\n };\n\n // When the pointer leaves the tooltip it can hover another point or group. If that does not happen,\n // the on-hover-lost handler is called after a short delay.\n public onMouseLeaveTooltip = () => {\n this.tooltipHovered = false;\n this.clearHover();\n };\n\n // The mouse-move handler takes all move events inside the chart, and its purpose is to capture hover for groups\n // of points (those having matching X value in cartesian charts), as this is not directly supported by Highcharts.\n // Points hovering takes precedence over groups hovering.\n private onChartMousemove = (event: MouseEvent) => {\n const chart = this.context.chart();\n // In pie charts there is no support for groups - only a single point can be hovered at a time.\n if (getChartSeries(chart.series).some((s) => s.type === \"pie\")) {\n return;\n }\n // The plotX and plotY are pointer coordinates, normalized against the chart plot.\n const normalized = chart.pointer.normalize(event);\n const plotX = normalized.chartX;\n const plotY = normalized.chartY;\n const { plotLeft, plotTop, plotWidth, plotHeight } = chart;\n // We only check for matched groups if the plotX, plotY are within the plot area, where series are rendered.\n if (plotX >= plotLeft && plotX <= plotLeft + plotWidth && plotY >= plotTop && plotY <= plotTop + plotHeight) {\n // We match groups by comparing the plotX, plotY against each group rect. If the pointer is within one of\n // the rects - the group is considered matched. Otherwise, we take the group which is closest to the pointer.\n // This is done to avoid gaps, when the hover state switches between on and off in a sparsely populated chart,\n // causing the tooltip to show and hide as the pointer moves.\n let matchedGroup: Highcharts.Point[] = [];\n let minDistance = Number.POSITIVE_INFINITY;\n for (const { group, rect } of this.context.derived.groupRects) {\n const [target, start, end] = chart.inverted\n ? [plotY, rect.y, rect.y + rect.height]\n : [plotX, rect.x, rect.x + rect.width];\n const minTargetDistance = Math.min(Math.abs(start - target), Math.abs(end - target));\n if (start <= target && target < end) {\n matchedGroup = group;\n break;\n } else if (minTargetDistance < minDistance) {\n minDistance = minTargetDistance;\n matchedGroup = group;\n }\n }\n this.setHoveredGroup(matchedGroup);\n }\n // If the plotX, plotY are outside of the series area (e.g. if the pointer is above axis titles or ticks),\n // we clear the group hover state and trigger the on-hover-lost after a short delay.\n else {\n this.hoveredGroup = null;\n this.clearHover();\n }\n };\n\n // This event is triggered when the pointer leaves the chart area. Here, it is technically not necessary to add\n // a delay before calling the on-hover-lost handler, but it is done for consistency in the UX.\n private onChartMouseout = () => {\n this.hoveredGroup = null;\n this.clearHover();\n };\n\n // This event is triggered by Highcharts when there is a click inside the chart plot. It might or might not include\n // the point, hovered immediately before the click.\n public onChartClick = (point: null | Highcharts.Point) => {\n this.onClick(point);\n };\n\n // This event is triggered by Highcharts when a series point is clicked, it always has a point target.\n public onSeriesPointClick = (point: Highcharts.Point) => {\n this.onClick(point);\n };\n\n // We treat the chart and point clicks the same, but call different handlers depending on the target (null or point).\n // When the point is not present, we assume the click was done on a group, so we take the group that was hovered before\n // the click event triggered.\n // Before calling the on-point-click or on-group-click handlers, we verify if the target point or group are still valid\n // (visible, and not destroyed by Highcharts).\n private onClick = (point: null | Highcharts.Point) => {\n const targetPoint = point ?? (this.hoveredPoint && isPointVisible(this.hoveredPoint) ? this.hoveredPoint : null);\n if (targetPoint) {\n this.handlers.onPointClick(targetPoint);\n return;\n }\n const targetGroup = this.hoveredGroup?.filter(isPointVisible) ?? null;\n if (targetGroup && targetGroup.length > 0) {\n this.handlers.onGroupClick(targetGroup);\n return;\n }\n };\n\n private setHoveredPoint = (point: Highcharts.Point) => {\n if (isPointVisible(point)) {\n this.hoveredPoint = point;\n this.hoveredGroup = null;\n this.handlers.onPointHover(point);\n this.applyCursorStyle();\n }\n };\n\n private setHoveredGroup = (group: Highcharts.Point[]) => {\n if (!this.hoveredPoint || !isPointVisible(this.hoveredPoint)) {\n const availablePoints = group.filter(isPointVisible);\n this.hoveredPoint = null;\n this.hoveredGroup = availablePoints;\n this.handlers.onGroupHover(availablePoints);\n this.applyCursorStyle();\n }\n };\n\n // The function calls the on-hover-lost handler in a short delay to give time for the hover to\n // transition from one target to another. Before calling the handler we check if no target\n // (point, group, or tooltip) is hovered.\n private clearHover = () => {\n this.hoverLostCall.call(() => {\n if (!this.hoveredPoint && !this.hoveredGroup && !this.tooltipHovered) {\n this.handlers.onHoverLost();\n this.applyCursorStyle();\n }\n }, HOVER_LOST_DELAY);\n };\n\n private applyCursorStyle = () => {\n const container = this.context.chart().container;\n if (container) {\n const value = this.hoveredPoint || this.hoveredGroup ? \"pointer\" : \"default\";\n container.style.cursor = value;\n }\n };\n}\n"]}
|
|
1
|
+
{"version":3,"file":"chart-extra-pointer.js","sourceRoot":"","sources":["../../../../src/core/chart-api/chart-extra-pointer.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAItC,OAAO,EAAE,cAAc,EAAE,cAAc,EAAa,MAAM,iCAAiC,CAAC;AAC5F,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAG3D,MAAM,gBAAgB,GAAG,EAAE,CAAC;AAU5B,iEAAiE;AACjE,MAAM,OAAO,iBAAiB;IAQ5B,YAAY,OAA0B,EAAE,QAAmC;QALnE,iBAAY,GAA4B,IAAI,CAAC;QAC7C,iBAAY,GAA8B,IAAI,CAAC;QAC/C,mBAAc,GAAG,KAAK,CAAC;QACvB,kBAAa,GAAG,IAAI,aAAa,EAAE,CAAC;QAOrC,gBAAW,GAAG,CAAC,KAAgB,EAAE,EAAE;YACxC,KAAK,CAAC,SAAS,CAAC,gBAAgB,CAAC,WAAW,EAAE,IAAI,CAAC,gBAAgB,CAAC,CAAC;YACrE,KAAK,CAAC,SAAS,CAAC,gBAAgB,CAAC,UAAU,EAAE,IAAI,CAAC,eAAe,CAAC,CAAC;QACrE,CAAC,CAAC;QAEK,mBAAc,GAAG,GAAG,EAAE;;YAC3B,MAAA,MAAA,IAAI,CAAC,OAAO,CAAC,WAAW,0CAAE,SAAS,0CAAE,mBAAmB,CAAC,WAAW,EAAE,IAAI,CAAC,gBAAgB,CAAC,CAAC;YAC7F,MAAA,MAAA,IAAI,CAAC,OAAO,CAAC,WAAW,0CAAE,SAAS,0CAAE,mBAAmB,CAAC,UAAU,EAAE,IAAI,CAAC,eAAe,CAAC,CAAC;QAC7F,CAAC,CAAC;QAEF,qGAAqG;QACrG,yGAAyG;QACzG,kGAAkG;QAC3F,2BAAsB,GAAG,CAAC,KAAuB,EAAE,EAAE;YAC1D,IAAI,CAAC,eAAe,CAAC,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,CAAC,SAAS,CAAC;YACjD,IAAI,SAAS,EAAE,CAAC;gBACd,MAAM,KAAK,GAAG,IAAI,CAAC,YAAY,IAAI,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC;gBAC7E,SAAS,CAAC,KAAK,CAAC,MAAM,GAAG,KAAK,CAAC;YACjC,CAAC;QACH,CAAC,CAAC;QAlKA,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC3B,CAAC;CAiKF","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type Highcharts from \"highcharts\";\n\nimport { getChartSeries, isPointVisible, SafeChart } from \"../../internal/utils/highcharts\";\nimport { DebouncedCall } from \"../../internal/utils/utils\";\nimport { ChartExtraContext } from \"./chart-extra-context\";\n\nconst HOVER_LOST_DELAY = 25;\n\nexport interface ChartExtraPointerHandlers {\n onPointHover(point: Highcharts.Point): void;\n onGroupHover(group: Highcharts.Point[]): void;\n onHoverLost(): void;\n onPointClick(point: Highcharts.Point): void;\n onGroupClick(group: Highcharts.Point[]): void;\n}\n\n// Chart helper that implements pointer events (click and hover).\nexport class ChartExtraPointer {\n private context: ChartExtraContext;\n private handlers: ChartExtraPointerHandlers;\n private hoveredPoint: null | Highcharts.Point = null;\n private hoveredGroup: null | Highcharts.Point[] = null;\n private tooltipHovered = false;\n private hoverLostCall = new DebouncedCall();\n\n constructor(context: ChartExtraContext, handlers: ChartExtraPointerHandlers) {\n this.context = context;\n this.handlers = handlers;\n }\n\n public onChartLoad = (chart: SafeChart) => {\n chart.container.addEventListener(\"mousemove\", this.onChartMousemove);\n chart.container.addEventListener(\"mouseout\", this.onChartMouseout);\n };\n\n public onChartDestroy = () => {\n this.context.chartOrNull?.container?.removeEventListener(\"mousemove\", this.onChartMousemove);\n this.context.chartOrNull?.container?.removeEventListener(\"mouseout\", this.onChartMouseout);\n };\n\n // This event is triggered by Highcharts when the cursor is over a Highcharts point. We leave this to\n // Highcharts because it includes computation of complex shape intersections, such as pie chart segments.\n // When triggered, we set the given point as hovered, and it takes precedence over hovered groups.\n public onSeriesPointMouseOver = (point: Highcharts.Point) => {\n this.setHoveredPoint(point);\n };\n\n // When the pointer leaves a point, it does not necessarily mean the hover state needs to be cleared, as another\n // point or group can be hovered next. If it does not happen, the on-hover-lost handler is called after a short delay.\n public onSeriesPointMouseOut = () => {\n this.hoveredPoint = null;\n this.clearHover();\n };\n\n // We clear hover state when the pointer is moved outside the chart, unless it is moved inside the tooltip.\n // Wo do, hover, clear the point and group hover state so that if the pointer leaves chart from the tooltip,\n // the on-hover-lost handler is still called.\n public onMouseEnterTooltip = () => {\n this.tooltipHovered = true;\n this.hoveredPoint = null;\n this.hoveredGroup = null;\n };\n\n // When the pointer leaves the tooltip it can hover another point or group. If that does not happen,\n // the on-hover-lost handler is called after a short delay.\n public onMouseLeaveTooltip = () => {\n this.tooltipHovered = false;\n this.clearHover();\n };\n\n // The mouse-move handler takes all move events inside the chart, and its purpose is to capture hover for groups\n // of points (those having matching X value in cartesian charts), as this is not directly supported by Highcharts.\n // Points hovering takes precedence over groups hovering.\n private onChartMousemove = (event: MouseEvent) => {\n const chart = this.context.chart();\n // In pie charts there is no support for groups - only a single point can be hovered at a time.\n if (getChartSeries(chart).some((s) => s.type === \"pie\")) {\n return;\n }\n // The plotX and plotY are pointer coordinates, normalized against the chart plot.\n const normalized = chart.pointer.normalize(event);\n const plotX = normalized.chartX;\n const plotY = normalized.chartY;\n const { plotLeft, plotTop, plotWidth, plotHeight } = chart;\n // We only check for matched groups if the plotX, plotY are within the plot area, where series are rendered.\n if (plotX >= plotLeft && plotX <= plotLeft + plotWidth && plotY >= plotTop && plotY <= plotTop + plotHeight) {\n // We match groups by comparing the plotX, plotY against each group rect. If the pointer is within one of\n // the rects - the group is considered matched. Otherwise, we take the group which is closest to the pointer.\n // This is done to avoid gaps, when the hover state switches between on and off in a sparsely populated chart,\n // causing the tooltip to show and hide as the pointer moves.\n let matchedGroup: Highcharts.Point[] = [];\n let minDistance = Number.POSITIVE_INFINITY;\n for (const { group, rect } of this.context.derived.groupRects) {\n const [target, start, end] = chart.inverted\n ? [plotY, rect.y, rect.y + rect.height]\n : [plotX, rect.x, rect.x + rect.width];\n const minTargetDistance = Math.min(Math.abs(start - target), Math.abs(end - target));\n if (start <= target && target < end) {\n matchedGroup = group;\n break;\n } else if (minTargetDistance < minDistance) {\n minDistance = minTargetDistance;\n matchedGroup = group;\n }\n }\n this.setHoveredGroup(matchedGroup);\n }\n // If the plotX, plotY are outside of the series area (e.g. if the pointer is above axis titles or ticks),\n // we clear the group hover state and trigger the on-hover-lost after a short delay.\n else {\n this.hoveredGroup = null;\n this.clearHover();\n }\n };\n\n // This event is triggered when the pointer leaves the chart area. Here, it is technically not necessary to add\n // a delay before calling the on-hover-lost handler, but it is done for consistency in the UX.\n private onChartMouseout = () => {\n this.hoveredGroup = null;\n this.clearHover();\n };\n\n // This event is triggered by Highcharts when there is a click inside the chart plot. It might or might not include\n // the point, hovered immediately before the click.\n public onChartClick = (point: null | Highcharts.Point) => {\n this.onClick(point);\n };\n\n // This event is triggered by Highcharts when a series point is clicked, it always has a point target.\n public onSeriesPointClick = (point: Highcharts.Point) => {\n this.onClick(point);\n };\n\n // We treat the chart and point clicks the same, but call different handlers depending on the target (null or point).\n // When the point is not present, we assume the click was done on a group, so we take the group that was hovered before\n // the click event triggered.\n // Before calling the on-point-click or on-group-click handlers, we verify if the target point or group are still valid\n // (visible, and not destroyed by Highcharts).\n private onClick = (point: null | Highcharts.Point) => {\n const targetPoint = point ?? (this.hoveredPoint && isPointVisible(this.hoveredPoint) ? this.hoveredPoint : null);\n if (targetPoint) {\n this.handlers.onPointClick(targetPoint);\n return;\n }\n const targetGroup = this.hoveredGroup?.filter(isPointVisible) ?? null;\n if (targetGroup && targetGroup.length > 0) {\n this.handlers.onGroupClick(targetGroup);\n return;\n }\n };\n\n private setHoveredPoint = (point: Highcharts.Point) => {\n if (isPointVisible(point)) {\n this.hoveredPoint = point;\n this.hoveredGroup = null;\n this.handlers.onPointHover(point);\n this.applyCursorStyle();\n }\n };\n\n private setHoveredGroup = (group: Highcharts.Point[]) => {\n if (!this.hoveredPoint || !isPointVisible(this.hoveredPoint)) {\n const availablePoints = group.filter(isPointVisible);\n this.hoveredPoint = null;\n this.hoveredGroup = availablePoints;\n this.handlers.onGroupHover(availablePoints);\n this.applyCursorStyle();\n }\n };\n\n // The function calls the on-hover-lost handler in a short delay to give time for the hover to\n // transition from one target to another. Before calling the handler we check if no target\n // (point, group, or tooltip) is hovered.\n private clearHover = () => {\n this.hoverLostCall.call(() => {\n if (!this.hoveredPoint && !this.hoveredGroup && !this.tooltipHovered) {\n this.handlers.onHoverLost();\n this.applyCursorStyle();\n }\n }, HOVER_LOST_DELAY);\n };\n\n private applyCursorStyle = () => {\n const container = this.context.chart().container;\n if (container) {\n const value = this.hoveredPoint || this.hoveredGroup ? \"pointer\" : \"default\";\n container.style.cursor = value;\n }\n };\n}\n"]}
|
|
@@ -5,8 +5,8 @@ import { getIsRtl } from "@cloudscape-design/component-toolkit/internal";
|
|
|
5
5
|
import * as Styles from "../../internal/chart-styles";
|
|
6
6
|
import { renderMarker } from "../../internal/components/series-marker/render-marker";
|
|
7
7
|
import AsyncStore from "../../internal/utils/async-store";
|
|
8
|
+
import { getChartSeries, isPointVisible } from "../../internal/utils/highcharts";
|
|
8
9
|
import { SVGRendererPool, SVGRendererSingle } from "../../internal/utils/renderer-utils";
|
|
9
|
-
import { isPointVisible } from "../../internal/utils/series-data";
|
|
10
10
|
import { DebouncedCall, isEqualArrays } from "../../internal/utils/utils";
|
|
11
11
|
import { getGroupRect, getPointRect, getSeriesId, isXThreshold, safeRect } from "../utils";
|
|
12
12
|
import testClasses from "../test-classes/styles.css.js";
|
|
@@ -48,7 +48,7 @@ export class ChartExtraTooltip extends AsyncStore {
|
|
|
48
48
|
var _a, _b;
|
|
49
49
|
this.lastPoint = props.point;
|
|
50
50
|
this.lastGroup = props.group;
|
|
51
|
-
const chartType = (_b = (_a = this.context.chart().
|
|
51
|
+
const chartType = (_b = (_a = getChartSeries(this.context.chart()).find((s) => s.type === "pie" || s.type === "solidgauge")) === null || _a === void 0 ? void 0 : _a.type) !== null && _b !== void 0 ? _b : "cartesian";
|
|
52
52
|
if (chartType === "pie") {
|
|
53
53
|
return this.updateTooltipCursorPie(props.group[0]);
|
|
54
54
|
}
|
|
@@ -63,7 +63,7 @@ export class ChartExtraTooltip extends AsyncStore {
|
|
|
63
63
|
const pointRect = point ? getPointRect(point) : getGroupRect(group.slice(0, 1));
|
|
64
64
|
const groupRect = getGroupRect(group);
|
|
65
65
|
// The cursor is not shown when column series are present (a UX decision).
|
|
66
|
-
const hasColumnSeries = this.context.chart().
|
|
66
|
+
const hasColumnSeries = getChartSeries(this.context.chart()).some((s) => s.type === "column");
|
|
67
67
|
this.cursor.create(groupRect, point, group, !hasColumnSeries);
|
|
68
68
|
this.targetTrack.rect(this.context.chart().renderer, { ...pointRect, ...this.commonTrackAttrs });
|
|
69
69
|
this.groupTrack.rect(this.context.chart().renderer, { ...groupRect, ...this.commonTrackAttrs });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chart-extra-tooltip.js","sourceRoot":"","sources":["../../../../src/core/chart-api/chart-extra-tooltip.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,IAAI,MAAM,MAAM,CAAC;AAGxB,OAAO,EAAE,QAAQ,EAAE,MAAM,+CAA+C,CAAC;AAEzE,OAAO,KAAK,MAAM,MAAM,6BAA6B,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,uDAAuD,CAAC;AACrF,OAAO,UAAU,MAAM,kCAAkC,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AACzF,OAAO,EA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AO,GAAG,QAAQ,GAAG,CAAC,OAAO,SAAS,KAAK,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS,GAAG,GAAG,CAAC,GAAG,KAAK,CAAC,SAAS,CAAC,CAAC;IAC7G,MAAM,OAAO,GAAG,OAAO,GAAG,CAAC,OAAO,SAAS,KAAK,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS,GAAG,GAAG,CAAC,GAAG,KAAK,CAAC,UAAU,CAAC,CAAC;IAC7G,MAAM,MAAM,GACV,CAAC,OAAO,gBAAgB,KAAK,QAAQ,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,gBAAgB,GAAG,GAAG,CAAC,GAAG,KAAK,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;IAC7G,OAAO,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,GAAG,MAAM,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,GAAG,MAAM,EAAE,CAAC;AAC3E,CAAC;AAED,SAAS,4BAA4B,CAAC,KAAuB;IAC3D,MAAM,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC;IACjC,OAAO,QAAQ,CAAC;QACd,CAAC,EAAE,KAAK,CAAC,QAAQ,GAAG,KAAK,CAAC,SAAS,GAAG,CAAC;QACvC,CAAC,EAAE,KAAK,CAAC,OAAO,GAAG,KAAK,CAAC,UAAU,GAAG,CAAC;QACvC,KAAK,EAAE,CAAC;QACR,MAAM,EAAE,CAAC;KACV,CAAC,CAAC;AACL,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport clsx from \"clsx\";\nimport type Highcharts from \"highcharts\";\n\nimport { getIsRtl } from \"@cloudscape-design/component-toolkit/internal\";\n\nimport * as Styles from \"../../internal/chart-styles\";\nimport { renderMarker } from \"../../internal/components/series-marker/render-marker\";\nimport AsyncStore from \"../../internal/utils/async-store\";\nimport { SVGRendererPool, SVGRendererSingle } from \"../../internal/utils/renderer-utils\";\nimport { isPointVisible } from \"../../internal/utils/series-data\";\nimport { DebouncedCall, isEqualArrays } from \"../../internal/utils/utils\";\nimport { Rect } from \"../interfaces\";\nimport { getGroupRect, getPointRect, getSeriesId, isXThreshold, safeRect } from \"../utils\";\nimport { ChartExtraContext } from \"./chart-extra-context\";\n\nimport testClasses from \"../test-classes/styles.css.js\";\n\nconst TOOLTIP_LAST_DISMISS_DELAY = 250;\n\n// The reactive state is used to propagate updates to the chart tooltip React component. The tooltip\n// content is to be derived from the target point and group.\nexport interface ReactiveTooltipState {\n visible: boolean;\n pinned: boolean;\n point: null | Highcharts.Point;\n group: readonly Highcharts.Point[];\n}\n\n// Chart helper that implements tooltip placement logic and cursors.\nexport class ChartExtraTooltip extends AsyncStore<ReactiveTooltipState> {\n private context: ChartExtraContext;\n\n // The tooltip lock is used to prevent tooltip position changes shortly after it was dismissed, to\n // deny its immediate re-appearance in the spot under where the dismiss button was.\n public tooltipLock = false;\n private tooltipLockCall = new DebouncedCall();\n private setTooltipLock = () => {\n if (this.get().pinned) {\n this.tooltipLock = true;\n this.tooltipLockCall.call(() => (this.tooltipLock = false), TOOLTIP_LAST_DISMISS_DELAY);\n }\n };\n\n // The cursor is a vertical or horizontal (in inverted charts) line and hollow or filled markers,\n // shown in cartesian charts on top of the matched group or point.\n private cursor = new HighlightCursorCartesian();\n // The track elements are invisible rectangles, compted for the given target point or group.\n // The target track is used for the \"target\" tooltip placement. The group track is used for\n // the \"middle\" and \"outside\" tooltip placement.\n private targetTrack = new SVGRendererSingle();\n private groupTrack = new SVGRendererSingle();\n\n // Cached coordinates to update cursor's position on re-render.\n private lastPoint: null | Highcharts.Point = null;\n private lastGroup: null | readonly Highcharts.Point[] = null;\n\n constructor(context: ChartExtraContext) {\n super({ visible: false, pinned: false, point: null, group: [] });\n this.context = context;\n }\n\n // The targetElement.element can get invalidated by Highcharts, so we cannot use\n // trackRef.current = targetElement.element as it might get invalidated unexpectedly.\n // The getTrack function ensures the latest element reference is given on each request.\n public getTargetTrack = () => (this.targetTrack.element?.element ?? null) as null | SVGElement;\n public getGroupTrack = () => {\n return (this.groupTrack.element?.element ?? null) as null | SVGElement;\n };\n\n public onChartRender() {\n if (this.lastGroup && this.get().visible) {\n this.updateTooltipCursor({ point: this.lastPoint, group: this.lastGroup });\n }\n }\n\n public onChartDestroy() {\n this.cursor.destroy();\n this.targetTrack.destroy();\n this.groupTrack.destroy();\n }\n\n public showTooltipOnPoint(point: Highcharts.Point, matchingGroup: readonly Highcharts.Point[], ignoreLock = false) {\n if (!this.tooltipLock || ignoreLock) {\n this.updateTooltipCursor({ point, group: matchingGroup });\n this.set(() => ({ visible: true, pinned: false, point, group: matchingGroup }));\n }\n }\n\n public showTooltipOnGroup(group: readonly Highcharts.Point[], ignoreLock = false) {\n if (!this.tooltipLock || ignoreLock) {\n this.updateTooltipCursor({ point: null, group });\n this.setGroupIfDifferent(group);\n }\n }\n\n public hideTooltip() {\n this.cursor.hide();\n this.targetTrack.hide();\n this.groupTrack.hide();\n this.setTooltipLock();\n this.set((prev) => ({ ...prev, visible: false, pinned: false }));\n }\n\n public pinTooltip() {\n if (this.context.settings.tooltipEnabled) {\n this.set((prev) => ({ ...prev, visible: true, pinned: true }));\n }\n }\n\n // Avoid re-rendering the tooltip on every cursor position change when hovering over the graph.\n // Just re-render when the groups are different.\n private setGroupIfDifferent(group: readonly Highcharts.Point[]) {\n function isGroupEqual(a: Highcharts.Point, b: Highcharts.Point) {\n return a?.x === b?.x && a?.y === b?.y && getSeriesId(a?.series) === getSeriesId(b?.series);\n }\n this.set((prev) => {\n return prev.point === null && isEqualArrays(prev.group, group, isGroupEqual)\n ? prev\n : { visible: true, pinned: false, point: null, group };\n });\n }\n\n private updateTooltipCursor = (props: { point: null | Highcharts.Point; group: readonly Highcharts.Point[] }) => {\n this.lastPoint = props.point;\n this.lastGroup = props.group;\n\n const chartType =\n this.context.chart().series.find((s) => s.type === \"pie\" || s.type === \"solidgauge\")?.type ?? \"cartesian\";\n if (chartType === \"pie\") {\n return this.updateTooltipCursorPie(props.group[0]);\n } else if (chartType === \"solidgauge\") {\n return this.updateTooltipCursorGauge(props.group[0]);\n } else {\n return this.updateTooltipCursorCartesian(props);\n }\n };\n\n private updateTooltipCursorCartesian = ({\n point,\n group,\n }: {\n point: null | Highcharts.Point;\n group: readonly Highcharts.Point[];\n }) => {\n const pointRect = point ? getPointRect(point) : getGroupRect(group.slice(0, 1));\n const groupRect = getGroupRect(group);\n // The cursor is not shown when column series are present (a UX decision).\n const hasColumnSeries = this.context.chart().series.some((s) => s.type === \"column\");\n this.cursor.create(groupRect, point, group, !hasColumnSeries);\n this.targetTrack.rect(this.context.chart().renderer, { ...pointRect, ...this.commonTrackAttrs });\n this.groupTrack.rect(this.context.chart().renderer, { ...groupRect, ...this.commonTrackAttrs });\n };\n\n private updateTooltipCursorPie = (point: Highcharts.Point) => {\n // We only create target track for pie chart as pie chart does not support groups.\n // It is also expected that only \"target\" tooltip position is used for pie charts.\n const pointRect = getPieChartTargetPlacement(point);\n this.targetTrack.rect(this.context.chart().renderer, { ...pointRect, ...this.commonTrackAttrs });\n };\n\n private updateTooltipCursorGauge = (point: Highcharts.Point) => {\n // Solid gauge charts are similar to pie charts in that they have a circular shape\n // and don't support grouping. We use a similar approach to pie charts.\n const pointRect = getSolidGaugeTargetPlacement(point);\n this.targetTrack.rect(this.context.chart().renderer, { ...pointRect, ...this.commonTrackAttrs });\n };\n\n private get commonTrackAttrs() {\n return { fill: \"transparent\", zIndex: -1, \"pointer-events\": \"none\", direction: this.direction };\n }\n\n // We compute the direction from the chart container and then explicitly set it to the track\n // elements, as otherwise the direction check done for track elements always results to \"ltr\".\n private get direction() {\n const isRtl = getIsRtl(this.context.chart().container.parentElement);\n return isRtl ? \"rtl\" : \"ltr\";\n }\n}\n\n// A helper class to draw the cursor elements (include cursor line and matched points markers).\nclass HighlightCursorCartesian {\n private lineElement = new SVGRendererSingle();\n private markerElementsPool = new SVGRendererPool();\n\n public create(target: Rect, point: null | Highcharts.Point, group: readonly Highcharts.Point[], showLine: boolean) {\n this.hide();\n if (!group[0]?.series) {\n return;\n }\n\n const chart = group[0]?.series.chart;\n if (!chart) {\n return;\n }\n if (showLine) {\n // The cursor line is rendered orthogonally to the x axis (when the chart is inverted, the line is rendered horizontally).\n // The line is 1px thick, and is rendered through the center of the target's rect.\n const lineAttrs = chart.inverted\n ? {\n x: chart.plotLeft,\n y: chart.plotTop + target.y - target.height - 1,\n width: chart.plotWidth,\n height: 1,\n }\n : {\n x: target.x + target.width / 2,\n y: chart.plotTop,\n width: 1,\n height: chart.plotHeight,\n };\n this.lineElement.rect(chart.renderer, { ...Styles.cursorLine, ...lineAttrs });\n }\n for (const p of group.filter(this.isPointEligibleForMarker)) {\n if (p.plotX !== undefined && p.plotY !== undefined) {\n const selected = p === point;\n const className = clsx(testClasses[\"highlight-marker\"], selected && testClasses[\"highlight-marker-selected\"]);\n renderMarker({ chart, pool: this.markerElementsPool, point: p, selected, className });\n }\n }\n }\n\n public hide() {\n this.lineElement.hide();\n this.markerElementsPool.hideAll();\n }\n\n public destroy() {\n this.lineElement.destroy();\n this.markerElementsPool.destroyAll();\n }\n\n private isPointEligibleForMarker = (point: Highcharts.Point) => {\n return (\n isPointVisible(point) &&\n !isXThreshold(point.series) &&\n point.series.type !== \"column\" &&\n point.series.type !== \"errorbar\"\n );\n };\n}\n\nfunction getPieChartTargetPlacement(point: Highcharts.Point): Rect {\n // The pie series segments do not provide plotX, plotY to compute the tooltip placement.\n // Instead, there is a `tooltipPos` tuple, which is not covered by TS.\n // See: https://github.com/highcharts/highcharts/issues/23118.\n if (\"tooltipPos\" in point && Array.isArray(point.tooltipPos)) {\n return safeRect({ x: point.tooltipPos[0], y: point.tooltipPos[1], width: 0, height: 0 });\n }\n // We use the alternative, middle, tooltip placement as a fallback, in case the undocumented \"tooltipPos\"\n // is no longer available in the point.\n return getPieMiddlePlacement(point);\n}\n\nfunction getPieMiddlePlacement(point: Highcharts.Point): Rect {\n const chart = point.series.chart;\n const [relativeX, relativeY, relativeDiameter] = point.series.center;\n const plotLeft = chart.plotLeft;\n const plotTop = chart.plotTop;\n const centerX = plotLeft + (typeof relativeX === \"number\" ? relativeX : (relativeX / 100) * chart.plotWidth);\n const centerY = plotTop + (typeof relativeY === \"number\" ? relativeY : (relativeY / 100) * chart.plotHeight);\n const radius =\n (typeof relativeDiameter === \"number\" ? relativeDiameter : (relativeDiameter / 100) * chart.plotWidth) / 2;\n return { x: centerX, y: centerY - radius, width: 1, height: 2 * radius };\n}\n\nfunction getSolidGaugeTargetPlacement(point: Highcharts.Point): Rect {\n const chart = point.series.chart;\n return safeRect({\n x: chart.plotLeft + chart.plotWidth / 2,\n y: chart.plotTop + chart.plotHeight / 2,\n width: 0,\n height: 0,\n });\n}\n"]}
|
|
1
|
+
{"version":3,"file":"chart-extra-tooltip.js","sourceRoot":"","sources":["../../../../src/core/chart-api/chart-extra-tooltip.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,IAAI,MAAM,MAAM,CAAC;AAGxB,OAAO,EAAE,QAAQ,EAAE,MAAM,+CAA+C,CAAC;AAEzE,OAAO,KAAK,MAAM,MAAM,6BAA6B,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,uDAAuD,CAAC;AACrF,OAAO,UAAU,MAAM,kCAAkC,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjF,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AACzF,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAE1E,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,WAAW,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;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,OAAO,GAAG,CAAC,OAAO,SAAS,KAAK,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS,GAAG,GAAG,CAAC,GAAG,KAAK,CAAC,UAAU,CAAC,CAAC;IAC7G,MAAM,MAAM,GACV,CAAC,OAAO,gBAAgB,KAAK,QAAQ,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,gBAAgB,GAAG,GAAG,CAAC,GAAG,KAAK,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;IAC7G,OAAO,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,GAAG,MAAM,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,GAAG,MAAM,EAAE,CAAC;AAC3E,CAAC;AAED,SAAS,4BAA4B,CAAC,KAAuB;IAC3D,MAAM,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC;IACjC,OAAO,QAAQ,CAAC;QACd,CAAC,EAAE,KAAK,CAAC,QAAQ,GAAG,KAAK,CAAC,SAAS,GAAG,CAAC;QACvC,CAAC,EAAE,KAAK,CAAC,OAAO,GAAG,KAAK,CAAC,UAAU,GAAG,CAAC;QACvC,KAAK,EAAE,CAAC;QACR,MAAM,EAAE,CAAC;KACV,CAAC,CAAC;AACL,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport clsx from \"clsx\";\nimport type Highcharts from \"highcharts\";\n\nimport { getIsRtl } from \"@cloudscape-design/component-toolkit/internal\";\n\nimport * as Styles from \"../../internal/chart-styles\";\nimport { renderMarker } from \"../../internal/components/series-marker/render-marker\";\nimport AsyncStore from \"../../internal/utils/async-store\";\nimport { getChartSeries, isPointVisible } from \"../../internal/utils/highcharts\";\nimport { SVGRendererPool, SVGRendererSingle } from \"../../internal/utils/renderer-utils\";\nimport { DebouncedCall, isEqualArrays } from \"../../internal/utils/utils\";\nimport { Rect } from \"../interfaces\";\nimport { getGroupRect, getPointRect, getSeriesId, isXThreshold, safeRect } from \"../utils\";\nimport { ChartExtraContext } from \"./chart-extra-context\";\n\nimport testClasses from \"../test-classes/styles.css.js\";\n\nconst TOOLTIP_LAST_DISMISS_DELAY = 250;\n\n// The reactive state is used to propagate updates to the chart tooltip React component. The tooltip\n// content is to be derived from the target point and group.\nexport interface ReactiveTooltipState {\n visible: boolean;\n pinned: boolean;\n point: null | Highcharts.Point;\n group: readonly Highcharts.Point[];\n}\n\n// Chart helper that implements tooltip placement logic and cursors.\nexport class ChartExtraTooltip extends AsyncStore<ReactiveTooltipState> {\n private context: ChartExtraContext;\n\n // The tooltip lock is used to prevent tooltip position changes shortly after it was dismissed, to\n // deny its immediate re-appearance in the spot under where the dismiss button was.\n public tooltipLock = false;\n private tooltipLockCall = new DebouncedCall();\n private setTooltipLock = () => {\n if (this.get().pinned) {\n this.tooltipLock = true;\n this.tooltipLockCall.call(() => (this.tooltipLock = false), TOOLTIP_LAST_DISMISS_DELAY);\n }\n };\n\n // The cursor is a vertical or horizontal (in inverted charts) line and hollow or filled markers,\n // shown in cartesian charts on top of the matched group or point.\n private cursor = new HighlightCursorCartesian();\n // The track elements are invisible rectangles, compted for the given target point or group.\n // The target track is used for the \"target\" tooltip placement. The group track is used for\n // the \"middle\" and \"outside\" tooltip placement.\n private targetTrack = new SVGRendererSingle();\n private groupTrack = new SVGRendererSingle();\n\n // Cached coordinates to update cursor's position on re-render.\n private lastPoint: null | Highcharts.Point = null;\n private lastGroup: null | readonly Highcharts.Point[] = null;\n\n constructor(context: ChartExtraContext) {\n super({ visible: false, pinned: false, point: null, group: [] });\n this.context = context;\n }\n\n // The targetElement.element can get invalidated by Highcharts, so we cannot use\n // trackRef.current = targetElement.element as it might get invalidated unexpectedly.\n // The getTrack function ensures the latest element reference is given on each request.\n public getTargetTrack = () => (this.targetTrack.element?.element ?? null) as null | SVGElement;\n public getGroupTrack = () => {\n return (this.groupTrack.element?.element ?? null) as null | SVGElement;\n };\n\n public onChartRender() {\n if (this.lastGroup && this.get().visible) {\n this.updateTooltipCursor({ point: this.lastPoint, group: this.lastGroup });\n }\n }\n\n public onChartDestroy() {\n this.cursor.destroy();\n this.targetTrack.destroy();\n this.groupTrack.destroy();\n }\n\n public showTooltipOnPoint(point: Highcharts.Point, matchingGroup: readonly Highcharts.Point[], ignoreLock = false) {\n if (!this.tooltipLock || ignoreLock) {\n this.updateTooltipCursor({ point, group: matchingGroup });\n this.set(() => ({ visible: true, pinned: false, point, group: matchingGroup }));\n }\n }\n\n public showTooltipOnGroup(group: readonly Highcharts.Point[], ignoreLock = false) {\n if (!this.tooltipLock || ignoreLock) {\n this.updateTooltipCursor({ point: null, group });\n this.setGroupIfDifferent(group);\n }\n }\n\n public hideTooltip() {\n this.cursor.hide();\n this.targetTrack.hide();\n this.groupTrack.hide();\n this.setTooltipLock();\n this.set((prev) => ({ ...prev, visible: false, pinned: false }));\n }\n\n public pinTooltip() {\n if (this.context.settings.tooltipEnabled) {\n this.set((prev) => ({ ...prev, visible: true, pinned: true }));\n }\n }\n\n // Avoid re-rendering the tooltip on every cursor position change when hovering over the graph.\n // Just re-render when the groups are different.\n private setGroupIfDifferent(group: readonly Highcharts.Point[]) {\n function isGroupEqual(a: Highcharts.Point, b: Highcharts.Point) {\n return a?.x === b?.x && a?.y === b?.y && getSeriesId(a?.series) === getSeriesId(b?.series);\n }\n this.set((prev) => {\n return prev.point === null && isEqualArrays(prev.group, group, isGroupEqual)\n ? prev\n : { visible: true, pinned: false, point: null, group };\n });\n }\n\n private updateTooltipCursor = (props: { point: null | Highcharts.Point; group: readonly Highcharts.Point[] }) => {\n this.lastPoint = props.point;\n this.lastGroup = props.group;\n\n const chartType =\n getChartSeries(this.context.chart()).find((s) => s.type === \"pie\" || s.type === \"solidgauge\")?.type ??\n \"cartesian\";\n if (chartType === \"pie\") {\n return this.updateTooltipCursorPie(props.group[0]);\n } else if (chartType === \"solidgauge\") {\n return this.updateTooltipCursorGauge(props.group[0]);\n } else {\n return this.updateTooltipCursorCartesian(props);\n }\n };\n\n private updateTooltipCursorCartesian = ({\n point,\n group,\n }: {\n point: null | Highcharts.Point;\n group: readonly Highcharts.Point[];\n }) => {\n const pointRect = point ? getPointRect(point) : getGroupRect(group.slice(0, 1));\n const groupRect = getGroupRect(group);\n // The cursor is not shown when column series are present (a UX decision).\n const hasColumnSeries = getChartSeries(this.context.chart()).some((s) => s.type === \"column\");\n this.cursor.create(groupRect, point, group, !hasColumnSeries);\n this.targetTrack.rect(this.context.chart().renderer, { ...pointRect, ...this.commonTrackAttrs });\n this.groupTrack.rect(this.context.chart().renderer, { ...groupRect, ...this.commonTrackAttrs });\n };\n\n private updateTooltipCursorPie = (point: Highcharts.Point) => {\n // We only create target track for pie chart as pie chart does not support groups.\n // It is also expected that only \"target\" tooltip position is used for pie charts.\n const pointRect = getPieChartTargetPlacement(point);\n this.targetTrack.rect(this.context.chart().renderer, { ...pointRect, ...this.commonTrackAttrs });\n };\n\n private updateTooltipCursorGauge = (point: Highcharts.Point) => {\n // Solid gauge charts are similar to pie charts in that they have a circular shape\n // and don't support grouping. We use a similar approach to pie charts.\n const pointRect = getSolidGaugeTargetPlacement(point);\n this.targetTrack.rect(this.context.chart().renderer, { ...pointRect, ...this.commonTrackAttrs });\n };\n\n private get commonTrackAttrs() {\n return { fill: \"transparent\", zIndex: -1, \"pointer-events\": \"none\", direction: this.direction };\n }\n\n // We compute the direction from the chart container and then explicitly set it to the track\n // elements, as otherwise the direction check done for track elements always results to \"ltr\".\n private get direction() {\n const isRtl = getIsRtl(this.context.chart().container.parentElement);\n return isRtl ? \"rtl\" : \"ltr\";\n }\n}\n\n// A helper class to draw the cursor elements (include cursor line and matched points markers).\nclass HighlightCursorCartesian {\n private lineElement = new SVGRendererSingle();\n private markerElementsPool = new SVGRendererPool();\n\n public create(target: Rect, point: null | Highcharts.Point, group: readonly Highcharts.Point[], showLine: boolean) {\n this.hide();\n if (!group[0]?.series) {\n return;\n }\n\n const chart = group[0]?.series.chart;\n if (!chart) {\n return;\n }\n if (showLine) {\n // The cursor line is rendered orthogonally to the x axis (when the chart is inverted, the line is rendered horizontally).\n // The line is 1px thick, and is rendered through the center of the target's rect.\n const lineAttrs = chart.inverted\n ? {\n x: chart.plotLeft,\n y: chart.plotTop + target.y - target.height - 1,\n width: chart.plotWidth,\n height: 1,\n }\n : {\n x: target.x + target.width / 2,\n y: chart.plotTop,\n width: 1,\n height: chart.plotHeight,\n };\n this.lineElement.rect(chart.renderer, { ...Styles.cursorLine, ...lineAttrs });\n }\n for (const p of group.filter(this.isPointEligibleForMarker)) {\n if (p.plotX !== undefined && p.plotY !== undefined) {\n const selected = p === point;\n const className = clsx(testClasses[\"highlight-marker\"], selected && testClasses[\"highlight-marker-selected\"]);\n renderMarker({ chart, pool: this.markerElementsPool, point: p, selected, className });\n }\n }\n }\n\n public hide() {\n this.lineElement.hide();\n this.markerElementsPool.hideAll();\n }\n\n public destroy() {\n this.lineElement.destroy();\n this.markerElementsPool.destroyAll();\n }\n\n private isPointEligibleForMarker = (point: Highcharts.Point) => {\n return (\n isPointVisible(point) &&\n !isXThreshold(point.series) &&\n point.series.type !== \"column\" &&\n point.series.type !== \"errorbar\"\n );\n };\n}\n\nfunction getPieChartTargetPlacement(point: Highcharts.Point): Rect {\n // The pie series segments do not provide plotX, plotY to compute the tooltip placement.\n // Instead, there is a `tooltipPos` tuple, which is not covered by TS.\n // See: https://github.com/highcharts/highcharts/issues/23118.\n if (\"tooltipPos\" in point && Array.isArray(point.tooltipPos)) {\n return safeRect({ x: point.tooltipPos[0], y: point.tooltipPos[1], width: 0, height: 0 });\n }\n // We use the alternative, middle, tooltip placement as a fallback, in case the undocumented \"tooltipPos\"\n // is no longer available in the point.\n return getPieMiddlePlacement(point);\n}\n\nfunction getPieMiddlePlacement(point: Highcharts.Point): Rect {\n const chart = point.series.chart;\n const [relativeX, relativeY, relativeDiameter] = point.series.center;\n const plotLeft = chart.plotLeft;\n const plotTop = chart.plotTop;\n const centerX = plotLeft + (typeof relativeX === \"number\" ? relativeX : (relativeX / 100) * chart.plotWidth);\n const centerY = plotTop + (typeof relativeY === \"number\" ? relativeY : (relativeY / 100) * chart.plotHeight);\n const radius =\n (typeof relativeDiameter === \"number\" ? relativeDiameter : (relativeDiameter / 100) * chart.plotWidth) / 2;\n return { x: centerX, y: centerY - radius, width: 1, height: 2 * radius };\n}\n\nfunction getSolidGaugeTargetPlacement(point: Highcharts.Point): Rect {\n const chart = point.series.chart;\n return safeRect({\n x: chart.plotLeft + chart.plotWidth / 2,\n y: chart.plotTop + chart.plotHeight / 2,\n width: 0,\n height: 0,\n });\n}\n"]}
|
package/core/chart-api/index.js
CHANGED
|
@@ -2,8 +2,7 @@
|
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
import { useEffect, useRef } from "react";
|
|
4
4
|
import { fireNonCancelableEvent } from "../../internal/events";
|
|
5
|
-
import { getChartSeries } from "../../internal/utils/
|
|
6
|
-
import { getSeriesData } from "../../internal/utils/series-data";
|
|
5
|
+
import { getChartSeries, getSeriesData } from "../../internal/utils/highcharts";
|
|
7
6
|
import { getChartAccessibleDescription, getGroupAccessibleDescription, getPointAccessibleDescription, isXThreshold, } from "../utils";
|
|
8
7
|
import { ChartExtraAxisTitles } from "./chart-extra-axis-titles";
|
|
9
8
|
import { createChartContext, updateChartContext } from "./chart-extra-context";
|
|
@@ -332,8 +331,8 @@ export class ChartAPI {
|
|
|
332
331
|
showMarkersForIsolatedPoints() {
|
|
333
332
|
var _a, _b, _c, _d, _e;
|
|
334
333
|
let shouldRedraw = false;
|
|
335
|
-
for (const s of this.context.chart()
|
|
336
|
-
const seriesData = getSeriesData(s
|
|
334
|
+
for (const s of getChartSeries(this.context.chart())) {
|
|
335
|
+
const seriesData = getSeriesData(s);
|
|
337
336
|
for (let i = 0; i < seriesData.length; i++) {
|
|
338
337
|
const isEligibleSeries = !isXThreshold(s) && s.type !== "scatter" && !((_a = seriesData[i].options.marker) === null || _a === void 0 ? void 0 : _a.enabled);
|
|
339
338
|
if (isEligibleSeries &&
|
|
@@ -367,7 +366,7 @@ export class ChartAPI {
|
|
|
367
366
|
resetColorCounter() {
|
|
368
367
|
const chart = this.context.chart();
|
|
369
368
|
if ("colorCounter" in chart && typeof chart.colorCounter === "number") {
|
|
370
|
-
chart.colorCounter = getChartSeries(chart
|
|
369
|
+
chart.colorCounter = getChartSeries(chart).length;
|
|
371
370
|
}
|
|
372
371
|
}
|
|
373
372
|
highlightActions(target, { isApiCall, overrideTooltipLock }) {
|