Table Unable to Become Invisible with 'updatemenus' Buttons
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- JavaScript
- Sterne
- 18.3k
- Forks
- 2k
- Ø Merge
- 2 T. 12 Std.
- Gemergte PRs (30 T.)
- 28
Beschreibung
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'}
}
]
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginnen Sie mit dem verlinkten CodePen und der bereitgestellten layout/updatemenus-Konfiguration; verfolgen Sie die method: 'update'-Aufrufe und ihre visible-Arrays für die Chart- und Table-Schaltflächen. Reproduzieren Sie beide Übergänge und bestätigen Sie, dass die Auswahl von Chart die Tabelle entfernt und das Chart-Layout wiederherstellt.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- javascript
- Bereich
- data-visualization, frontend
- Issue-Typ
- Bug
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100