[FEATURE]: Add automatic contrast for secondary hover labels

Offen
#8,149 3 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Anfängerfreundlichkeit
58/100
Issue-Typ
Feature
Klarheit
Größtenteils klar
Aktivitätsstatus
Aktiv
Tech-Stack
javascript

Rechercherichtung

The issue points to Color.wcagContrast() and links PR #8115 and issue #2342. Read the review comment linked from PR #8115 and inspect how secondary hover labels get their text and background colors. Add automatic text color selection using a 4.5:1 contrast threshold, then verify that light trace colors produce readable labels while adequate contrast is preserved.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

enhancement feature P3 size: 1
Description

Secondary hover labels inherit their text color from the trace color. However, light or low contrast trace colors can make the text difficult to read against the label background.

I propose using Color.wcagContrast() with a 4.5:1 threshold to automatically select a more readable text color.

Related to #2342 and #8115 (see the review comment: https://github.com/plotly/plotly.js/pull/8115/changes/1926941923cda4b90e4258e9e48e8c9702543083#r4383215739).

Before
Image
After
Image
Vorherrschende Sprache
JavaScript
Sterne
18.4k
Forks
2.1k
Ø Merge
2 T. 16 Std.
Gemergte PRs (30 T.)
11

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus plotly/plotly.js

Alle Issues in plotly/plotly.js

Ähnliche Issues

Weitere Issues zu JavaScript

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.