Plotly js - scatter plot chart responsive issue

A bit of a guess, but this sounds very much like what some code that @aimped posted in another thread does. This code is set up to use Dash, but I think it should be adaptable to plotly.js