plotly / plotly/plotly.js

Table Unable to Become Invisible with 'updatemenus' Buttons

Aperta
#4,640 3 commenti 1 reazione 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

bug P3
Lingua principale
JavaScript
Stelle
18.3k
Fork
2k
Merge medio
2g 12h
PR unite (30g)
28

Descrizione

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'}
      }
      ]

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia con il CodePen collegato e la configurazione layout/updatemenus fornita; traccia le chiamate method: 'update' e i relativi array visible per i pulsanti Chart e Table. Riproduci entrambe le transizioni e conferma che la selezione di Chart rimuove la tabella e ripristina il layout del grafico.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
javascript
Ambito
data-visualization, frontend
Tipo di issue
Bug
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.