updated for new plotly api
updated for new plotly api