plotly / plotly/plotly.js

Feature Request: Add vertical spacing option between plot and rangeslider

Aperta
#7,510 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

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

Descrizione

Hi Plotly team ,

I'm working with rangeslider in a dual-axis layout (xaxis + xaxis2, yaxis2), and I’d like to request a feature that allows more control over the vertical spacing between the plot area and the rangeslider.

In the current setup, the rangeslider always appears directly below the main plot and sometimes the labels are inside the rangeslider.

Screenshot of plotly figure

The definition of the layout is:

function staticLayout(): object {
  
  return {
    margin: {l: 70, r: 20, t: 10, b: 20},
    showlegend: true,
    legend: {
      orientation: 'h',
      x: 0,
      y: 1.02,
      yanchor: 'bottom',
    },
    xaxis: {
      domain: [0.0, 1.0],
      anchor: 'y',     
      side: 'bottom',    
      title: {
        text: 'Time (s)',
        standoff: 15
      },
      automargin: true,
      rangeslider: {
        visible: true,
        thickness: 0.07,
        bgcolor: "#f5f5f5",
        bordercolor: "black",
        borderwidth: 1,
      },
      showticklabels: false,
      showgrid: false,
      zeroline: false,
      fixedrange: true,
    },
    yaxis: {
      visible: false,
      showticklabels: false,
      showgrid: false,
      zeroline: false,
      showline: false,
      overlaying: 'y2',
    },
    xaxis2: {
      anchor: 'y2',      
      side: 'bottom',    
      // type: 'log',
      ticklabelposition: 'outside',
    },
    yaxis2: {
      anchor: 'x2',
      zeroline: false,
      showticklabels: true,
      ticklabelposition: 'outside',
    }
  };
}

How can I fix the spacing?

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 riproducendo il layout a due assi fornito con xaxis.rangeslider e il comportamento di sovrapposizione delle etichette mostrato nello screenshot. Traccia il punto in cui viene determinata la spaziatura tra il grafico e rangeslider, quindi definisci l’opzione di spaziatura richiesta e verifica che l’esempio separi il grafico e rangeslider senza posizionare etichette al suo interno.

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

Valutazione

Stack tecnologico
javascript
Ambito
data-visualization
Tipo di issue
Funzionalità
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Da chiarire
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.