✊🏿 Black Lives Matter. Please consider donating to Black Girls Code today.
⚡️ Concerned about the grid? Kyle Baranko teaches how to predicting peak loads using XGBoost. Register for the August webinar!

Width of Viewport in pixels

Hello, is there a way to get the current viewport width of the client in pixels in dash?

I’m trying to have my plot display a dna sequence via annotations once a certain zoom treshhold is reached. Based on the screen width this threshhold has to be different, since a smaller screen will fit less annotations(I don’t want to change the font size). Therefore I’d like to use the absolute width in order to calculate this value.
Since my graph is on autosize i can’t get the width from the layout and my google searches were unfortunately also fruitless.

3 Likes

I would like to build in conditional styling. Elg. if window size is lower that x show legend horizontally.