mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Geomap: Use set to order labels in reducer (#37509)
* shared location config * shared locaiton config * shared locaiton config * remove file * add alpha annotations * chore: set is already ordered Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
This commit is contained in:
parent
7323ba5ec1
commit
968817b151
@ -156,21 +156,17 @@ export function reduceSeriesToRows(
|
||||
}
|
||||
|
||||
export function getDistinctLabelKeys(frames: DataFrame[]): string[] {
|
||||
const ordered: string[] = [];
|
||||
const keys = new Set<string>();
|
||||
for (const frame of frames) {
|
||||
for (const field of frame.fields) {
|
||||
if (field.labels) {
|
||||
for (const k of Object.keys(field.labels)) {
|
||||
if (!keys.has(k)) {
|
||||
ordered.push(k);
|
||||
keys.add(k);
|
||||
}
|
||||
keys.add(k);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return ordered;
|
||||
return [...keys];
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user