@axdspub/axiom-charts 0.0.23 → 0.0.25

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.
@@ -1792,6 +1792,19 @@ var AxiomCharts = (function (exports, axiomUiDataServices, d3Array, lodash, requ
1792
1792
  const [error, setError] = require$$0.useState(null);
1793
1793
  const [chartLibrary, setChartLibrary] = require$$0.useState(undefined);
1794
1794
  const [chart, setChart] = require$$0.useState(undefined);
1795
+ const initChart = () => {
1796
+ if (chartLibrary !== undefined && chartRef.current !== null) {
1797
+ let ChartClass;
1798
+ if (props.settings.layout === 'radial') {
1799
+ ChartClass = chartLibrary.RadialChart;
1800
+ }
1801
+ else {
1802
+ ChartClass = chartLibrary.Chart;
1803
+ }
1804
+ const newChart = new ChartClass(Object.assign(Object.assign({}, props), { element: chartRef.current }));
1805
+ setChart(newChart);
1806
+ }
1807
+ };
1795
1808
  require$$0.useEffect(() => {
1796
1809
  if (chartRef.current !== null && !loaded && !loading) {
1797
1810
  const library = 'axiom';
@@ -1807,19 +1820,8 @@ var AxiomCharts = (function (exports, axiomUiDataServices, d3Array, lodash, requ
1807
1820
  });
1808
1821
  }
1809
1822
  });
1810
- require$$0.useEffect(() => {
1811
- if (chartLibrary !== undefined && chartRef.current !== null) {
1812
- let ChartClass;
1813
- if (props.settings.layout === 'radial') {
1814
- ChartClass = chartLibrary.RadialChart;
1815
- }
1816
- else {
1817
- ChartClass = chartLibrary.Chart;
1818
- }
1819
- const newChart = new ChartClass(Object.assign(Object.assign({}, props), { element: chartRef.current }));
1820
- setChart(newChart);
1821
- }
1822
- }, [chartLibrary]);
1823
+ require$$0.useEffect(initChart, [chartLibrary]);
1824
+ require$$0.useEffect(initChart, [props.plots]);
1823
1825
  require$$0.useEffect(() => {
1824
1826
  if (chart !== undefined) {
1825
1827
  chart.init(true)