[Feature request]: change height sizing policy of plotly htmlwidget to 100%
Personne n'a encore pris cette issue.
- Langage dominant
- R
- Étoiles
- 2.7k
- Forks
- 641
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Description
Can we change the default widget height sizing policy set in as_widget to 100%. Right now it is 400px and this makes it hard to make a plot to fill its container along the height.
For example, I am hoping to use the following simplified example to change my plot to height 5in. It does not work (for me), because the style of the resulting htmlwidget is set to the default "400px"
tags$div(style="width: 100%; height: 5in",
plot_ly(x=1, y=1, type="scatter", mode="markers")
)
The following on the other hand does the job.
tags$div(style="width: 100%; height: 5in",
plot_ly(x=1, y=1, type="scatter", mode="markers") %T>% {
.$sizingPolicy$defaultHeight<-"100%"
}
)
It seems to me that a default height of "100%", like the default for width, makes more sense (allowing for the container to control the size) than the arbitrary "400px" used right now.
I really would like to control the height of my plots in a R markdown html document and this was the only solution I could come up with: R plotly seems to deal fine with "px" units, but setting inches and % did not work. Perhaps I am missing something...
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 au point d’entrée as_widget et examinez comment la hauteur de la sizingPolicy par défaut est attribuée. Reproduisez l’exemple tags$div avec un conteneur de 5in, puis vérifiez que le widget utilise la hauteur du conteneur lorsque la hauteur par défaut est de 100 %.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- r
- Domaine
- data-visualization
- Type d'issue
- Fonctionnalité
- Difficulté
- 2/5
- Temps estimé
- 1-3 heures
- Activité
- À l'abandon
- Clarté
- Clairement spécifiée
- Accessibilité débutants
- 48/100