@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.mjs CHANGED
@@ -4553,7 +4553,6 @@ var ReactChart = (props) => {
4553
4553
  const chartRef = useRef7(null);
4554
4554
  const chartInstance = useRef7(null);
4555
4555
  const resizeObserverRef = useRef7(null);
4556
- const [error, setError] = useState15(null);
4557
4556
  const [tableData, setTableData] = useState15(null);
4558
4557
  useEffect10(() => {
4559
4558
  if (!chartRef.current) {
@@ -4569,12 +4568,22 @@ var ReactChart = (props) => {
4569
4568
  input = children;
4570
4569
  }
4571
4570
  if (!input) {
4572
- setError("Chart data input is missing");
4571
+ if (chartInstance.current) {
4572
+ chartInstance.current.clear();
4573
+ }
4574
+ setTableData(null);
4573
4575
  return;
4574
4576
  }
4575
4577
  const { data: chartData, error: parseError } = parseAndValidateChartData(input);
4576
4578
  if (parseError || !chartData) {
4577
- setError(parseError || "Failed to parse chart data");
4579
+ console.warn(
4580
+ "ReactChart failed to parse chart data:",
4581
+ parseError || "Unknown parse error"
4582
+ );
4583
+ if (chartInstance.current) {
4584
+ chartInstance.current.clear();
4585
+ }
4586
+ setTableData(null);
4578
4587
  return;
4579
4588
  }
4580
4589
  if (chartData.table && Array.isArray(chartData.table)) {
@@ -4583,11 +4592,13 @@ var ReactChart = (props) => {
4583
4592
  if (chartData.echarts) {
4584
4593
  try {
4585
4594
  chartInstance.current.setOption(chartData.echarts, true);
4586
- setError(null);
4587
4595
  } catch (err) {
4588
4596
  const errorMessage = err instanceof Error ? err.message : "Failed to render chart";
4589
4597
  console.error("Failed to set ECharts option:", err);
4590
- setError(errorMessage);
4598
+ if (chartInstance.current) {
4599
+ chartInstance.current.clear();
4600
+ }
4601
+ setTableData(null);
4591
4602
  }
4592
4603
  }
4593
4604
  const handleResize = () => {
@@ -4643,9 +4654,6 @@ var ReactChart = (props) => {
4643
4654
  }
4644
4655
  return data;
4645
4656
  };
4646
- if (error) {
4647
- return null;
4648
- }
4649
4657
  return /* @__PURE__ */ jsxs6(Card5, { children: [
4650
4658
  /* @__PURE__ */ jsx14(
4651
4659
  "div",