mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Transformers: PartitionByValues (#56767)
Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
This commit is contained in:
@@ -32,7 +32,8 @@ export const filterFieldsByNameTransformer: DataTransformerInfo<FilterFieldsByNa
|
||||
),
|
||||
};
|
||||
|
||||
const getMatcherConfig = (options?: RegexpOrNamesMatcherOptions): MatcherConfig | undefined => {
|
||||
// Exported to share with other implementations, but not exported to `@grafana/data`
|
||||
export const getMatcherConfig = (options?: RegexpOrNamesMatcherOptions): MatcherConfig | undefined => {
|
||||
if (!options) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
@@ -35,4 +35,5 @@ export enum DataTransformerID {
|
||||
extractFields = 'extractFields',
|
||||
groupingToMatrix = 'groupingToMatrix',
|
||||
limit = 'limit',
|
||||
partitionByValues = 'partitionByValues',
|
||||
}
|
||||
|
||||
@@ -1,21 +1,19 @@
|
||||
import { DataTransformerInfo } from '../../types/transformations';
|
||||
import { DataFrame } from '../../types';
|
||||
import { SynchronousDataTransformerInfo } from '../../types/transformations';
|
||||
|
||||
import { DataTransformerID } from './ids';
|
||||
|
||||
export interface NoopTransformerOptions {
|
||||
include?: string;
|
||||
exclude?: string;
|
||||
}
|
||||
export interface NoopTransformerOptions {}
|
||||
|
||||
export const noopTransformer: DataTransformerInfo<NoopTransformerOptions> = {
|
||||
export const noopTransformer: SynchronousDataTransformerInfo<NoopTransformerOptions> = {
|
||||
id: DataTransformerID.noop,
|
||||
name: 'noop',
|
||||
description: 'No-operation transformer',
|
||||
defaultOptions: {},
|
||||
|
||||
/**
|
||||
* Return a modified copy of the series. If the transform is not or should not
|
||||
* be applied, just return the input series
|
||||
*/
|
||||
/** no operation */
|
||||
operator: (options: NoopTransformerOptions) => (source) => source,
|
||||
|
||||
/** no operation */
|
||||
transformer: (options: NoopTransformerOptions) => (data: DataFrame[]) => data,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user