Feature/mathandreduce (#41608)

* Added new math functions: round, ceil, floor 
* Added a new reduce function: last.
This commit is contained in:
Marius Bezuidenhout
2022-01-21 13:15:50 -05:00
committed by GitHub
parent 5d0bc9e933
commit 9fc0aee02b
6 changed files with 98 additions and 1 deletions
@@ -12,7 +12,7 @@ interface Props {
const mathPlaceholder =
'Math operations on one more queries, you reference the query by ${refId} ie. $A, $B, $C etc\n' +
'Example: $A + $B\n' +
'Available functions: abs(), log(), is_number(), is_inf(), is_nan(), is_null()';
'Available functions: abs(), log(), is_number(), round(), ceil(), floor(), is_inf(), is_nan(), is_null(), ';
export const Math: FC<Props> = ({ labelWidth, onChange, query }) => {
const onExpressionChange = (event: ChangeEvent<HTMLTextAreaElement>) => {
+1
View File
@@ -21,6 +21,7 @@ export const reducerTypes: Array<SelectableValue<string>> = [
{ value: ReducerID.mean, label: 'Mean', description: 'Get the average value' },
{ value: ReducerID.sum, label: 'Sum', description: 'Get the sum of all values' },
{ value: ReducerID.count, label: 'Count', description: 'Get the number of values' },
{ value: ReducerID.last, label: 'Last', description: 'Get the last value' },
];
export const downsamplingTypes: Array<SelectableValue<string>> = [