Skip to content

Commit

Permalink
feat: bump major yagr (#353)
Browse files Browse the repository at this point in the history
* feat: bumping yagr to 4.0.0
  • Loading branch information
zefirka authored Nov 28, 2023
1 parent 74975a9 commit 0e80011
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 12 deletions.
16 changes: 8 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/yagr/renderer/YagrWidget.tsx
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/yagr/renderer/useWidgetData.ts
Original file line number Diff line number Diff line change
@@ -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';

Expand Down
7 changes: 7 additions & 0 deletions src/plugins/yagr/renderer/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 || {};
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/yagr/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 0e80011

Please sign in to comment.