|
@@ -35,7 +35,6 @@ export interface StatCalculatorInfo {
|
|
|
id: string;
|
|
id: string;
|
|
|
name: string;
|
|
name: string;
|
|
|
description: string;
|
|
description: string;
|
|
|
-
|
|
|
|
|
alias?: string; // optional secondary key. 'avg' vs 'mean', 'total' vs 'sum'
|
|
alias?: string; // optional secondary key. 'avg' vs 'mean', 'total' vs 'sum'
|
|
|
|
|
|
|
|
// Internal details
|
|
// Internal details
|
|
@@ -54,6 +53,7 @@ export function getStatsCalculators(ids?: string[]): StatCalculatorInfo[] {
|
|
|
}
|
|
}
|
|
|
return listOfStats;
|
|
return listOfStats;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
return ids.reduce((list, id) => {
|
|
return ids.reduce((list, id) => {
|
|
|
const stat = getById(id);
|
|
const stat = getById(id);
|
|
|
if (stat) {
|
|
if (stat) {
|
|
@@ -123,6 +123,7 @@ export function calculateStats(options: CalculateStatsOptions): ColumnStats {
|
|
|
interface TableStatIndex {
|
|
interface TableStatIndex {
|
|
|
[id: string]: StatCalculatorInfo;
|
|
[id: string]: StatCalculatorInfo;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
const listOfStats: StatCalculatorInfo[] = [];
|
|
const listOfStats: StatCalculatorInfo[] = [];
|
|
|
const index: TableStatIndex = {};
|
|
const index: TableStatIndex = {};
|
|
|
let hasBuiltIndex = false;
|
|
let hasBuiltIndex = false;
|
|
@@ -166,7 +167,7 @@ function getById(id: string): StatCalculatorInfo | undefined {
|
|
|
{
|
|
{
|
|
|
id: StatID.delta,
|
|
id: StatID.delta,
|
|
|
name: 'Delta',
|
|
name: 'Delta',
|
|
|
- description: 'Cumulative change in value (??? help not really sure ???)',
|
|
|
|
|
|
|
+ description: 'Cumulative change in value',
|
|
|
standard: true,
|
|
standard: true,
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
@@ -217,6 +218,7 @@ function getById(id: string): StatCalculatorInfo | undefined {
|
|
|
});
|
|
});
|
|
|
hasBuiltIndex = true;
|
|
hasBuiltIndex = true;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
return index[id];
|
|
return index[id];
|
|
|
}
|
|
}
|
|
|
|
|
|