@advt-gpt-chart/package 3.2.8 → 3.3.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 (35) hide show
  1. package/dist/Chart/ChartBase/constants.d.ts +2 -1
  2. package/dist/Chart/ChartCodeRender/type.d.ts +2 -0
  3. package/dist/Chart/ChartControllers/IemsController/index.d.ts +6 -0
  4. package/dist/Chart/ChartWrapper/style.d.ts +2 -0
  5. package/dist/Chart/ChartWrapper/utils.d.ts +2 -0
  6. package/dist/Charts/{AgentCharts → Custom/AgentCharts}/DimensionAttribution/types.d.ts +1 -1
  7. package/dist/Charts/{AgentCharts → Custom/AgentCharts}/FactorAttribution/types.d.ts +1 -1
  8. package/dist/Charts/{AgentCharts → Custom/AgentCharts}/types.d.ts +1 -1
  9. package/dist/Charts/Custom/CapacityDemand/index.d.ts +3 -0
  10. package/dist/Charts/Custom/CapacityDemand/types.d.ts +34 -0
  11. package/dist/Charts/Custom/CapacityDemand/utils.d.ts +1 -0
  12. package/dist/Charts/PivotTable/columnTreeUtils.d.ts +16 -0
  13. package/dist/Charts/PivotTable/types.d.ts +5 -1
  14. package/dist/Charts/common/hooks/useDashLine.d.ts +2 -1
  15. package/dist/Charts/common/types.d.ts +5 -0
  16. package/dist/DataView/DataSource/iems.d.ts +2 -0
  17. package/dist/DataView/DataSource/types.d.ts +2 -1
  18. package/dist/GPTVis/hooks/formatChartJson.d.ts +2 -0
  19. package/dist/export.d.ts +7 -4
  20. package/dist/index.es.js +167124 -166924
  21. package/dist/index.es.js.gz +0 -0
  22. package/dist/index.umd.js +2109 -2094
  23. package/dist/index.umd.js.gz +0 -0
  24. package/dist/locale/en-US.d.ts +3 -0
  25. package/dist/locale/zh-CN.d.ts +3 -0
  26. package/dist/locale/zh-TW.d.ts +3 -0
  27. package/dist/types/chart.d.ts +8 -1
  28. package/dist/utils/useTools.d.ts +2 -0
  29. package/dist/version.d.ts +1 -1
  30. package/package.json +1 -1
  31. /package/dist/Charts/{AgentCharts → Custom/AgentCharts}/AgentChartHeader.d.ts +0 -0
  32. /package/dist/Charts/{AgentCharts → Custom/AgentCharts}/AgentChartHeaderStyle.d.ts +0 -0
  33. /package/dist/Charts/{AgentCharts → Custom/AgentCharts}/DimensionAttribution/index.d.ts +0 -0
  34. /package/dist/Charts/{AgentCharts → Custom/AgentCharts}/FactorAttribution/index.d.ts +0 -0
  35. /package/dist/Charts/{AgentCharts → Custom/AgentCharts}/index.d.ts +0 -0
@@ -28,6 +28,7 @@ export type Tools = {
28
28
  getFieldType: (fieldName: string, value?: any) => GenericDataType | undefined;
29
29
  createLabelFormatMethod: (axesConfig: any, isMetricFolded?: boolean) => (val: any, datum: any) => any;
30
30
  getUnit: (field: string) => string;
31
+ getFieldNameAlias: (field: string) => string | undefined;
31
32
  };
32
33
  export declare const getPolarLegendSpec: (seriesField: string | boolean | undefined, categoryField: string, tools?: Tools) => {
33
34
  visible: boolean;
@@ -37,7 +38,7 @@ export declare const getPolarLegendSpec: (seriesField: string | boolean | undefi
37
38
  };
38
39
  };
39
40
  };
40
- export declare const getCartesianLegend: (xField?: string, seriesField?: string | boolean) => any;
41
+ export declare const getCartesianLegend: (seriesField?: string | boolean, tools?: Tools) => any;
41
42
  export declare const getPolarTooltipSpec: ({ categoryField, valueField, seriesField, showPercent, isMetricFolded }: PolarTooltipOptions, tools?: Tools) => {
42
43
  mark: {
43
44
  title: {
@@ -69,6 +69,8 @@ export interface ChartJson {
69
69
  timeGrain?: TimeGrainType;
70
70
  dataFormat?: DataFormat;
71
71
  hideChartHeader?: boolean;
72
+ hideChartAction?: boolean;
73
+ hideChartBorder?: boolean;
72
74
  series?: any[];
73
75
  agent?: AgentConfig;
74
76
  availableChartTypes?: string[];
@@ -0,0 +1,6 @@
1
+ import { DataSource } from '../../../DataView/DataSource/types';
2
+ interface IemsControllerProps {
3
+ dataSource: DataSource;
4
+ }
5
+ export declare function IemsController({ dataSource }: IemsControllerProps): null;
6
+ export {};
@@ -1,6 +1,8 @@
1
1
  export declare const StyleWrapperInner: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
2
2
  theme: string;
3
3
  $hideChartHeader?: boolean;
4
+ $hideChartBorder?: boolean;
5
+ $minHeight?: string;
4
6
  style?: any;
5
7
  }>> & string;
6
8
  export declare const StyleChartHeader: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
@@ -24,6 +24,8 @@ export declare function chartAdvisor(chartJson: ChartJson): Promise<{
24
24
  timeGrain?: import("../../utils").TimeGrainType;
25
25
  dataFormat?: import("../../DataView/Dataset/types").DataFormat;
26
26
  hideChartHeader?: boolean;
27
+ hideChartAction?: boolean;
28
+ hideChartBorder?: boolean;
27
29
  series?: any[];
28
30
  agent?: import("../ChartCodeRender/type").AgentConfig;
29
31
  availableChartTypes?: string[];
@@ -1,4 +1,4 @@
1
- import type { BaseChartProps } from '../../../types';
1
+ import type { BaseChartProps } from '../../../../types';
2
2
  import type { AgentConfig, SeriesItem } from '../types';
3
3
  export interface DimensionAttributionProps extends BaseChartProps {
4
4
  series?: SeriesItem[];
@@ -1,4 +1,4 @@
1
- import type { BaseChartProps } from '../../../types';
1
+ import type { BaseChartProps } from '../../../../types';
2
2
  import type { AgentConfig, AgentDataItem } from '../types';
3
3
  export interface FactorAttributionProps extends BaseChartProps {
4
4
  data?: AgentDataItem[];
@@ -1,4 +1,4 @@
1
- import type { BaseChartProps, ChartType, DataItem } from '../../types';
1
+ import type { BaseChartProps, ChartType, DataItem } from '../../../types';
2
2
  export interface DimensionItem {
3
3
  id: string;
4
4
  name: string;
@@ -0,0 +1,3 @@
1
+ import type { CapacityDemandProps } from './types';
2
+ declare const CapacityDemand: (props: CapacityDemandProps) => import("react/jsx-runtime").JSX.Element | null;
3
+ export default CapacityDemand;
@@ -0,0 +1,34 @@
1
+ import type { BaseChartProps } from '../../../types';
2
+ /** 容需分析数据项 */
3
+ export interface CapacityDemandDataItem {
4
+ /** 时间 */
5
+ time: string;
6
+ /** 需量 */
7
+ demand: number;
8
+ /** 容量 */
9
+ capacity: number;
10
+ /** 差值 */
11
+ differenceValue: number;
12
+ /** 是否预测值 */
13
+ isPrediction: boolean;
14
+ /** 需量预测数据 */
15
+ demandPrediction?: number | null;
16
+ }
17
+ /** 容需分析图表配置 */
18
+ export interface CapacityDemandConfig {
19
+ /** 数据 */
20
+ data: CapacityDemandDataItem[];
21
+ /** 摘要文本,显示在表格上方 */
22
+ summary?: string;
23
+ /** 主题 */
24
+ theme?: 'light' | 'dark';
25
+ /** 列配置 */
26
+ columns?: CapacityDemandDataItem[];
27
+ /** 数据格式 */
28
+ dataFormat?: string;
29
+ /** 时间粒度 */
30
+ timeGrain?: 'day' | 'hour' | 'minute' | 'second';
31
+ }
32
+ /** 容需分析图表属性 */
33
+ export interface CapacityDemandProps extends BaseChartProps, Partial<CapacityDemandConfig> {
34
+ }
@@ -0,0 +1 @@
1
+ export declare const formatCapacityDemandChartJson: any;
@@ -0,0 +1,16 @@
1
+ import type { DataItem } from '../../types';
2
+ /** 隐藏指标映射:{ [dimensionKey]: { [dimensionValue]: [要隐藏的indicatorKey] } } */
3
+ type HideMap = Record<string, Record<string, string[]>>;
4
+ interface ComputeColumnTreeParams {
5
+ data: DataItem[];
6
+ metrics: string[];
7
+ cols: string[];
8
+ columnIndicatorHide?: HideMap;
9
+ autoHideColumnIndicators?: boolean;
10
+ }
11
+ /**
12
+ * 计算最终的 columnTree 配置
13
+ * 合并自动检测(autoHideColumnIndicators)和手动指定(columnIndicatorHide)的隐藏规则
14
+ */
15
+ export declare const computeColumnTree: (params: ComputeColumnTreeParams) => Record<string, any>[] | undefined;
16
+ export {};
@@ -13,7 +13,11 @@ export interface PivotTableConfig extends CommonGlobalConfig {
13
13
  dimensions?: string[];
14
14
  metrics?: string[];
15
15
  rows?: string[];
16
- columns?: string[];
16
+ cols?: string[];
17
+ /** 控制列维度值下隐藏的指标,不配置则默认全部显示 */
18
+ columnIndicatorHide?: Record<string, Record<string, string[]>>;
19
+ /** 开启后自动分析数据,隐藏全为 null/undefined 的指标列 */
20
+ autoHideColumnIndicators?: boolean;
17
21
  spec?: Record<string, any>;
18
22
  onTreeHierarchyStateChange?: (args: any, tableInstance?: any) => void;
19
23
  onReady?: (tableInstance: any) => void;
@@ -17,7 +17,7 @@ import type { DashSegment } from '../types';
17
17
  * });
18
18
  * ```
19
19
  */
20
- export declare const useDashLine: ({ data, actualData, xField, yField, getFieldType, dashSegments, metrics, }: {
20
+ export declare const useDashLine: ({ data, actualData, xField, yField, getFieldType, dashSegments, metrics, seriesField, }: {
21
21
  data: any[];
22
22
  actualData?: any[];
23
23
  xField: string;
@@ -25,6 +25,7 @@ export declare const useDashLine: ({ data, actualData, xField, yField, getFieldT
25
25
  getFieldType?: (fieldName: string, value?: any) => GenericDataType | undefined;
26
26
  dashSegments?: DashSegment[];
27
27
  metrics?: string[];
28
+ seriesField?: string;
28
29
  }) => {
29
30
  processedData: any[];
30
31
  style: any;
@@ -11,6 +11,9 @@
11
11
  *
12
12
  * // 多段虚线
13
13
  * [{ from: '00:30', to: '00:45' }, { from: '01:00' }]
14
+ *
15
+ * // 只对指定指标生效
16
+ * [{ from: '2026-07', metrics: ['demand'] }]
14
17
  * ```
15
18
  */
16
19
  export interface DashSegment {
@@ -18,6 +21,8 @@ export interface DashSegment {
18
21
  from: string | number;
19
22
  /** 结束点(可选,不填则到末尾) */
20
23
  to?: string | number;
24
+ /** 只对指定指标生效(可选,不填则对所有指标生效) */
25
+ metrics?: string[];
21
26
  }
22
27
  /**
23
28
  * 阈值线配置
@@ -0,0 +1,2 @@
1
+ import { DataSource } from './types';
2
+ export declare const queryChartData: (dataSource: DataSource) => Promise<any>;
@@ -4,8 +4,9 @@ import { FieldInfoItem } from '../Dataset/types';
4
4
  export declare const DataSourceTypes: {
5
5
  METRIC: string;
6
6
  SJ: string;
7
+ IEMS: string;
7
8
  };
8
- export type DataSourceType = 'metricInsight' | 'simpleJson';
9
+ export type DataSourceType = 'metricInsight' | 'simpleJson' | 'iems';
9
10
  export type DataSource = {
10
11
  type: DataSourceType;
11
12
  url: string;
@@ -0,0 +1,2 @@
1
+ import type { ChartJson } from '../../Chart/ChartCodeRender/type';
2
+ export declare const formatChartJson: (chartJson: ChartJson) => any;
package/dist/export.d.ts CHANGED
@@ -1,7 +1,4 @@
1
1
  import React from 'react';
2
- /********** AgentCharts **********/
3
- import { default as AgentCharts } from './Charts/AgentCharts';
4
- import type { AgentChartsProps } from './Charts/AgentCharts/types';
5
2
  /********** Vcharts chart **********/
6
3
  import { default as Area } from './Charts/Area';
7
4
  import { AreaProps } from './Charts/Area/types';
@@ -9,6 +6,12 @@ import { default as Bar } from './Charts/Bar';
9
6
  import type { BarProps } from './Charts/Bar/types';
10
7
  import { default as Composite } from './Charts/Composite';
11
8
  import type { CompositeProps } from './Charts/Composite/types';
9
+ /********** AgentCharts **********/
10
+ import { default as AgentCharts } from './Charts/Custom/AgentCharts';
11
+ import type { AgentChartsProps } from './Charts/Custom/AgentCharts/types';
12
+ /********** CapacityDemand **********/
13
+ import { default as CapacityDemand } from './Charts/Custom/CapacityDemand';
14
+ import type { CapacityDemandProps } from './Charts/Custom/CapacityDemand/types';
12
15
  import { default as Donut } from './Charts/Donut';
13
16
  import type { DonutProps } from './Charts/Donut/types';
14
17
  import { default as Funnel } from './Charts/Funnel';
@@ -41,7 +44,7 @@ import { default as Tabs } from './Charts/Tabs';
41
44
  import type { TabsProps } from './Charts/Tabs/types';
42
45
  /********** NTV **********/
43
46
  import { VisText, type VisTextProps } from './Charts/Text';
44
- export { AgentCharts, type AgentChartsProps, Area, type AreaProps, Bar, type BarProps, Composite, type CompositeProps, Donut, type DonutProps, Funnel, type FunnelProps, Gauge, type GaugeProps, Heatmap, type HeatmapProps, Indicator, type IndicatorProps, Line, type LineProps, Pie, type PieProps, PivotTable, type PivotTableProps, Radar, type RadarProps, Rank, type RankProps, Scatter, type ScatterProps, Table, type TableProps, Tabs, type TabsProps, VisText, type VisTextProps, };
47
+ export { AgentCharts, type AgentChartsProps, Area, type AreaProps, Bar, type BarProps, CapacityDemand, type CapacityDemandProps, Composite, type CompositeProps, Donut, type DonutProps, Funnel, type FunnelProps, Gauge, type GaugeProps, Heatmap, type HeatmapProps, Indicator, type IndicatorProps, Line, type LineProps, Pie, type PieProps, PivotTable, type PivotTableProps, Radar, type RadarProps, Rank, type RankProps, Scatter, type ScatterProps, Table, type TableProps, Tabs, type TabsProps, VisText, type VisTextProps, };
45
48
  export declare const DEFAULT_CHART_COMPONENTS: Record<string, React.FC<any>>;
46
49
  export declare const COMMON_CHART_COMPONENTS: Record<string, any>;
47
50
  export declare const NTV_CHART_COMPONENTS: Record<string, any>;