Skip to content

Commit bc9b386

Browse files
committed
adressed comments
1 parent 695fd05 commit bc9b386

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

src/ui/grids/composables/useSharedGridLogic.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,8 @@ export function useSharedGridLogic() {
215215
high
216216
);
217217
store.updateHistogram(histogram);
218+
} else {
219+
store.updateHistogram(undefined);
218220
}
219221
}
220222

src/utils/histogram.ts

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -65,19 +65,20 @@ function filterInvalidData(
6565
missingValue?: number,
6666
fillValue?: number
6767
) {
68-
const rawData = data as ArrayLike<number>;
69-
const validData = Array.from(rawData).filter((value) => {
68+
const validData: number[] = [];
69+
for (let i = 0; i < data.length; i++) {
70+
const value = data[i];
7071
if (!isFinite(value)) {
71-
return false;
72+
continue;
7273
}
7374
if (missingValue !== undefined && value === missingValue) {
74-
return false;
75+
continue;
7576
}
7677
if (fillValue !== undefined && value === fillValue) {
77-
return false;
78+
continue;
7879
}
79-
return true;
80-
});
80+
validData.push(value);
81+
}
8182
return validData;
8283
}
8384

0 commit comments

Comments
 (0)