[Feature request]: change height sizing policy of plotly htmlwidget to 100%
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- R
- Estrellas
- 2.7k
- Forks
- 641
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
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...
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Línea de trabajo
Comienza en el punto de entrada as_widget e inspecciona cómo se asigna la altura de la sizingPolicy predeterminada. Reproduce el ejemplo de tags$div con un contenedor de 5in y, a continuación, verifica que el widget use la altura del contenedor cuando la altura predeterminada sea 100%.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- r
- Área
- data-visualization
- Tipo de issue
- Nueva funcionalidad
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Estado de actividad
- Estancado
- Claridad
- Bien especificado
- Aptitud para principiantes
- 48/100