Skip to content

Commit e79bd67

Browse files
committed
feat: new store for custom chart
1 parent 1843b44 commit e79bd67

17 files changed

Lines changed: 182 additions & 892 deletions

File tree

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
"@mendix/widget-plugin-platform": "workspace:*",
5151
"classnames": "^2.5.1",
5252
"deepmerge": "^4.3.1",
53+
"mobx-react-lite": "4.0.7",
5354
"plotly.js-dist-min": "^3.0.0"
5455
},
5556
"devDependencies": {
Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1-
import { constructWrapperStyle, getPlaygroundContext } from "@mendix/shared-charts/main";
21
import { Fragment, ReactElement } from "react";
2+
import { constructWrapperStyle, getPlaygroundContext } from "@mendix/shared-charts/main";
33
import { CustomChartContainerProps } from "../typings/CustomChartProps";
44
import { useCustomChart } from "./hooks/useCustomChart";
55
import "./ui/CustomChart.scss";
6+
import { observer } from "mobx-react-lite";
67

78
const PlaygroundContext = getPlaygroundContext();
89

9-
export default function CustomChart(props: CustomChartContainerProps): ReactElement {
10+
const Container = observer(function CustomChart(props: CustomChartContainerProps): ReactElement {
1011
const { playgroundData, ref } = useCustomChart(props);
1112
const wrapperStyle = constructWrapperStyle(props);
1213

@@ -16,4 +17,8 @@ export default function CustomChart(props: CustomChartContainerProps): ReactElem
1617
<div ref={ref} className="widget-custom-chart" style={wrapperStyle} tabIndex={props.tabIndex} />
1718
</Fragment>
1819
);
20+
});
21+
22+
export default function CustomChart(props: CustomChartContainerProps): ReactElement {
23+
return <Container {...props} />;
1924
}

packages/pluggableWidgets/custom-chart-web/src/__tests__/__snapshots__/mergeChartProps.spec.ts.snap

Lines changed: 0 additions & 71 deletions
This file was deleted.

0 commit comments

Comments
 (0)