disable default selection of button in range selector buttons
Personne n'a encore pris cette issue.
- Langage dominant
- JavaScript
- Étoiles
- 18.3k
- Forks
- 2k
- Merge moyen
- 2 j 12 h
- PR mergées (30 j)
- 28
Description
Hello all,
Right now, enabling the use of buttons in layout.xaxis.rangeselector makes it such that the button 'all' is always selected by default, no matter where it is positioned in the list of buttons. If the button 'all' is not present, the display is still rendered as if it was selected by default.
May we add a default (boolean) property inside a button to know which should be selected by default when first displaying the graph ? This could help to focus on a key point of the data, while allowing the user to zoom out by clicking the 'all' button or by double-clicking on the graph.
This property would be set to false by default, and if no buttons show a true value for this property, then the usual 'all' display shall be rendered.
Example :
Usual display
var layout = {
xaxis: {
autorange: true,
rangeselector: {
buttons: [
{
count: 1,
label: '1m',
step: 'month',
stepmode: 'backward'
},
{
count: 6,
label: '6m',
step: 'month',
stepmode: 'backward'
},
{
step: 'all'
}
]
},
rangeslider: {autorange: true},
type: 'date'
}
};
In the second case, when loading the page, we already have the 6 months zoom.
6 months button selected by default
var layout = {
xaxis: {
autorange: true,
rangeselector: {
buttons: [
{
count: 1,
label: '1m',
step: 'month',
stepmode: 'backward'
},
{
count: 6,
label: '6m',
step: 'month',
stepmode: 'backward',
default: true
},
{
step: 'all'
}
]
},
rangeslider: {autorange: true},
type: 'date'
}
};
Guide de contribution
Ouvrir le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Piste de recherche
Commencez par le traitement des boutons de xaxis.rangeselector décrit dans l’issue et suivez la manière dont la plage sélectionnée initialement est choisie. Le travail est terminé lorsqu’un bouton avec default: true contrôle la plage initiale, tandis que le comportement existant de « all » reste le fallback lorsqu’aucun bouton n’est marqué par défaut.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- javascript
- Domaine
- data-visualization
- Type d'issue
- Fonctionnalité
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Activité
- À l'abandon
- Clarté
- Plutôt claire
- Accessibilité débutants
- 35/100