I’m trying to make a custom Lovelace card that implements the plot.ly javascript library. I need to somehow include the plotly.js file. I have tried adding it as a resource in home assistant, and I’ve tried to include it in the beginning of the custom Lovelace card code, but these both have errors. I looked at the code for the Apex Charts lovelace card, and it looks like the entirety of the apexcharts.js file has just been included in the apex charts lovelace card js file, along with the bits for lovelace. So I tried doing the same and including all the code of the plotly.js file in my custom lovelace card, but it didn’t get me anywhere. I just get “Custom element doesn’t exist” as soon as I add the plotly.js code into my custom lovelace card.
The code in the Apex Charts lovelace card is all minified and I’m not sure where the apexcharts.js code ends and the lovelace custom card js starts, so I may be doing it wrong when I am trying to follow the example of that custom card.
Does anyone have any pointers for me?
Thanks so much!