Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-icecream-charts

Package Overview
Dependencies
Maintainers
3
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-icecream-charts - npm Package Compare versions

Comparing version 0.10.2 to 0.10.3

.travis-diff.txt

3

esm/_chart/chart.js

@@ -56,3 +56,4 @@ import Highcharts from 'highcharts';

}
}
},
reflow: false
},

@@ -59,0 +60,0 @@ lang: createHighLangOptions(langData.langOptions),

@@ -5,2 +5,4 @@ import { useEffect, useImperativeHandle, useLayoutEffect, useRef } from 'react';

import memoize from 'lodash.memoize';
import { addListener, removeListener } from 'resize-detector';
import debounce from 'lodash.debounce';
import { useUnstableEvent } from './utils/hooks';

@@ -83,2 +85,17 @@ var loadHighstock = memoize(function (langOptions) { return import('highcharts/highstock').then(function (Highstock) {

useEffect(function () { return function () { var _a; return (_a = chartRef.current) === null || _a === void 0 ? void 0 : _a.destroy(); }; }, []);
useLayoutEffect(function () {
var renderDom = renderToRef.current;
var debouncedReflowChart = debounce(function () {
var _a;
(_a = chartRef.current) === null || _a === void 0 ? void 0 : _a.reflow();
}, 200);
if (renderDom) {
addListener(renderDom, debouncedReflowChart);
}
return function () {
if (renderDom) {
removeListener(renderDom, debouncedReflowChart);
}
};
}, []);
return [renderToRef, createChartRef];

@@ -85,0 +102,0 @@ }

@@ -72,3 +72,4 @@ "use strict";

}
}
},
reflow: false
},

@@ -75,0 +76,0 @@ lang: chart_1.createHighLangOptions(langData.langOptions),

@@ -30,2 +30,4 @@ "use strict";

var lodash_memoize_1 = __importDefault(require("lodash.memoize"));
var resize_detector_1 = require("resize-detector");
var lodash_debounce_1 = __importDefault(require("lodash.debounce"));
var hooks_1 = require("./utils/hooks");

@@ -108,2 +110,17 @@ var loadHighstock = lodash_memoize_1.default(function (langOptions) { return Promise.resolve().then(function () { return __importStar(require('highcharts/highstock')); }).then(function (Highstock) {

react_1.useEffect(function () { return function () { var _a; return (_a = chartRef.current) === null || _a === void 0 ? void 0 : _a.destroy(); }; }, []);
react_1.useLayoutEffect(function () {
var renderDom = renderToRef.current;
var debouncedReflowChart = lodash_debounce_1.default(function () {
var _a;
(_a = chartRef.current) === null || _a === void 0 ? void 0 : _a.reflow();
}, 200);
if (renderDom) {
resize_detector_1.addListener(renderDom, debouncedReflowChart);
}
return function () {
if (renderDom) {
resize_detector_1.removeListener(renderDom, debouncedReflowChart);
}
};
}, []);
return [renderToRef, createChartRef];

@@ -110,0 +127,0 @@ }

{
"name": "react-icecream-charts",
"version": "0.10.2",
"version": "0.10.3",
"license": "MIT",

@@ -40,4 +40,6 @@ "main": "esm/index.js",

"icecream-base": "^0.0.4",
"lodash.debounce": "^4.0.8",
"lodash.memoize": "~4.1.2",
"lodash.mergewith": "^4.6.2"
"lodash.mergewith": "^4.6.2",
"resize-detector": "^0.3.0"
},

@@ -52,2 +54,3 @@ "peerDependencies": {

"@types/jest": "^25.1.4",
"@types/lodash.debounce": "^4.0.7",
"@types/lodash.memoize": "^4.1.2",

@@ -54,0 +57,0 @@ "@types/lodash.mergewith": "^4.6.6",

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