diff --git a/packages/pluggableWidgets/area-chart-web/CHANGELOG.md b/packages/pluggableWidgets/area-chart-web/CHANGELOG.md index 31c64e4597..2708cb1e71 100644 --- a/packages/pluggableWidgets/area-chart-web/CHANGELOG.md +++ b/packages/pluggableWidgets/area-chart-web/CHANGELOG.md @@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), ## [Unreleased] +### Changed + +- We updated shared charts dependency. + ## [6.2.0] - 2025-06-03 ### Fixed diff --git a/packages/pluggableWidgets/area-chart-web/package.json b/packages/pluggableWidgets/area-chart-web/package.json index 517ec44928..2da7c572be 100644 --- a/packages/pluggableWidgets/area-chart-web/package.json +++ b/packages/pluggableWidgets/area-chart-web/package.json @@ -1,7 +1,7 @@ { "name": "@mendix/area-chart-web", "widgetName": "AreaChart", - "version": "6.2.0", + "version": "6.2.1", "description": "An area chart displays a solid color between the traces of a graph.", "copyright": "© Mendix Technology BV 2025. All rights reserved.", "license": "Apache-2.0", diff --git a/packages/pluggableWidgets/area-chart-web/src/package.xml b/packages/pluggableWidgets/area-chart-web/src/package.xml index 0929537270..93fd6aaca1 100644 --- a/packages/pluggableWidgets/area-chart-web/src/package.xml +++ b/packages/pluggableWidgets/area-chart-web/src/package.xml @@ -1,6 +1,6 @@ - + diff --git a/packages/pluggableWidgets/bar-chart-web/CHANGELOG.md b/packages/pluggableWidgets/bar-chart-web/CHANGELOG.md index 4c2e228426..c753fa338e 100644 --- a/packages/pluggableWidgets/bar-chart-web/CHANGELOG.md +++ b/packages/pluggableWidgets/bar-chart-web/CHANGELOG.md @@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), ## [Unreleased] +### Changed + +- We updated shared charts dependency. + ## [6.2.0] - 2025-06-03 ### Fixed diff --git a/packages/pluggableWidgets/bar-chart-web/package.json b/packages/pluggableWidgets/bar-chart-web/package.json index b4cf24e656..23145d7915 100644 --- a/packages/pluggableWidgets/bar-chart-web/package.json +++ b/packages/pluggableWidgets/bar-chart-web/package.json @@ -1,7 +1,7 @@ { "name": "@mendix/bar-chart-web", "widgetName": "BarChart", - "version": "6.2.0", + "version": "6.2.1", "description": "Shows difference between the data points for one or more categories.", "copyright": "© Mendix Technology BV 2025. All rights reserved.", "license": "Apache-2.0", diff --git a/packages/pluggableWidgets/bar-chart-web/src/package.xml b/packages/pluggableWidgets/bar-chart-web/src/package.xml index 687257e3a7..d37e483ff3 100644 --- a/packages/pluggableWidgets/bar-chart-web/src/package.xml +++ b/packages/pluggableWidgets/bar-chart-web/src/package.xml @@ -1,6 +1,6 @@ - + diff --git a/packages/pluggableWidgets/bubble-chart-web/CHANGELOG.md b/packages/pluggableWidgets/bubble-chart-web/CHANGELOG.md index e3b816fac4..609799b6b8 100644 --- a/packages/pluggableWidgets/bubble-chart-web/CHANGELOG.md +++ b/packages/pluggableWidgets/bubble-chart-web/CHANGELOG.md @@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), ## [Unreleased] +### Changed + +- We updated shared charts dependency. + ## [6.2.0] - 2025-06-03 ### Fixed diff --git a/packages/pluggableWidgets/bubble-chart-web/package.json b/packages/pluggableWidgets/bubble-chart-web/package.json index a618883c03..e51399304d 100644 --- a/packages/pluggableWidgets/bubble-chart-web/package.json +++ b/packages/pluggableWidgets/bubble-chart-web/package.json @@ -1,7 +1,7 @@ { "name": "@mendix/bubble-chart-web", "widgetName": "BubbleChart", - "version": "6.2.0", + "version": "6.2.1", "description": "Shows data in a bubble format graph.", "copyright": "© Mendix Technology BV 2025. All rights reserved.", "license": "Apache-2.0", diff --git a/packages/pluggableWidgets/bubble-chart-web/src/package.xml b/packages/pluggableWidgets/bubble-chart-web/src/package.xml index 118cdd6a80..b02123520b 100644 --- a/packages/pluggableWidgets/bubble-chart-web/src/package.xml +++ b/packages/pluggableWidgets/bubble-chart-web/src/package.xml @@ -1,6 +1,6 @@ - + diff --git a/packages/pluggableWidgets/chart-playground-web/CHANGELOG.md b/packages/pluggableWidgets/chart-playground-web/CHANGELOG.md index 2299c110d3..a3f1fc968d 100644 --- a/packages/pluggableWidgets/chart-playground-web/CHANGELOG.md +++ b/packages/pluggableWidgets/chart-playground-web/CHANGELOG.md @@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), ## [Unreleased] +### Changed + +- We updated shared charts dependency. + ## [2.0.0] - 2025-02-28 ### Changed diff --git a/packages/pluggableWidgets/chart-playground-web/package.json b/packages/pluggableWidgets/chart-playground-web/package.json index 9f04d9472d..7f8436f6ba 100644 --- a/packages/pluggableWidgets/chart-playground-web/package.json +++ b/packages/pluggableWidgets/chart-playground-web/package.json @@ -1,7 +1,7 @@ { "name": "@mendix/chart-playground-web", "widgetName": "ChartPlayground", - "version": "2.0.0", + "version": "2.1.1", "description": "A small playground widget for charts", "copyright": "© Mendix Technology BV 2025. All rights reserved.", "license": "Apache-2.0", diff --git a/packages/pluggableWidgets/chart-playground-web/src/package.xml b/packages/pluggableWidgets/chart-playground-web/src/package.xml index d4b762fbec..7d11b0ae66 100644 --- a/packages/pluggableWidgets/chart-playground-web/src/package.xml +++ b/packages/pluggableWidgets/chart-playground-web/src/package.xml @@ -1,6 +1,6 @@ - + diff --git a/packages/pluggableWidgets/charts-web/package.json b/packages/pluggableWidgets/charts-web/package.json index a94db9d421..d73a7292ea 100644 --- a/packages/pluggableWidgets/charts-web/package.json +++ b/packages/pluggableWidgets/charts-web/package.json @@ -1,6 +1,6 @@ { "name": "@mendix/charts-web", - "version": "6.2.0", + "version": "6.2.1", "description": "Chart widgets collection for data visualization", "copyright": "© Mendix Technology BV 2025. All rights reserved.", "license": "Apache-2.0", diff --git a/packages/pluggableWidgets/charts-web/src/package.xml b/packages/pluggableWidgets/charts-web/src/package.xml index 3291946680..815aa852f5 100644 --- a/packages/pluggableWidgets/charts-web/src/package.xml +++ b/packages/pluggableWidgets/charts-web/src/package.xml @@ -1,6 +1,6 @@ - + diff --git a/packages/pluggableWidgets/column-chart-web/CHANGELOG.md b/packages/pluggableWidgets/column-chart-web/CHANGELOG.md index 0376ce0467..adf8424b7e 100644 --- a/packages/pluggableWidgets/column-chart-web/CHANGELOG.md +++ b/packages/pluggableWidgets/column-chart-web/CHANGELOG.md @@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), ## [Unreleased] +### Changed + +- We updated shared charts dependency. + ## [6.2.0] - 2025-06-03 ### Fixed diff --git a/packages/pluggableWidgets/column-chart-web/package.json b/packages/pluggableWidgets/column-chart-web/package.json index c3326d7974..ee15c42d29 100644 --- a/packages/pluggableWidgets/column-chart-web/package.json +++ b/packages/pluggableWidgets/column-chart-web/package.json @@ -1,7 +1,7 @@ { "name": "@mendix/column-chart-web", "widgetName": "ColumnChart", - "version": "6.2.0", + "version": "6.2.1", "description": "Shows data in a column format graph.", "copyright": "© Mendix Technology BV 2025. All rights reserved.", "license": "Apache-2.0", diff --git a/packages/pluggableWidgets/column-chart-web/src/package.xml b/packages/pluggableWidgets/column-chart-web/src/package.xml index 543022649e..cc3198ef9b 100644 --- a/packages/pluggableWidgets/column-chart-web/src/package.xml +++ b/packages/pluggableWidgets/column-chart-web/src/package.xml @@ -1,6 +1,6 @@ - + diff --git a/packages/pluggableWidgets/custom-chart-web/CHANGELOG.md b/packages/pluggableWidgets/custom-chart-web/CHANGELOG.md index 0d53035801..5fb8400031 100644 --- a/packages/pluggableWidgets/custom-chart-web/CHANGELOG.md +++ b/packages/pluggableWidgets/custom-chart-web/CHANGELOG.md @@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), ## [Unreleased] +### Changed + +- We updated shared charts dependency. + ## [1.2.0] - 2025-06-03 ### Changed diff --git a/packages/pluggableWidgets/custom-chart-web/package.json b/packages/pluggableWidgets/custom-chart-web/package.json index b00df7f1e3..1bb3c89df8 100644 --- a/packages/pluggableWidgets/custom-chart-web/package.json +++ b/packages/pluggableWidgets/custom-chart-web/package.json @@ -1,7 +1,7 @@ { "name": "@mendix/custom-chart-web", "widgetName": "CustomChart", - "version": "1.2.0", + "version": "1.2.1", "description": "", "copyright": "© Mendix Technology BV 2025. All rights reserved.", "license": "Apache-2.0", diff --git a/packages/pluggableWidgets/custom-chart-web/src/package.xml b/packages/pluggableWidgets/custom-chart-web/src/package.xml index b63d811c08..be57f70d83 100644 --- a/packages/pluggableWidgets/custom-chart-web/src/package.xml +++ b/packages/pluggableWidgets/custom-chart-web/src/package.xml @@ -1,6 +1,6 @@ - + diff --git a/packages/pluggableWidgets/heatmap-chart-web/CHANGELOG.md b/packages/pluggableWidgets/heatmap-chart-web/CHANGELOG.md index a217374a92..6554ecac0b 100644 --- a/packages/pluggableWidgets/heatmap-chart-web/CHANGELOG.md +++ b/packages/pluggableWidgets/heatmap-chart-web/CHANGELOG.md @@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), ## [Unreleased] +### Fixed + +- We fixed on click events by correctly adding datasource and allow to listen to selection. + ## [6.0.0] - 2025-02-28 ### Changed diff --git a/packages/pluggableWidgets/heatmap-chart-web/package.json b/packages/pluggableWidgets/heatmap-chart-web/package.json index a80e4452ee..2e7426ce44 100644 --- a/packages/pluggableWidgets/heatmap-chart-web/package.json +++ b/packages/pluggableWidgets/heatmap-chart-web/package.json @@ -1,7 +1,7 @@ { "name": "@mendix/heatmap-chart-web", "widgetName": "HeatMap", - "version": "6.0.0", + "version": "6.2.1", "description": "Shows data in a heatmap format graph.", "copyright": "© Mendix Technology BV 2025. All rights reserved.", "license": "Apache-2.0", diff --git a/packages/pluggableWidgets/heatmap-chart-web/src/HeatMap.tsx b/packages/pluggableWidgets/heatmap-chart-web/src/HeatMap.tsx index 88c056632b..23064148c8 100644 --- a/packages/pluggableWidgets/heatmap-chart-web/src/HeatMap.tsx +++ b/packages/pluggableWidgets/heatmap-chart-web/src/HeatMap.tsx @@ -68,7 +68,8 @@ export function HeatMap(props: HeatMapContainerProps): ReactElement | null { tooltipHoverText: props.tooltipHoverText, verticalAxisAttribute: props.verticalAxisAttribute, verticalSortAttribute: props.verticalSortAttribute, - verticalSortOrder: props.verticalSortOrder + verticalSortOrder: props.verticalSortOrder, + seriesItemSelection: props.seriesItemSelection }); const heatmapChartLayout = useMemo(() => { diff --git a/packages/pluggableWidgets/heatmap-chart-web/src/HeatMap.xml b/packages/pluggableWidgets/heatmap-chart-web/src/HeatMap.xml index 4fb1191485..b62773b750 100644 --- a/packages/pluggableWidgets/heatmap-chart-web/src/HeatMap.xml +++ b/packages/pluggableWidgets/heatmap-chart-web/src/HeatMap.xml @@ -20,6 +20,14 @@ + + Selection type + + + + + + @@ -184,7 +192,7 @@ - + On click action diff --git a/packages/pluggableWidgets/heatmap-chart-web/src/hooks/data.ts b/packages/pluggableWidgets/heatmap-chart-web/src/hooks/data.ts index 2060fb04ee..bf80115200 100644 --- a/packages/pluggableWidgets/heatmap-chart-web/src/hooks/data.ts +++ b/packages/pluggableWidgets/heatmap-chart-web/src/hooks/data.ts @@ -1,10 +1,11 @@ -import { ValueStatus } from "mendix"; -import { useEffect, useMemo, useState } from "react"; +import { ValueStatus, ObjectItem } from "mendix"; +import { useCallback, useEffect, useMemo, useRef, useState } from "react"; import { ensure } from "@mendix/pluggable-widgets-tools"; import { HeatMapContainerProps } from "../../typings/HeatMapProps"; import { ChartWidgetProps, compareAttrValuesAsc } from "@mendix/shared-charts/main"; import { executeAction } from "@mendix/widget-plugin-platform/framework/execute-action"; import Big from "big.js"; +import { PlotDatum } from "plotly.js-dist-min"; type HeatMapDataSeriesHooks = Pick< HeatMapContainerProps, @@ -22,6 +23,7 @@ type HeatMapDataSeriesHooks = Pick< | "verticalAxisAttribute" | "verticalSortAttribute" | "verticalSortOrder" + | "seriesItemSelection" >; type AttributeValue = string | number | Date | undefined; @@ -33,6 +35,7 @@ type LocalHeatMapData = { verticalAxisValue: AttributeValue; horizontalSortValue: string | Big | Date | undefined; verticalSortValue: string | Big | Date | undefined; + id: string; }; function getUniqueValues(values: T[]): T[] { @@ -64,20 +67,28 @@ export const useHeatMapDataSeries = ({ tooltipHoverText, verticalAxisAttribute, verticalSortAttribute, - verticalSortOrder + verticalSortOrder, + seriesItemSelection }: HeatMapDataSeriesHooks): HeatMapHookData => { const [heatmapChartData, setHeatMapData] = useState([]); + const objectMap = useRef>(new Map()); useEffect(() => { if (seriesDataSource.status === ValueStatus.Available && seriesDataSource.items) { - const dataSourceItems = seriesDataSource.items.map(dataSourceItem => ({ - value: ensure(seriesValueAttribute).get(dataSourceItem).value?.toNumber(), - hoverText: tooltipHoverText?.get(dataSourceItem).value, - horizontalAxisValue: formatValueAttribute(horizontalAxisAttribute?.get(dataSourceItem).value), - horizontalSortValue: horizontalSortAttribute?.get(dataSourceItem).value, - verticalAxisValue: formatValueAttribute(verticalAxisAttribute?.get(dataSourceItem).value), - verticalSortValue: verticalSortAttribute?.get(dataSourceItem).value - })); + objectMap.current = new Map(); + const dataSourceItems = seriesDataSource.items.map(dataSourceItem => { + objectMap.current.set(dataSourceItem.id, dataSourceItem); + const item = { + value: ensure(seriesValueAttribute).get(dataSourceItem).value?.toNumber(), + hoverText: tooltipHoverText?.get(dataSourceItem).value, + horizontalAxisValue: formatValueAttribute(horizontalAxisAttribute?.get(dataSourceItem).value), + horizontalSortValue: horizontalSortAttribute?.get(dataSourceItem).value, + verticalAxisValue: formatValueAttribute(verticalAxisAttribute?.get(dataSourceItem).value), + verticalSortValue: verticalSortAttribute?.get(dataSourceItem).value, + id: dataSourceItem.id + }; + return item; + }); setHeatMapData(dataSourceItems); } }, [ @@ -90,7 +101,32 @@ export const useHeatMapDataSeries = ({ verticalSortAttribute ]); - const onClick = useMemo(() => (onClickAction ? () => executeAction(onClickAction) : undefined), [onClickAction]); + const onClick = useCallback( + (item: ObjectItem, data: PlotDatum) => { + let selectedObjectItem: ObjectItem | undefined = item; + if (selectedObjectItem === null || selectedObjectItem === undefined) { + const selectedLocalHeatmapData = heatmapChartData.values().find(heatMapPointData => { + return ( + heatMapPointData.horizontalAxisValue === data.x && + heatMapPointData.verticalAxisValue === data.y && + heatMapPointData.value === data.z + ); + }); + + if (selectedLocalHeatmapData) { + selectedObjectItem = objectMap.current.get(selectedLocalHeatmapData.id); + } + } + + if (selectedObjectItem) { + executeAction(onClickAction?.get(selectedObjectItem)); + if (seriesItemSelection && seriesItemSelection.type === "Single") { + seriesItemSelection.setSelection(selectedObjectItem); + } + } + }, + [onClickAction, heatmapChartData, seriesItemSelection] + ); return useMemo(() => { // `Array.reverse` mutates, so we make a copy. diff --git a/packages/pluggableWidgets/heatmap-chart-web/src/package.xml b/packages/pluggableWidgets/heatmap-chart-web/src/package.xml index 307cdfc052..7ce1510b96 100644 --- a/packages/pluggableWidgets/heatmap-chart-web/src/package.xml +++ b/packages/pluggableWidgets/heatmap-chart-web/src/package.xml @@ -1,6 +1,6 @@ - + diff --git a/packages/pluggableWidgets/heatmap-chart-web/typings/HeatMapProps.d.ts b/packages/pluggableWidgets/heatmap-chart-web/typings/HeatMapProps.d.ts index dc4c190529..626c385a3e 100644 --- a/packages/pluggableWidgets/heatmap-chart-web/typings/HeatMapProps.d.ts +++ b/packages/pluggableWidgets/heatmap-chart-web/typings/HeatMapProps.d.ts @@ -4,7 +4,7 @@ * @author Mendix Widgets Framework Team */ import { ComponentType, CSSProperties, ReactNode } from "react"; -import { ActionValue, DynamicValue, ListValue, ListAttributeValue, ListExpressionValue } from "mendix"; +import { DynamicValue, ListValue, ListActionValue, ListAttributeValue, ListExpressionValue, SelectionSingleValue } from "mendix"; import { Big } from "big.js"; export type HorizontalSortOrderEnum = "asc" | "desc"; @@ -34,6 +34,7 @@ export interface HeatMapContainerProps { tabIndex?: number; seriesDataSource: ListValue; seriesValueAttribute: ListAttributeValue; + seriesItemSelection?: SelectionSingleValue; horizontalAxisAttribute?: ListAttributeValue; horizontalSortAttribute?: ListAttributeValue; horizontalSortOrder: HorizontalSortOrderEnum; @@ -55,7 +56,7 @@ export interface HeatMapContainerProps { width: number; heightUnit: HeightUnitEnum; height: number; - onClickAction?: ActionValue; + onClickAction?: ListActionValue; tooltipHoverText?: ListExpressionValue; enableThemeConfig: boolean; customLayout: string; @@ -76,6 +77,7 @@ export interface HeatMapPreviewProps { translate: (text: string) => string; seriesDataSource: {} | { caption: string } | { type: string } | null; seriesValueAttribute: string; + seriesItemSelection: "None" | "Single"; horizontalAxisAttribute: string; horizontalSortAttribute: string; horizontalSortOrder: HorizontalSortOrderEnum; diff --git a/packages/pluggableWidgets/line-chart-web/CHANGELOG.md b/packages/pluggableWidgets/line-chart-web/CHANGELOG.md index 123d1241b3..c65f275c06 100644 --- a/packages/pluggableWidgets/line-chart-web/CHANGELOG.md +++ b/packages/pluggableWidgets/line-chart-web/CHANGELOG.md @@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), ## [Unreleased] +### Changed + +- We updated shared charts dependency. + ## [6.2.0] - 2025-06-03 ### Fixed diff --git a/packages/pluggableWidgets/line-chart-web/package.json b/packages/pluggableWidgets/line-chart-web/package.json index 671b174204..589a248070 100644 --- a/packages/pluggableWidgets/line-chart-web/package.json +++ b/packages/pluggableWidgets/line-chart-web/package.json @@ -1,7 +1,7 @@ { "name": "@mendix/line-chart-web", "widgetName": "LineChart", - "version": "6.2.0", + "version": "6.2.1", "description": "Shows data in a line format graph.", "copyright": "© Mendix Technology BV 2025. All rights reserved.", "license": "Apache-2.0", diff --git a/packages/pluggableWidgets/line-chart-web/src/package.xml b/packages/pluggableWidgets/line-chart-web/src/package.xml index 8b9f9e1c98..0cea8b3580 100644 --- a/packages/pluggableWidgets/line-chart-web/src/package.xml +++ b/packages/pluggableWidgets/line-chart-web/src/package.xml @@ -1,6 +1,6 @@ - + diff --git a/packages/pluggableWidgets/pie-doughnut-chart-web/CHANGELOG.md b/packages/pluggableWidgets/pie-doughnut-chart-web/CHANGELOG.md index e55eb02fd4..bf1cd622e3 100644 --- a/packages/pluggableWidgets/pie-doughnut-chart-web/CHANGELOG.md +++ b/packages/pluggableWidgets/pie-doughnut-chart-web/CHANGELOG.md @@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), ## [Unreleased] +### Changed + +- We updated shared charts dependency. + ## [6.2.0] - 2025-06-03 ### Changed diff --git a/packages/pluggableWidgets/pie-doughnut-chart-web/package.json b/packages/pluggableWidgets/pie-doughnut-chart-web/package.json index 9bf981c838..9fa2c4a801 100644 --- a/packages/pluggableWidgets/pie-doughnut-chart-web/package.json +++ b/packages/pluggableWidgets/pie-doughnut-chart-web/package.json @@ -1,7 +1,7 @@ { "name": "@mendix/pie-doughnut-chart-web", "widgetName": "PieChart", - "version": "6.2.0", + "version": "6.2.1", "description": "Shows data in a pie format graph.", "copyright": "© Mendix Technology BV 2025. All rights reserved.", "license": "Apache-2.0", diff --git a/packages/pluggableWidgets/pie-doughnut-chart-web/src/package.xml b/packages/pluggableWidgets/pie-doughnut-chart-web/src/package.xml index c19a1068a7..89a7cf7de5 100644 --- a/packages/pluggableWidgets/pie-doughnut-chart-web/src/package.xml +++ b/packages/pluggableWidgets/pie-doughnut-chart-web/src/package.xml @@ -1,6 +1,6 @@ - + diff --git a/packages/pluggableWidgets/time-series-chart-web/CHANGELOG.md b/packages/pluggableWidgets/time-series-chart-web/CHANGELOG.md index fa7a135ccb..40256e52eb 100644 --- a/packages/pluggableWidgets/time-series-chart-web/CHANGELOG.md +++ b/packages/pluggableWidgets/time-series-chart-web/CHANGELOG.md @@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), ## [Unreleased] +### Changed + +- We updated shared charts dependency. + ## [6.2.0] - 2025-06-03 ### Fixed diff --git a/packages/pluggableWidgets/time-series-chart-web/package.json b/packages/pluggableWidgets/time-series-chart-web/package.json index 898c69e303..8b21b895a2 100644 --- a/packages/pluggableWidgets/time-series-chart-web/package.json +++ b/packages/pluggableWidgets/time-series-chart-web/package.json @@ -1,7 +1,7 @@ { "name": "@mendix/time-series-chart-web", "widgetName": "TimeSeries", - "version": "6.2.0", + "version": "6.2.1", "description": "Shows data changes over period of time.", "copyright": "© Mendix Technology BV 2025. All rights reserved.", "license": "Apache-2.0", diff --git a/packages/pluggableWidgets/time-series-chart-web/src/package.xml b/packages/pluggableWidgets/time-series-chart-web/src/package.xml index ea4fcbe768..9212a937aa 100644 --- a/packages/pluggableWidgets/time-series-chart-web/src/package.xml +++ b/packages/pluggableWidgets/time-series-chart-web/src/package.xml @@ -1,6 +1,6 @@ - + diff --git a/packages/shared/charts/package.json b/packages/shared/charts/package.json index dad5f743df..d24ec41ac5 100644 --- a/packages/shared/charts/package.json +++ b/packages/shared/charts/package.json @@ -1,6 +1,6 @@ { "name": "@mendix/shared-charts", - "version": "2.2.0", + "version": "2.2.1", "description": "Shared components for charts", "copyright": "© Mendix Technology BV 2025. All rights reserved.", "private": true, diff --git a/packages/shared/charts/src/components/ChartView.tsx b/packages/shared/charts/src/components/ChartView.tsx index 232dbf743d..0bd1f5cc14 100644 --- a/packages/shared/charts/src/components/ChartView.tsx +++ b/packages/shared/charts/src/components/ChartView.tsx @@ -35,10 +35,16 @@ export const ChartView = ({ const [{ curveNumber, pointIndex, pointIndices, pointNumber, pointNumbers }] = event.points; const index = pointIndex ?? pointNumber; const indices = pointIndices ?? pointNumbers; - const itemIndex = getItemIndex(index, indices); - const { dataSourceItems, onClick } = data[curveNumber]; - const item = dataSourceItems[itemIndex]; - onClick?.(item); + try { + const itemIndex = getItemIndex(index, indices); + const { dataSourceItems, onClick } = data[curveNumber]; + const item = dataSourceItems[itemIndex]; + onClick?.(item); + } catch (_e: any) { + // let the chart handle it's own onClick + const { onClick } = data[curveNumber]; + onClick?.(null, event.points[0]); + } }, [data] ); diff --git a/packages/shared/charts/src/components/types.ts b/packages/shared/charts/src/components/types.ts index d101cd784f..cdeb918657 100644 --- a/packages/shared/charts/src/components/types.ts +++ b/packages/shared/charts/src/components/types.ts @@ -1,11 +1,13 @@ import { ObjectItem } from "mendix"; -import { Config, Data, Layout } from "plotly.js-dist-min"; +import { Config, Data, Layout, PlotDatum } from "plotly.js-dist-min"; declare module "plotly.js-dist-min" { interface PlotDatum { /** This array appears on only when aggregation is used */ pointIndices?: number[]; pointNumbers?: number[]; + // this is only appear on 3 dimentional matrix datasource + z?: number; } } export type ExtraTraceProps = { @@ -14,7 +16,7 @@ export type ExtraTraceProps = { /** JSON string. Expected to be an object with custom 'trace' options. */ customSeriesOptions: string | undefined; /** Click handler for each point on current 'trace'. Should be call with ObjectItem associated with clicked point. */ - onClick?: (item: ObjectItem) => void; + onClick?: (item: ObjectItem | null, data?: Partial) => void; }; export type PlotTrace = Partial & ExtraTraceProps;