Scripting to change size of annotation on zoom

Hi all,

I’m currently using plotly annotations to group box plots together in python. When fully zoomed out, the number of groups is high, so the annotation font needs to be small. But when I zoom in, the box plots are responsive and grow, but the annotations remain small. I’m wondering if there’s a way to add javascript to the .js file in the /assets/ directory to plug into the zoom level so I can adjust the annotation font size as it changes.