@empet, thank you so much. Not only it works, but it is also much more intuitive than my version.
Yes, this is an old Pluto notebook I have to use again this year. My code did not work in the past, but I have decided not to let it go this time. You solved the problem.
As far as the official documentation is concerned, thanks to you, I have now realized that one thing is the version still available on the PlotlyJS website here, and the other is the one available on GitHub here. Gosh, such a fantastic package, but maintenance seems to be complicated.
Thanks a lot.