Examples/server/api/flask_embed.py: why is the rendered plot so small?

I ran the flask_embed.py script in the examples/ directory. I then viewed the plot in two different Chrome tabs: one accessing the Flask URL (which embeds the Bokeh plot), and the other accessing the Bokeh server URL directly.

I noticed that the plots are not the same size. The Flask app appears to shrink the plot. I would like the Flask app to show the plot as the same size. Is there any way to accomplish this?

I understand this might be a Flask or browser issue, but asking here because I am not sure.

I attempted to attach two screenshots illustrating the size difference, but cannot do so as a new user.

AFAIK the only difference is that that the flask page has the plot embedded in a div. I don’t really have any idea why things would be different, all I can suggest is that you open your browser dev tools and actually compare the DOM elements and computed CSS layout, etc side by side to see if anything jumps out to explain things.

After a little more experimentation, it appears that the issue only exists in Google Chrome. In Firefox, the plots are identical in size. The Firefox size matches the embedded plot size in Chrome, which perhaps implies that the non-embedded Chrome plot is oversized.

Inspecting the computed CSS layout in Google Chrome, I don’t see any notable differences.

That seems like something local / browser specific (per page zoom level override maybe?) so there’s obviously nothing we can do about that on our end.

You are right, I didn’t realize I had a zoom enabled on the localhost domain, and I was accessing one page via 127.0.01 and the other via localhost.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.