Table Unable to Become Invisible with 'updatemenus' Buttons
Ninguém assumiu esta issue ainda.
- Linguagem predominante
- JavaScript
- Estrelas
- 18.3k
- Forks
- 2k
- Merge médio
- 2d 12h
- PRs com merge (30d)
- 28
Descrição
I love plotly.js, such a fantastic library. I have very little javascript knowledge and yet have accomplished quite a lot. Unfortunately, I have run into a problem with the layout/updatemenus buttons. I am trying to create a set of buttons that would allow a user to switch from a "Chart" mode to a "Table" mode. When the user clicks "Table", it successfully displays the table, as you can see from the included codepen. Unfortunately, once the table is set to visible, it will never leave the screen, no matter what you select. The table continues to obscure the chart after you select "Chart".
https://codepen.io/rar83/pen/OJVvXWW
If this is indeed a bug, could someone possibly point out an alternative way of doing this? Or it is quite possible I am just using the plotly.js badly.
I have included a portion of the relevant code to show how I am turning on/off visibility, just as the documentation shows.
var updatemenus=[
{
buttons: [
{
args: [{'visible': [true, true, true, true, false]},{'xaxis.visible': true, 'yaxis.visible': true, 'autosize': true}],
label: 'Chart',
method: 'update'
},
{
args: [{'visible': [false, false, false, false, true]},{'xaxis.visible': false, 'yaxis.visible': false, 'autosize': false, 'width': 500}],
label: 'Table',
method:'update'
}
],
direction: 'left',
pad: {'r': 5, 't': 5},
showactive: true,
type: 'buttons',
x: 0.01,
xanchor: 'left',
y: 1.1,
yanchor: 'middle',
font: {size: '30'}
}
]
Guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Direção de pesquisa
Comece pelo CodePen vinculado e pela configuração de layout/updatemenus fornecida; rastreie as chamadas method: 'update' e seus arrays visible para os botões Chart e Table. Reproduza ambas as transições e confirme que selecionar Chart remove a tabela e restaura o layout do gráfico.
Escrita pelo modelo de indexação a partir do texto da issue.
Avaliação
- Stack de tecnologia
- javascript
- Domínio
- data-visualization, frontend
- Tipo de issue
- Bug
- Dificuldade
- 3/5
- Tempo estimado
- 1-2 dias
- Status de atividade
- Estagnada
- Clareza
- Razoavelmente clara
- Facilidade para iniciantes
- 35/100