Sorry to say that, but your script is not correct at all actually. You should really read the basic documentation about Dash Plotly: https://dash.plotly.com/tutorial
Good luck!