mengw15 commented on code in PR #9021:
URL: https://github.com/apache/texera/pull/9021#discussion_r4689889254


##########
frontend/src/app/workspace/component/workflow-form/workflow-form.component.ts:
##########
@@ -371,15 +367,14 @@ export class WorkflowFormComponent implements OnInit, 
OnDestroy {
     // views switch, so a step chosen there is already selected here and no 
event will say so.
     this.syncSelectionFromHighlight();
 
-    // A result changing bumps that operator's version (so its chart frame is 
rebuilt, not reused),
-    // re-limits what the form shows to the currently-viewed set, and re-fits 
the visualisations.
+    // A result update re-limits what the form shows and re-fits the 
visualisations. The chart
+    // frame is left alone: it redraws in place on its own operator's updates. 
The per-operator
+    // version that used to key the frame here never produced a second frame 
-- a visualisation
+    // operator draws once, from its whole input -- so it is gone; the 
measurements are on #8759.

Review Comment:
   This isn't true for every visualisation: HTML Visualizer and URL Visualizer 
output one row per input row, so a slow source sends several updates with a 
picture. On main each one rebuilds the frame, which is the flicker in #8759, 
and this PR does fix it. Also, there are no measurements on #8759. Could you 
correct this comment, the one in the template, and the description?



##########
frontend/src/app/workspace/component/visualization-panel-content/visualization-frame-content.component.ts:
##########
@@ -45,13 +45,18 @@ export class VisualizationFrameContentComponent implements 
AfterContentInit {
     // attempt to draw chart immediately
     this.drawChart();
 
-    // setup an event lister that re-draws the chart content every (n) 
milliseconds
-    // auditTime makes sure the first re-draw happens after (n) milliseconds 
has elapsed
+    // Re-draw on this operator's result updates, at most once per 
UPDATE_INTERVAL_MS: auditTime
+    // holds the first re-draw until the interval has elapsed. Filter BEFORE 
auditing: an update
+    // event carries only the operators whose result changed, so with the 
audit first a window that
+    // closed on another operator's event handed the filter that event, and 
this operator's pending
+    // re-draw was lost -- the last update of a run showed the previous 
picture for good.
     this.workflowResultService
       .getResultUpdateStream()
-      .pipe(auditTime(VisualizationFrameContentComponent.UPDATE_INTERVAL_MS))
-      .pipe(filter(rec => this.operatorId !== undefined && 
rec[this.operatorId] !== undefined))
-      .pipe(untilDestroyed(this))
+      .pipe(
+        filter(rec => this.operatorId !== undefined && rec[this.operatorId] 
!== undefined),
+        auditTime(VisualizationFrameContentComponent.UPDATE_INTERVAL_MS),

Review Comment:
   With the key gone, a quick re-run shows the old chart for 2 more seconds. 
Results are first polled 2 s after the run starts, so a run that finishes 
sooner sends a single update, already carrying the new picture. Nothing clears 
the previous result, so the frame is still mounted and waits out this window. 
On main the key redraws it at once.
   
   I ran this with the real result service: the new picture appears immediately 
on main, and after 2 s here. Drawing on the first update (`throttleTime` with 
leading and trailing) fixes it and still keeps the same frame.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to