Yicong-Huang commented on code in PR #6213:
URL: https://github.com/apache/texera/pull/6213#discussion_r3888597071
##########
frontend/src/app/workspace/service/joint-ui/joint-ui.service.ts:
##########
@@ -515,6 +516,24 @@ export class JointUIService {
jointPaper.getModelById(operator.operatorID).attr("rect.body/fill",
JointUIService.getOperatorFillColor(operator));
}
+ /**
+ * Paints an operator's body fill for the performance heat-map overlay. The
heat-map owns only
+ * `rect.body/fill`, so it coexists with the execution-status border
(`rect.body/stroke`).
+ * A `score` of undefined means "no metrics captured yet" and paints a
neutral color.
Review Comment:
This was exact before the latest push and is now half the story.
`heatmapScores` also omits operators that *have* metrics and simply are not
measurable for the active view, so both causes arrive here as `undefined`. That
is the not-measurable-vs-measured-zero distinction `rawMetricForView` now
spends a paragraph establishing, so it is worth stating here too.
```suggestion
* A `score` of undefined means no heat is known for the operator — either
no metrics
* captured yet, or the active view is not measurable for it — and paints
a neutral color.
```
##########
frontend/src/app/workspace/service/joint-ui/joint-ui.service.ts:
##########
@@ -515,6 +516,24 @@ export class JointUIService {
jointPaper.getModelById(operator.operatorID).attr("rect.body/fill",
JointUIService.getOperatorFillColor(operator));
}
+ /**
+ * Paints an operator's body fill for the performance heat-map overlay. The
heat-map owns only
+ * `rect.body/fill`, so it coexists with the execution-status border
(`rect.body/stroke`).
+ * A `score` of undefined means "no metrics captured yet" and paints a
neutral color.
+ */
+ public applyHeatmapColor(jointPaper: joint.dia.Paper, operatorID: string,
score: number | undefined): void {
+ const fill = score === undefined ? HEATMAP_NO_DATA_COLOR :
scoreToColor(score);
+ jointPaper.getModelById(operatorID)?.attr("rect.body/fill", fill);
+ }
+
+ /**
+ * Restores an operator's default body fill (used when the heat-map overlay
is turned off),
+ * reusing the same source as the normal type/disable coloring.
Review Comment:
`getOperatorFillColor` branches only on `operator.isDisabled` (`#E0E0E0` /
`#FFFFFF`), so the body fill carries no operator-type component. As written a
reader goes looking for a type branch that is not there.
```suggestion
* reusing the same source as the normal enabled/disabled coloring.
```
--
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]