[FEATURE]: Better error message for axis scaling.
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- JavaScript
- Estrellas
- 18.3k
- Forks
- 2k
- Merge medio
- 2 d 12 h
- PR fusionados (30 d)
- 28
Descripción
Description
Currently, when a Plotly chart is rendered inside a container <div> that is too small (e.g., height = 0 or very small), Plotly.js throws a very broad error:
Uncaught (in promise) Error: Something went wrong with axis scaling
The error stack traces to internal scaling functions, but it provides no actionable guidance for the developer. In my case, the issue was resolved by explicitly setting a minimum height on the container:
#plotlyContainer {
min-height: 600px;
}
The error message should instead clearly indicate that the container element is too small to render the chart, so developers can quickly diagnose the problem.
Why should this feature be added?
- Improved developer experience: The current error is misleading and vague. Many users may spend significant time debugging chart data or layout issues when the root cause is the container size.
- Faster debugging: A clear, descriptive error such as "Plotly container height is too small to render the chart" would allow developers to quickly fix layout issues.
- Prevents unnecessary workarounds: Developers currently have to discover these issues through trial and error.
Mocks/Designs
No visual mockups required. The requested change is purely to improve the clarity of the error message.
Notes
- This could potentially be implemented as a validation step during
Plotly.newPlotthat checks the container's computed height and width before rendering. - It might also be helpful to provide a warning in the console if either dimension is below a certain threshold.
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 Plotly.newPlot y sigue el error existente de escalado de ejes descrito en el issue. Determina dónde están disponibles las dimensiones del contenedor y cómo se produce el error actual; el trabajo estará terminado cuando el fallo indique que el contenedor es demasiado pequeño para renderizar el gráfico y guíe a los desarrolladores para corregir sus dimensiones.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- javascript
- Área
- data-visualization
- Tipo de issue
- Nueva funcionalidad
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 35/100