Skip to content

Commit

Permalink
Tweak visualization of point-in-time annotations
Browse files Browse the repository at this point in the history
This results in slightly nicer looking annotations when the
point-in-time annotation's start time matches an event's start time. The
improvement is visible in `TestVisualizationAnnotations`, for example.
  • Loading branch information
anishathalye committed Feb 18, 2025
1 parent 83594e4 commit cb1ebbb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions visualization/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,10 +178,10 @@ function render(data) {
// annotations goes in the opposite direction as that for events).
allData[allData.length - 1]['History'].forEach((el) => {
if (el['End'] === el['Start']) {
// point-in-time annotation
el['Start'] -= epsilon / 4
// point-in-time annotation: we adjust these to have a non-zero-duration;
// we only need to edit the end timestamp, and we can leave the start
// as-is
el['End'] += epsilon / 4
allTimestamps.add(el['Start'])
allTimestamps.add(el['End'])
} else {
// annotation touching another event or annotation
Expand Down

0 comments on commit cb1ebbb

Please sign in to comment.