@allurereport/charts-api 3.0.0-beta.22 → 3.0.0-beta.24

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.
@@ -1,10 +1,3 @@
1
+ import { type ChartOptions } from "./types.js";
1
2
  export declare const DEFAULT_CHART_HISTORY_LIMIT = 10;
2
- export declare const defaultChartsConfig: ({
3
- type: string;
4
- title: string;
5
- dataType?: undefined;
6
- } | {
7
- type: string;
8
- dataType: string;
9
- title: string;
10
- })[];
3
+ export declare const defaultChartsConfig: ChartOptions[];
package/dist/constants.js CHANGED
@@ -1,66 +1,67 @@
1
+ import { BarChartType, ChartDataType, ChartType, FunnelChartType, TreeMapChartType, } from "./types.js";
1
2
  export const DEFAULT_CHART_HISTORY_LIMIT = 10;
2
3
  export const defaultChartsConfig = [
3
4
  {
4
- type: "pie",
5
+ type: ChartType.CurrentStatus,
5
6
  title: "Current status",
6
7
  },
7
8
  {
8
- type: "trend",
9
- dataType: "status",
9
+ type: ChartType.Trend,
10
+ dataType: ChartDataType.Status,
10
11
  title: "Status dynamics",
11
12
  },
12
13
  {
13
- type: "bar",
14
- dataType: "statusBySeverity",
14
+ type: ChartType.Bar,
15
+ dataType: BarChartType.StatusBySeverity,
15
16
  title: "Test result severities",
16
17
  },
17
18
  {
18
- type: "bar",
19
- dataType: "statusTrend",
19
+ type: ChartType.Bar,
20
+ dataType: BarChartType.StatusTrend,
20
21
  title: "Status change dynamics",
21
22
  },
22
23
  {
23
- type: "bar",
24
- dataType: "statusChangeTrend",
24
+ type: ChartType.Bar,
25
+ dataType: BarChartType.StatusChangeTrend,
25
26
  title: "Test base growth dynamics",
26
27
  },
27
28
  {
28
- type: "treemap",
29
- dataType: "coverageDiff",
29
+ type: ChartType.TreeMap,
30
+ dataType: TreeMapChartType.CoverageDiff,
30
31
  title: "Coverage diff map",
31
32
  },
32
33
  {
33
- type: "treemap",
34
- dataType: "successRateDistribution",
34
+ type: ChartType.TreeMap,
35
+ dataType: TreeMapChartType.SuccessRateDistribution,
35
36
  title: "Success rate distribution",
36
37
  },
37
38
  {
38
- type: "heatmap",
39
+ type: ChartType.HeatMap,
39
40
  title: "Problems distribution by environment",
40
41
  },
41
42
  {
42
- type: "bar",
43
- dataType: "stabilityRateDistribution",
43
+ type: ChartType.Bar,
44
+ dataType: BarChartType.StabilityRateDistribution,
44
45
  title: "Stability rate distribution",
45
46
  },
46
47
  {
47
- type: "bar",
48
- dataType: "durationsByLayer",
48
+ type: ChartType.Bar,
49
+ dataType: BarChartType.DurationsByLayer,
49
50
  title: "Durations by layer histogram",
50
51
  },
51
52
  {
52
- type: "bar",
53
+ type: ChartType.Bar,
53
54
  dataType: "performanceTrend",
54
55
  title: "Performance dynamics",
55
56
  },
56
57
  {
57
- type: "bar",
58
- dataType: "fbsuAgePyramid",
58
+ type: ChartType.Bar,
59
+ dataType: BarChartType.FbsuAgePyramid,
59
60
  title: "FBSU age pyramid",
60
61
  },
61
62
  {
62
- type: "funnel",
63
- dataType: "testingPyramid",
63
+ type: ChartType.Funnel,
64
+ dataType: FunnelChartType.TestingPyramid,
64
65
  title: "Testing pyramid",
65
66
  },
66
67
  ];
package/dist/types.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import type { HistoryDataPoint, SeverityLevel, Statistic, TestResult, TestStatus } from "@allurereport/core-api";
2
2
  export declare enum ChartType {
3
3
  Trend = "trend",
4
- Pie = "pie",
4
+ CurrentStatus = "currentStatus",
5
5
  TreeMap = "treemap",
6
6
  HeatMap = "heatmap",
7
7
  Bar = "bar",
@@ -148,12 +148,6 @@ export interface HeatMapChartData<T extends Record<string, any> = {}> {
148
148
  title?: string;
149
149
  data: HeatMapSerie<T>[];
150
150
  }
151
- export interface PieChartData {
152
- type: ChartType.Pie;
153
- title?: string;
154
- slices: PieSlice[];
155
- percentage: number;
156
- }
157
151
  export interface ComingSoonChartData {
158
152
  type: ChartType.ComingSoon;
159
153
  title?: string;
@@ -164,7 +158,12 @@ export interface FunnelChartData {
164
158
  title?: string;
165
159
  data: Record<string, number | string>[];
166
160
  }
167
- export type GeneratedChartData = TrendChartData | PieChartData | BarChartData | ComingSoonChartData | TreeMapChartData | HeatMapChartData | FunnelChartData;
161
+ export interface CurrentStatusChartData {
162
+ type: ChartType.CurrentStatus;
163
+ title?: string;
164
+ data: Statistic;
165
+ }
166
+ export type GeneratedChartData = TrendChartData | BarChartData | CurrentStatusChartData | ComingSoonChartData | TreeMapChartData | HeatMapChartData | FunnelChartData;
168
167
  export type GeneratedChartsData = Record<ChartId, GeneratedChartData>;
169
168
  export type TrendChartOptions = {
170
169
  type: ChartType.Trend;
@@ -174,9 +173,11 @@ export type TrendChartOptions = {
174
173
  limit?: number;
175
174
  metadata?: TrendMetadataFnOverrides;
176
175
  };
177
- export type PieChartOptions = {
178
- type: ChartType.Pie;
176
+ export type CurrentStatusChartOptions = {
177
+ type: ChartType.CurrentStatus;
179
178
  title?: string;
179
+ statuses?: TestStatus[];
180
+ metric?: TestStatus;
180
181
  };
181
182
  export type BarChartOptions = {
182
183
  type: ChartType.Bar;
@@ -205,7 +206,7 @@ export type FunnelChartOptions = {
205
206
  title?: string;
206
207
  layers?: string[];
207
208
  };
208
- export type ChartOptions = TrendChartOptions | PieChartOptions | BarChartOptions | ComingSoonChartOptions | TreeMapChartOptions | HeatMapChartOptions | FunnelChartOptions;
209
+ export type ChartOptions = TrendChartOptions | CurrentStatusChartOptions | BarChartOptions | ComingSoonChartOptions | TreeMapChartOptions | HeatMapChartOptions | FunnelChartOptions;
209
210
  export interface AllureChartsStoreData {
210
211
  historyDataPoints: HistoryDataPoint[];
211
212
  testResults: TestResult[];
package/dist/types.js CHANGED
@@ -1,7 +1,7 @@
1
1
  export var ChartType;
2
2
  (function (ChartType) {
3
3
  ChartType["Trend"] = "trend";
4
- ChartType["Pie"] = "pie";
4
+ ChartType["CurrentStatus"] = "currentStatus";
5
5
  ChartType["TreeMap"] = "treemap";
6
6
  ChartType["HeatMap"] = "heatmap";
7
7
  ChartType["Bar"] = "bar";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allurereport/charts-api",
3
- "version": "3.0.0-beta.22",
3
+ "version": "3.0.0-beta.24",
4
4
  "description": "Allure Charts API",
5
5
  "keywords": [
6
6
  "allure",
@@ -27,8 +27,8 @@
27
27
  "eslint:format": "eslint --fix ./src/**/*.{js,jsx,ts,tsx}"
28
28
  },
29
29
  "dependencies": {
30
- "@allurereport/core-api": "3.0.0-beta.22",
31
- "@allurereport/plugin-api": "3.0.0-beta.22",
30
+ "@allurereport/core-api": "3.0.0-beta.24",
31
+ "@allurereport/plugin-api": "3.0.0-beta.24",
32
32
  "d3-shape": "^3.2.0"
33
33
  },
34
34
  "devDependencies": {