Align hover label text content with *hoverlabel.align*#3753
Conversation
... using their layout hoverlabel counterparts
- with values 'left', 'right' and 'auto' (the dflt and current behavior)
|
The default is center? I would have thought the default would be “auto” to describe the current behaviour |
|
Also re the description: this doesn’t just apply to “texts right? It applies to the entire contents of the hoverlabel, even if it’s built with hovertemplate etc? |
I think we could replace `text` by text in the description.
The default is actually |
The default is |
|
Wow. Sorry I made things confusing. The block I pasted in the PR description is in align: {
valType: 'enumerated',
values: ['left', 'right', 'auto'],
dflt: 'auto',
role: 'style',
editType: 'none',
description: [
'Sets the horizontal alignment of the text content within hover label box.',
'Has an effect only if the hover label text spans more two or more lines'
].join(' ')
},as found in |
|
@etpinard about your #3726 (comment) . Since there are two different things we may want to align, wouldn't it be safer to call this new attribute |
Fair. But you could say the same thing about annotations. |
|
|
🎉 that's what I thought. |
|
✨ from me :) |
|
💃 once the tests pass! |
|
Going with |
|
Would it be possible to allow center-aligning text as well? |
resolves #3726 by adding a new attribute under the
hoverlabeltrace and layout containers.See demo: https://codepen.io/etpinard/pen/MRJvLr?editors=1010
I picked align as its behavior reminded me of
alignin the annotations attributes:plotly.js/src/components/annotations/attributes.js
Lines 87 to 99 in 1dcee93
Let me know if you can think of a better name.
cc @plotly/plotly_js @nicolaskruchten