-
-
Notifications
You must be signed in to change notification settings - Fork 531
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Plotly plot in Plotly Pane inside Card does not work well. #1770
Comments
From what I see it's more a plotly problem. It seems like plotly is not height responsive |
Thanks @xavArtley Regarding the missing height responsiveness of Plotly.js I've created an issue here plotly/plotly.js#5270. I can see that there are some technical discussions on the (lack of) responsiveness here
Maybe somebody more technically skilled than me can find a solution some day. That might also solve I am thinking how to handle this. Because a new user of Panel would not know or care that it really is Plotly.js that is the issue. Should we put a small comment in the Plotly pane reference guide that Plotly is not height responsive and the the responsiveness of plotly overall is not that great? Additional Contexthttps://plotly.com/javascript/responsive-fluid-layout/ |
Here's an example that builds a width/height responsive plotly.js figure. This is a cleaned up version of the output of <html>
<head><meta charset="utf-8"/></head>
<body>
<div>
<script type="text/javascript">window.PlotlyConfig = {MathJaxConfig: 'local'};</script>
<script src="https://cdn.plot.ly/plotly-latest.min.js"></script>
<div id="0c689639-14e5-46c8-bb86-7c8fe6f132c6" class="plotly-graph-div" style="height:100%; width:100%;"></div>
<script type="text/javascript">
window.PLOTLYENV=window.PLOTLYENV || {};
if (document.getElementById("0c689639-14e5-46c8-bb86-7c8fe6f132c6")) {
Plotly.newPlot(
"0c689639-14e5-46c8-bb86-7c8fe6f132c6", // elemend id
[{"type": "scatter", "y": [1, 3, 2]}], // figure.data
{"title": {"text": "Fig title"}}, // figure.layout
{"responsive": true} // figure.config
)
};
</script>
</div>
</body>
</html> As I recall, I think it was important to explicitly set the width and height of the div enclosing the figure to |
Panel 0.10.1
I'm trying to create a demo streaming app with the different plotting libraries supported by Panel. I can see that the Plotly plot does not (re-)size well inside a card. And furthermore does not work responsively in the ReactTemplate.
Minimum reproducible example
The text was updated successfully, but these errors were encountered: