How to write javascript in html.Script()? (dash_html_components)

i wanna use chartjs in my app
how can use html.Script() ?

I don’t think you’ll have much success combining chart.js through plain Javascript with Dash, because Dash is based on React, which has its own virtual DOM that can clash with direct changes to the DOM. You’re best off wrapping chart.js up as a Dash component in order to do this.

There’s already a react-chartjs project, so a bunch of the work is already done; you just need to convert these react components into Dash components. See the sections React for Python Developers and Build Your Own Components in the Dash guide.

What features of chart.js do you want to use that plotly.js doesn’t have?

Hi, you can try visdcc.Run_js, it allows you run javascript by easy way, or you need to build your own dash components