@gravity-ui/chartkit 0.10.1 → 0.11.0
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 +7 -0
- package/build/components/ChartKit.d.ts +6 -6
- package/build/index.d.ts +1 -1
- package/build/plugins/highcharts/renderer/components/HighchartsComponent.d.ts +2 -2
- package/build/plugins/highcharts/renderer/helpers/graph.d.ts +4 -4
- package/build/plugins/highcharts/types/comments.d.ts +1 -1
- package/build/plugins/highcharts/types/index.d.ts +1 -1
- package/build/plugins/highcharts/types/misc.d.ts +4 -4
- package/build/plugins/highcharts/types/widget.d.ts +3 -3
- package/build/plugins/index.d.ts +1 -1
- package/build/types/index.d.ts +9 -9
- package/build/types/widget.d.ts +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.11.0](https://github.com/gravity-ui/chartkit/compare/v0.10.1...v0.11.0) (2022-11-18)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* types improvements ([#67](https://github.com/gravity-ui/chartkit/issues/67)) ([33b4f07](https://github.com/gravity-ui/chartkit/commit/33b4f07a24abdfde52005ddbbf17fb7a25817beb))
|
|
9
|
+
|
|
3
10
|
## [0.10.1](https://github.com/gravity-ui/chartkit/compare/v0.10.0...v0.10.1) (2022-11-18)
|
|
4
11
|
|
|
5
12
|
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type {
|
|
2
|
+
import type { ChartKitType, ChartKitRef, ChartKitProps } from '../types';
|
|
3
3
|
import '@gravity-ui/uikit/styles/styles.css';
|
|
4
4
|
import './ChartKit.css';
|
|
5
|
-
declare type ChartKitComponentProps<T extends
|
|
5
|
+
declare type ChartKitComponentProps<T extends ChartKitType> = Omit<ChartKitProps<T>, 'onError'> & {
|
|
6
6
|
instanceRef?: React.ForwardedRef<ChartKitRef | undefined>;
|
|
7
7
|
};
|
|
8
|
-
declare const ChartKitComponent: <T extends keyof import("../types").
|
|
9
|
-
export declare const ChartKit: <T extends keyof import("../types").
|
|
8
|
+
declare const ChartKitComponent: <T extends keyof import("../types").ChartKitWidget>(props: ChartKitComponentProps<T>) => JSX.Element;
|
|
9
|
+
export declare const ChartKit: <T extends keyof import("../types").ChartKitWidget>(props: {
|
|
10
10
|
type: T;
|
|
11
|
-
data: import("../types").
|
|
11
|
+
data: import("../types").ChartKitWidget[T]["data"];
|
|
12
12
|
id?: string | undefined;
|
|
13
13
|
isMobile?: boolean | undefined;
|
|
14
14
|
onLoad?: ((data?: import("../types").ChartKitOnLoadData<T> | undefined) => void) | undefined;
|
|
15
15
|
onError?: import("../types").ChartKitOnError | undefined;
|
|
16
|
-
} & { [key in keyof Omit<import("../types").
|
|
16
|
+
} & { [key in keyof Omit<import("../types").ChartKitWidget[T], "widget" | "data">]: import("../types").ChartKitWidget[T][key]; } & {
|
|
17
17
|
ref?: React.ForwardedRef<ChartKitRef | undefined> | undefined;
|
|
18
18
|
}) => ReturnType<typeof ChartKitComponent>;
|
|
19
19
|
export {};
|
package/build/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ChartKit } from './components/ChartKit';
|
|
2
2
|
import { settings } from './libs';
|
|
3
|
-
export type { ChartKitLang, ChartKitOnLoadData, ChartKitOnError, ChartKitPlugin, ChartKitProps, ChartKitRef, ChartKitWidgetRef,
|
|
3
|
+
export type { ChartKitLang, ChartKitOnLoadData, ChartKitOnError, ChartKitPlugin, ChartKitProps, ChartKitRef, ChartKitWidgetRef, ChartKitType, ChartKitWidget, } from './types';
|
|
4
4
|
export { settings };
|
|
5
5
|
export default ChartKit;
|
|
@@ -550,8 +550,8 @@ export declare class HighchartsComponent extends React.PureComponent<Props, Stat
|
|
|
550
550
|
text: any;
|
|
551
551
|
};
|
|
552
552
|
series: any;
|
|
553
|
-
_externalComments: import("../../types").
|
|
554
|
-
_internalComments: import("../../types").
|
|
553
|
+
_externalComments: import("../../types").HighchartsComment[];
|
|
554
|
+
_internalComments: import("../../types").HighchartsComment[];
|
|
555
555
|
};
|
|
556
556
|
callback: (chart: import("../../types").ExtendedHChart) => void;
|
|
557
557
|
isError: boolean;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { ChartKitHolidays } from '../../../../types';
|
|
2
|
-
import type { HighchartsWidgetData,
|
|
2
|
+
import type { HighchartsWidgetData, HighchartsComment, ExtendedHChart } from '../../types';
|
|
3
3
|
import type { ConfigOptions } from './types';
|
|
4
4
|
import './graph.css';
|
|
5
5
|
declare type GetGraphArgs = {
|
|
6
6
|
options: ConfigOptions;
|
|
7
7
|
data: HighchartsWidgetData['data'];
|
|
8
|
-
comments?:
|
|
8
|
+
comments?: HighchartsComment[];
|
|
9
9
|
holidays?: ChartKitHolidays;
|
|
10
10
|
isMobile?: boolean;
|
|
11
11
|
};
|
|
@@ -544,8 +544,8 @@ declare function getGraph({ options, data, comments, isMobile, holidays }: GetGr
|
|
|
544
544
|
text: any;
|
|
545
545
|
};
|
|
546
546
|
series: any;
|
|
547
|
-
_externalComments:
|
|
548
|
-
_internalComments:
|
|
547
|
+
_externalComments: HighchartsComment[];
|
|
548
|
+
_internalComments: HighchartsComment[];
|
|
549
549
|
};
|
|
550
550
|
callback: (chart: ExtendedHChart) => void;
|
|
551
551
|
};
|
|
@@ -47,5 +47,5 @@ interface CommentFlagX extends CommentBase {
|
|
|
47
47
|
shape: string;
|
|
48
48
|
};
|
|
49
49
|
}
|
|
50
|
-
export declare type
|
|
50
|
+
export declare type HighchartsComment = CommentDotXY | CommentBandX | CommentLineX | CommentFlagX;
|
|
51
51
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export type { Highcharts } from './lib';
|
|
2
2
|
export type { HighchartsWidgetData } from './widget';
|
|
3
3
|
export type { DrillDownConfig, ExtendedHChart, StringParams, XAxisItem } from './misc';
|
|
4
|
-
export type {
|
|
4
|
+
export type { HighchartsComment } from './comments';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { HighchartsComment } from './comments';
|
|
2
2
|
export declare type StringParams = Record<string, string | string[]>;
|
|
3
3
|
export declare type DrillDownConfig = {
|
|
4
4
|
breadcrumbs: string[];
|
|
@@ -10,9 +10,9 @@ export declare type XAxisItem = Highcharts.Axis & {
|
|
|
10
10
|
};
|
|
11
11
|
export declare type ExtendedHChart = Highcharts.Chart & {
|
|
12
12
|
userOptions: Highcharts.Options & {
|
|
13
|
-
_internalComments:
|
|
14
|
-
_externalComments:
|
|
15
|
-
_getComments: () =>
|
|
13
|
+
_internalComments: HighchartsComment[];
|
|
14
|
+
_externalComments: HighchartsComment[];
|
|
15
|
+
_getComments: () => HighchartsComment[];
|
|
16
16
|
};
|
|
17
17
|
xAxis: XAxisItem[];
|
|
18
18
|
navigator?: Highcharts.Options['navigator'];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Highcharts } from './lib';
|
|
2
|
-
import type {
|
|
2
|
+
import type { HighchartsComment } from './comments';
|
|
3
3
|
import type { DrillDownConfig, StringParams } from './misc';
|
|
4
4
|
declare type GraphWidgetSeriesOptions = Highcharts.SeriesOptionsType & {
|
|
5
5
|
title?: string;
|
|
@@ -16,7 +16,7 @@ export declare type HighchartsWidgetData = {
|
|
|
16
16
|
} | {
|
|
17
17
|
graphs: GraphWidgetSeriesOptions[];
|
|
18
18
|
}) & {
|
|
19
|
-
comments?:
|
|
19
|
+
comments?: HighchartsComment[];
|
|
20
20
|
};
|
|
21
21
|
config: {
|
|
22
22
|
hideComments?: boolean;
|
|
@@ -41,7 +41,7 @@ export declare type HighchartsWidgetData = {
|
|
|
41
41
|
};
|
|
42
42
|
libraryConfig: Highcharts.Options;
|
|
43
43
|
params?: StringParams;
|
|
44
|
-
comments?:
|
|
44
|
+
comments?: HighchartsComment[];
|
|
45
45
|
sideMarkdown?: string;
|
|
46
46
|
};
|
|
47
47
|
export {};
|
package/build/plugins/index.d.ts
CHANGED
|
@@ -3,4 +3,4 @@ export type { Yagr, YagrWidgetData } from './yagr/types';
|
|
|
3
3
|
export { IndicatorPlugin } from './indicator';
|
|
4
4
|
export type { IndicatorWidgetData } from './indicator/types';
|
|
5
5
|
export { HighchartsPlugin } from './highcharts';
|
|
6
|
-
export type { Highcharts, HighchartsWidgetData } from './highcharts/types';
|
|
6
|
+
export type { Highcharts, HighchartsWidgetData, HighchartsComment } from './highcharts/types';
|
package/build/types/index.d.ts
CHANGED
|
@@ -1,33 +1,33 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import type {
|
|
2
|
+
import type { ChartKitWidget } from './widget';
|
|
3
3
|
export type { ChartKitHolidays } from './misc';
|
|
4
4
|
export declare type ChartKitLang = 'ru' | 'en';
|
|
5
|
-
export declare type
|
|
5
|
+
export declare type ChartKitType = keyof ChartKitWidget;
|
|
6
6
|
export declare type ChartKitRef = {
|
|
7
7
|
reflow: (details?: unknown) => void;
|
|
8
8
|
};
|
|
9
9
|
export declare type ChartKitWidgetRef = {
|
|
10
10
|
reflow?: ChartKitRef['reflow'];
|
|
11
11
|
};
|
|
12
|
-
export declare type ChartKitOnLoadData<T extends
|
|
13
|
-
widget?:
|
|
12
|
+
export declare type ChartKitOnLoadData<T extends ChartKitType> = {
|
|
13
|
+
widget?: ChartKitWidget[T]['widget'];
|
|
14
14
|
widgetRendering?: number;
|
|
15
15
|
};
|
|
16
16
|
export declare type ChartKitOnError = (data: {
|
|
17
17
|
error: any;
|
|
18
18
|
}) => void;
|
|
19
|
-
export declare type ChartKitProps<T extends
|
|
19
|
+
export declare type ChartKitProps<T extends ChartKitType> = {
|
|
20
20
|
type: T;
|
|
21
|
-
data:
|
|
21
|
+
data: ChartKitWidget[T]['data'];
|
|
22
22
|
id?: string;
|
|
23
23
|
isMobile?: boolean;
|
|
24
24
|
onLoad?: (data?: ChartKitOnLoadData<T>) => void;
|
|
25
25
|
onError?: ChartKitOnError;
|
|
26
26
|
} & {
|
|
27
|
-
[key in keyof Omit<
|
|
27
|
+
[key in keyof Omit<ChartKitWidget[T], 'data' | 'widget'>]: ChartKitWidget[T][key];
|
|
28
28
|
};
|
|
29
29
|
export declare type ChartKitPlugin = {
|
|
30
|
-
type:
|
|
30
|
+
type: ChartKitType;
|
|
31
31
|
renderer: React.LazyExoticComponent<any>;
|
|
32
32
|
};
|
|
33
|
-
export type {
|
|
33
|
+
export type { ChartKitWidget };
|
package/build/types/widget.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import type Yagr from 'yagr';
|
|
|
2
2
|
import type { YagrWidgetData } from '../plugins/yagr/types';
|
|
3
3
|
import type { IndicatorWidgetData } from '../plugins/indicator/types';
|
|
4
4
|
import type { Highcharts, HighchartsWidgetData, StringParams } from '../plugins/highcharts/types';
|
|
5
|
-
export interface
|
|
5
|
+
export interface ChartKitWidget {
|
|
6
6
|
yagr: {
|
|
7
7
|
data: YagrWidgetData;
|
|
8
8
|
widget: Yagr;
|
package/package.json
CHANGED