plotly / plotly/plotly.js

Weird Symbols show up when using Local version compared to CDN

Open
#7,052 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug P3
Dominant language
JavaScript
Stars
18.3k
Forks
2k
Avg merge
2d 12h
Merged PRs (30d)
28

Description

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.

  1. Open this code pen here
  2. You will see that the y-axis is formatted normally as expected.
  3. Now instead of using the CDN, copy paste the plotly-cartesian.min.js contents between the <script> tags in the html.
  4. You will then see the weird characters show up.

This is the weird symbols using the local version

image

This is the normal version using the CDN

image

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked CodePen and compare the CDN build with the inline contents of plotly-cartesian.min.js while using tickformat '.1e'. Reproduce the unexpected symbols for values between 0 and 1, then verify that the local and CDN versions render matching y-axis labels without requiring additional charset configuration.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
data-visualization
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.