forked from grafana/grafana
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Transform: adding missing "table"-transform and "series to rows"-tran…
…sform to Grafana v7-transforms. (grafana#26042) * Fixed so the merge for table values works as it did before. * wip * fixed tests. * merge tests are green. * removed unused code and simplify the seriesToRows. * added time series to rows editor. * using getFrameDisplayName for the metric value. * updated description of transforms. * updated docs. * fixed according to feedback. * changed from images to markdown tables for the examples. * forgot to save :P
- Loading branch information
Showing
16 changed files
with
708 additions
and
359 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { DataFrame, FieldType } from '../types/dataFrame'; | ||
|
||
export const isTimeSerie = (frame: DataFrame): boolean => { | ||
if (frame.fields.length > 2) { | ||
return false; | ||
} | ||
return !!frame.fields.find(field => field.type === FieldType.time); | ||
}; | ||
|
||
export const isTimeSeries = (data: DataFrame[]): boolean => { | ||
return !data.find(frame => !isTimeSerie(frame)); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.