AnnotationsPlugin2: Skip zero-length, field-less, and time-less frames (#80810)

This commit is contained in:
Leon Sorokin 2024-01-18 08:34:28 -06:00 committed by GitHub
parent 3903d3eb94
commit 2c5289028d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -69,7 +69,9 @@ export const AnnotationsPlugin2 = ({
const getColorByName = useTheme2().visualization.getColorByName;
const annos = useMemo(() => {
let annos = annotations.filter((frame) => frame.name !== 'exemplar');
let annos = annotations.filter(
(frame) => frame.name !== 'exemplar' && frame.length > 0 && frame.fields.some((f) => f.name === 'time')
);
if (newRange) {
let isRegion = newRange.to > newRange.from;