diff --git a/package-lock.json b/package-lock.json index db53add5..9e749011 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,7 +11,7 @@ "dependencies": { "@bem-react/classname": "^1.6.0", "@gravity-ui/date-utils": "^1.4.1", - "@gravity-ui/yagr": "^3.11.4", + "@gravity-ui/yagr": "^4.0.0", "afterframe": "^1.0.2", "d3": "^7.8.5", "lodash": "^4.17.21", @@ -2755,11 +2755,11 @@ } }, "node_modules/@gravity-ui/yagr": { - "version": "3.11.4", - "resolved": "https://registry.npmjs.org/@gravity-ui/yagr/-/yagr-3.11.4.tgz", - "integrity": "sha512-xHhLQi1JLalJYV9/XNJF8ktESn1QEXOEkbi/lB804bk05iT+X7LKo3zZYYWLAHmOB5CH1wZF5jNWN2eL1qgk0A==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@gravity-ui/yagr/-/yagr-4.0.0.tgz", + "integrity": "sha512-LSVbz1Jf5/SP/8VwOh/6KHsYQPlg+iWH+u0CCmrKnnLHpnKbtpi8Sj9yQj2uRqCJ6WsEKMEsUmBlxZM4iVW1mA==", "dependencies": { - "uplot": "1.6.25" + "uplot": "1.6.27" }, "engines": { "node": ">=16.0.0" @@ -24797,9 +24797,9 @@ } }, "node_modules/uplot": { - "version": "1.6.25", - "resolved": "https://registry.npmjs.org/uplot/-/uplot-1.6.25.tgz", - "integrity": "sha512-eWLAhEaGtIcVBiS67mC2UC0yV+G6eYLS2rU67N4F2JVWjt7uBMg4xKXUYGW0dEz9G+m7fNatjCVXHts4gjyuMQ==" + "version": "1.6.27", + "resolved": "https://registry.npmjs.org/uplot/-/uplot-1.6.27.tgz", + "integrity": "sha512-78U4ss5YeU65kQkOC/QAKiyII+4uo+TYUJJKvuxRzeSpk/s5sjpY1TL0agkmhHBBShpvLtmbHIEiM7+C5lBULg==" }, "node_modules/uri-js": { "version": "4.4.1", diff --git a/package.json b/package.json index f9863cf8..edcadaf8 100644 --- a/package.json +++ b/package.json @@ -48,7 +48,7 @@ "dependencies": { "@bem-react/classname": "^1.6.0", "@gravity-ui/date-utils": "^1.4.1", - "@gravity-ui/yagr": "^3.11.4", + "@gravity-ui/yagr": "^4.0.0", "afterframe": "^1.0.2", "d3": "^7.8.5", "lodash": "^4.17.21", diff --git a/src/plugins/yagr/renderer/YagrWidget.tsx b/src/plugins/yagr/renderer/YagrWidget.tsx index b580a143..a4c201f5 100644 --- a/src/plugins/yagr/renderer/YagrWidget.tsx +++ b/src/plugins/yagr/renderer/YagrWidget.tsx @@ -1,7 +1,7 @@ import React from 'react'; import isEmpty from 'lodash/isEmpty'; -import YagrComponent, {YagrChartProps, YagrReactRef} from '@gravity-ui/yagr/dist/react'; +import YagrComponent, {YagrChartProps, YagrReactRef} from '@gravity-ui/yagr/react'; import {i18n} from '../../../i18n'; import type {ChartKitWidgetRef} from '../../../types'; diff --git a/src/plugins/yagr/renderer/useWidgetData.ts b/src/plugins/yagr/renderer/useWidgetData.ts index 02137676..286eb51e 100644 --- a/src/plugins/yagr/renderer/useWidgetData.ts +++ b/src/plugins/yagr/renderer/useWidgetData.ts @@ -1,6 +1,6 @@ import React from 'react'; import {useThemeValue} from '@gravity-ui/uikit'; -import type {YagrChartProps} from '@gravity-ui/yagr/dist/react'; +import type {YagrChartProps} from '@gravity-ui/yagr/react'; import type {YagrTheme, MinimalValidConfig, YagrWidgetProps} from '../types'; import {shapeYagrConfig} from './utils'; diff --git a/src/plugins/yagr/renderer/utils.ts b/src/plugins/yagr/renderer/utils.ts index e14ac9bc..7a0dcda9 100644 --- a/src/plugins/yagr/renderer/utils.ts +++ b/src/plugins/yagr/renderer/utils.ts @@ -162,6 +162,13 @@ export const shapeYagrConfig = (args: ShapeYagrConfigArgs): MinimalValidConfig = if (args.customTooltip) { config.tooltip.virtual = true; } + + /** + * @todo remove this on next chartkit major release + * This added to prevent breaking changes in chartkit, while updating yagr@4 which + * has fixed tooltip sorting (@see https://github.com/gravity-ui/yagr/issues/149) + */ + config.tooltip.sort = config.tooltip.sort || ((a, b) => b.rowIdx - a.rowIdx); } config.axes = config.axes || {}; diff --git a/src/plugins/yagr/types.ts b/src/plugins/yagr/types.ts index 00c0a42e..7bab2e76 100644 --- a/src/plugins/yagr/types.ts +++ b/src/plugins/yagr/types.ts @@ -3,7 +3,7 @@ import type Yagr from '@gravity-ui/yagr'; import {ChartKitProps} from 'src/types'; export type {default as Yagr} from '@gravity-ui/yagr'; -export type {YagrReactRef} from '@gravity-ui/yagr/dist/react'; +export type {YagrReactRef} from '@gravity-ui/yagr/react'; export * from '@gravity-ui/yagr/dist/types'; export interface CustomTooltipProps {