Skip to content

Commit ed86641

Browse files
committed
fix: custom charts set event data attribute
1 parent 22cdecb commit ed86641

File tree

7 files changed

+51
-51
lines changed

7 files changed

+51
-51
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@
5353
"jest-environment-jsdom": "^29.7.0",
5454
"[email protected]": ">=1.0.2",
5555
"[email protected]": ">=1.0.2",
56-
"@codemirror/view": "^6.34.2",
56+
"@codemirror/view": "^6.38.1",
57+
"@codemirror/state": "^6.5.2",
5758
"enzyme>cheerio": "1.0.0-rc.10",
5859
"ts-node": "10.9.2",
5960
"react-big-calendar@1>clsx": "2.1.0"

packages/pluggableWidgets/custom-chart-web/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66

77
## [Unreleased]
88

9+
### Fixed
10+
11+
- We fixed an issue where event data attribute wouldn't successfully get its value set.
12+
913
## [1.1.1] - 2025-07-15
1014

1115
### Fixed

packages/pluggableWidgets/custom-chart-web/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"name": "@mendix/custom-chart-web",
33
"widgetName": "CustomChart",
4-
"version": "1.1.1",
5-
"description": "",
4+
"version": "1.1.2",
5+
"description": "Create customizable charts with Plotly.js for advanced visualization needs",
66
"copyright": "© Mendix Technology BV 2025. All rights reserved.",
77
"license": "Apache-2.0",
88
"repository": {

packages/pluggableWidgets/custom-chart-web/src/controllers/ChartPropsController.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,10 +125,9 @@ export class ChartPropsController implements ReactiveController {
125125
private get chartOnClick(): (data: any) => void {
126126
return (data: any): void => {
127127
if (this.props.eventDataAttribute) {
128-
this.props.eventDataAttribute?.setValue(JSON.stringify(data.points[0].bbox));
129-
} else {
130-
executeAction(this.props.onClick);
128+
this.props.eventDataAttribute.setValue(JSON.stringify(data.points[0].bbox));
131129
}
130+
executeAction(this.props.onClick);
132131
};
133132
}
134133

packages/pluggableWidgets/custom-chart-web/src/hooks/useCustomChart.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { EditorStoreState, initStateFromProps, PlaygroundData, useEditorStore }
22
import { GateProvider } from "@mendix/widget-plugin-mobx-kit/GateProvider";
33
import { useConst } from "@mendix/widget-plugin-mobx-kit/react/useConst";
44
import { useSetup } from "@mendix/widget-plugin-mobx-kit/react/useSetup";
5-
import { executeAction } from "@mendix/widget-plugin-platform/framework/execute-action";
65
import { CSSProperties, Ref, RefCallback, useEffect } from "react";
76
import { CustomChartControllerHost } from "src/controllers/CustomChartControllerHost";
87
import { mergeRefs } from "src/utils/mergeRefs";
@@ -45,13 +44,6 @@ export function useCustomChart(props: CustomChartContainerProps): UseCustomChart
4544
editorStateGateProvider.setProps(editorStore.state);
4645
});
4746

48-
useEffect(() => {
49-
if (props.eventDataAttribute?.value && props.onClick) {
50-
executeAction(props.onClick);
51-
props.eventDataAttribute.setValue("");
52-
}
53-
}, [props.eventDataAttribute?.value]);
54-
5547
const containerStyle: CSSProperties = {
5648
width: props.widthUnit === "percentage" ? `${props.width}%` : `${props.width}px`
5749
};

packages/pluggableWidgets/custom-chart-web/src/package.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8" ?>
22
<package xmlns="http://www.mendix.com/package/1.0/">
3-
<clientModule name="CustomChart" version="1.1.1" xmlns="http://www.mendix.com/clientModule/1.0/">
3+
<clientModule name="CustomChart" version="1.1.2" xmlns="http://www.mendix.com/clientModule/1.0/">
44
<widgetFiles>
55
<widgetFile path="CustomChart.xml" />
66
</widgetFiles>

pnpm-lock.yaml

Lines changed: 40 additions & 36 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)