';
for (const item of result.items) {
@@ -321,16 +411,17 @@
const leftPct = (visSp / bucketCount * 100).toFixed(4);
const widthPct = ((visEp - visSp) / bucketCount * 100).toFixed(4);
const w = Math.max(parseFloat(widthPct), 0.3);
- const top = 10 + item.lane * (SEG_H + SEG_GAP);
+ const top = TRACK_TOP + item.lane * (SEG_H + SEG_GAP);
const seg = item.seg;
html += '
';
}
- if (hasEvt) {
+ {
const evtY = segAreaH + 8;
const seen = new Set();
- for (const evt of row.events) {
- const ep = calcPosition(evt.at_iso, from, to, bucketCount);
+ for (const item of visibleEvents) {
+ const evt = item.evt;
+ const ep = item.ep;
const key = evt.label + '|' + evt.at_iso;
if (seen.has(key)) continue;
seen.add(key);
@@ -339,13 +430,18 @@
? '
'
: '
';
const epPct = (ep / bucketCount * 100).toFixed(4);
- html += '
' + shape + '
';
+ const parentItem = evt.is_state_node ? segmentById.get(String(evt.parent_entry_id || '')) : null;
+ const eventTop = parentItem ? TRACK_TOP + parentItem.lane * (SEG_H + SEG_GAP) + SEG_H - 2 : segAreaH + (item.lane || 0) * (EVENT_H + EVENT_GAP);
+ const labelClass = evt.is_state_node ? 'tl-state-label' : 'tl-event-label';
+ const labelStyle = FLOAT_LABEL_STYLE + (evt.is_state_node ? ';opacity:0;visibility:hidden;transform:translateY(-2px);transition:opacity .12s,visibility .12s,transform .12s' : '');
+ const eventLabel = '
' + esc(evt.label) + '';
+ html += '
' + shape + eventLabel + '
';
}
}
html += '