Socket
Socket
Sign inDemoInstall

react-gauge-component

Package Overview
Dependencies
Maintainers
0
Versions
45
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-gauge-component - npm Package Compare versions

Comparing version 1.2.51 to 1.2.61

30

dist/lib/GaugeComponent/index.js

@@ -121,2 +121,3 @@ "use strict";

var _a;
setTimeout(function () { return window.dispatchEvent(new Event('resize')); }, 10);
if (!((_a = selectedRef.current) === null || _a === void 0 ? void 0 : _a.offsetParent))

@@ -136,2 +137,31 @@ return;

}, [props]);
// useEffect(() => {
// console.log(selectedRef.current?.offsetWidth)
// // workaround to trigger recomputing of gauge size on first load (e.g. F5)
// setTimeout(() => window.dispatchEvent(new Event('resize')), 10);
// }, [selectedRef.current?.parentNode]);
(0, react_1.useEffect)(function () {
var element = selectedRef.current;
if (!element)
return;
var handleResize = function () {
var parentNode = element.parentNode;
if (parentNode) {
chartHooks.renderChart(gauge, true);
// console.log("Parent node width:", width);
}
};
// Create a ResizeObserver to watch the parent node
var observer = new ResizeObserver(handleResize);
// Observe the parent node
if (element.parentNode) {
observer.observe(element.parentNode);
}
// Cleanup observer when component unmounts
return function () {
if (element.parentNode) {
observer.unobserve(element.parentNode);
}
};
}, []);
var id = props.id, style = props.style, className = props.className, type = props.type;

@@ -138,0 +168,0 @@ return (react_1.default.createElement("div", { id: id, className: "".concat(gauge.props.type, "-gauge").concat(className ? ' ' + className : ''), style: style, ref: function (svg) { return (selectedRef.current = svg); } }));

3

package.json
{
"name": "react-gauge-component",
"version": "1.2.51",
"version": "1.2.61",
"main": "dist/lib/index.js",

@@ -84,2 +84,3 @@ "module": "dist/lib/index.js",

"react-dom": "^17.0.1",
"react-grid-layout": "^1.4.4",
"react-scripts": "^5.0.1",

@@ -86,0 +87,0 @@ "rimraf": "^2.7.1",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc