Scattergl slow with react


I am using plotly in my Python backend to generate three scattergl plots and send them in JSON format to the frontend made with React (using react-plotly.js).
With 30K data points it works perfect, but with 300K the website does not respond.

Do you know how to optimize the plots so they work with that number of points?