I have created an interactive plot using plot.ly and now I want to seamlessly incorporate it into a blog article on Shopify.
Here is my plan:
- First, save the code as an .js file in the assets folder
window.PLOTLYENV=window.PLOTLYENV || {};
if (document.getElementById("xxxxxxxxxxxxxxxx")) {
Plotly.newPlot(
"xxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
[{"hovertemplate":".......................................................<br>
- Next, link it within the blog's HTML or Liquid with:
<script type="text/javascript" src="{{ 'myplot.js' | asset_url }}"></script>
However, the plot does not seem to be visible. What could I possibly be missing?