@allurereport/core-api 3.0.0-beta.20 → 3.0.0-beta.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +0 -2
- package/dist/index.js +0 -2
- package/package.json +1 -1
- package/dist/charts/types.d.ts +0 -80
- package/dist/charts/types.js +0 -36
- package/dist/charts/utils.d.ts +0 -6
- package/dist/charts/utils.js +0 -34
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
package/package.json
CHANGED
package/dist/charts/types.d.ts
DELETED
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
import type { TestStatus } from "../model.js";
|
|
2
|
-
export declare enum ChartType {
|
|
3
|
-
Trend = "trend",
|
|
4
|
-
Pie = "pie",
|
|
5
|
-
TreeMap = "treemap",
|
|
6
|
-
HeatMap = "heatmap",
|
|
7
|
-
Bar = "bar",
|
|
8
|
-
Funnel = "funnel",
|
|
9
|
-
ComingSoon = "coming-soon"
|
|
10
|
-
}
|
|
11
|
-
export declare enum ChartDataType {
|
|
12
|
-
Status = "status",
|
|
13
|
-
Severity = "severity"
|
|
14
|
-
}
|
|
15
|
-
export declare enum BarChartType {
|
|
16
|
-
StatusBySeverity = "statusBySeverity",
|
|
17
|
-
StatusTrend = "statusTrend",
|
|
18
|
-
StatusChangeTrend = "statusChangeTrend"
|
|
19
|
-
}
|
|
20
|
-
export declare enum TreeMapChartType {
|
|
21
|
-
SuccessRateDistribution = "successRateDistribution",
|
|
22
|
-
CoverageDiff = "coverageDiff"
|
|
23
|
-
}
|
|
24
|
-
export declare enum ChartMode {
|
|
25
|
-
Raw = "raw",
|
|
26
|
-
Percent = "percent"
|
|
27
|
-
}
|
|
28
|
-
export type ChartId = string;
|
|
29
|
-
export type TrendPointId = string;
|
|
30
|
-
export type TrendSliceId = string;
|
|
31
|
-
export type BaseMetadata = Record<string, unknown>;
|
|
32
|
-
export interface BaseTrendSliceMetadata extends BaseMetadata {
|
|
33
|
-
executionId: string;
|
|
34
|
-
executionName?: string;
|
|
35
|
-
}
|
|
36
|
-
export interface TrendPoint {
|
|
37
|
-
x: string;
|
|
38
|
-
y: number;
|
|
39
|
-
}
|
|
40
|
-
export type TrendSliceMetadata<Metadata extends BaseMetadata> = BaseTrendSliceMetadata & Metadata;
|
|
41
|
-
export interface TrendSlice<Metadata extends BaseTrendSliceMetadata = BaseTrendSliceMetadata> {
|
|
42
|
-
min: number;
|
|
43
|
-
max: number;
|
|
44
|
-
metadata: TrendSliceMetadata<Metadata>;
|
|
45
|
-
}
|
|
46
|
-
export interface BasePieSlice {
|
|
47
|
-
status: TestStatus;
|
|
48
|
-
count: number;
|
|
49
|
-
}
|
|
50
|
-
export interface PieSlice extends BasePieSlice {
|
|
51
|
-
d: string | null;
|
|
52
|
-
}
|
|
53
|
-
export type PieChartValues = {
|
|
54
|
-
percentage: number;
|
|
55
|
-
slices: PieSlice[];
|
|
56
|
-
};
|
|
57
|
-
export type BarGroupValues<T extends string = string> = Record<T, number>;
|
|
58
|
-
export type BarGroup<G extends string, T extends string = string> = {
|
|
59
|
-
groupId: G;
|
|
60
|
-
} & BarGroupValues<T>;
|
|
61
|
-
export declare enum BarGroupMode {
|
|
62
|
-
Grouped = "grouped",
|
|
63
|
-
Stacked = "stacked"
|
|
64
|
-
}
|
|
65
|
-
export type NewKey<T extends string> = `new${Capitalize<T>}`;
|
|
66
|
-
export type RemovedKey<T extends string> = `removed${Capitalize<T>}`;
|
|
67
|
-
export type TreeMapNode<T extends Record<string, any> = {}> = T & {
|
|
68
|
-
id: string;
|
|
69
|
-
value?: number;
|
|
70
|
-
colorValue?: number;
|
|
71
|
-
children?: TreeMapNode<T>[];
|
|
72
|
-
};
|
|
73
|
-
export type HeatMapPoint = {
|
|
74
|
-
x: string;
|
|
75
|
-
y?: number;
|
|
76
|
-
};
|
|
77
|
-
export type HeatMapSerie<T extends Record<string, any> = Record<string, any>> = {
|
|
78
|
-
id: string;
|
|
79
|
-
data: HeatMapPoint[];
|
|
80
|
-
} & T;
|
package/dist/charts/types.js
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
export var ChartType;
|
|
2
|
-
(function (ChartType) {
|
|
3
|
-
ChartType["Trend"] = "trend";
|
|
4
|
-
ChartType["Pie"] = "pie";
|
|
5
|
-
ChartType["TreeMap"] = "treemap";
|
|
6
|
-
ChartType["HeatMap"] = "heatmap";
|
|
7
|
-
ChartType["Bar"] = "bar";
|
|
8
|
-
ChartType["Funnel"] = "funnel";
|
|
9
|
-
ChartType["ComingSoon"] = "coming-soon";
|
|
10
|
-
})(ChartType || (ChartType = {}));
|
|
11
|
-
export var ChartDataType;
|
|
12
|
-
(function (ChartDataType) {
|
|
13
|
-
ChartDataType["Status"] = "status";
|
|
14
|
-
ChartDataType["Severity"] = "severity";
|
|
15
|
-
})(ChartDataType || (ChartDataType = {}));
|
|
16
|
-
export var BarChartType;
|
|
17
|
-
(function (BarChartType) {
|
|
18
|
-
BarChartType["StatusBySeverity"] = "statusBySeverity";
|
|
19
|
-
BarChartType["StatusTrend"] = "statusTrend";
|
|
20
|
-
BarChartType["StatusChangeTrend"] = "statusChangeTrend";
|
|
21
|
-
})(BarChartType || (BarChartType = {}));
|
|
22
|
-
export var TreeMapChartType;
|
|
23
|
-
(function (TreeMapChartType) {
|
|
24
|
-
TreeMapChartType["SuccessRateDistribution"] = "successRateDistribution";
|
|
25
|
-
TreeMapChartType["CoverageDiff"] = "coverageDiff";
|
|
26
|
-
})(TreeMapChartType || (TreeMapChartType = {}));
|
|
27
|
-
export var ChartMode;
|
|
28
|
-
(function (ChartMode) {
|
|
29
|
-
ChartMode["Raw"] = "raw";
|
|
30
|
-
ChartMode["Percent"] = "percent";
|
|
31
|
-
})(ChartMode || (ChartMode = {}));
|
|
32
|
-
export var BarGroupMode;
|
|
33
|
-
(function (BarGroupMode) {
|
|
34
|
-
BarGroupMode["Grouped"] = "grouped";
|
|
35
|
-
BarGroupMode["Stacked"] = "stacked";
|
|
36
|
-
})(BarGroupMode || (BarGroupMode = {}));
|
package/dist/charts/utils.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { PieArcDatum } from "d3-shape";
|
|
2
|
-
import type { BasePieSlice, PieChartValues, Statistic } from "../index.js";
|
|
3
|
-
export declare const getPercentage: (value: number, total: number) => number;
|
|
4
|
-
export declare const d3Arc: import("d3-shape").Arc<any, PieArcDatum<BasePieSlice>>;
|
|
5
|
-
export declare const d3Pie: import("d3-shape").Pie<any, BasePieSlice>;
|
|
6
|
-
export declare const getPieChartValues: (stats: Statistic) => PieChartValues;
|
package/dist/charts/utils.js
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { arc, pie } from "d3-shape";
|
|
2
|
-
import { statusesList } from "../constants.js";
|
|
3
|
-
export const getPercentage = (value, total) => Math.floor((value / total) * 10000) / 100;
|
|
4
|
-
export const d3Arc = arc().innerRadius(40).outerRadius(50).cornerRadius(2).padAngle(0.03);
|
|
5
|
-
export const d3Pie = pie()
|
|
6
|
-
.value((d) => d.count)
|
|
7
|
-
.padAngle(0.03)
|
|
8
|
-
.sortValues((a, b) => a - b);
|
|
9
|
-
export const getPieChartValues = (stats) => {
|
|
10
|
-
const convertedStatuses = statusesList
|
|
11
|
-
.filter((status) => !!stats?.[status])
|
|
12
|
-
.map((status) => ({
|
|
13
|
-
status,
|
|
14
|
-
count: stats[status],
|
|
15
|
-
}));
|
|
16
|
-
const arcsData = d3Pie(convertedStatuses);
|
|
17
|
-
const slices = arcsData
|
|
18
|
-
.map((arcData) => {
|
|
19
|
-
const d = d3Arc(arcData);
|
|
20
|
-
if (!d) {
|
|
21
|
-
return null;
|
|
22
|
-
}
|
|
23
|
-
return {
|
|
24
|
-
d,
|
|
25
|
-
...arcData.data,
|
|
26
|
-
};
|
|
27
|
-
})
|
|
28
|
-
.filter((item) => item !== null);
|
|
29
|
-
const percentage = getPercentage(stats.passed ?? 0, stats.total);
|
|
30
|
-
return {
|
|
31
|
-
slices,
|
|
32
|
-
percentage,
|
|
33
|
-
};
|
|
34
|
-
};
|