plotly / plotly/plotly.py

allow aligning hovertext for annotations

Aberta
#3,583 1 comentário 1 reação 0 responsáveis Ver no GitHub

Ninguém assumiu esta issue ainda.

feature P3
Linguagem predominante
Python
Estrelas
18.8k
Forks
2.8k
Merge médio
16h 26min
PRs com merge (30d)
21

Descrição

It looks like there is no way to control the text justification for annotation hovertexts. For example:

# Make an background image
f = px.imshow( [[255]*6]*3, origin='lower')

# Add two annotations with hovertext
f.add_annotation( x=1, y=1, text='left', hovertext='Will be left justified<br>*', showarrow=False)
f.add_annotation( x=5, y=1, text='right', hovertext='Will be right justified<br>*', showarrow=False)

# Tighten the plot
f.update_layout( margin={'l':0, 'r':0, 't':0, 'b':0}, coloraxis_showscale=False)

# This will not apply on the annotation hovertext
f.update_layout( hoverlabel_align='left') 

# This does not exist and annotation hovertexts default to auto
# f.update_annotations( hoverlabel_align='left')

f.show()

The image hovertexts will be all properly left-justified, but the annotation hovertexts will default to 'auto', with the left one being left-justified, and the right one being right-justified. Am I missing something, or this is an omission in the tunable options? Is there some other way to force left-justification on the annotation hovertexts? I produce a set of tables that way that look atrocious otherwise.

Thanks!

Guia de contribuição

Abrir o guia de contribuição

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Direção de pesquisa

Comece pelas APIs de annotation mostradas em f.add_annotation e pelo comportamento de hoverlabel_align em f.update_layout; em seguida, rastreie como as opções de hovertext das annotations são expostas. O trabalho estará concluído quando os hovertexts das annotations puderem receber uma configuração explícita de alinhamento, incluindo os exemplos de alinhamento à esquerda e à direita descritos na issue.

Escrita pelo modelo de indexação a partir do texto da issue.

Avaliação

Stack de tecnologia
plotly, python
Domínio
data-visualization
Tipo de issue
Funcionalidade
Dificuldade
3/5
Tempo estimado
1-2 dias
Status de atividade
Estagnada
Clareza
Razoavelmente clara
Facilidade para iniciantes
45/100

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.