Skip to content

Commit 3280609

Browse files
Lena Kashtelyanmeta-codesync[bot]
authored andcommitted
Make infeasible arm red hover outlines 40% opaque (#5057)
Summary: Pull Request resolved: #5057 Saw the bright red, found it a bit jarring: {F1986915507} Updating to (from N9873964): {F1986917158} --- Claude stuff [ax] Make infeasible arm red hover outlines 60% opaque The red outlines added by D94783502 for infeasible arms in ScatterPlot and ArmEffectsPlot are fully opaque. This makes them 60% opaque by changing the INFEASIBLE_OUTLINE_COLOR from 'red' to 'rgba(255, 0, 0, 0.6)', resulting in a softer visual indicator that is less visually jarring while still clearly marking constraint violations. Changes: - plotly/utils.py: Change INFEASIBLE_OUTLINE_COLOR from 'red' to 'rgba(255, 0, 0, 0.6)' - Tests: Update test assertions to match new rgba color value Reviewed By: SebastianAment Differential Revision: D96936657 fbshipit-source-id: efc2cf593d40e7dc92e6f0ecfab4b4b2c32942dc
1 parent 987833b commit 3280609

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

ax/analysis/plotly/tests/test_arm_effects.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ def test_infeasible_arms_have_red_outline(self) -> None:
359359
# Single trace containing all infeasible arms
360360
self.assertEqual(len(infeasible_traces), 1)
361361
trace = infeasible_traces[0]
362-
self.assertEqual(trace["marker"]["line"]["color"], "red")
362+
self.assertEqual(trace["marker"]["line"]["color"], "rgba(255, 0, 0, 0.6)")
363363
self.assertGreater(trace["marker"]["line"]["width"], 0)
364364
# The trace should contain 2 infeasible points
365365
self.assertEqual(len([x for x in trace["x"] if x is not None]), 2)

ax/analysis/plotly/tests/test_scatter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@ def test_infeasible_arms_have_red_outline(self) -> None:
422422
# Single trace containing all infeasible arms
423423
self.assertEqual(len(infeasible_traces), 1)
424424
trace = infeasible_traces[0]
425-
self.assertEqual(trace["marker"]["line"]["color"], "red")
425+
self.assertEqual(trace["marker"]["line"]["color"], "rgba(255, 0, 0, 0.6)")
426426
self.assertGreater(trace["marker"]["line"]["width"], 0)
427427
# The trace should contain 2 infeasible points
428428
self.assertEqual(len([x for x in trace["x"] if x is not None]), 2)

ax/analysis/plotly/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
SINGLE_CANDIDATE_TRIAL_LEGEND: str = "Candidate Trial"
7474
MULTIPLE_CANDIDATE_TRIALS_LEGEND: str = "Candidate Trials"
7575

76-
INFEASIBLE_OUTLINE_COLOR: str = "red"
76+
INFEASIBLE_OUTLINE_COLOR: str = "rgba(255, 0, 0, 0.6)"
7777
INFEASIBLE_OUTLINE_WIDTH: float = 2.0
7878
INFEASIBLE_LEGEND_NAME: str = "Likely Infeasible"
7979

0 commit comments

Comments
 (0)