Are you also using stimulus? It would be much better if you attached a controller to your tag inside the turbo frame and created your chart in the connect method.
Hi Lee, yes, I am and also thought about this approach, but this code was/is from the pre-turbo era and it worked this way. Maybe I will move the js code to a stimulus controller.
I think that’s the best idea. I’m looking at setting up a controller to use SortableJS now, but without webpacker so I need to figure out which .JS file to put where.
I’m guessing the .esm.js file into /assets/javascripts/libraries?
That said, I got impatient and found that making Stimulus controllers for loading things like this was trivial. I’ve done it with Flatpickr, Videojs, and Plyr with no issues.