@gravity-ui/chartkit 1.6.5 → 1.6.7

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/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.6.7](https://github.com/gravity-ui/chartkit/compare/v1.6.6...v1.6.7) (2023-02-21)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * fix check if chart exists before adjust font size ([#130](https://github.com/gravity-ui/chartkit/issues/130)) ([d81c6b2](https://github.com/gravity-ui/chartkit/commit/d81c6b2e4c64b04f7d62b684c46133ab9177a479))
9
+
10
+ ## [1.6.6](https://github.com/gravity-ui/chartkit/compare/v1.6.5...v1.6.6) (2023-02-21)
11
+
12
+
13
+ ### Bug Fixes
14
+
15
+ * add check if chart exists before adjust font size ([#128](https://github.com/gravity-ui/chartkit/issues/128)) ([451e3c1](https://github.com/gravity-ui/chartkit/commit/451e3c119858adffc02fede05eb9f91407b6e31c))
16
+
3
17
  ## [1.6.5](https://github.com/gravity-ui/chartkit/compare/v1.6.4...v1.6.5) (2023-02-10)
4
18
 
5
19
 
@@ -5,6 +5,7 @@ import merge from 'lodash/merge';
5
5
  import mergeWith from 'lodash/mergeWith';
6
6
  import get from 'lodash/get';
7
7
  import clamp from 'lodash/clamp';
8
+ import isEmpty from 'lodash/isEmpty';
8
9
  import isNumber from 'lodash/isNumber';
9
10
  import throttle from 'lodash/throttle';
10
11
  import pick from 'lodash/pick';
@@ -1078,7 +1079,7 @@ function fixTooltipOnClick(event, { options }) {
1078
1079
  fixTooltip(this.chart.tooltip, options, event);
1079
1080
  }
1080
1081
  function adjustDonutFontSize(chart, chartSeries, innerWidth, totals) {
1081
- if (!totals) {
1082
+ if (!totals || isEmpty(chart) || isEmpty(chartSeries)) {
1082
1083
  return;
1083
1084
  }
1084
1085
  const MIN_ACCEPTABLE_INNER_SIZE = 400;
@@ -27,10 +27,6 @@ export declare type ChartKitProps<T extends ChartKitType> = {
27
27
  data: ChartKitWidget[T]['data'];
28
28
  id?: string;
29
29
  isMobile?: boolean;
30
- /**
31
- * @depricated please use onRender & onChartLoad instead
32
- * @param data
33
- */
34
30
  onLoad?: (data?: ChartKitOnLoadData<T>) => void;
35
31
  /**
36
32
  * called on each render
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gravity-ui/chartkit",
3
- "version": "1.6.5",
3
+ "version": "1.6.7",
4
4
  "description": "React component used to render charts based on any sources you need",
5
5
  "license": "MIT",
6
6
  "repository": "git@github.com:gravity-ui/ChartKit.git",