@gravity-ui/chartkit 2.13.0 → 3.0.0-beta.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 +0 -14
- package/build/components/ChartKit.d.ts +1 -2
- package/build/components/ChartKit.js +2 -2
- package/build/plugins/highcharts/renderer/HighchartsWidget.d.ts +1 -2
- package/build/plugins/highcharts/renderer/components/withSplitPane/withSplitPane.js +4 -1
- package/build/plugins/indicator/renderer/IndicatorWidget.d.ts +1 -2
- package/build/plugins/yagr/__stories__/Yagr.stories.d.ts +2 -0
- package/build/plugins/yagr/__stories__/Yagr.stories.js +23 -3
- package/build/plugins/yagr/__stories__/mocks/line10.d.ts +51 -0
- package/build/plugins/yagr/__stories__/mocks/line10.js +15 -0
- package/build/plugins/yagr/__tests__/utils.test.js +4 -4
- package/build/plugins/yagr/renderer/YagrWidget.d.ts +1 -2
- package/build/plugins/yagr/renderer/YagrWidget.js +10 -8
- package/build/plugins/yagr/renderer/tooltip/renderTooltip.js +4 -4
- package/build/plugins/yagr/renderer/utils.js +1 -1
- package/build/types/index.d.ts +9 -7
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,19 +1,5 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
## [2.13.0](https://github.com/gravity-ui/chartkit/compare/v2.12.0...v2.13.0) (2023-06-30)
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
### Features
|
|
7
|
-
|
|
8
|
-
* **Yagr plugin:** update to v 2.2.6 ([#186](https://github.com/gravity-ui/chartkit/issues/186)) ([bddd692](https://github.com/gravity-ui/chartkit/commit/bddd6920742b398b35ce4ef6d8b78d87d50148db))
|
|
9
|
-
|
|
10
|
-
## [2.12.0](https://github.com/gravity-ui/chartkit/compare/v2.11.0...v2.12.0) (2023-06-30)
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
### Features
|
|
14
|
-
|
|
15
|
-
* add renderPluginLoader property ([#184](https://github.com/gravity-ui/chartkit/issues/184)) ([3955d2f](https://github.com/gravity-ui/chartkit/commit/3955d2f1995fb204c16cda53e96b4eca50c2ef0e))
|
|
16
|
-
|
|
17
3
|
## [2.11.0](https://github.com/gravity-ui/chartkit/compare/v2.10.1...v2.11.0) (2023-06-20)
|
|
18
4
|
|
|
19
5
|
|
|
@@ -13,9 +13,8 @@ export declare const ChartKit: <T extends keyof import("../types").ChartKitWidge
|
|
|
13
13
|
onLoad?: ((data?: import("../types").ChartKitOnLoadData<T> | undefined) => void) | undefined;
|
|
14
14
|
onRender?: ((data: import("../types").ChartKitOnRenderData) => void) | undefined;
|
|
15
15
|
onChartLoad?: ((data: import("../types").ChartKitOnChartLoad<T>) => void) | undefined;
|
|
16
|
-
onError?: import("../types").ChartKitOnError | undefined;
|
|
17
16
|
renderError?: import("../types").RenderError | undefined;
|
|
18
|
-
|
|
17
|
+
onError?: import("../types").ChartKitOnError | undefined;
|
|
19
18
|
} & { [key in keyof Omit<import("../types").ChartKitWidget[T], "widget" | "data">]: import("../types").ChartKitWidget[T][key]; } & {
|
|
20
19
|
ref?: React.ForwardedRef<ChartKitRef | undefined> | undefined;
|
|
21
20
|
}) => ReturnType<typeof ChartKitComponent>;
|
|
@@ -10,7 +10,7 @@ import './ChartKit.css';
|
|
|
10
10
|
const b = block('chartkit');
|
|
11
11
|
const ChartKitComponent = (props) => {
|
|
12
12
|
const widgetRef = React.useRef();
|
|
13
|
-
const { instanceRef, id: propsId, type, isMobile
|
|
13
|
+
const { instanceRef, id: propsId, type, isMobile } = props, restProps = __rest(props, ["instanceRef", "id", "type", "isMobile"]);
|
|
14
14
|
const ckId = React.useMemo(() => getRandomCKId(), []);
|
|
15
15
|
const id = propsId || ckId;
|
|
16
16
|
const lang = settings.get('lang');
|
|
@@ -31,7 +31,7 @@ const ChartKitComponent = (props) => {
|
|
|
31
31
|
}
|
|
32
32
|
},
|
|
33
33
|
}), []);
|
|
34
|
-
return (React.createElement(React.Suspense, { fallback:
|
|
34
|
+
return (React.createElement(React.Suspense, { fallback: React.createElement(Loader, null) },
|
|
35
35
|
React.createElement("div", { className: b({ mobile: isMobile }, 'chartkit-theme_common') },
|
|
36
36
|
React.createElement(ChartComponent, Object.assign({ ref: widgetRef, id: id, lang: lang }, restProps)))));
|
|
37
37
|
};
|
|
@@ -8,9 +8,8 @@ declare const HighchartsWidget: React.ForwardRefExoticComponent<{
|
|
|
8
8
|
onLoad?: ((data?: import("../../../types").ChartKitOnLoadData<"highcharts"> | undefined) => void) | undefined;
|
|
9
9
|
onRender?: ((data: import("../../../types").ChartKitOnRenderData) => void) | undefined;
|
|
10
10
|
onChartLoad?: ((data: import("../../../types").ChartKitOnChartLoad<"highcharts">) => void) | undefined;
|
|
11
|
-
onError?: import("../../../types").ChartKitOnError | undefined;
|
|
12
11
|
renderError?: import("../../../types").RenderError | undefined;
|
|
13
|
-
|
|
12
|
+
onError?: import("../../../types").ChartKitOnError | undefined;
|
|
14
13
|
} & {
|
|
15
14
|
hoistConfigError?: boolean | undefined;
|
|
16
15
|
nonBodyScroll?: boolean | undefined;
|
|
@@ -43,6 +43,9 @@ function getPointsForInitialRefresh(chart) {
|
|
|
43
43
|
}
|
|
44
44
|
function forceHoverState(chart, activePoints) {
|
|
45
45
|
const chartType = get(chart, 'userOptions.chart.type');
|
|
46
|
+
if (!chartType) {
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
46
49
|
if (chartType === 'pie') {
|
|
47
50
|
chart.tooltip.refresh(activePoints);
|
|
48
51
|
chart.pointsForInitialRefresh = activePoints;
|
|
@@ -205,6 +208,6 @@ export const withSplitPane = (ComposedComponent) => {
|
|
|
205
208
|
}
|
|
206
209
|
}
|
|
207
210
|
return React.forwardRef((props, ref) => {
|
|
208
|
-
return React.createElement(WithSplitPane, Object.assign({ forwardedRef: ref }
|
|
211
|
+
return React.createElement(WithSplitPane, Object.assign({}, props, { forwardedRef: ref }));
|
|
209
212
|
});
|
|
210
213
|
};
|
|
@@ -9,9 +9,8 @@ declare const IndicatorWidget: React.ForwardRefExoticComponent<{
|
|
|
9
9
|
onLoad?: ((data?: import("../../../types").ChartKitOnLoadData<"indicator"> | undefined) => void) | undefined;
|
|
10
10
|
onRender?: ((data: import("../../../types").ChartKitOnRenderData) => void) | undefined;
|
|
11
11
|
onChartLoad?: ((data: import("../../../types").ChartKitOnChartLoad<"indicator">) => void) | undefined;
|
|
12
|
-
onError?: import("../../../types").ChartKitOnError | undefined;
|
|
13
12
|
renderError?: import("../../../types").RenderError | undefined;
|
|
14
|
-
|
|
13
|
+
onError?: import("../../../types").ChartKitOnError | undefined;
|
|
15
14
|
} & {
|
|
16
15
|
formatNumber?: (<T = any>(value: number, options?: T | undefined) => string) | undefined;
|
|
17
16
|
} & React.RefAttributes<ChartKitWidgetRef | undefined>>;
|
|
@@ -3,12 +3,13 @@ import { Button } from '@gravity-ui/uikit';
|
|
|
3
3
|
import { settings } from '../../../libs';
|
|
4
4
|
import { YagrPlugin } from '../../../plugins';
|
|
5
5
|
import { ChartKit } from '../../../components/ChartKit';
|
|
6
|
-
import { line10 } from './mocks/line10';
|
|
6
|
+
import { getNewConfig, line10 } from './mocks/line10';
|
|
7
|
+
import '@gravity-ui/yagr/dist/index.css';
|
|
7
8
|
export default {
|
|
8
9
|
title: 'Plugins/Yagr',
|
|
9
10
|
component: ChartKit,
|
|
10
11
|
};
|
|
11
|
-
const
|
|
12
|
+
const LineTemplate = () => {
|
|
12
13
|
const [shown, setShown] = React.useState(false);
|
|
13
14
|
const chartkitRef = React.useRef();
|
|
14
15
|
if (!shown) {
|
|
@@ -18,4 +19,23 @@ const Template = () => {
|
|
|
18
19
|
return (React.createElement("div", { style: { height: 300, width: '100%' } },
|
|
19
20
|
React.createElement(ChartKit, { ref: chartkitRef, id: "1", type: "yagr", data: line10 })));
|
|
20
21
|
};
|
|
21
|
-
|
|
22
|
+
const UpdatesTemplate = () => {
|
|
23
|
+
const [shown, setShown] = React.useState(false);
|
|
24
|
+
const chartkitRef = React.useRef();
|
|
25
|
+
const [state, setState] = React.useState(line10);
|
|
26
|
+
const onStartUpdates = React.useCallback(() => {
|
|
27
|
+
setInterval(() => {
|
|
28
|
+
setState(getNewConfig());
|
|
29
|
+
}, 1000);
|
|
30
|
+
}, []);
|
|
31
|
+
if (!shown) {
|
|
32
|
+
settings.set({ plugins: [YagrPlugin] });
|
|
33
|
+
return React.createElement(Button, { onClick: () => setShown(true) }, "Show chart");
|
|
34
|
+
}
|
|
35
|
+
return (React.createElement("div", { style: { height: 300, width: '100%' } },
|
|
36
|
+
React.createElement(ChartKit, { ref: chartkitRef, id: "1", type: "yagr", data: state }),
|
|
37
|
+
React.createElement(Button, { onClick: onStartUpdates }, "Start Updates"),
|
|
38
|
+
React.createElement(Button, { onClick: () => setState(getNewConfig()) }, "Once")));
|
|
39
|
+
};
|
|
40
|
+
export const Line = LineTemplate.bind({});
|
|
41
|
+
export const Updates = UpdatesTemplate.bind({});
|
|
@@ -1,2 +1,53 @@
|
|
|
1
1
|
import type { YagrWidgetData } from '../../types';
|
|
2
2
|
export declare const line10: YagrWidgetData;
|
|
3
|
+
export declare const getNewConfig: () => {
|
|
4
|
+
libraryConfig: {
|
|
5
|
+
title: {
|
|
6
|
+
text: string;
|
|
7
|
+
};
|
|
8
|
+
chart?: import("@gravity-ui/yagr/dist/YagrCore/types").YagrChartOptions | undefined;
|
|
9
|
+
legend?: import("@gravity-ui/yagr/dist/YagrCore/plugins/legend/legend").LegendOptions | undefined;
|
|
10
|
+
axes?: Record<string, import("@gravity-ui/yagr/dist/YagrCore/types").AxisOptions> | undefined;
|
|
11
|
+
cursor?: import("@gravity-ui/yagr/dist/YagrCore/plugins/cursor/cursor").CursorOptions | undefined;
|
|
12
|
+
timeline?: number[] | undefined;
|
|
13
|
+
tooltip?: Partial<import("@gravity-ui/yagr/dist/YagrCore/plugins/tooltip/types").TooltipOptions> | undefined;
|
|
14
|
+
grid?: import("uplot").Axis.Grid | undefined;
|
|
15
|
+
markers?: import("@gravity-ui/yagr/dist/YagrCore/types").MarkersOptions | undefined;
|
|
16
|
+
scales?: Record<string, import("@gravity-ui/yagr/dist/YagrCore/types").Scale> | undefined;
|
|
17
|
+
series?: import("@gravity-ui/yagr/dist/YagrCore/types").RawSerieData<Omit<import("@gravity-ui/yagr/dist/YagrCore/types").SeriesOptions, "type"> & {
|
|
18
|
+
type?: import("@gravity-ui/yagr/dist/YagrCore/types").ChartType | undefined;
|
|
19
|
+
}>[] | undefined;
|
|
20
|
+
hooks?: import("@gravity-ui/yagr/dist/YagrCore/types").YagrHooks | undefined;
|
|
21
|
+
processing?: import("@gravity-ui/yagr/dist/YagrCore/types").ProcessingSettings | undefined;
|
|
22
|
+
editUplotOptions?: ((opts: import("uplot").Options) => import("uplot").Options) | undefined;
|
|
23
|
+
plugins?: Record<string, import("@gravity-ui/yagr/dist/YagrCore/types").YagrPlugin<{}, []>> | undefined;
|
|
24
|
+
};
|
|
25
|
+
data: {
|
|
26
|
+
timeline: number[];
|
|
27
|
+
graphs: {
|
|
28
|
+
data: number[];
|
|
29
|
+
name?: string | undefined;
|
|
30
|
+
id?: string | undefined;
|
|
31
|
+
scale?: string | undefined;
|
|
32
|
+
focus?: boolean | undefined;
|
|
33
|
+
show?: boolean | undefined;
|
|
34
|
+
color?: string | undefined;
|
|
35
|
+
spanGaps?: boolean | undefined;
|
|
36
|
+
cursorOptions?: Pick<import("@gravity-ui/yagr/dist/YagrCore/plugins/cursor/cursor").CursorOptions, "snapToValues" | "markersSize"> | undefined;
|
|
37
|
+
formatter?: ((value: string | number | null, serie: import("uplot").Series) => string) | undefined;
|
|
38
|
+
precision?: number | undefined;
|
|
39
|
+
snapToValues?: false | import("@gravity-ui/yagr/dist/YagrCore/types").SnapToValue | undefined;
|
|
40
|
+
stackGroup?: number | undefined;
|
|
41
|
+
title?: string | ((sIdx: number) => string) | undefined;
|
|
42
|
+
transform?: ((val: string | number | null, series: import("@gravity-ui/yagr/dist/YagrCore/types").DataSeries[], idx: number) => number | null) | undefined;
|
|
43
|
+
showInTooltip?: boolean | undefined;
|
|
44
|
+
postProcess?: ((data: (number | null)[], idx: number, y: import("@gravity-ui/yagr/dist/YagrCore").default<import("@gravity-ui/yagr/dist/YagrCore/types").MinimalValidConfig>) => (number | null)[]) | undefined;
|
|
45
|
+
type?: import("@gravity-ui/yagr/dist/YagrCore/types").ChartType | undefined;
|
|
46
|
+
}[];
|
|
47
|
+
};
|
|
48
|
+
sources?: Record<number, {
|
|
49
|
+
data: {
|
|
50
|
+
program: string;
|
|
51
|
+
};
|
|
52
|
+
}> | undefined;
|
|
53
|
+
};
|
|
@@ -61,3 +61,18 @@ export const line10 = {
|
|
|
61
61
|
processing: {},
|
|
62
62
|
},
|
|
63
63
|
};
|
|
64
|
+
export const getNewConfig = () => {
|
|
65
|
+
const startPoint = (Math.random() * 10 ** 5) >> 0; // eslint-disable-line no-bitwise
|
|
66
|
+
return Object.assign(Object.assign({}, line10), { libraryConfig: Object.assign(Object.assign({}, line10.libraryConfig), { title: {
|
|
67
|
+
text: 'line: random 100 pts',
|
|
68
|
+
} }), data: {
|
|
69
|
+
timeline: new Array(100).fill(0).map((_, i) => {
|
|
70
|
+
return startPoint + i * 1000;
|
|
71
|
+
}),
|
|
72
|
+
graphs: line10.data.graphs.map((graph) => {
|
|
73
|
+
return Object.assign(Object.assign({}, graph), { data: new Array(100).fill(0).map(() => {
|
|
74
|
+
return (Math.random() * 100) >> 0; // eslint-disable-line no-bitwise
|
|
75
|
+
}) });
|
|
76
|
+
}),
|
|
77
|
+
} });
|
|
78
|
+
};
|
|
@@ -6,13 +6,13 @@ const DATA = {
|
|
|
6
6
|
describe('plugins/yagr/utils', () => {
|
|
7
7
|
describe('shapeYagrConfig > check chart property', () => {
|
|
8
8
|
test.each([
|
|
9
|
-
[{}, {
|
|
10
|
-
[{
|
|
11
|
-
[{
|
|
9
|
+
[{}, { appearance: { locale: 'en', theme: 'dark' } }],
|
|
10
|
+
[{ appearance: { locale: 'ru' } }, { appearance: { locale: 'ru', theme: 'dark' } }],
|
|
11
|
+
[{ appearance: { theme: 'light' } }, { appearance: { locale: 'en', theme: 'light' } }],
|
|
12
12
|
[
|
|
13
13
|
{ series: { type: 'dots' }, select: { zoom: false }, timeMultiplier: 1 },
|
|
14
14
|
{
|
|
15
|
-
|
|
15
|
+
appearance: { locale: 'en', theme: 'dark' },
|
|
16
16
|
series: { type: 'dots' },
|
|
17
17
|
select: { zoom: false },
|
|
18
18
|
timeMultiplier: 1,
|
|
@@ -11,9 +11,8 @@ declare const YagrWidget: React.ForwardRefExoticComponent<{
|
|
|
11
11
|
onLoad?: ((data?: import("../../../types").ChartKitOnLoadData<"yagr"> | undefined) => void) | undefined;
|
|
12
12
|
onRender?: ((data: import("../../../types").ChartKitOnRenderData) => void) | undefined;
|
|
13
13
|
onChartLoad?: ((data: import("../../../types").ChartKitOnChartLoad<"yagr">) => void) | undefined;
|
|
14
|
-
onError?: import("../../../types").ChartKitOnError | undefined;
|
|
15
14
|
renderError?: import("../../../types").RenderError | undefined;
|
|
16
|
-
|
|
15
|
+
onError?: import("../../../types").ChartKitOnError | undefined;
|
|
17
16
|
} & {} & {
|
|
18
17
|
id: string;
|
|
19
18
|
} & React.RefAttributes<ChartKitWidgetRef | undefined>>;
|
|
@@ -23,9 +23,11 @@ const YagrWidget = React.forwardRef((props, forwardedRef) => {
|
|
|
23
23
|
onRender === null || onRender === void 0 ? void 0 : onRender({ renderTime });
|
|
24
24
|
}, [onLoad, data]);
|
|
25
25
|
const onWindowResize = React.useCallback(() => {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
if (yagrRef.current) {
|
|
27
|
+
const chart = yagrRef.current.yagr();
|
|
28
|
+
if (!chart) {
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
29
31
|
const root = chart.root;
|
|
30
32
|
const height = root.offsetHeight;
|
|
31
33
|
const width = root.offsetWidth;
|
|
@@ -38,9 +40,9 @@ const YagrWidget = React.forwardRef((props, forwardedRef) => {
|
|
|
38
40
|
onWindowResize();
|
|
39
41
|
},
|
|
40
42
|
}), [onWindowResize]);
|
|
41
|
-
React.
|
|
43
|
+
React.useEffect(() => {
|
|
42
44
|
var _a, _b, _c, _d;
|
|
43
|
-
const yagr = (_a = yagrRef.current) === null || _a === void 0 ? void 0 : _a.
|
|
45
|
+
const yagr = (_a = yagrRef.current) === null || _a === void 0 ? void 0 : _a.yagr();
|
|
44
46
|
if (!yagr) {
|
|
45
47
|
return;
|
|
46
48
|
}
|
|
@@ -67,11 +69,11 @@ const YagrWidget = React.forwardRef((props, forwardedRef) => {
|
|
|
67
69
|
handlers.mouseDown = null;
|
|
68
70
|
}
|
|
69
71
|
});
|
|
70
|
-
});
|
|
72
|
+
}, []);
|
|
71
73
|
React.useLayoutEffect(() => {
|
|
72
74
|
var _a;
|
|
73
|
-
onChartLoad === null || onChartLoad === void 0 ? void 0 : onChartLoad({ widget: (_a = yagrRef.current) === null || _a === void 0 ? void 0 : _a.
|
|
74
|
-
}, []);
|
|
75
|
+
onChartLoad === null || onChartLoad === void 0 ? void 0 : onChartLoad({ widget: (_a = yagrRef.current) === null || _a === void 0 ? void 0 : _a.yagr() });
|
|
76
|
+
}, [yagrRef, onChartLoad]);
|
|
75
77
|
return (React.createElement(YagrComponent, { ref: yagrRef, id: id, config: config, debug: debug, onChartLoad: handleChartLoading }));
|
|
76
78
|
});
|
|
77
79
|
export default YagrWidget;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import moment from 'moment';
|
|
2
2
|
import { formatTooltip } from './tooltip';
|
|
3
3
|
const calcOption = (d) => {
|
|
4
|
-
return typeof d === 'object'
|
|
4
|
+
return typeof d === 'object' && d !== null
|
|
5
5
|
? Object.values(d).reduce((_, t) => {
|
|
6
6
|
return t;
|
|
7
7
|
})
|
|
@@ -16,7 +16,7 @@ export const renderTooltip = (data) => {
|
|
|
16
16
|
const cfg = data.yagr.config;
|
|
17
17
|
const timeMultiplier = cfg.chart.timeMultiplier || 1;
|
|
18
18
|
const opts = data.options;
|
|
19
|
-
const { x,
|
|
19
|
+
const { x, state } = data;
|
|
20
20
|
let sumTotal = 0;
|
|
21
21
|
const rows = Object.values(data.scales).reduce((acc, scale) => {
|
|
22
22
|
sumTotal += scale.sum || 0;
|
|
@@ -27,7 +27,7 @@ export const renderTooltip = (data) => {
|
|
|
27
27
|
const maxLines = calcOption(opts.maxLines);
|
|
28
28
|
const valueFormatter = calcOption(opts.value);
|
|
29
29
|
// eslint-disable-next-line no-nested-ternary
|
|
30
|
-
const hiddenRowsNumber = pinned
|
|
30
|
+
const hiddenRowsNumber = state.pinned
|
|
31
31
|
? undefined
|
|
32
32
|
: lines > maxLines
|
|
33
33
|
? Math.abs(maxLines - lines)
|
|
@@ -50,6 +50,6 @@ export const renderTooltip = (data) => {
|
|
|
50
50
|
tooltipFormatOptions.sum = valueFormatter(sumTotal);
|
|
51
51
|
}
|
|
52
52
|
return formatTooltip(tooltipFormatOptions, {
|
|
53
|
-
lastVisibleRowIndex: pinned ? rows.length - 1 : maxLines - 1,
|
|
53
|
+
lastVisibleRowIndex: state.pinned ? rows.length - 1 : maxLines - 1,
|
|
54
54
|
});
|
|
55
55
|
};
|
|
@@ -87,7 +87,7 @@ export const shapeYagrConfig = (args) => {
|
|
|
87
87
|
const { data, libraryConfig, theme } = args;
|
|
88
88
|
const config = Object.assign(Object.assign({}, libraryConfig), { timeline: data.timeline, series: data.graphs });
|
|
89
89
|
const chart = {
|
|
90
|
-
|
|
90
|
+
appearance: {
|
|
91
91
|
locale: settings.get('lang'),
|
|
92
92
|
theme,
|
|
93
93
|
},
|
package/build/types/index.d.ts
CHANGED
|
@@ -29,16 +29,18 @@ export declare type ChartKitProps<T extends ChartKitType> = {
|
|
|
29
29
|
id?: string;
|
|
30
30
|
isMobile?: boolean;
|
|
31
31
|
onLoad?: (data?: ChartKitOnLoadData<T>) => void;
|
|
32
|
-
/**
|
|
32
|
+
/**
|
|
33
|
+
* called on each render
|
|
34
|
+
* @param data
|
|
35
|
+
*/
|
|
33
36
|
onRender?: (data: ChartKitOnRenderData) => void;
|
|
34
|
-
/**
|
|
37
|
+
/**
|
|
38
|
+
* called on chart mount
|
|
39
|
+
* @param data
|
|
40
|
+
*/
|
|
35
41
|
onChartLoad?: (data: ChartKitOnChartLoad<T>) => void;
|
|
36
|
-
/** Fires in case of unhandled plugin's exception */
|
|
37
|
-
onError?: ChartKitOnError;
|
|
38
|
-
/** Used to render user's error component */
|
|
39
42
|
renderError?: RenderError;
|
|
40
|
-
|
|
41
|
-
renderPluginLoader?: () => React.ReactNode;
|
|
43
|
+
onError?: ChartKitOnError;
|
|
42
44
|
} & {
|
|
43
45
|
[key in keyof Omit<ChartKitWidget[T], 'data' | 'widget'>]: ChartKitWidget[T][key];
|
|
44
46
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gravity-ui/chartkit",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0-beta.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": "^
|
|
16
|
+
"@gravity-ui/yagr": "^3.3.0",
|
|
17
17
|
"bem-cn-lite": "^4.1.0",
|
|
18
18
|
"highcharts": "^8.2.2",
|
|
19
19
|
"highcharts-react-official": "^3.0.0",
|
|
@@ -65,9 +65,9 @@
|
|
|
65
65
|
"typescript": "^4.2.3"
|
|
66
66
|
},
|
|
67
67
|
"peerDependencies": {
|
|
68
|
-
"
|
|
68
|
+
"@gravity-ui/uikit": "^4.0.0",
|
|
69
69
|
"moment": "^2.19.3",
|
|
70
|
-
"
|
|
70
|
+
"react": "^16.0.0 || ^17.0.0 || ^18.0.0"
|
|
71
71
|
},
|
|
72
72
|
"scripts": {
|
|
73
73
|
"test": "jest",
|