Skip to content

Heat-map operator fills read harsher than the same ramp in the legend #8594

Description

@PG1204

Task Summary

Soften how the performance heat-map paints operator bodies. The ramp itself is sound, and it is applied opaquely across the whole operator box, which reads far harsher than the identical ramp in the legend bar.

Context

Measured against ColorBrewer RdYlBu, which heatmap-color.ts names as its reference:

hex saturation lightness
COLD (code) #5b9bd5 59% 60%
ColorBrewer cold #4575b4 45% 49%
MID (code) #ffffbf 100% 87%
HOT (code) #e05a52 70% 60%
ColorBrewer hot #d73027 69% 50%

#ffffbf is RdYlBu's own midpoint, so the pure yellow is inherited rather than introduced. The cold end is the only real departure, and it was deliberate, lightened for label readability, per the comment on the constant.

The larger factor is painted area, not the ramp:

same scoreToColor() -> thin legend bar   (heatmap-legend.component.ts:57) -> reads fine
                    -> whole rect.body   (joint-ui.service.ts:537)        -> reads harsh

Proposed Change

Pick one. Cost is CIELAB ΔE end-to-end across the ramp; today it is 87.5.

Option ΔE after Cost
A. Blend the ramp ~35% toward white 54.7 (−37% range) One function. Also helps label contrast
B. Paint a strip inside the operator instead of the whole body 87.5 (unchanged) Element markup plus the repaint / restore paths
C. Re-anchor to the true ColorBrewer stops ~87.5 Darker fills; regresses the label readability the cold end was lightened for

Constraint: the border is not available - #6213 assigned rect.body/stroke to execution status.

Whichever is chosen, the legend and the fills must stay derived from one source. Blending only at the fill site would leave the legend advertising colors the canvas never shows.

Required Test

  • heatmap-color.spec.ts pins scoreToColor at 0 / 0.5 / 1 to exact hex; update those three if the ramp changes.
  • Assert the legend gradient and the operator fill resolve to the same color for a given score, so the two cannot drift.
  • For option B, assert the strip is cleared by restoreOperatorFill when the overlay is turned off.

Related

Raised in #8552. Part of the heat-map umbrella #5772; the ramp and legend landed in #6213.

Task Type

  • Refactor / Cleanup
  • DevOps / Deployment / CI
  • Testing / QA
  • Documentation
  • Performance
  • Other

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions