Skip to content

Fluid Resizing with plotly.py #512

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

Closed
GrainsofSalt opened this issue Jun 27, 2016 · 3 comments
Closed

Fluid Resizing with plotly.py #512

GrainsofSalt opened this issue Jun 27, 2016 · 3 comments

Comments

@GrainsofSalt
Copy link

Hey guys,

I was wondering if it would be possible to get the charts made by plotly.py to be retroactively resized with the browser window. As of now, it seems that there is only a js implementation for the minified version. It would be really convenient if the height and width attributes could take a percentage instead of a pixel value. This way, with a percentage set, one could use css to fluidly resize the entire structure of the webpage. Resizing the container of the chart would cause the chart to automatically resize. Not sure how difficult this would be, but since the plotly.py commands are not run within js, it makes fluid resizing very difficult.

I hope I haven't overlooked some super simple solution, and if I have please let me know! I am trying to adapt my web app for more than just desktop use. I would really like to make it mobile. I love how powerful plotly is with all of its graphing functionality, so I would prefer to continue with its use in the web app.

Thanks

@GrainsofSalt
Copy link
Author

Is it possible that in future updates charts will be able to fluidly resize with view ports as opposed to having a strict pixel height and width?

@jessexknight
Copy link

I was struggling to do this too, but I may have found a "super simple solution" :)
dcc.Graph( ... , style={'width':'100%'})
This yields fluid resizing of the div containing the chart, and auto-resizing of any charts within that.

Perhaps this issue can be closed?

@jonmmease
Copy link
Contributor

Closing as plots displayed using FigureWidget in the classic notebook or JupyterLab do autoresize with their container, as do offline iplot figures in JupyterLab using the @jupyterlab/plotly-extension. Resizing for offline iplot figures in the classic notebook is going to be looked at for version 3.4 (#970).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants