@oliasoft-open-source/charts-library 8.0.2 → 8.0.3
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 +5 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -38445,6 +38445,7 @@ var Legend = ({ chartRef, legendConfig }) => {
|
|
|
38445
38445
|
const resizeRef = measureRef;
|
|
38446
38446
|
const panelRef = useRef(null);
|
|
38447
38447
|
const [legendPosition, setLegendPosition] = useState(legend?.position || Position.BottomLeft);
|
|
38448
|
+
const [prevLegendPositionProp, setPrevLegendPositionProp] = useState(legend?.position);
|
|
38448
38449
|
const panelRect = panelRef?.current ? panelRef.current.getBoundingClientRect() : null;
|
|
38449
38450
|
const panelSize = {
|
|
38450
38451
|
width: panelRect?.width,
|
|
@@ -38460,6 +38461,10 @@ var Legend = ({ chartRef, legendConfig }) => {
|
|
|
38460
38461
|
}, 20);
|
|
38461
38462
|
return () => clearTimeout(timeout);
|
|
38462
38463
|
}, [chart?.chartArea, measureRect]);
|
|
38464
|
+
if (legend?.position && legend.position !== prevLegendPositionProp) {
|
|
38465
|
+
setPrevLegendPositionProp(legend.position);
|
|
38466
|
+
setLegendPosition(legend.position);
|
|
38467
|
+
}
|
|
38463
38468
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
38464
38469
|
/* @__PURE__ */ jsx("div", {
|
|
38465
38470
|
ref: resizeRef,
|
package/package.json
CHANGED