@advt-gpt-chart/package 0.0.11 → 0.0.23

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 (118) hide show
  1. package/dist/Chart/ChartBase/constants.d.ts +101 -0
  2. package/dist/{VChartBase → Chart/ChartBase}/transformed.d.ts +1 -1
  3. package/dist/{VChartBase → Chart/ChartBase}/types.d.ts +5 -1
  4. package/dist/{ChartCodeRender → Chart/ChartCodeRender}/index.d.ts +1 -0
  5. package/dist/{ChartCodeRender → Chart/ChartCodeRender}/type.d.ts +16 -5
  6. package/dist/Chart/ChartCodeRender/visChart/ChartStoreContext.d.ts +18 -0
  7. package/dist/Chart/ChartCodeRender/visChart/VisChart.d.ts +3 -0
  8. package/dist/Chart/ChartCodeRender/visChart/style.d.ts +2 -0
  9. package/dist/Chart/ChartCodeRender/visChart/types.d.ts +16 -0
  10. package/dist/Chart/ChartControllers/Filter/FilterController.d.ts +9 -0
  11. package/dist/Chart/ChartControllers/Filter/FilterModal.d.ts +8 -0
  12. package/dist/Chart/ChartControllers/Filter/FiltersController.d.ts +7 -0
  13. package/dist/Chart/ChartControllers/Filter/styles.d.ts +6 -0
  14. package/dist/Chart/ChartControllers/Filter/types.d.ts +16 -0
  15. package/dist/Chart/ChartControllers/Filter/utils.d.ts +33 -0
  16. package/dist/Chart/ChartControllers/TimeRange/AdvancedContent.d.ts +7 -0
  17. package/dist/Chart/ChartControllers/TimeRange/CustomContent.d.ts +7 -0
  18. package/dist/Chart/ChartControllers/TimeRange/TimeRangePopover.d.ts +9 -0
  19. package/dist/Chart/ChartControllers/TimeRange/index.d.ts +7 -0
  20. package/dist/Chart/ChartControllers/TimeRange/styles.d.ts +12 -0
  21. package/dist/Chart/ChartControllers/TimeRange/types.d.ts +55 -0
  22. package/dist/Chart/ChartControllers/TimeRange/utils.d.ts +77 -0
  23. package/dist/Chart/ChartControllers/index.d.ts +15 -0
  24. package/dist/Chart/ChartControllers/style.d.ts +3 -0
  25. package/dist/Chart/ChartControllers/utils.d.ts +12 -0
  26. package/dist/Chart/ChartEvents/ChartContextMenu/ChartContextMenu.d.ts +10 -0
  27. package/dist/Chart/ChartEvents/ChartContextMenu/styles.d.ts +1 -0
  28. package/dist/Chart/ChartEvents/ChartContextMenu/utils.d.ts +5 -0
  29. package/dist/Chart/ChartEvents/DrillBy/DrillByChart.d.ts +7 -0
  30. package/dist/Chart/ChartEvents/DrillBy/styles.d.ts +1 -0
  31. package/dist/Chart/ChartWrapper/ChartHeader.d.ts +5 -0
  32. package/dist/Chart/ChartWrapper/ChartWrapper.d.ts +9 -0
  33. package/dist/Chart/ChartWrapper/style.d.ts +9 -0
  34. package/dist/Chart/ChartWrapper/utils.d.ts +22 -0
  35. package/dist/Chart/DataSource/index.d.ts +9 -0
  36. package/dist/Chart/DataSource/metricInsight.d.ts +10 -0
  37. package/dist/Chart/DataSource/simpleJson.d.ts +0 -0
  38. package/dist/Chart/DataSource/types.d.ts +24 -0
  39. package/dist/Chart/DataSource/useChartDataQuery.d.ts +15 -0
  40. package/dist/Chart/Dataset/types.d.ts +7 -0
  41. package/dist/{Area → Charts/Area}/types.d.ts +1 -1
  42. package/dist/{Bar → Charts/Bar}/types.d.ts +1 -1
  43. package/dist/{Donut → Charts/Donut}/types.d.ts +1 -1
  44. package/dist/{Funnel → Charts/Funnel}/types.d.ts +1 -1
  45. package/dist/{Gauge → Charts/Gauge}/types.d.ts +1 -1
  46. package/dist/{Heatmap → Charts/Heatmap}/types.d.ts +1 -1
  47. package/dist/{Indicator → Charts/Indicator}/types.d.ts +2 -2
  48. package/dist/{Line → Charts/Line}/types.d.ts +1 -1
  49. package/dist/{Pie → Charts/Pie}/types.d.ts +1 -1
  50. package/dist/{Radar → Charts/Radar}/types.d.ts +1 -1
  51. package/dist/{Radar → Charts/Radar}/utils.d.ts +1 -1
  52. package/dist/{Rank → Charts/Rank}/types.d.ts +1 -1
  53. package/dist/{Scatter → Charts/Scatter}/types.d.ts +1 -1
  54. package/dist/{Table → Charts/Table}/types.d.ts +4 -2
  55. package/dist/ConfigProvider/hooks/useConfig.d.ts +14 -11
  56. package/dist/GPTVis/Lite.d.ts +4 -0
  57. package/dist/GPTVis/hooks/useContext.d.ts +1 -0
  58. package/dist/GPTVis/hooks/useStore.d.ts +43 -0
  59. package/dist/components/ErrorMessage.d.ts +7 -0
  60. package/dist/components/FormatOptions.d.ts +1 -0
  61. package/dist/components/Loading.d.ts +5 -0
  62. package/dist/components/VButton.d.ts +5 -0
  63. package/dist/components/VCalendar.d.ts +6 -0
  64. package/dist/components/VSelect.d.ts +5 -0
  65. package/dist/components/VTimePicker.d.ts +5 -0
  66. package/dist/export.d.ts +26 -26
  67. package/dist/index.d.ts +2 -2
  68. package/dist/index.es.js +176125 -109719
  69. package/dist/index.es.js.gz +0 -0
  70. package/dist/index.umd.js +10206 -210
  71. package/dist/index.umd.js.gz +0 -0
  72. package/dist/locale/antdLocale.d.ts +5 -0
  73. package/dist/locale/dayjsLocale.d.ts +2 -0
  74. package/dist/locale/en-US.d.ts +95 -0
  75. package/dist/locale/index.d.ts +7 -0
  76. package/dist/locale/utils.d.ts +7 -0
  77. package/dist/locale/zh-CN.d.ts +95 -0
  78. package/dist/locale/zh-TW.d.ts +91 -0
  79. package/dist/services/constants.d.ts +2 -0
  80. package/dist/services/index.d.ts +74 -0
  81. package/dist/services/types.d.ts +14 -0
  82. package/dist/theme/antdTheme.d.ts +15 -0
  83. package/dist/types/chart.d.ts +50 -1
  84. package/dist/types/config.d.ts +1 -0
  85. package/dist/types/index.d.ts +2 -2
  86. package/dist/utils/data.d.ts +17 -0
  87. package/dist/utils/date.d.ts +13 -1
  88. package/dist/utils/downloadAsImage.d.ts +11 -0
  89. package/dist/utils/index.d.ts +2 -0
  90. package/dist/utils/useTools.d.ts +6 -0
  91. package/dist/version.d.ts +1 -1
  92. package/package.json +17 -7
  93. package/dist/ChartCodeRender/Loading.d.ts +0 -2
  94. package/dist/ChartCodeRender/VisChart.d.ts +0 -11
  95. package/dist/ChartContainer/chartContextProvider.d.ts +0 -10
  96. package/dist/ChartContainer/index.d.ts +0 -9
  97. package/dist/ChartContainer/style.d.ts +0 -5
  98. package/dist/VChartBase/constants.d.ts +0 -54
  99. /package/dist/{VChartBase → Chart/ChartBase}/index.d.ts +0 -0
  100. /package/dist/{VChartBase → Chart/ChartBase}/tooltip.d.ts +0 -0
  101. /package/dist/{VChartBase → Chart/ChartBase}/utils.d.ts +0 -0
  102. /package/dist/{Area → Charts/Area}/index.d.ts +0 -0
  103. /package/dist/{Bar → Charts/Bar}/index.d.ts +0 -0
  104. /package/dist/{Donut → Charts/Donut}/index.d.ts +0 -0
  105. /package/dist/{Funnel → Charts/Funnel}/index.d.ts +0 -0
  106. /package/dist/{Gauge → Charts/Gauge}/index.d.ts +0 -0
  107. /package/dist/{Heatmap → Charts/Heatmap}/index.d.ts +0 -0
  108. /package/dist/{Indicator → Charts/Indicator}/contants.d.ts +0 -0
  109. /package/dist/{Indicator → Charts/Indicator}/index.d.ts +0 -0
  110. /package/dist/{Indicator → Charts/Indicator}/styles.d.ts +0 -0
  111. /package/dist/{Line → Charts/Line}/index.d.ts +0 -0
  112. /package/dist/{Pie → Charts/Pie}/index.d.ts +0 -0
  113. /package/dist/{Radar → Charts/Radar}/index.d.ts +0 -0
  114. /package/dist/{Rank → Charts/Rank}/index.d.ts +0 -0
  115. /package/dist/{Scatter → Charts/Scatter}/index.d.ts +0 -0
  116. /package/dist/{Table → Charts/Table}/index.d.ts +0 -0
  117. /package/dist/{Table → Charts/Table}/theme.d.ts +0 -0
  118. /package/dist/{constants → theme}/light.d.ts +0 -0
@@ -0,0 +1,101 @@
1
+ import { ICartesianAxisSpec, InterpolateType } from '@visactor/vchart';
2
+ import { AxesType } from './utils';
3
+ type CartesianOptions = {
4
+ xField: string;
5
+ yField: string;
6
+ };
7
+ type CartesianTooltipOptions = CartesianOptions & {
8
+ seriesField?: string;
9
+ };
10
+ type PolarTooltipOptions = {
11
+ categoryField: string;
12
+ valueField: string;
13
+ seriesField?: string;
14
+ showPercent?: boolean;
15
+ categoryFieldType?: AxesType;
16
+ };
17
+ export declare const getPolarLegendSpec: (seriesField: string | boolean | undefined, categoryField: string) => {
18
+ visible: boolean;
19
+ item: {
20
+ label: {
21
+ formatMethod: (val: any) => any;
22
+ };
23
+ };
24
+ };
25
+ export declare const getCartesianLegend: (xField?: string, seriesField?: string | boolean) => any;
26
+ export declare const getPolarTooltipSpec: ({ categoryField, valueField, seriesField, showPercent, }: PolarTooltipOptions) => {
27
+ mark: {
28
+ title: {
29
+ value: (datum: any) => any;
30
+ };
31
+ content: {
32
+ key: () => string;
33
+ value: (datum: any) => any;
34
+ } | undefined;
35
+ };
36
+ dimension: {
37
+ title: {
38
+ value: (datum: any) => any;
39
+ };
40
+ content: {
41
+ key: () => string;
42
+ value: (datum: any) => any;
43
+ } | undefined;
44
+ };
45
+ };
46
+ export declare const getDefaultTooltip: (seriesField: string | boolean | undefined) => {
47
+ mark: {
48
+ title: {
49
+ visible: boolean;
50
+ };
51
+ };
52
+ dimension: {
53
+ title: {
54
+ visible: boolean;
55
+ };
56
+ };
57
+ };
58
+ export declare const getLineStyle: () => {
59
+ line: {
60
+ style: {
61
+ lineWidth: number;
62
+ curveType: InterpolateType;
63
+ };
64
+ };
65
+ point: {
66
+ style: {
67
+ fillOpacity: number;
68
+ strokeOpacity: number;
69
+ size: number;
70
+ };
71
+ state: {
72
+ dimension_hover: {
73
+ size: number;
74
+ fillOpacity: number;
75
+ strokeOpacity: number;
76
+ };
77
+ };
78
+ };
79
+ };
80
+ export declare const getCartesianAxesSpec: (options: CartesianOptions) => ICartesianAxisSpec[];
81
+ export declare const getCartesianTootipSpec: ({ xField, yField, seriesField, }: CartesianTooltipOptions) => {
82
+ mark: {
83
+ title: {
84
+ value: (datum: any) => any;
85
+ };
86
+ content: {
87
+ key: () => string;
88
+ value: (datum: any) => any;
89
+ } | undefined;
90
+ };
91
+ dimension: {
92
+ title: {
93
+ value: (datum: any) => any;
94
+ };
95
+ content: {
96
+ key: () => string;
97
+ value: (datum: any) => any;
98
+ } | undefined;
99
+ };
100
+ };
101
+ export {};
@@ -1,4 +1,4 @@
1
- import { DataItem } from '../types';
1
+ import { DataItem } from '../../types';
2
2
  export declare enum DSType {
3
3
  sdsm = "singleDemensionSingleMetric",
4
4
  sdmm = "singleDemensionMultiMetric",
@@ -1,15 +1,19 @@
1
1
  import type { IChartSpec } from '@visactor/vchart';
2
2
  import type { ComponentType } from 'react';
3
- import { BaseChartProps, DataItem } from '../types';
3
+ import { BaseChartProps, DataItem } from '../../types';
4
+ import { FieldInfoItem } from '../Dataset/types';
5
+ import { DataSource } from '../DataSource/types';
4
6
  export interface VChartBaseProps extends BaseChartProps {
5
7
  VChart: ComponentType<any>;
6
8
  spec?: Partial<IChartSpec>;
7
9
  }
8
10
  export interface BaseVChartConfig<T = DataItem> {
9
11
  data: T[];
12
+ columns?: FieldInfoItem[];
10
13
  spec?: Partial<IChartSpec>;
11
14
  chartName?: string;
12
15
  chartTheme?: string;
16
+ dataSource?: DataSource;
13
17
  }
14
18
  export interface BaseVChartProps extends BaseChartProps, BaseVChartConfig {
15
19
  }
@@ -6,3 +6,4 @@ export declare const withChartCode: (options: WithChartCodeOptions) => CodeBlock
6
6
  * @returns
7
7
  */
8
8
  export declare const withDefaultChartCode: (options?: Partial<WithChartCodeOptions>) => CodeBlockComponent;
9
+ export declare const withDefaultChartJsonCode: (options?: Partial<WithChartCodeOptions>) => any;
@@ -1,6 +1,9 @@
1
1
  import type React from 'react';
2
2
  import type { FC } from 'react';
3
3
  import type { Components, ExtraProps } from 'react-markdown';
4
+ import { ChartType, DataItem } from '../../types';
5
+ import { FieldInfoItem } from '../Dataset/types';
6
+ import { DataSource } from '../DataSource/types';
4
7
  export type WithChartCodeOptions = {
5
8
  /**
6
9
  * 要额外加载的图表组件
@@ -26,13 +29,21 @@ export type WithChartCodeOptions = {
26
29
  * 图表样式,配置容器样式
27
30
  */
28
31
  style?: React.CSSProperties;
32
+ renderMode?: 'json' | 'md';
29
33
  };
30
- /**
31
- * 图表渲染数据接口,后续拓展,这里只是写个示例
32
- */
33
34
  export interface ChartJson {
34
- type: string;
35
- data: any;
35
+ type: ChartType;
36
+ data: DataItem[];
37
+ chartId?: string;
38
+ chartName?: string;
39
+ xField?: string;
40
+ yField?: string;
41
+ nameField?: string;
42
+ valField?: string;
43
+ dimensions?: string[];
44
+ metrics?: string[];
45
+ dataSource?: DataSource;
46
+ columns?: FieldInfoItem[];
36
47
  }
37
48
  /**
38
49
  * 图表组件字典
@@ -0,0 +1,18 @@
1
+ import React from 'react';
2
+ import { VizChartState } from '../../../GPTVis/hooks/useStore';
3
+ import { BaseChartProps } from '../../../types';
4
+ import { ChartJson } from '../type';
5
+ interface ChartStoreContextType {
6
+ store: VizChartState;
7
+ chartId: string;
8
+ }
9
+ export declare const ChartStoreContext: React.Context<ChartStoreContextType | null>;
10
+ export declare const useChartContext: () => ChartStoreContextType;
11
+ export declare const getChartId: () => string;
12
+ export declare const getChartStore: () => VizChartState;
13
+ interface ChartStoreProviderProps {
14
+ chartProps: BaseChartProps & ChartJson;
15
+ children: React.ReactNode;
16
+ }
17
+ export declare const ChartStoreProvider: React.FC<ChartStoreProviderProps>;
18
+ export {};
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ import { RenderVisChartProps } from './types';
3
+ export declare const RenderVisChart: React.FC<RenderVisChartProps>;
@@ -0,0 +1,2 @@
1
+ export declare const StyledGPTVis: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
2
+ export declare const GlobalStyles: import("react").NamedExoticComponent<import("styled-components").ExecutionProps & object>;
@@ -0,0 +1,16 @@
1
+ import React from 'react';
2
+ import type { ChartComponents } from '../type';
3
+ export type RenderVisChartProps = {
4
+ content: string;
5
+ components: ChartComponents;
6
+ debug?: boolean;
7
+ loadingTimeout?: number;
8
+ style?: React.CSSProperties;
9
+ };
10
+ export type RenderErrorProps = {
11
+ debug?: boolean;
12
+ loadingTimeout?: number;
13
+ loading?: boolean;
14
+ style?: React.CSSProperties;
15
+ setLoading: React.Dispatch<React.SetStateAction<boolean>>;
16
+ };
@@ -0,0 +1,9 @@
1
+ import { FilterItemType } from './types';
2
+ interface FilterItemProps {
3
+ filter: FilterItemType;
4
+ filterKey?: string;
5
+ onFilterChange: (filter: FilterItemType) => void;
6
+ deleteFilter?: () => void;
7
+ }
8
+ export declare const FilterController: ({ filter, filterKey, onFilterChange, deleteFilter, }: FilterItemProps) => import("react/jsx-runtime").JSX.Element;
9
+ export {};
@@ -0,0 +1,8 @@
1
+ import { FilterItemType } from './types';
2
+ interface Props {
3
+ filter: FilterItemType;
4
+ onCancel: () => void;
5
+ onApply: (filter: any) => void;
6
+ }
7
+ export declare const FilterModal: ({ filter, onCancel, onApply }: Props) => import("react/jsx-runtime").JSX.Element;
8
+ export {};
@@ -0,0 +1,7 @@
1
+ import { FilterItemType } from './types';
2
+ interface Props {
3
+ filters?: FilterItemType[];
4
+ onChange: (filters: FilterItemType[]) => void;
5
+ }
6
+ export declare const FiltersController: ({ filters, onChange }: Props) => import("react/jsx-runtime").JSX.Element;
7
+ export {};
@@ -0,0 +1,6 @@
1
+ export declare const StyleFiltersConainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
2
+ theme?: string;
3
+ }>> & string;
4
+ export declare const StyleFilterModal: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
5
+ theme?: string;
6
+ }>> & string;
@@ -0,0 +1,16 @@
1
+ export type FilterItem = {
2
+ conjunction: string;
3
+ subFilter: FilterItemType;
4
+ };
5
+ export type FilterItemType = {
6
+ type: string;
7
+ basic?: {
8
+ dimensionId: string;
9
+ condition: string;
10
+ value: any;
11
+ };
12
+ sql?: {
13
+ conditionType: string;
14
+ filterCondition: string;
15
+ };
16
+ };
@@ -0,0 +1,33 @@
1
+ import { FilterItem } from './types';
2
+ export declare const menuOptions: {
3
+ key: string;
4
+ label: string;
5
+ value: string;
6
+ }[];
7
+ export declare const conditionOptions: {
8
+ key: string;
9
+ label: string;
10
+ value: string;
11
+ }[];
12
+ export declare const conditionTypeOptions: {
13
+ key: string;
14
+ label: string;
15
+ value: string;
16
+ }[];
17
+ export declare function findBasicFilterDataset(dimension: any, dimensions?: any[]): {
18
+ datasetName: any;
19
+ dimensionColumn: any;
20
+ dimensionId: any;
21
+ } | null;
22
+ export declare const getFilters: (filters?: FilterItem[]) => {
23
+ type: string;
24
+ basic?: {
25
+ dimensionId: string;
26
+ condition: string;
27
+ value: any;
28
+ };
29
+ sql?: {
30
+ conditionType: string;
31
+ filterCondition: string;
32
+ };
33
+ }[];
@@ -0,0 +1,7 @@
1
+ import { AdvancedTimeRange } from './types';
2
+ interface Props {
3
+ advancedTimeRange: AdvancedTimeRange;
4
+ onChange: (value: AdvancedTimeRange) => void;
5
+ }
6
+ export declare const AdvancedContent: ({ advancedTimeRange, onChange }: Props) => import("react/jsx-runtime").JSX.Element;
7
+ export {};
@@ -0,0 +1,7 @@
1
+ import { CustomTimeRange } from './types';
2
+ interface Props {
3
+ customTimeRange: CustomTimeRange;
4
+ onChange: (timeRange: CustomTimeRange) => void;
5
+ }
6
+ export declare const CustomContent: ({ customTimeRange, onChange }: Props) => import("react/jsx-runtime").JSX.Element;
7
+ export {};
@@ -0,0 +1,9 @@
1
+ import { TimeRange } from './types';
2
+ interface Props {
3
+ type: string;
4
+ setClose: (isBack?: boolean) => void;
5
+ setApply: (val: any) => void;
6
+ timeRange?: TimeRange;
7
+ }
8
+ export declare const TimeRangePopover: ({ type, setClose, setApply, timeRange }: Props) => import("react/jsx-runtime").JSX.Element;
9
+ export {};
@@ -0,0 +1,7 @@
1
+ import { TimeRange } from './types';
2
+ interface Props {
3
+ timeRange?: TimeRange;
4
+ onChange: (val: TimeRange) => void;
5
+ }
6
+ export declare const TimeRangeSelect: ({ timeRange, onChange }: Props) => import("react/jsx-runtime").JSX.Element;
7
+ export {};
@@ -0,0 +1,12 @@
1
+ export declare const StyleTimeRange: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
2
+ theme?: string;
3
+ }>> & string;
4
+ export declare const StylePopoverContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
5
+ theme?: string;
6
+ }>> & string;
7
+ export declare const StyleCustom: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
8
+ theme?: string;
9
+ }>> & string;
10
+ export declare const StyleAdvanced: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
11
+ theme?: string;
12
+ }>> & string;
@@ -0,0 +1,55 @@
1
+ import { Dayjs } from 'dayjs';
2
+ import { FilterItemType } from '../Filter/types';
3
+ export type CustomTimeRange = {
4
+ from?: Dayjs;
5
+ to?: Dayjs;
6
+ };
7
+ export type AdvancedTimeRange = {
8
+ type: string;
9
+ lastPeriod?: {
10
+ range: number;
11
+ unit: string;
12
+ };
13
+ periodAgo?: {
14
+ range: number;
15
+ unit: string;
16
+ };
17
+ periodBoundary?: {
18
+ boundaryType: string;
19
+ periodRange?: number;
20
+ boundaryUnit: string;
21
+ periodType: string;
22
+ periodUnit: string;
23
+ };
24
+ };
25
+ export type TimeRange = {
26
+ type: string;
27
+ basic?: string;
28
+ custom?: {
29
+ from: string;
30
+ to: string;
31
+ };
32
+ advanced?: AdvancedTimeRange;
33
+ };
34
+ export type OptionType = {
35
+ label: string;
36
+ value: string;
37
+ };
38
+ export type QueryData = {
39
+ timeRange?: TimeRange;
40
+ metrics?: OptionType[];
41
+ dimensions?: OptionType[];
42
+ filters?: FilterItemType[];
43
+ timeGrain?: string;
44
+ };
45
+ export interface TableData {
46
+ columns: Array<{
47
+ name: string;
48
+ type: string;
49
+ }>;
50
+ rows: Array<{
51
+ row: Array<{
52
+ v: any;
53
+ }>;
54
+ }>;
55
+ }
@@ -0,0 +1,77 @@
1
+ import { DataSource } from '../../DataSource/types';
2
+ import { AdvancedTimeRange, TimeRange } from './types';
3
+ export declare const timeRangeOptions: {
4
+ key: string;
5
+ label: string;
6
+ value: string;
7
+ }[];
8
+ export declare const advancedMenuOptions: {
9
+ key: string;
10
+ label: string;
11
+ value: string;
12
+ }[];
13
+ export declare const previousConfiguration: {
14
+ key: string;
15
+ label: string;
16
+ value: string;
17
+ }[];
18
+ export declare const timeGrainOptions: {
19
+ key: string;
20
+ label: string;
21
+ value: string;
22
+ }[];
23
+ export declare const previousBoundaryType: {
24
+ key: string;
25
+ label: string;
26
+ value: string;
27
+ }[];
28
+ export declare const defaultTimeRange: TimeRange;
29
+ export declare const defaultAdvancedTimeRange: AdvancedTimeRange;
30
+ export declare const getRestrictedTimeGrainOptions: (periodUnit?: string) => {
31
+ key: string;
32
+ label: string;
33
+ value: string;
34
+ }[];
35
+ export declare const getDateString: (label: string, timeRange: TimeRange | undefined, formatMessage: any) => any;
36
+ export declare const getTimeDimension2TimeGrain: (timeDimension: {
37
+ dimensionName: string;
38
+ dimensionUnit: string;
39
+ }) => string;
40
+ export declare const getMql2TimeRange: (timeRange: TimeRange, dataSource: DataSource) => TimeRange | {
41
+ type: string;
42
+ custom: {
43
+ from: any;
44
+ to: any;
45
+ };
46
+ };
47
+ export declare const emptyTimeRange: {
48
+ type: string;
49
+ basic: string;
50
+ advanced: {
51
+ type: string;
52
+ lastPeriod: {
53
+ range: null;
54
+ unit: string;
55
+ };
56
+ periodAgo: {
57
+ range: null;
58
+ unit: string;
59
+ };
60
+ periodBoundary: {
61
+ periodType: string;
62
+ periodRange: null;
63
+ periodUnit: string;
64
+ boundaryType: string;
65
+ boundaryRange: null;
66
+ boundaryUnit: string;
67
+ };
68
+ custom: {
69
+ from: string;
70
+ to: string;
71
+ };
72
+ };
73
+ custom: {
74
+ from: string;
75
+ to: string;
76
+ };
77
+ };
@@ -0,0 +1,15 @@
1
+ import { DataSource } from '../DataSource/types';
2
+ import { FilterItemType } from './Filter/types';
3
+ import { OptionType, TimeRange } from './TimeRange/types';
4
+ export interface ChartHeaderProps {
5
+ theme?: string;
6
+ dataSource: DataSource;
7
+ }
8
+ export interface ChartControllersState {
9
+ timeRange?: TimeRange;
10
+ metrics: OptionType[];
11
+ dimensions: OptionType[];
12
+ timeGrain?: string;
13
+ filters?: FilterItemType[];
14
+ }
15
+ export declare function ChartControllers({ theme, dataSource }: ChartHeaderProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,3 @@
1
+ export declare const StyleChartControllers: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
2
+ theme: string;
3
+ }>> & string;
@@ -0,0 +1,12 @@
1
+ import { ChartJson } from '../ChartCodeRender/type';
2
+ export declare function handleMetricInfo(metricInfo: any, chartJson: ChartJson, metricTime: {
3
+ label: string;
4
+ value: string;
5
+ }): {
6
+ metrics: {
7
+ value: any;
8
+ label: any;
9
+ }[];
10
+ matchedDimensions: any;
11
+ dimOptions: any;
12
+ } | null;
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ interface ContextMenuProps {
3
+ visible?: boolean;
4
+ clientX?: number;
5
+ clientY?: number;
6
+ onClose?: () => void;
7
+ onAction?: (action: string) => void;
8
+ }
9
+ declare const ChartContextMenu: React.FC<ContextMenuProps>;
10
+ export default ChartContextMenu;
@@ -0,0 +1 @@
1
+ export declare const ContextMenuWrapperStyle: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
@@ -0,0 +1,5 @@
1
+ import { FieldInfoItem } from '../../Dataset/types';
2
+ export declare function getSelectedInfo(selected: any[], fieldInfo: FieldInfoItem[] | undefined, metricTime: {
3
+ label: string;
4
+ value: string;
5
+ }): any[];
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ import { DataSource } from '../../DataSource/types';
3
+ interface DrillByChartProps {
4
+ dataSource: DataSource;
5
+ }
6
+ declare const DrillByChart: React.FC<DrillByChartProps>;
7
+ export default DrillByChart;
@@ -0,0 +1 @@
1
+ export declare const DrillByChartWrapperStyle: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
@@ -0,0 +1,5 @@
1
+ export interface ChartHeaderProps {
2
+ theme?: string;
3
+ }
4
+ declare function ChartHeader({ theme }: ChartHeaderProps): import("react/jsx-runtime").JSX.Element;
5
+ export { ChartHeader };
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import { ChartComponents } from '../ChartCodeRender/type';
3
+ export interface ChartContainerProps {
4
+ components?: ChartComponents;
5
+ className?: string;
6
+ chartStyle?: React.CSSProperties;
7
+ }
8
+ declare const _default: React.MemoExoticComponent<({ className, chartStyle, components, }: ChartContainerProps) => import("react/jsx-runtime").JSX.Element>;
9
+ export default _default;
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ export declare const StyleChartContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
3
+ theme: string;
4
+ style?: React.CSSProperties;
5
+ }>> & string;
6
+ export declare const StyleChartHeader: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
7
+ theme?: string;
8
+ }>> & string;
9
+ export declare const GlobalDropdownStyle: React.NamedExoticComponent<import("styled-components").ExecutionProps & object>;
@@ -0,0 +1,22 @@
1
+ import VMind from '@visactor/vmind';
2
+ import { ChartType } from '../../types';
3
+ import { ChartJson } from '../ChartCodeRender/type';
4
+ export declare function isChartTypeInTabs(chartTabs: {
5
+ [key: string]: any;
6
+ }[], chartType: ChartType): boolean;
7
+ export declare function isChartAdvisor(chartJson: ChartJson): boolean;
8
+ export declare const vmind: VMind;
9
+ export declare function chartAdvisor(chartJson: ChartJson): Promise<{
10
+ type: any;
11
+ data: import("../..").DataItem[];
12
+ chartId?: string;
13
+ chartName?: string;
14
+ xField?: string;
15
+ yField?: string;
16
+ nameField?: string;
17
+ valField?: string;
18
+ dimensions?: string[];
19
+ metrics?: string[];
20
+ dataSource?: import("../DataSource/types").DataSource;
21
+ columns?: import("../Dataset/types").FieldInfoItem[];
22
+ }>;
@@ -0,0 +1,9 @@
1
+ import { DataSourceType } from './types';
2
+ export interface DataSourceMethods {
3
+ query2Params: (params: any) => Promise<any>;
4
+ queryChartData: (params: any) => Promise<any>;
5
+ queryMetric: (params: any) => Promise<any>;
6
+ queryDimensions: (params: any) => Promise<any>;
7
+ transformData: (params: any) => any;
8
+ }
9
+ export declare const useQueryDataSource: (dataSourceType: DataSourceType) => DataSourceMethods;
@@ -0,0 +1,10 @@
1
+ import { QueryData, TableData } from '../ChartControllers/TimeRange/types';
2
+ export declare const queryMetric: (id: string) => Promise<any>;
3
+ export declare const queryDimensions: (orgId?: string) => Promise<any>;
4
+ export declare const query2Params: (mql: any) => Promise<any>;
5
+ export declare const queryChartData: ({ timeRange, metrics, dimensions, timeGrain, filters, }: QueryData) => Promise<any>;
6
+ export declare const transformData: (params: {
7
+ data: TableData;
8
+ }) => {
9
+ [key: string]: any;
10
+ }[];
File without changes