@gravity-ui/chartkit 2.3.1 → 2.4.1

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
+ ## [2.4.1](https://github.com/gravity-ui/chartkit/compare/v2.4.0...v2.4.1) (2023-04-19)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * **Highcharts plugin:** Replace deprecated event.path ([#153](https://github.com/gravity-ui/chartkit/issues/153)) ([23be4a9](https://github.com/gravity-ui/chartkit/commit/23be4a96479820a69534098100140cd9a3fad45a))
9
+
10
+ ## [2.4.0](https://github.com/gravity-ui/chartkit/compare/v2.3.1...v2.4.0) (2023-04-13)
11
+
12
+
13
+ ### Features
14
+
15
+ * **Yagr:** update to v2.2.4 ([#150](https://github.com/gravity-ui/chartkit/issues/150)) ([7b7ab46](https://github.com/gravity-ui/chartkit/commit/7b7ab4632f6ece68dc05e1bec5949283e4307f88))
16
+
3
17
  ## [2.3.1](https://github.com/gravity-ui/chartkit/compare/v2.3.0...v2.3.1) (2023-04-12)
4
18
 
5
19
 
@@ -1 +1,3 @@
1
- export function addHolidays(chart: any, holidays: any): boolean;
1
+ import type { ChartKitHolidays } from '../../../../types';
2
+ import type { ExtendedHChart } from '../../types';
3
+ export declare function addHolidays(chart: ExtendedHChart, holidays: ChartKitHolidays): boolean;
@@ -17,7 +17,7 @@ const calculateConsistentClosestPointRange = (type, closestPointRange, series) =
17
17
  export function addHolidays(chart, holidays) {
18
18
  const { userOptions: { _config: { region: configRegion = 'TOT' } = {} }, xAxis: [xAxis], } = chart;
19
19
  const { dataMin, dataMax, closestPointRange, series } = xAxis;
20
- const isConsistentClosestPointRange = calculateConsistentClosestPointRange(xAxis.options.type, closestPointRange, series);
20
+ const isConsistentClosestPointRange = calculateConsistentClosestPointRange(xAxis.options.type || '', closestPointRange, series);
21
21
  let needRedraw = false;
22
22
  if (isConsistentClosestPointRange) {
23
23
  const region = configRegion.toLowerCase();
@@ -64,7 +64,7 @@ function getFormattedValueWithSuffixAndPrefix(item) {
64
64
  }
65
65
  function isZoomResetButtonClick(event, chartContainer) {
66
66
  let iterationIndex = 0;
67
- let element = event.path[iterationIndex];
67
+ let element = event.composedPath()[iterationIndex];
68
68
  while (element) {
69
69
  if (element === chartContainer) {
70
70
  return false;
@@ -72,7 +72,7 @@ function isZoomResetButtonClick(event, chartContainer) {
72
72
  else if (element.classList.contains('highcharts-reset-zoom')) {
73
73
  return true;
74
74
  }
75
- element = event.path[++iterationIndex];
75
+ element = event.composedPath()[++iterationIndex];
76
76
  }
77
77
  return false;
78
78
  }
@@ -38,6 +38,7 @@ declare module 'highcharts' {
38
38
 
39
39
  // for Stock chart from https://github.com/highcharts/highcharts/blob/master/ts/Stock/Navigator/NavigatorComposition.ts#L65
40
40
  interface Series {
41
+ xData: number[];
41
42
  baseSeries?: Series;
42
43
  navigatorSeries?: Series;
43
44
  }
@@ -13,6 +13,9 @@ export declare type ExtendedHChart = Highcharts.Chart & {
13
13
  _internalComments: HighchartsComment[];
14
14
  _externalComments: HighchartsComment[];
15
15
  _getComments: () => HighchartsComment[];
16
+ _config?: {
17
+ region?: string;
18
+ };
16
19
  };
17
20
  xAxis: XAxisItem[];
18
21
  navigator?: Highcharts.Options['navigator'];
@@ -1,9 +1,9 @@
1
1
  import React from 'react';
2
- import { useThemeType } from '@gravity-ui/uikit';
2
+ import { useThemeValue } from '@gravity-ui/uikit';
3
3
  import { shapeYagrConfig } from './utils';
4
4
  export const useWidgetData = (args) => {
5
5
  const { id, data, sources, libraryConfig } = args;
6
- const theme = useThemeType();
6
+ const theme = useThemeValue();
7
7
  const config = React.useMemo(() => shapeYagrConfig({ data, libraryConfig, theme }), [data, libraryConfig, theme]);
8
8
  const debug = React.useMemo(() => {
9
9
  const filename = sources
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gravity-ui/chartkit",
3
- "version": "2.3.1",
3
+ "version": "2.4.1",
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",
@@ -13,7 +13,7 @@
13
13
  "access": "public"
14
14
  },
15
15
  "dependencies": {
16
- "@gravity-ui/yagr": "^2.2.2",
16
+ "@gravity-ui/yagr": "^2.2.4",
17
17
  "bem-cn-lite": "^4.1.0",
18
18
  "highcharts": "^8.2.2",
19
19
  "highcharts-react-official": "^3.0.0",