Weird Symbols show up when using Local version compared to CDN
Hello,
I am currently trying to plot a graph using plotly-cartesian.min.js. We are currently limited to downloading and using a local copy rather than the CDN. I am plotting a graph that use the tickformat '.1e' for the y axis.
When I run the code using the local version, I get some rather weird symbols when the values are between 0 and 1. It looks like there is some encoding issue but the html I am running has the tags <meta charset="utf-8" /> as well as the script has the charset specified.
When I run the CDN version, the values are what are to be expected so I am just wondering if there is something else I need to specify in the configuration of either the web server we are running, or within the html itself.
You can reproduce this by using the following.
- Open this code pen here
- You will see that the y-axis is formatted normally as expected.
- Now instead of using the CDN, copy paste the
plotly-cartesian.min.jscontents between the - You will then see the weird characters show up.
This is the weird symbols using the local version
This is the normal version using the CDN
Exact same problem on me. Also using local version of
plotly-2.32.0.min.js.
Hello,
I am currently trying to plot a graph using
plotly-cartesian.min.js. We are currently limited to downloading and using a local copy rather than the CDN. I am plotting a graph that use the tickformat '.1e' for the y axis.When I run the code using the local version, I get some rather weird symbols when the values are between 0 and 1. It looks like there is some encoding issue but the html I am running has the tags
<meta charset="utf-8" />as well as the script has thecharsetspecified.When I run the CDN version, the values are what are to be expected so I am just wondering if there is something else I need to specify in the configuration of either the web server we are running, or within the html itself.
You can reproduce this by using the following.
- Open this code pen here
- You will see that the y-axis is formatted normally as expected.
- Now instead of using the CDN, copy paste the
plotly-cartesian.min.jscontents between the- You will then see the weird characters show up.
This is the weird symbols using the local version
This is the normal version using the CDN
![]()
Hey, I found out just add <meta charset="utf-8"> to your html fix this problem;
Thank you for the recommendation. Unfortunately, that does not fix our issue as mentioned in the original issue description. It may also be important to note that I am using nginx in a self-hosted configuration with docker. I've tried to change the config settings in the container to use the UTF-8 encoding as well, but no luck.
hey @tkalp thanks for bringing this up. I found this because I had the same gibberish characters problem as you, but i didn't realize the CDN version worked. That gave me the idea the maybe if I downloaded a copy of the file using curl, rather than copying and pasting from the browser, it might fix it. And voila, it does.
tldr; don't copy and paste from the browser - use curl to download the file.
This is the normal version using the CDN