@eyepop.ai/eyepop-render-2d 3.6.1 → 3.7.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -55,12 +55,12 @@ var BoxType = /* @__PURE__ */ ((BoxType2) => {
55
55
  var RenderBox = class _RenderBox {
56
56
  constructor(options = {}) {
57
57
  this.target = DEFAULT_TARGET;
58
- const { showClass = true, showConfidence = false, showTraceId = false, showNestedClasses = false, target = "$..objects.*", boxType = "rich" /* Rich */ } = options;
58
+ const { showClass = true, showConfidence = false, showTrackId = false, showNestedClasses = false, target = "$..objects.*", boxType = "rich" /* Rich */ } = options;
59
59
  this.target = target;
60
60
  this.showClass = showClass;
61
61
  this.showNestedClasses = showNestedClasses;
62
62
  this.showConfidence = showConfidence;
63
- this.showTraceId = showTraceId;
63
+ this.showTrackId = showTrackId;
64
64
  this.boxType = boxType;
65
65
  }
66
66
  start(context, style) {
@@ -151,8 +151,8 @@ var RenderBox = class _RenderBox {
151
151
  yOffset += this.drawLabel(label, context, element, yScale, xScale, yOffset, xOffset, style, boundingBoxWidth, padding, false, fontSize);
152
152
  }
153
153
  }
154
- if (this.showTraceId && element.traceId) {
155
- label = "ID: " + element.traceId;
154
+ if (this.showTrackId && element.trackId) {
155
+ label = "ID: " + element.trackId;
156
156
  label = _RenderBox.toTitleCase(label);
157
157
  yOffset += this.drawLabel(label, context, element, yScale, xScale, yOffset, xOffset, style, boundingBoxWidth, padding, false, fontSize);
158
158
  }
@@ -208,8 +208,8 @@ var RenderBox = class _RenderBox {
208
208
  yOffset += this.drawLabel(label, context, element, yScale, xScale, yOffset, xOffset, style, boundingBoxWidth, padding, false, fontSize);
209
209
  }
210
210
  }
211
- if (this.showTraceId && element.traceId) {
212
- label = "ID: " + element.traceId;
211
+ if (this.showTrackId && element.trackId) {
212
+ label = "ID: " + element.trackId;
213
213
  label = _RenderBox.toTitleCase(label);
214
214
  yOffset += this.drawLabel(label, context, element, yScale, xScale, yOffset, xOffset, style, boundingBoxWidth, padding, false, fontSize);
215
215
  }
@@ -287,8 +287,8 @@ var RenderBox = class _RenderBox {
287
287
  yOffset += this.drawLabel(label, context, element, yScale, xScale, yOffset, xOffset, style, boundingBoxWidth, padding, false, fontSize);
288
288
  }
289
289
  }
290
- if (this.showTraceId && element.traceId) {
291
- label = "ID: " + element.traceId;
290
+ if (this.showTrackId && element.trackId) {
291
+ label = "ID: " + element.trackId;
292
292
  label = _RenderBox.toTitleCase(label);
293
293
  yOffset += this.drawLabel(label, context, element, yScale, xScale, yOffset, xOffset, style, boundingBoxWidth, padding, false, fontSize);
294
294
  }
@@ -408,8 +408,8 @@ var RenderBox = class _RenderBox {
408
408
  }
409
409
  }
410
410
  }
411
- if (this.showTraceId && element.traceId) {
412
- const label = `ID: ${element.traceId}`;
411
+ if (this.showTrackId && element.trackId) {
412
+ const label = `ID: ${element.trackId}`;
413
413
  const formattedLabel = `${_RenderBox.toTitleCase(label)}`;
414
414
  if (formattedLabel.length > largestLabel.length) {
415
415
  largestLabel = formattedLabel;
@@ -3614,7 +3614,7 @@ var TRIM_INTERVAL = 1e3 * 1e3 * 1e3 * 10;
3614
3614
  var RenderTrail = class {
3615
3615
  constructor(options = {}) {
3616
3616
  this.target = DEFAULT_TARGET;
3617
- const { target = "$..objects[?(@.traceId)]", trailLengthSeconds = 1, traceDetails } = options;
3617
+ const { target = "$..objects[?(@.trackId)]", trailLengthSeconds = 1, traceDetails } = options;
3618
3618
  this.target = target;
3619
3619
  this.trailLengthNanos = trailLengthSeconds * 1e3 * 1e3 * 1e3;
3620
3620
  this.traceDetails = traceDetails;
@@ -3626,7 +3626,7 @@ var RenderTrail = class {
3626
3626
  this.style = style;
3627
3627
  }
3628
3628
  draw(element, xOffset, yOffset, xScale, yScale, streamTime) {
3629
- if (!element.traceId || streamTime.timestamp === void 0) {
3629
+ if (!element.trackId || streamTime.timestamp === void 0) {
3630
3630
  return;
3631
3631
  }
3632
3632
  const context = this.context;
@@ -3664,9 +3664,9 @@ var RenderTrail = class {
3664
3664
  const head = {
3665
3665
  points,
3666
3666
  timestamp: streamTime.timestamp,
3667
- next: this.traces.get(element.traceId) ?? null
3667
+ next: this.traces.get(element.trackId) ?? null
3668
3668
  };
3669
- this.traces.set(element.traceId, head);
3669
+ this.traces.set(element.trackId, head);
3670
3670
  const radius = element.width * xScale / 40;
3671
3671
  let n = 0;
3672
3672
  for (let entry = head; entry != null; entry = entry.next) {
@@ -3680,10 +3680,10 @@ var RenderTrail = class {
3680
3680
  }
3681
3681
  }
3682
3682
  if (streamTime.timestamp - this.lastTrim > TRIM_INTERVAL) {
3683
- this.traces.forEach((traceEntry, traceId) => {
3683
+ this.traces.forEach((traceEntry, trackId) => {
3684
3684
  const age = streamTime.timestamp - traceEntry.timestamp;
3685
3685
  if (age > this.trailLengthNanos) {
3686
- this.traces.delete(traceId);
3686
+ this.traces.delete(trackId);
3687
3687
  }
3688
3688
  });
3689
3689
  }