From b905f8536bced93e25d9943461a76b8c6521c70a Mon Sep 17 00:00:00 2001 From: rakadu1 Date: Wed, 14 Jan 2026 11:37:19 +0530 Subject: [PATCH] added state beside ttc marker on the visualization. --- steps/src/drawUtils.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/steps/src/drawUtils.js b/steps/src/drawUtils.js index 3decfe3..1840cb8 100644 --- a/steps/src/drawUtils.js +++ b/steps/src/drawUtils.js @@ -522,11 +522,14 @@ export function drawTrackMarkers(p, plotScales) { // Defer Text Drawing const speed = (Math.sqrt(vx * vx + vy * vy) * 3.6).toFixed(1); - const ttc = + let ttcText = log.ttc !== null && isFinite(log.ttc) && log.ttc < 100 ? `TTC: ${log.ttc.toFixed(1)}s` : ""; - const text = `ID: ${track.id} | ${speed} km/h\n${ttc}`; + if (log.state !== undefined && log.state !== null) { + ttcText += ttcText ? ` | st: ${log.state}` : `st: ${log.state}`; + } + const text = `ID: ${track.id} | ${speed} km/h\n${ttcText}`; textLabels.push({ x, y, text }); }