@gravity-ui/chartkit 5.21.0 → 6.0.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.
Files changed (45) hide show
  1. package/build/index.d.ts +0 -1
  2. package/build/index.js +0 -1
  3. package/build/plugins/d3/renderer/D3Widget.d.ts +1 -1
  4. package/build/types/index.d.ts +0 -1
  5. package/build/types/index.js +1 -2
  6. package/build/types/widget.d.ts +2 -2
  7. package/package.json +4 -4
  8. package/build/types/widget-data/area.d.ts +0 -75
  9. package/build/types/widget-data/area.js +0 -1
  10. package/build/types/widget-data/axis.d.ts +0 -85
  11. package/build/types/widget-data/axis.js +0 -1
  12. package/build/types/widget-data/bar-x.d.ts +0 -66
  13. package/build/types/widget-data/bar-x.js +0 -1
  14. package/build/types/widget-data/bar-y.d.ts +0 -59
  15. package/build/types/widget-data/bar-y.js +0 -1
  16. package/build/types/widget-data/base.d.ts +0 -47
  17. package/build/types/widget-data/base.js +0 -1
  18. package/build/types/widget-data/chart.d.ts +0 -15
  19. package/build/types/widget-data/chart.js +0 -1
  20. package/build/types/widget-data/halo.d.ts +0 -9
  21. package/build/types/widget-data/halo.js +0 -1
  22. package/build/types/widget-data/index.d.ts +0 -39
  23. package/build/types/widget-data/index.js +0 -17
  24. package/build/types/widget-data/legend.d.ts +0 -92
  25. package/build/types/widget-data/legend.js +0 -1
  26. package/build/types/widget-data/line.d.ts +0 -56
  27. package/build/types/widget-data/line.js +0 -1
  28. package/build/types/widget-data/marker.d.ts +0 -12
  29. package/build/types/widget-data/marker.js +0 -1
  30. package/build/types/widget-data/pie.d.ts +0 -87
  31. package/build/types/widget-data/pie.js +0 -1
  32. package/build/types/widget-data/scatter.d.ts +0 -45
  33. package/build/types/widget-data/scatter.js +0 -1
  34. package/build/types/widget-data/series.d.ts +0 -225
  35. package/build/types/widget-data/series.js +0 -1
  36. package/build/types/widget-data/split.d.ts +0 -13
  37. package/build/types/widget-data/split.js +0 -1
  38. package/build/types/widget-data/title.d.ts +0 -5
  39. package/build/types/widget-data/title.js +0 -1
  40. package/build/types/widget-data/tooltip.d.ts +0 -67
  41. package/build/types/widget-data/tooltip.js +0 -1
  42. package/build/types/widget-data/treemap.d.ts +0 -45
  43. package/build/types/widget-data/treemap.js +0 -1
  44. package/build/types/widget-data/waterfall.d.ts +0 -39
  45. package/build/types/widget-data/waterfall.js +0 -1
package/build/index.d.ts CHANGED
@@ -1,6 +1,5 @@
1
1
  import { ChartKit } from './components/ChartKit';
2
2
  import { settings } from './libs';
3
- export * from './types/widget-data';
4
3
  export * from './libs/chartkit-error/chartkit-error';
5
4
  export type { ChartKitLang, ChartKitOnLoadData, ChartKitOnRenderData, ChartKitOnChartLoad, ChartKitOnError, ChartKitPlugin, ChartKitProps, ChartKitRef, ChartKitWidgetRef, ChartKitType, ChartKitWidget, } from './types';
6
5
  export { settings };
package/build/index.js CHANGED
@@ -1,6 +1,5 @@
1
1
  import { ChartKit } from './components/ChartKit';
2
2
  import { settings } from './libs';
3
- export * from './types/widget-data';
4
3
  export * from './libs/chartkit-error/chartkit-error';
5
4
  export { settings };
6
5
  export default ChartKit;
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import type { ChartKitWidgetRef } from '../../../types';
3
3
  declare const D3Widget: React.ForwardRefExoticComponent<{
4
4
  type: "d3";
5
- data: import("../../../types").ChartKitWidgetData;
5
+ data: import("@gravity-ui/charts").ChartData<any>;
6
6
  id?: string | undefined;
7
7
  isMobile?: boolean | undefined;
8
8
  onLoad?: ((data?: import("../../../types").ChartKitOnLoadData<"d3"> | undefined) => void) | undefined;
@@ -2,7 +2,6 @@ import React from 'react';
2
2
  import { ChartKitError } from '../libs';
3
3
  import type { ChartKitWidget } from './widget';
4
4
  export type { ChartKitHolidays } from './misc';
5
- export * from './widget-data';
6
5
  export type ChartKitLang = 'ru' | 'en';
7
6
  export type ChartKitType = keyof ChartKitWidget;
8
7
  export type ChartKitRef = {
@@ -1,2 +1 @@
1
- // TODO: remove in the next major. This types should be consumed directly from '@gravity-ui/charts'
2
- export * from './widget-data';
1
+ export {};
@@ -1,9 +1,9 @@
1
1
  /// <reference types="react" />
2
+ import type { ChartData } from '@gravity-ui/charts';
2
3
  import type { SplitLayoutType } from '../components/SplitPane/types';
3
4
  import type { Highcharts, HighchartsWidgetData, StringParams } from '../plugins/highcharts/types';
4
5
  import type { IndicatorWidgetData } from '../plugins/indicator/types';
5
6
  import type { CustomTooltipProps, Yagr, YagrWidgetData } from '../plugins/yagr/types';
6
- import type { ChartKitWidgetData } from './widget-data';
7
7
  export interface ChartKitWidget {
8
8
  yagr: {
9
9
  data: YagrWidgetData;
@@ -33,7 +33,7 @@ export interface ChartKitWidget {
33
33
  }, callExternalOnChange?: boolean) => void;
34
34
  };
35
35
  d3: {
36
- data: ChartKitWidgetData;
36
+ data: ChartData;
37
37
  widget: never;
38
38
  tooltip?: {
39
39
  splitted?: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gravity-ui/chartkit",
3
- "version": "5.21.0",
3
+ "version": "6.0.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",
@@ -47,7 +47,7 @@
47
47
  ],
48
48
  "dependencies": {
49
49
  "@bem-react/classname": "^1.6.0",
50
- "@gravity-ui/charts": "^0.5.0",
50
+ "@gravity-ui/charts": "^0.7.0",
51
51
  "@gravity-ui/date-utils": "^2.1.0",
52
52
  "@gravity-ui/i18n": "^1.0.0",
53
53
  "@gravity-ui/yagr": "^4.6.0",
@@ -63,7 +63,7 @@
63
63
  "@gravity-ui/prettier-config": "^1.1.0",
64
64
  "@gravity-ui/stylelint-config": "^4.0.1",
65
65
  "@gravity-ui/tsconfig": "^1.0.0",
66
- "@gravity-ui/uikit": "^6.35.2",
66
+ "@gravity-ui/uikit": "^7.4.0",
67
67
  "@jest/types": "^29.6.3",
68
68
  "@playwright/experimental-ct-react17": "^1.41.1",
69
69
  "@storybook/addon-actions": "^7.6.14",
@@ -111,7 +111,7 @@
111
111
  "typescript": "^5.3.3"
112
112
  },
113
113
  "peerDependencies": {
114
- "@gravity-ui/uikit": "^6.0.0",
114
+ "@gravity-ui/uikit": "^7.0.0",
115
115
  "react": "^16.0.0 || ^17.0.0 || ^18.0.0"
116
116
  },
117
117
  "scripts": {
@@ -1,75 +0,0 @@
1
- import { SeriesType } from '../../constants';
2
- import type { BaseSeries, BaseSeriesData } from './base';
3
- import type { ChartKitWidgetLegend, RectLegendSymbolOptions } from './legend';
4
- import type { PointMarkerOptions } from './marker';
5
- export type AreaSeriesData<T = any> = BaseSeriesData<T> & {
6
- /**
7
- * The `x` value of the point. Depending on the context , it may represents:
8
- * - numeric value (for `linear` x axis)
9
- * - timestamp value (for `datetime` x axis)
10
- * - x axis category value (for `category` x axis). If the type is a string, then it is a category value itself. If the type is a number, then it is the index of an element in the array of categories described in `xAxis.categories`
11
- */
12
- x?: string | number;
13
- /**
14
- * The `y` value of the point. Depending on the context , it may represents:
15
- * - numeric value (for `linear` y axis)
16
- * - timestamp value (for `datetime` y axis)
17
- * - y axis category value (for `category` y axis). If the type is a string, then it is a category value itself. If the type is a number, then it is the index of an element in the array of categories described in `yAxis[0].categories`
18
- */
19
- y?: string | number;
20
- /** Data label value of the point. If not specified, the y value is used. */
21
- label?: string | number;
22
- /** Individual marker options for the point. */
23
- marker?: {
24
- /** States for a single point marker. */
25
- states?: {
26
- /** The normal state of a single point marker. */
27
- normal?: {
28
- /**
29
- * Enable or disable the point marker.
30
- *
31
- * @default false
32
- * */
33
- enabled: boolean;
34
- };
35
- };
36
- };
37
- };
38
- export type AreaMarkerSymbol = 'circle' | 'square';
39
- export type AreaMarkerOptions = PointMarkerOptions & {
40
- symbol?: AreaMarkerSymbol;
41
- };
42
- export type AreaSeries<T = any> = BaseSeries & {
43
- type: typeof SeriesType.Area;
44
- data: AreaSeriesData<T>[];
45
- /** The name of the series (used in legend, tooltip etc) */
46
- name: string;
47
- /** Whether to stack the values of each series on top of each other.
48
- * Possible values are undefined to disable, "normal" to stack by value or "percent"
49
- *
50
- * @default undefined
51
- * */
52
- stacking?: 'normal' | 'percent';
53
- /** This option allows grouping series in a stacked chart */
54
- stackId?: string;
55
- /** The main color of the series (hex, rgba) */
56
- color?: string;
57
- /** Fill opacity for the area
58
- *
59
- * @default 0.75
60
- * */
61
- opacity?: number;
62
- /** Pixel width of the graph line.
63
- *
64
- * @default 1
65
- * */
66
- lineWidth?: number;
67
- /** Individual series legend options. Has higher priority than legend options in widget data */
68
- legend?: ChartKitWidgetLegend & {
69
- symbol?: RectLegendSymbolOptions;
70
- };
71
- /** Options for the point markers of line in area series */
72
- marker?: AreaMarkerOptions;
73
- /** Y-axis index (when using two axes) */
74
- yAxis?: number;
75
- };
@@ -1 +0,0 @@
1
- export {};
@@ -1,85 +0,0 @@
1
- import type { FormatNumberOptions } from '../../plugins/shared';
2
- import type { BaseTextStyle } from './base';
3
- export type ChartKitWidgetAxisType = 'category' | 'datetime' | 'linear' | 'logarithmic';
4
- export type ChartKitWidgetAxisTitleAlignment = 'left' | 'center' | 'right';
5
- export type ChartKitWidgetAxisLabels = {
6
- /** Enable or disable the axis labels. */
7
- enabled?: boolean;
8
- /** The label's pixel distance from the perimeter of the plot area.
9
- *
10
- * @default: 10
11
- */
12
- margin?: number;
13
- /** The pixel padding for axis labels, to ensure white space between them.
14
- *
15
- * @defaults: 5
16
- * */
17
- padding?: number;
18
- dateFormat?: string;
19
- numberFormat?: FormatNumberOptions;
20
- style?: Partial<BaseTextStyle>;
21
- /** For horizontal axes, enable label rotation to prevent overlapping labels.
22
- * If there is enough space, labels are not rotated.
23
- * As the chart gets narrower, it will start rotating the labels -45 degrees. */
24
- autoRotation?: boolean;
25
- /** Rotation of the labels in degrees.
26
- *
27
- * @default: 0
28
- */
29
- rotation?: number;
30
- };
31
- export type ChartKitWidgetAxis = {
32
- categories?: string[];
33
- timestamps?: number[];
34
- type?: ChartKitWidgetAxisType;
35
- /** The axis labels show the number or category for each tick. */
36
- labels?: ChartKitWidgetAxisLabels;
37
- /** The color of the line marking the axis itself. */
38
- lineColor?: string;
39
- title?: {
40
- text?: string;
41
- /** CSS styles for the title */
42
- style?: Partial<BaseTextStyle>;
43
- /** The pixel distance between the axis labels or line and the title.
44
- *
45
- * Defaults to 4 for horizontal axes, 8 for vertical.
46
- * */
47
- margin?: number;
48
- /** Alignment of the title. */
49
- align?: ChartKitWidgetAxisTitleAlignment;
50
- /** Allows limiting of the contents of a title block to the specified number of lines.
51
- * Defaults to 1. */
52
- maxRowCount?: number;
53
- };
54
- /** The minimum value of the axis. If undefined the min value is automatically calculate. */
55
- min?: number;
56
- /** The grid lines settings. */
57
- grid?: {
58
- /** Enable or disable the grid lines.
59
- *
60
- * Defaults to true.
61
- * */
62
- enabled?: boolean;
63
- };
64
- ticks?: {
65
- /** Pixel interval of the tick marks. Not applicable to categorized axis.
66
- * The specified value is only a hint; the interval between ticks can be greater or less depending on the data. */
67
- pixelInterval?: number;
68
- };
69
- /** Padding of the max value relative to the length of the axis.
70
- * A padding of 0.05 will make a 100px axis 5px longer.
71
- *
72
- * Defaults to 0.05 for Y axis and to 0.01 for X axis.
73
- * */
74
- maxPadding?: number;
75
- };
76
- export type ChartKitWidgetXAxis = ChartKitWidgetAxis;
77
- export type ChartKitWidgetYAxis = ChartKitWidgetAxis & {
78
- /** Axis location.
79
- * Possible values - 'left' and 'right'.
80
- * */
81
- position?: 'left' | 'right';
82
- /** Property for splitting charts. Determines which area the axis is located in.
83
- * */
84
- plotIndex?: number;
85
- };
@@ -1 +0,0 @@
1
- export {};
@@ -1,66 +0,0 @@
1
- import { SeriesType } from '../../constants';
2
- import type { BaseSeries, BaseSeriesData } from './base';
3
- import { ChartKitWidgetLegend, RectLegendSymbolOptions } from './legend';
4
- import type { ChartKitWidgetSeriesOptions } from './series';
5
- export type BarXSeriesData<T = any> = BaseSeriesData<T> & {
6
- /**
7
- * The `x` value of the bar. Depending on the context , it may represents:
8
- * - numeric value (for `linear` x axis)
9
- * - timestamp value (for `datetime` x axis)
10
- * - x axis category value (for `category` x axis). If the type is a string, then it is a category value itself. If the type is a number, then it is the index of an element in the array of categories described in `xAxis.categories`
11
- */
12
- x?: string | number;
13
- /**
14
- * The `y` value of the bar. Depending on the context , it may represents:
15
- * - numeric value (for `linear` y axis)
16
- * - timestamp value (for `datetime` y axis)
17
- * - y axis category value (for `category` y axis). If the type is a string, then it is a category value itself. If the type is a number, then it is the index of an element in the array of categories described in `yAxis[0].categories`
18
- */
19
- y?: string | number;
20
- /**
21
- * Corresponding value of axis category.
22
- *
23
- * @deprecated use `x` or `y` instead
24
- */
25
- category?: string;
26
- /** Data label value of the bar-x column. If not specified, the y value is used. */
27
- label?: string | number;
28
- /** Individual opacity for the bar-x column. */
29
- opacity?: number;
30
- };
31
- export type BarXSeries<T = any> = BaseSeries & {
32
- type: typeof SeriesType.BarX;
33
- data: BarXSeriesData<T>[];
34
- /** The name of the series (used in legend, tooltip etc) */
35
- name: string;
36
- /** The main color of the series (hex, rgba) */
37
- color?: string;
38
- /** Whether to stack the values of each series on top of each other.
39
- * Possible values are undefined to disable, "normal" to stack by value or "percent"
40
- *
41
- * @default undefined
42
- * */
43
- stacking?: 'normal' | 'percent';
44
- /** This option allows grouping series in a stacked chart */
45
- stackId?: string;
46
- /** Whether to group non-stacked columns or to let them render independent of each other.
47
- * When false columns will be laid out individually and overlap each other.
48
- *
49
- * @default true
50
- * */
51
- grouping?: boolean;
52
- dataLabels?: BaseSeries['dataLabels'] & ChartKitWidgetSeriesOptions['dataLabels'] & {
53
- /**
54
- * Whether to align the data label inside or outside the box
55
- *
56
- * @default false
57
- * */
58
- inside?: boolean;
59
- };
60
- /** Individual series legend options. Has higher priority than legend options in widget data */
61
- legend?: ChartKitWidgetLegend & {
62
- symbol?: RectLegendSymbolOptions;
63
- };
64
- /** Y-axis index (when using two axes) */
65
- yAxis?: number;
66
- };
@@ -1 +0,0 @@
1
- export {};
@@ -1,59 +0,0 @@
1
- import { SeriesType } from '../../constants';
2
- import type { BaseSeries, BaseSeriesData } from './base';
3
- import { ChartKitWidgetLegend, RectLegendSymbolOptions } from './legend';
4
- import type { ChartKitWidgetSeriesOptions } from './series';
5
- export type BarYSeriesData<T = any> = BaseSeriesData<T> & {
6
- /**
7
- * The `x` value of the bar. Depending on the context , it may represents:
8
- * - numeric value (for `linear` x axis)
9
- * - timestamp value (for `datetime` x axis)
10
- * - x axis category value (for `category` x axis). If the type is a string, then it is a category value itself. If the type is a number, then it is the index of an element in the array of categories described in `xAxis.categories`
11
- */
12
- x?: string | number;
13
- /**
14
- * The `y` value of the bar. Depending on the context , it may represents:
15
- * - numeric value (for `linear` y axis)
16
- * - timestamp value (for `datetime` y axis)
17
- * - y axis category value (for `category` y axis). If the type is a string, then it is a category value itself. If the type is a number, then it is the index of an element in the array of categories described in `yAxis[0].categories`
18
- */
19
- y?: string | number;
20
- /** Data label value of the bar. If not specified, the x value is used. */
21
- label?: string | number;
22
- /** Individual opacity for the bar. */
23
- opacity?: number;
24
- };
25
- export type BarYSeries<T = any> = BaseSeries & {
26
- type: typeof SeriesType.BarY;
27
- data: BarYSeriesData<T>[];
28
- /** The name of the series (used in legend, tooltip etc) */
29
- name: string;
30
- /** The main color of the series (hex, rgba) */
31
- color?: string;
32
- /** Whether to stack the values of each series on top of each other.
33
- * Possible values are undefined to disable, "normal" to stack by value or "percent"
34
- *
35
- * @default undefined
36
- * */
37
- stacking?: 'normal' | 'percent';
38
- /** This option allows grouping series in a stacked chart */
39
- stackId?: string;
40
- /** Whether to group non-stacked columns or to let them render independent of each other.
41
- * When false columns will be laid out individually and overlap each other.
42
- *
43
- * @default true
44
- * */
45
- grouping?: boolean;
46
- dataLabels?: ChartKitWidgetSeriesOptions['dataLabels'] & {
47
- /**
48
- * Whether to align the data label inside or outside the box.
49
- * For charts with a percentage stack, it is always true.
50
- *
51
- * @default false
52
- * */
53
- inside?: boolean;
54
- };
55
- /** Individual series legend options. Has higher priority than legend options in widget data */
56
- legend?: ChartKitWidgetLegend & {
57
- symbol?: RectLegendSymbolOptions;
58
- };
59
- };
@@ -1 +0,0 @@
1
- export {};
@@ -1,47 +0,0 @@
1
- export type BaseSeries = {
2
- /** Initial visibility of the series */
3
- visible?: boolean;
4
- /**
5
- * Options for the series data labels, appearing next to each data point.
6
- * */
7
- dataLabels?: {
8
- /**
9
- * Enable or disable the data labels
10
- * @default true
11
- */
12
- enabled?: boolean;
13
- style?: Partial<BaseTextStyle>;
14
- /**
15
- * @default 5
16
- * */
17
- padding?: number;
18
- /**
19
- * @default false
20
- * */
21
- allowOverlap?: boolean;
22
- /**
23
- * Allows to use any html-tags to display the content.
24
- * The element will be displayed outside the box of the SVG element.
25
- *
26
- * @default false
27
- * */
28
- html?: boolean;
29
- };
30
- /** You can set the cursor to "pointer" if you have click events attached to the series, to signal to the user that the points and lines can be clicked. */
31
- cursor?: string;
32
- };
33
- export type BaseSeriesData<T = any> = {
34
- /**
35
- * A reserved subspace to store options and values for customized functionality
36
- *
37
- * Here you can add additional data for your own event callbacks and formatter callbacks
38
- */
39
- custom?: T;
40
- /** Individual color for the data chunk (point in scatter, segment in pie, bar etc) */
41
- color?: string;
42
- };
43
- export type BaseTextStyle = {
44
- fontSize: string;
45
- fontWeight?: string;
46
- fontColor?: string;
47
- };
@@ -1 +0,0 @@
1
- export {};
@@ -1,15 +0,0 @@
1
- export type ChartMargin = {
2
- top: number;
3
- right: number;
4
- bottom: number;
5
- left: number;
6
- };
7
- export type ChartKitWidgetChart = {
8
- margin?: Partial<ChartMargin>;
9
- events?: {
10
- click?: (data: {
11
- point: unknown;
12
- series: unknown;
13
- }, event: PointerEvent) => void;
14
- };
15
- };
@@ -1 +0,0 @@
1
- export {};
@@ -1,9 +0,0 @@
1
- /** The halo appearing around the hovered part of series(point in line-type series or slice in pie charts) */
2
- export type Halo = {
3
- /** Enable or disable the halo */
4
- enabled?: boolean;
5
- /** The opacity of halo */
6
- opacity?: number;
7
- /** The pixel size of the halo. Radius for point markers or width of the outside slice in pie charts. */
8
- size?: number;
9
- };
@@ -1 +0,0 @@
1
- export {};
@@ -1,39 +0,0 @@
1
- import type { ChartKitWidgetXAxis, ChartKitWidgetYAxis } from './axis';
2
- import type { ChartKitWidgetChart } from './chart';
3
- import type { ChartKitWidgetLegend } from './legend';
4
- import type { ChartKitWidgetSeries, ChartKitWidgetSeriesOptions } from './series';
5
- import type { ChartKitWidgetSplit } from './split';
6
- import type { ChartKitWidgetTitle } from './title';
7
- import type { ChartKitWidgetTooltip } from './tooltip';
8
- export * from './axis';
9
- export * from './base';
10
- export * from './chart';
11
- export * from './legend';
12
- export * from './pie';
13
- export * from './scatter';
14
- export * from './bar-x';
15
- export * from './bar-y';
16
- export * from './area';
17
- export * from './line';
18
- export * from './series';
19
- export * from './split';
20
- export * from './title';
21
- export * from './tooltip';
22
- export * from './halo';
23
- export * from './treemap';
24
- export * from './waterfall';
25
- export type ChartKitWidgetData<T = any> = {
26
- chart?: ChartKitWidgetChart;
27
- legend?: ChartKitWidgetLegend;
28
- series: {
29
- data: ChartKitWidgetSeries<T>[];
30
- options?: ChartKitWidgetSeriesOptions;
31
- };
32
- title?: ChartKitWidgetTitle;
33
- tooltip?: ChartKitWidgetTooltip<T>;
34
- xAxis?: ChartKitWidgetXAxis;
35
- yAxis?: ChartKitWidgetYAxis[];
36
- /** Setting for displaying charts on different plots.
37
- * It can be used to visualize related information on multiple charts. */
38
- split?: ChartKitWidgetSplit;
39
- };
@@ -1,17 +0,0 @@
1
- export * from './axis';
2
- export * from './base';
3
- export * from './chart';
4
- export * from './legend';
5
- export * from './pie';
6
- export * from './scatter';
7
- export * from './bar-x';
8
- export * from './bar-y';
9
- export * from './area';
10
- export * from './line';
11
- export * from './series';
12
- export * from './split';
13
- export * from './title';
14
- export * from './tooltip';
15
- export * from './halo';
16
- export * from './treemap';
17
- export * from './waterfall';
@@ -1,92 +0,0 @@
1
- import type { BaseTextStyle } from './base';
2
- export type ChartKitWidgetLegend = {
3
- enabled?: boolean;
4
- /**
5
- * Different types for different color schemes.
6
- * If the color scheme is continuous, a gradient legend will be drawn.
7
- * Otherwise, samples for different point values
8
- *
9
- * @default 'discrete'
10
- */
11
- type?: 'discrete' | 'continuous';
12
- /**
13
- * The horizontal alignment of the legend box within the chart area.
14
- *
15
- * @default center
16
- * */
17
- align?: 'left' | 'center' | 'right';
18
- /**
19
- * Defines the pixel distance between each legend item
20
- *
21
- * @default 20
22
- * */
23
- itemDistance?: number;
24
- /** CSS styles for each legend item */
25
- itemStyle?: BaseTextStyle;
26
- /**
27
- * The space between the legend and the axis labels or chart area.
28
- *
29
- * @default 15
30
- */
31
- margin?: number;
32
- title?: {
33
- text?: string;
34
- /** CSS styles for the title */
35
- style?: Partial<BaseTextStyle>;
36
- /** The distance(in pixels) between the main content of the legend and its title
37
- *
38
- * Defaults to 4 for horizontal axes, 8 for vertical.
39
- * */
40
- margin?: number;
41
- };
42
- colorScale?: {
43
- stops?: number[];
44
- colors: string[];
45
- domain?: number[];
46
- };
47
- width?: number;
48
- };
49
- export type BaseLegendSymbol = {
50
- /**
51
- * The pixel padding between the legend item symbol and the legend item text.
52
- *
53
- * @default 5
54
- * */
55
- padding?: number;
56
- };
57
- export type RectLegendSymbolOptions = BaseLegendSymbol & {
58
- /**
59
- * The pixel width of the symbol for series types that use a rectangle in the legend
60
- *
61
- * @default 10
62
- * */
63
- width?: number;
64
- /**
65
- * The pixel width of the symbol for series types that use a rectangle in the legend
66
- *
67
- * @default 10
68
- * */
69
- height?: number;
70
- /**
71
- * The border radius of the symbol for series types that use a rectangle in the legend.
72
- *
73
- * Defaults to half the symbolHeight, effectively creating a circle.
74
- */
75
- radius?: number;
76
- };
77
- export type PathLegendSymbolOptions = BaseLegendSymbol & {
78
- /**
79
- * The pixel width of the symbol for series types that use a path in the legend
80
- *
81
- * @default 16
82
- * */
83
- width?: number;
84
- };
85
- export type SymbolLegendSymbolOptions = BaseLegendSymbol & {
86
- /**
87
- * The pixel width of the symbol for series types that use a symbol in the legend
88
- *
89
- * @default 8
90
- * */
91
- width?: number;
92
- };
@@ -1 +0,0 @@
1
- export {};
@@ -1,56 +0,0 @@
1
- import { DashStyle, LineCap, SeriesType } from '../../constants';
2
- import type { BaseSeries, BaseSeriesData } from './base';
3
- import type { ChartKitWidgetLegend, RectLegendSymbolOptions } from './legend';
4
- import type { PointMarkerOptions } from './marker';
5
- export type LineSeriesData<T = any> = BaseSeriesData<T> & {
6
- /**
7
- * The `x` value of the point. Depending on the context , it may represents:
8
- * - numeric value (for `linear` x axis)
9
- * - timestamp value (for `datetime` x axis)
10
- * - x axis category value (for `category` x axis). If the type is a string, then it is a category value itself. If the type is a number, then it is the index of an element in the array of categories described in `xAxis.categories`
11
- */
12
- x?: string | number;
13
- /**
14
- * The `y` value of the point. Depending on the context , it may represents:
15
- * - numeric value (for `linear` y axis)
16
- * - timestamp value (for `datetime` y axis)
17
- * - y axis category value (for `category` y axis). If the type is a string, then it is a category value itself. If the type is a number, then it is the index of an element in the array of categories described in `yAxis[0].categories`
18
- */
19
- y?: string | number;
20
- /** Data label value of the point. If not specified, the y value is used. */
21
- label?: string | number;
22
- marker?: {
23
- states?: {
24
- normal?: {
25
- enabled: boolean;
26
- };
27
- };
28
- };
29
- };
30
- export type LineSeries<T = any> = BaseSeries & {
31
- type: typeof SeriesType.Line;
32
- data: LineSeriesData<T>[];
33
- /** The name of the series (used in legend, tooltip etc) */
34
- name: string;
35
- /** The main color of the series (hex, rgba) */
36
- color?: string;
37
- /** Pixel width of the graph line.
38
- *
39
- * @default 1
40
- * */
41
- lineWidth?: number;
42
- /** Individual series legend options. Has higher priority than legend options in widget data */
43
- legend?: ChartKitWidgetLegend & {
44
- symbol?: RectLegendSymbolOptions;
45
- };
46
- /** Options for the point markers of line series */
47
- marker?: PointMarkerOptions;
48
- /** Option for line stroke style */
49
- dashStyle?: `${DashStyle}`;
50
- /** Option for line cap style */
51
- linecap?: `${LineCap}`;
52
- /** Individual opacity for the line. */
53
- opacity?: number;
54
- /** Y-axis index (when using two axes) */
55
- yAxis?: number;
56
- };
@@ -1 +0,0 @@
1
- export {};
@@ -1,12 +0,0 @@
1
- import { SymbolType } from '../../constants';
2
- export type PointMarkerOptions = {
3
- /** Enable or disable the point marker */
4
- enabled?: boolean;
5
- /** The radius of the point marker */
6
- radius?: number;
7
- /** The color of the point marker's border */
8
- borderColor?: string;
9
- /** The width of the point marker's border */
10
- borderWidth?: number;
11
- symbol?: `${SymbolType}`;
12
- };
@@ -1 +0,0 @@
1
- export {};
@@ -1,87 +0,0 @@
1
- import type { BaseType } from 'd3';
2
- import { SeriesType } from '../../constants';
3
- import type { BaseSeries, BaseSeriesData } from './base';
4
- import { ChartKitWidgetLegend, RectLegendSymbolOptions } from './legend';
5
- export type PieSeriesData<T = any> = BaseSeriesData<T> & {
6
- /** The value of the pie segment. */
7
- value: number;
8
- /** The name of the pie segment (used in legend, tooltip etc). */
9
- name: string;
10
- /** Initial visibility of the pie segment. */
11
- visible?: boolean;
12
- /** Initial data label of the pie segment. If not specified, the value is used. */
13
- label?: string;
14
- /** Individual opacity for the pie segment. */
15
- opacity?: number;
16
- };
17
- export type ConnectorShape = 'straight-line' | 'polyline';
18
- export type ConnectorCurve = 'linear' | 'basic';
19
- export type PieSeries<T = any> = BaseSeries & {
20
- type: typeof SeriesType.Pie;
21
- data: PieSeriesData<T>[];
22
- /**
23
- * The color of the border surrounding each segment.
24
- * @default `--g-color-base-background` from @gravity-ui/uikit.
25
- */
26
- borderColor?: string;
27
- /**
28
- * The width of the border surrounding each segment.
29
- * @default '1px'
30
- */
31
- borderWidth?: number;
32
- /**
33
- * The corner radius of the border surrounding each segment.
34
- * @default 0
35
- */
36
- borderRadius?: number;
37
- /** The center of the pie chart relative to the chart area. */
38
- center?: [string | number | null, string | number | null];
39
- /**
40
- * The inner radius of the pie.
41
- * @default 0
42
- */
43
- innerRadius?: string | number;
44
- /** The radius of the pie relative to the chart area. The default behaviour is to scale to the chart area. */
45
- radius?: string | number;
46
- /** Individual series legend options. Has higher priority than legend options in widget data */
47
- legend?: ChartKitWidgetLegend & {
48
- symbol?: RectLegendSymbolOptions;
49
- };
50
- dataLabels?: BaseSeries['dataLabels'] & {
51
- /**
52
- * The distance of the data label from the pie's edge.
53
- *
54
- * @default 30
55
- * */
56
- distance?: number;
57
- /**
58
- * The distance from the data label to the connector.
59
- *
60
- * @default 5
61
- * */
62
- connectorPadding?: number;
63
- /**
64
- * The method that is used to generate the connector path.
65
- *
66
- * @default 'polyline'
67
- * */
68
- connectorShape?: ConnectorShape;
69
- /**
70
- * How to interpolate between two-dimensional [x, y] points for a connector.
71
- * Works only if connectorShape equals to 'polyline'
72
- *
73
- * @default 'basic'
74
- * */
75
- connectorCurve?: ConnectorCurve;
76
- };
77
- /**
78
- * Function for adding custom svg nodes for a series
79
- *
80
- * @return BaseType
81
- * */
82
- renderCustomShape?: (args: {
83
- series: {
84
- innerRadius: number;
85
- };
86
- }) => BaseType;
87
- };
@@ -1 +0,0 @@
1
- export {};
@@ -1,45 +0,0 @@
1
- import { SeriesType, SymbolType } from '../../constants';
2
- import type { BaseSeries, BaseSeriesData } from './base';
3
- import type { ChartKitWidgetLegend, RectLegendSymbolOptions } from './legend';
4
- export type ScatterSeriesData<T = any> = BaseSeriesData<T> & {
5
- /**
6
- * The `x` value of the point. Depending on the context , it may represents:
7
- * - numeric value (for `linear` x axis)
8
- * - timestamp value (for `datetime` x axis)
9
- * - x axis category value (for `category` x axis). If the type is a string, then it is a category value itself. If the type is a number, then it is the index of an element in the array of categories described in `xAxis.categories`
10
- */
11
- x?: string | number;
12
- /**
13
- * The `y` value of the point. Depending on the context , it may represents:
14
- * - numeric value (for `linear` y axis)
15
- * - timestamp value (for `datetime` y axis)
16
- * - y axis category value (for `category` y axis). If the type is a string, then it is a category value itself. If the type is a number, then it is the index of an element in the array of categories described in `yAxis[0].categories`
17
- */
18
- y?: string | number;
19
- /**
20
- * Corresponding value of axis category.
21
- *
22
- * @deprecated use `x` or `y` instead
23
- */
24
- category?: string;
25
- /** Individual radius for the point. */
26
- radius?: number;
27
- /** Individual opacity for the point. */
28
- opacity?: number;
29
- };
30
- export type ScatterSeries<T = any> = BaseSeries & {
31
- type: typeof SeriesType.Scatter;
32
- data: ScatterSeriesData<T>[];
33
- /** The name of the series (used in legend, tooltip etc) */
34
- name: string;
35
- /** The main color of the series (hex, rgba) */
36
- color?: string;
37
- /** A predefined shape or symbol for the dot */
38
- symbolType?: `${SymbolType}`;
39
- /** Individual series legend options. Has higher priority than legend options in widget data */
40
- legend?: ChartKitWidgetLegend & {
41
- symbol?: RectLegendSymbolOptions;
42
- };
43
- /** Y-axis index (when using two axes) */
44
- yAxis?: number;
45
- };
@@ -1 +0,0 @@
1
- export {};
@@ -1,225 +0,0 @@
1
- import React from 'react';
2
- import { DashStyle, LineCap } from '../../constants';
3
- import type { AreaSeries, AreaSeriesData } from './area';
4
- import type { BarXSeries, BarXSeriesData } from './bar-x';
5
- import type { BarYSeries, BarYSeriesData } from './bar-y';
6
- import type { Halo } from './halo';
7
- import type { LineSeries, LineSeriesData } from './line';
8
- import type { PointMarkerOptions } from './marker';
9
- import type { PieSeries, PieSeriesData } from './pie';
10
- import type { ScatterSeries, ScatterSeriesData } from './scatter';
11
- import type { TreemapSeries, TreemapSeriesData } from './treemap';
12
- import type { WaterfallSeries, WaterfallSeriesData } from './waterfall';
13
- export type ChartKitWidgetSeries<T = any> = ScatterSeries<T> | PieSeries<T> | BarXSeries<T> | BarYSeries<T> | LineSeries<T> | AreaSeries<T> | TreemapSeries<T> | WaterfallSeries<T>;
14
- export type ChartKitWidgetSeriesData<T = any> = ScatterSeriesData<T> | PieSeriesData<T> | BarXSeriesData<T> | BarYSeriesData<T> | LineSeriesData<T> | AreaSeriesData<T> | TreemapSeriesData<T> | WaterfallSeriesData<T>;
15
- export type DataLabelRendererData<T = any> = {
16
- data: ChartKitWidgetSeriesData<T>;
17
- };
18
- type BasicHoverState = {
19
- /**
20
- * Enable separate styles for the hovered series.
21
- *
22
- * @default true
23
- * */
24
- enabled?: boolean;
25
- /**
26
- * How much to brighten/darken the point on hover. Use positive to brighten, negative to darken.
27
- * The behavior of this property is dependent on the implementing color space ([more details](https://d3js.org/d3-color#color_brighter)).
28
- * For example in case of using rgb color you can use floating point number from `-5.0` to `5.0`.
29
- * Rgb color space is used by default.
30
- *
31
- * @default 0.3
32
- */
33
- brightness?: number;
34
- };
35
- export type BasicInactiveState = {
36
- /**
37
- * Enable separate styles for the inactive series.
38
- *
39
- * @default true
40
- * */
41
- enabled?: boolean;
42
- /**
43
- * Opacity of series elements (bars, data labels)
44
- *
45
- * @default 0.5
46
- * */
47
- opacity?: number;
48
- };
49
- export type ChartKitWidgetSeriesOptions = {
50
- /** Individual data label for each point. */
51
- dataLabels?: {
52
- /** Enable or disable the data labels */
53
- enabled?: boolean;
54
- /** Callback function to render the data label */
55
- renderer?: (args: DataLabelRendererData) => React.SVGTextElementAttributes<SVGTextElement>;
56
- };
57
- 'bar-x'?: {
58
- /** The maximum allowed pixel width for a column.
59
- * This prevents the columns from becoming too wide when there is a small number of points in the chart.
60
- *
61
- * @default 50
62
- */
63
- barMaxWidth?: number;
64
- /** Padding between each column or bar, in x axis units.
65
- *
66
- * @default 0.1
67
- * */
68
- barPadding?: number;
69
- /** Padding between each value groups, in x axis units
70
- *
71
- * @default 0.2
72
- */
73
- groupPadding?: number;
74
- dataSorting?: {
75
- /** Determines what data value should be used to sort by.
76
- * Possible values are undefined to disable, "name" to sort by series name or "y"
77
- *
78
- * @default undefined
79
- * */
80
- key?: 'name' | 'y' | undefined;
81
- /** Sorting direction.
82
- *
83
- * @default 'asc'
84
- * */
85
- direction?: 'asc' | 'desc';
86
- };
87
- /** Options for the series states that provide additional styling information to the series. */
88
- states?: {
89
- hover?: BasicHoverState;
90
- inactive?: BasicInactiveState;
91
- };
92
- };
93
- 'bar-y'?: {
94
- /** The maximum allowed pixel width for a column.
95
- * This prevents the columns from becoming too wide when there is a small number of points in the chart.
96
- *
97
- * @default 50
98
- */
99
- barMaxWidth?: number;
100
- /** Padding between each column or bar, in x axis units.
101
- *
102
- * @default 0.1
103
- * */
104
- barPadding?: number;
105
- /** Padding between each value groups, in x axis units
106
- *
107
- * @default 0.2
108
- */
109
- groupPadding?: number;
110
- dataSorting?: {
111
- /** Determines what data value should be used to sort by.
112
- * Possible values are undefined to disable, "name" to sort by series name or "x"
113
- *
114
- * @default undefined
115
- * */
116
- key?: 'name' | 'x' | undefined;
117
- /** Sorting direction.
118
- *
119
- * @default 'asc'
120
- * */
121
- direction?: 'asc' | 'desc';
122
- };
123
- /** Options for the series states that provide additional styling information to the series. */
124
- states?: {
125
- hover?: BasicHoverState;
126
- inactive?: BasicInactiveState;
127
- };
128
- };
129
- pie?: {
130
- /** Options for the series states that provide additional styling information to the series. */
131
- states?: {
132
- hover?: BasicHoverState & {
133
- /** Options for the halo appearing outside the hovered slice */
134
- halo?: Halo;
135
- };
136
- inactive?: BasicInactiveState;
137
- };
138
- };
139
- scatter?: {
140
- /** Options for the series states that provide additional styling information to the series. */
141
- states?: {
142
- hover?: BasicHoverState & {
143
- marker?: PointMarkerOptions & {
144
- /** Options for the halo appearing around the hovered point */
145
- halo?: Halo;
146
- };
147
- };
148
- inactive?: BasicInactiveState;
149
- };
150
- };
151
- line?: {
152
- /** Pixel width of the graph line.
153
- *
154
- * @default 1
155
- * */
156
- lineWidth?: number;
157
- /** Options for the series states that provide additional styling information to the series. */
158
- states?: {
159
- hover?: BasicHoverState & {
160
- marker?: PointMarkerOptions & {
161
- /** Options for the halo appearing around the hovered point */
162
- halo?: Halo;
163
- };
164
- };
165
- inactive?: BasicInactiveState;
166
- };
167
- /** Options for the point markers of line series */
168
- marker?: PointMarkerOptions;
169
- /** Options for line style
170
- *
171
- * @default 'Solid'
172
- * */
173
- dashStyle?: `${DashStyle}`;
174
- /** Options for line cap style
175
- *
176
- * @default 'round' when dashStyle is not 'solid', 'none' when dashStyle is not 'solid'
177
- * */
178
- linecap?: `${LineCap}`;
179
- };
180
- area?: {
181
- /** Pixel width of the graph line.
182
- *
183
- * @default 1
184
- * */
185
- lineWidth?: number;
186
- /** Options for the series states that provide additional styling information to the series. */
187
- states?: {
188
- hover?: BasicHoverState & {
189
- marker?: PointMarkerOptions & {
190
- /** Options for the halo appearing around the hovered point */
191
- halo?: Halo;
192
- };
193
- };
194
- inactive?: BasicInactiveState;
195
- };
196
- /** Options for the point markers of line series */
197
- marker?: PointMarkerOptions;
198
- };
199
- treemap?: {
200
- /** Options for the series states that provide additional styling information to the series. */
201
- states?: {
202
- hover?: BasicHoverState;
203
- inactive?: BasicInactiveState;
204
- };
205
- };
206
- waterfall?: {
207
- /** The maximum allowed pixel width for a column.
208
- * This prevents the columns from becoming too wide when there is a small number of points in the chart.
209
- *
210
- * @default 50
211
- */
212
- barMaxWidth?: number;
213
- /** Padding between each column or bar, in x axis units.
214
- *
215
- * @default 0.1
216
- * */
217
- barPadding?: number;
218
- /** Options for the series states that provide additional styling information to the series. */
219
- states?: {
220
- hover?: BasicHoverState;
221
- inactive?: BasicInactiveState;
222
- };
223
- };
224
- };
225
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1,13 +0,0 @@
1
- import type { BaseTextStyle } from './base';
2
- export type SplitPlotOptions = {
3
- title?: {
4
- text: string;
5
- style?: Partial<BaseTextStyle>;
6
- };
7
- };
8
- export type ChartKitWidgetSplit = {
9
- enable: boolean;
10
- layout?: 'vertical';
11
- gap?: string | number;
12
- plots?: SplitPlotOptions[];
13
- };
@@ -1 +0,0 @@
1
- export {};
@@ -1,5 +0,0 @@
1
- import type { BaseTextStyle } from './base';
2
- export type ChartKitWidgetTitle = {
3
- text: string;
4
- style?: Partial<BaseTextStyle>;
5
- };
@@ -1 +0,0 @@
1
- export {};
@@ -1,67 +0,0 @@
1
- /// <reference types="react" />
2
- import type { AreaSeries, AreaSeriesData } from './area';
3
- import type { BarXSeries, BarXSeriesData } from './bar-x';
4
- import type { BarYSeries, BarYSeriesData } from './bar-y';
5
- import type { LineSeries, LineSeriesData } from './line';
6
- import type { PieSeries, PieSeriesData } from './pie';
7
- import type { ScatterSeries, ScatterSeriesData } from './scatter';
8
- import type { TreemapSeries, TreemapSeriesData } from './treemap';
9
- import type { WaterfallSeries, WaterfallSeriesData } from './waterfall';
10
- export type TooltipDataChunkBarX<T = any> = {
11
- data: BarXSeriesData<T>;
12
- series: BarXSeries<T>;
13
- };
14
- export type TooltipDataChunkBarY<T = any> = {
15
- data: BarYSeriesData<T>;
16
- series: BarYSeries<T>;
17
- };
18
- export type TooltipDataChunkPie<T = any> = {
19
- data: PieSeriesData<T>;
20
- series: {
21
- type: PieSeries['type'];
22
- id: string;
23
- name: string;
24
- };
25
- };
26
- export type TooltipDataChunkScatter<T = any> = {
27
- data: ScatterSeriesData<T>;
28
- series: {
29
- type: ScatterSeries['type'];
30
- id: string;
31
- name: string;
32
- };
33
- };
34
- export type TooltipDataChunkLine<T = any> = {
35
- data: LineSeriesData<T>;
36
- series: {
37
- type: LineSeries['type'];
38
- id: string;
39
- name: string;
40
- };
41
- };
42
- export type TooltipDataChunkArea<T = any> = {
43
- data: AreaSeriesData<T>;
44
- series: {
45
- type: AreaSeries['type'];
46
- id: string;
47
- name: string;
48
- };
49
- };
50
- export type TooltipDataChunkTreemap<T = any> = {
51
- data: TreemapSeriesData<T>;
52
- series: TreemapSeries<T>;
53
- };
54
- export type TooltipDataChunkWaterfall<T = any> = {
55
- data: WaterfallSeriesData<T>;
56
- series: WaterfallSeries<T>;
57
- };
58
- export type TooltipDataChunk<T = any> = (TooltipDataChunkBarX<T> | TooltipDataChunkBarY<T> | TooltipDataChunkPie<T> | TooltipDataChunkScatter<T> | TooltipDataChunkLine<T> | TooltipDataChunkArea<T> | TooltipDataChunkTreemap<T> | TooltipDataChunkWaterfall<T>) & {
59
- closest?: boolean;
60
- };
61
- export type ChartKitWidgetTooltip<T = any> = {
62
- enabled?: boolean;
63
- /** Specifies the renderer for the tooltip. If returned null default tooltip renderer will be used. */
64
- renderer?: (args: {
65
- hovered: TooltipDataChunk<T>[];
66
- }) => React.ReactElement | null;
67
- };
@@ -1 +0,0 @@
1
- export {};
@@ -1,45 +0,0 @@
1
- import { LayoutAlgorithm, SeriesType } from '../../constants';
2
- import type { BaseSeries, BaseSeriesData } from './base';
3
- import { ChartKitWidgetLegend, RectLegendSymbolOptions } from './legend';
4
- export type TreemapSeriesData<T = any> = BaseSeriesData<T> & {
5
- /** The name of the node (used in legend, tooltip etc). */
6
- name: string | string[];
7
- /** The value of the node. All nodes should have this property except nodes that have children. */
8
- value?: number;
9
- /** An id for the node. Used to group children. */
10
- id?: string;
11
- /**
12
- * Parent id. Used to build a tree structure. The value should be the id of the node which is the parent.
13
- * If no nodes has a matching id, or this option is undefined, then the parent will be set to the root.
14
- */
15
- parentId?: string;
16
- };
17
- export type TreemapSeries<T = any> = BaseSeries & {
18
- type: typeof SeriesType.Treemap;
19
- data: TreemapSeriesData<T>[];
20
- /** The name of the series (used in legend, tooltip etc). */
21
- name: string;
22
- /** The main color of the series (hex, rgba). */
23
- color?: string;
24
- /** Individual series legend options. Has higher priority than legend options in widget data. */
25
- legend?: ChartKitWidgetLegend & {
26
- symbol?: RectLegendSymbolOptions;
27
- };
28
- /** Set options on specific levels. Takes precedence over series options, but not point options. */
29
- levels?: {
30
- /** Decides which level takes effect from the options set in the levels object. */
31
- index: number;
32
- /** Can set the padding between all points which lies on the same level. */
33
- padding?: number;
34
- /** Can set a color on all points which lies on the same level. */
35
- color?: string;
36
- }[];
37
- layoutAlgorithm?: `${LayoutAlgorithm}`;
38
- /**
39
- * Options for the series data labels, appearing next to each data point.
40
- * */
41
- dataLabels?: BaseSeries['dataLabels'] & {
42
- /** Horizontal alignment of the data label inside the tile. */
43
- align?: 'left' | 'center' | 'right';
44
- };
45
- };
@@ -1 +0,0 @@
1
- export {};
@@ -1,39 +0,0 @@
1
- import { SeriesType } from '../../constants';
2
- import type { BaseSeries, BaseSeriesData } from './base';
3
- import { ChartKitWidgetLegend, RectLegendSymbolOptions } from './legend';
4
- export type WaterfallSeriesData<T = any> = BaseSeriesData<T> & {
5
- /**
6
- * The `x` value. Depending on the context , it may represents:
7
- * - numeric value (for `linear` x axis)
8
- * - timestamp value (for `datetime` x axis)
9
- * - x axis category value (for `category` x axis). If the type is a string, then it is a category value itself. If the type is a number, then it is the index of an element in the array of categories described in `xAxis.categories`
10
- */
11
- x?: string | number;
12
- /**
13
- * The `y` value. Depending on the context , it may represents:
14
- * - numeric value (for `linear` y axis)
15
- */
16
- y?: number;
17
- /** Data label value of the point. If not specified, the y value is used. */
18
- label?: string | number;
19
- /** Individual opacity for the point. */
20
- opacity?: number;
21
- /** When this property is true, the point display the total sum across the entire series. */
22
- total?: boolean;
23
- };
24
- export type WaterfallSeries<T = any> = BaseSeries & {
25
- type: typeof SeriesType.Waterfall;
26
- data: WaterfallSeriesData<T>[];
27
- /** The name of the series (used in legend, tooltip etc). */
28
- name: string;
29
- /** The main color of the series (hex, rgba). */
30
- color?: string;
31
- /** The color used for positive values. If it is not specified, the general color of the series is used. */
32
- positiveColor?: string;
33
- /** The color used for negative values. If it is not specified, the general color of the series is used. */
34
- negativeColor?: string;
35
- /** Individual series legend options. Has higher priority than legend options in widget data. */
36
- legend?: ChartKitWidgetLegend & {
37
- symbol?: RectLegendSymbolOptions;
38
- };
39
- };
@@ -1 +0,0 @@
1
- export {};