mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
FieldValues: Use simple array in panel visualizations (#66706)
Co-authored-by: Leon Sorokin <leeoniya@gmail.com>
This commit is contained in:
@@ -174,7 +174,7 @@ export const dynamicGeoJSONLayer: MapLayerRegistryItem<DynamicGeoJSONMapperConfi
|
||||
const field = findField(frame, config.idField);
|
||||
if (field) {
|
||||
idToIdx.clear();
|
||||
field.values.toArray().forEach((v, i) => idToIdx.set(v, i));
|
||||
field.values.forEach((v, i) => idToIdx.set(v, i));
|
||||
}
|
||||
|
||||
style.dims = getStyleDimension(frame, style, theme, config.dataStyle);
|
||||
|
||||
@@ -56,7 +56,7 @@ export const lastPointTracker: MapLayerRegistryItem<LastPointConfig> = {
|
||||
if (!out.field) {
|
||||
return; // ???
|
||||
}
|
||||
point.setGeometry(out.field.values.get(frame.length - 1));
|
||||
point.setGeometry(out.field.values[frame.length - 1]);
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
@@ -171,13 +171,13 @@ export const photosLayer: MapLayerRegistryItem<PhotoConfig> = {
|
||||
if (config.src) {
|
||||
const srcField: Field | undefined = findField(frame, config.src);
|
||||
if (srcField) {
|
||||
images = srcField?.values.toArray();
|
||||
images = srcField?.values;
|
||||
}
|
||||
} else {
|
||||
for (let i = 0; i < frame.fields.length; i++) {
|
||||
const field = frame.fields[i];
|
||||
if (field.type === FieldType.string) {
|
||||
images = field.values.toArray();
|
||||
images = field.values;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -229,7 +229,7 @@ export const routeLayer: MapLayerRegistryItem<RouteConfig> = {
|
||||
if (frame && time) {
|
||||
const timeField = frame.fields.find((f) => f.name === TIME_SERIES_TIME_FIELD_NAME);
|
||||
if (timeField) {
|
||||
const timestamps: number[] = timeField.values.toArray();
|
||||
const timestamps: number[] = timeField.values;
|
||||
const pointIdx = findNearestTimeIndex(timestamps, time);
|
||||
if (pointIdx !== null) {
|
||||
const out = getGeometryField(frame, location);
|
||||
|
||||
Reference in New Issue
Block a user