@axiom-lattice/react-sdk 2.1.41 → 2.1.42
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/dist/index.js +16 -8
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +16 -8
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -4608,7 +4608,6 @@ var ReactChart = (props) => {
|
|
|
4608
4608
|
const chartRef = (0, import_react16.useRef)(null);
|
|
4609
4609
|
const chartInstance = (0, import_react16.useRef)(null);
|
|
4610
4610
|
const resizeObserverRef = (0, import_react16.useRef)(null);
|
|
4611
|
-
const [error, setError] = (0, import_react16.useState)(null);
|
|
4612
4611
|
const [tableData, setTableData] = (0, import_react16.useState)(null);
|
|
4613
4612
|
(0, import_react16.useEffect)(() => {
|
|
4614
4613
|
if (!chartRef.current) {
|
|
@@ -4624,12 +4623,22 @@ var ReactChart = (props) => {
|
|
|
4624
4623
|
input = children;
|
|
4625
4624
|
}
|
|
4626
4625
|
if (!input) {
|
|
4627
|
-
|
|
4626
|
+
if (chartInstance.current) {
|
|
4627
|
+
chartInstance.current.clear();
|
|
4628
|
+
}
|
|
4629
|
+
setTableData(null);
|
|
4628
4630
|
return;
|
|
4629
4631
|
}
|
|
4630
4632
|
const { data: chartData, error: parseError } = parseAndValidateChartData(input);
|
|
4631
4633
|
if (parseError || !chartData) {
|
|
4632
|
-
|
|
4634
|
+
console.warn(
|
|
4635
|
+
"ReactChart failed to parse chart data:",
|
|
4636
|
+
parseError || "Unknown parse error"
|
|
4637
|
+
);
|
|
4638
|
+
if (chartInstance.current) {
|
|
4639
|
+
chartInstance.current.clear();
|
|
4640
|
+
}
|
|
4641
|
+
setTableData(null);
|
|
4633
4642
|
return;
|
|
4634
4643
|
}
|
|
4635
4644
|
if (chartData.table && Array.isArray(chartData.table)) {
|
|
@@ -4638,11 +4647,13 @@ var ReactChart = (props) => {
|
|
|
4638
4647
|
if (chartData.echarts) {
|
|
4639
4648
|
try {
|
|
4640
4649
|
chartInstance.current.setOption(chartData.echarts, true);
|
|
4641
|
-
setError(null);
|
|
4642
4650
|
} catch (err) {
|
|
4643
4651
|
const errorMessage = err instanceof Error ? err.message : "Failed to render chart";
|
|
4644
4652
|
console.error("Failed to set ECharts option:", err);
|
|
4645
|
-
|
|
4653
|
+
if (chartInstance.current) {
|
|
4654
|
+
chartInstance.current.clear();
|
|
4655
|
+
}
|
|
4656
|
+
setTableData(null);
|
|
4646
4657
|
}
|
|
4647
4658
|
}
|
|
4648
4659
|
const handleResize = () => {
|
|
@@ -4698,9 +4709,6 @@ var ReactChart = (props) => {
|
|
|
4698
4709
|
}
|
|
4699
4710
|
return data;
|
|
4700
4711
|
};
|
|
4701
|
-
if (error) {
|
|
4702
|
-
return null;
|
|
4703
|
-
}
|
|
4704
4712
|
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_antd5.Card, { children: [
|
|
4705
4713
|
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
4706
4714
|
"div",
|