FieldValues: Use simple array in panel visualizations (#66706)

Co-authored-by: Leon Sorokin <leeoniya@gmail.com>
This commit is contained in:
Ryan McKinley
2023-04-17 14:46:29 -07:00
committed by GitHub
parent 50cb4f8998
commit 09f03e92bf
60 changed files with 265 additions and 320 deletions

View File

@@ -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);

View File

@@ -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]);
}
},
};

View File

@@ -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;
}
}

View File

@@ -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);