Skip to content
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

Graphs auto shrunk with Voila #2083

Closed
b060149ee opened this issue Jan 16, 2020 · 8 comments
Closed

Graphs auto shrunk with Voila #2083

b060149ee opened this issue Jan 16, 2020 · 8 comments

Comments

@b060149ee
Copy link

Hi,

We use plotly, jupyter lab and voila for our work. Recently we have started facing an issue with plotly graphs in our notebook files shrinking completely. This behaviour is experienced with standalone voila execution of notebooks and also when a voila button is clicked in Jupyter Lab.

The current plotly version that we use is 4.4.1 and voila is at 0.1.20.

Please note that this behavior is not consistent. Sometimes both the graphs shrink, sometimes just one graph shrinks, other times both do not shrink. Also, most importantly, as soon as I resize the window that has these graphs, the graphs come back and autofit properly.

See the 'svg-container' div element's width and height attributes in the below image - one graph's width and heights are in px values, whereas the other graph's in %.

image

By shrink, I mean this:

image

Any kind of help is appreciated. I'm unable to give a reproducible notebook, so I apologize in advance. My only hope is that ppl who are aware of plotly's svg-container div elements would understand the issue right away with the way the width elements are sometimes pixels and %s.

Thanks,

@jg1141
Copy link

jg1141 commented Jan 21, 2020

Seeing identical issue with plotly==4.2.1, voila==0.1.18

@emmanuelle
Copy link
Contributor

Hi @b060149ee and @jg1141 thanks for the report. It would really help if you could share a standalone notebook reproducing the issue, because I made a quick test with a plotly figure in a notebook and the voila rendered app looked good, so it's hard to investigate. Thanks!

@jg1141
Copy link

jg1141 commented Jan 22, 2020

@emmanuelle In this notebook, I reproduced your success with a SINGLE plot, then kept adding plots until the issue came up (after 4th plot) as shown in screenshot
Screen Shot 2020-01-22 at 1 19 57 PM

.

@jg1141
Copy link

jg1141 commented Jan 22, 2020

Note that in re-testing this example just now, if I render the plots in JupyterLab FIRST, then Voilà works perfectly, but if I reset the kernel and JUST run the notebook in Voilà, the first and second plots are shrunk as shown.

@deangoodmanson
Copy link

Noticed this today myself. Has anyone identified a workaround?

@Okroshiashvili
Copy link

Okroshiashvili commented Apr 11, 2020

I also encountered this issue today. Some plots were rendering by Voila but some not. I tried almost everything to solve this problem but nothing worked. After that, I noticed that indicating width and height parameters in figure layout solved the issue.

In this example, I introduced width, heigh parameters and works perfectly.


values = df['social-network'].value_counts().sort_index().tolist()

fig = go.Figure(data=[go.Pie(labels=labels,
                             values=values,
                             text=labels,
                             textposition='auto',
                             hoverinfo='label+percent')])

fig.update_layout(title_text='Social Network Distribution',width=900, height=700)

fig.show(renderer='notebook')```

@jitendra123609
Copy link

Thank u so much dear. Okroshiashvili.
It perfectly worked.
God bless u.
Om Shanti.

@gvwilson
Copy link
Contributor

Hi - we are trying to tidy up the stale issues and PRs in Plotly's public repositories so that we can focus on things that are still important to our community. Since this one has been sitting for several years, I'm going to close it; if it is still a concern, please add a comment letting us know what recent version of our software you've checked it with so that I can reopen it and add it to our backlog. Thanks for your help - @gvwilson

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

7 participants