mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
GraphNG: flip logic so we can explicitly say the field types to keep (#33140)
This commit is contained in:
parent
534614063a
commit
5f54f2dc00
@ -96,7 +96,7 @@ class UnthemedGraphNG extends React.Component<GraphNGProps, GraphNGState> {
|
|||||||
|
|
||||||
return {
|
return {
|
||||||
...state,
|
...state,
|
||||||
data: preparePlotData(frame, [FieldType.string]),
|
data: preparePlotData(frame, [FieldType.number]),
|
||||||
alignedDataFrame: frame,
|
alignedDataFrame: frame,
|
||||||
seriesToDataFrameFieldIndexMap: frame.fields.map((f) => f.state!.origin!),
|
seriesToDataFrameFieldIndexMap: frame.fields.map((f) => f.state!.origin!),
|
||||||
dimFields,
|
dimFields,
|
||||||
|
@ -35,7 +35,7 @@ export function buildPlotConfig(props: PlotProps, plugins: Record<string, PlotPl
|
|||||||
|
|
||||||
/** @internal */
|
/** @internal */
|
||||||
|
|
||||||
export function preparePlotData(frame: DataFrame, ignoreFieldTypes?: FieldType[]): AlignedData {
|
export function preparePlotData(frame: DataFrame, keepFieldTypes?: FieldType[]): AlignedData {
|
||||||
const result: any[] = [];
|
const result: any[] = [];
|
||||||
const stackingGroups: Map<string, number[]> = new Map();
|
const stackingGroups: Map<string, number[]> = new Map();
|
||||||
let seriesIndex = 0;
|
let seriesIndex = 0;
|
||||||
@ -57,7 +57,7 @@ export function preparePlotData(frame: DataFrame, ignoreFieldTypes?: FieldType[]
|
|||||||
seriesIndex++;
|
seriesIndex++;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (ignoreFieldTypes && ignoreFieldTypes.indexOf(f.type) > -1) {
|
if (keepFieldTypes && keepFieldTypes.indexOf(f.type) < 0) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
collectStackingGroups(f, stackingGroups, seriesIndex);
|
collectStackingGroups(f, stackingGroups, seriesIndex);
|
||||||
|
Loading…
Reference in New Issue
Block a user