Repository navigation
Conversation
hoverlabel
| @@ -0,0 +1 @@ | |||
| - Add `hoverlabel.borderwidth`, `hoverlabel.borderradius`, `hoverlabel.borderpad`, `hoverlabel.namecolor`, `hoverlabel.bgnamecolor`, and `hoverlabel.shadow` styling options [[#8115](https://github.com/plotly/plotly.js/pull/8115)] No newline at end of file | |||
There was a problem hiding this comment.
| - Add `hoverlabel.borderwidth`, `hoverlabel.borderradius`, `hoverlabel.borderpad`, `hoverlabel.namecolor`, `hoverlabel.bgnamecolor`, and `hoverlabel.shadow` styling options [[#8115](https://github.com/plotly/plotly.js/pull/8115)] | |
| - Add `hoverlabel.borderwidth`, `hoverlabel.borderradius`, `hoverlabel.borderpad`, `hoverlabel.namecolor`, `hoverlabel.bgnamecolor`, and `hoverlabel.shadow` styling options, and improve text contrast for secondary hover labels [[#8115](https://github.com/plotly/plotly.js/pull/8115)] |
|
Thanks for the PR! Our team will review and follow up. |
|
BTW, I just realized that there are currently no controls for the width of either the main hover label or the secondary hover label, and there is also no automatic text wrapping. This has actually been requested before: Width / automatic wrapping
#3800 was closed during the repository cleanup, but the requested I think it may make sense to add: hoverlabel: {
width: 200,
maxwidth: 300
}where Hover label positioningWhile looking into this, I also noticed that the positioning problem I reported in #7330 is closely related to the much older issue #381:
#381 has been open since 2016 and includes a proposal for: with values such as:
ref: #381 (comment) IMHO, I think options: Above may also be worth considering but in separate follow-ups. |
Addresses some requests in #2342 without closing it.
This PR adds several new
hoverlabelstyling options based on the discussion in #2342.New options:
hoverlabel.borderwidth— sets the hover label border widthhoverlabel.borderradius— sets the hover label border radiushoverlabel.borderpad— sets the padding between the text and the borderhoverlabel.namecolor— sets the secondary hover label text colorhoverlabel.bgnamecolor— sets the secondary hover label background colorhoverlabel.shadow— sets a drop shadow on the hover labelAdditional improvement
If
hoverlabel.namecoloris not specified, the trace color is preserved when it has sufficient contrast against the secondary label background (WCAG 4.5:1). Otherwise, a contrasting text color is used automatically.(Not sure whether this contrast improvement change belongs in this PR. Happy to move it out if preferred.)
Before/After
See the comparison in #2342 (comment).