|
|
@ -13,6 +13,7 @@ import { |
|
|
toggleFrameNorm, |
|
|
toggleFrameNorm, |
|
|
toggleVelocity, |
|
|
toggleVelocity, |
|
|
toggleStationaryColor, |
|
|
toggleStationaryColor, |
|
|
|
|
|
toggleConfirmedOnly, |
|
|
} from "./dom.js"; |
|
|
} from "./dom.js"; |
|
|
|
|
|
|
|
|
// Defines a set of SNR (Signal-to-Noise Ratio) colors.
|
|
|
// Defines a set of SNR (Signal-to-Noise Ratio) colors.
|
|
|
@ -277,8 +278,15 @@ export function drawTrajectories(p, plotScales) { |
|
|
const localTtcColors = ttcColors(p); |
|
|
const localTtcColors = ttcColors(p); |
|
|
|
|
|
|
|
|
for (const track of appState.vizData.tracks) { |
|
|
for (const track of appState.vizData.tracks) { |
|
|
|
|
|
// if (toggleConfirmedOnly.checked && track.isConfirmed === false) {
|
|
|
|
|
|
// continue;
|
|
|
|
|
|
// }
|
|
|
if (!track || !track.historyLog || !Array.isArray(track.historyLog)) { |
|
|
if (!track || !track.historyLog || !Array.isArray(track.historyLog)) { |
|
|
// Safeguard for malformed data
|
|
|
|
|
|
|
|
|
const trackId = track ? track.id : 'Unknown ID'; |
|
|
|
|
|
console.warn( |
|
|
|
|
|
`Skipping malformed track in frame ${appState.currentFrame}. Track ID: ${trackId}`, |
|
|
|
|
|
track // We also log the entire track object for detailed inspection.
|
|
|
|
|
|
); // Safeguard for malformed data
|
|
|
continue; |
|
|
continue; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@ -405,6 +413,9 @@ export function drawTrackMarkers(p, plotScales) { |
|
|
for (const track of appState.vizData.tracks) { |
|
|
for (const track of appState.vizData.tracks) { |
|
|
// --- START: Add the Same Safeguard Here ---
|
|
|
// --- START: Add the Same Safeguard Here ---
|
|
|
// This robust check ensures the track and its historyLog are valid before use.
|
|
|
// This robust check ensures the track and its historyLog are valid before use.
|
|
|
|
|
|
// if (toggleConfirmedOnly.checked && track.isConfirmed === false) {
|
|
|
|
|
|
// continue;
|
|
|
|
|
|
// }
|
|
|
if (!track || !track.historyLog || !Array.isArray(track.historyLog)) { |
|
|
if (!track || !track.historyLog || !Array.isArray(track.historyLog)) { |
|
|
// We don't need to log a warning here again, as drawTrajectories already did.
|
|
|
// We don't need to log a warning here again, as drawTrajectories already did.
|
|
|
// We can just safely skip this malformed track.
|
|
|
// We can just safely skip this malformed track.
|
|
|
|