@gravity-ui/chartkit
Advanced tools
Comparing version 2.2.2 to 2.3.0
@@ -7,2 +7,3 @@ import React from 'react'; | ||
import { CHARTKIT_SCROLLABLE_NODE_CLASSNAME } from '../../../constants'; | ||
import { getChartPerformanceDuration, getRandomCKId, markChartPerformance } from '../../../utils'; | ||
import { IndicatorItem } from './IndicatorItem'; | ||
@@ -15,8 +16,12 @@ import './IndicatorWidget.css'; | ||
function IndicatorWidgetInner(props, _ref) { | ||
const { onLoad, formatNumber, data: { data = [], defaultColor }, } = props; | ||
const { onLoad, formatNumber, data: { data = [], defaultColor }, id, onRender, } = props; | ||
const generatedId = React.useMemo(() => `${id}_${getRandomCKId()}`, [data, defaultColor, formatNumber, id]); | ||
markChartPerformance(generatedId); | ||
React.useLayoutEffect(() => { | ||
// TODO: swap to onRender after https://github.com/gravity-ui/chartkit/issues/33 | ||
onLoad === null || onLoad === void 0 ? void 0 : onLoad(); | ||
// TODO: add onRender with renderTime Issue #114 | ||
}); | ||
if (onRender) { | ||
onRender({ renderTime: getChartPerformanceDuration(generatedId) }); | ||
return; | ||
} | ||
onLoad === null || onLoad === void 0 ? void 0 : onLoad({ widgetRendering: getChartPerformanceDuration(generatedId) }); | ||
}, [onLoad, onRender, generatedId]); | ||
if (isEmpty(data)) { | ||
@@ -23,0 +28,0 @@ throw new ChartKitError({ |
# Changelog | ||
## [2.3.0](https://github.com/gravity-ui/chartkit/compare/v2.2.2...v2.3.0) (2023-04-11) | ||
### Features | ||
* **Indicator plugin:** add onRender ([#145](https://github.com/gravity-ui/chartkit/issues/145)) ([3a044c0](https://github.com/gravity-ui/chartkit/commit/3a044c08583cd96bd08e3fb29a89c06ca9a6be18)) | ||
* **Indicator plugin:** add renderTime ([3a044c0](https://github.com/gravity-ui/chartkit/commit/3a044c08583cd96bd08e3fb29a89c06ca9a6be18)) | ||
## [2.2.2](https://github.com/gravity-ui/chartkit/compare/v2.2.1...v2.2.2) (2023-03-28) | ||
@@ -4,0 +12,0 @@ |
{ | ||
"name": "@gravity-ui/chartkit", | ||
"version": "2.2.2", | ||
"version": "2.3.0", | ||
"description": "React component used to render charts based on any sources you need", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
920802
26170