Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Fix unicode variable names #6

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 8, 2024
Merged

Conversation

GeorchW
Copy link

@GeorchW GeorchW commented May 4, 2024

Our tooling (parcel) doesn't like the Unicode variable names and refuses to build Plotly because of this code.

I've already opened an issue with Parcel here, but maybe this is the quicker fix.

@GeorchW GeorchW changed the title Fux unicode variable names Fix unicode variable names May 4, 2024
@GeorchW
Copy link
Author

GeorchW commented May 6, 2024

@archmoj ping -- not sure if you're watching this repo, since it's not very active

@archmoj
Copy link

archmoj commented May 6, 2024

Thanks for the PR @GeorchW.
Is that the only place that it should be fixed?
Or there are more?

@GeorchW
Copy link
Author

GeorchW commented May 7, 2024

Thanks for the quick reply @archmoj !

I couldn't find any other in the resulting builds of plotly. I changed these places in node_modules directly and the build worked again. So at least in this package that should be it.

I also tried running this:

cd node_modules
find . -type f -iname '*.js' | xargs grep -P -n "^[^/\"'*]*[\x80-\xFF]"  
# that regex catches all lines with non-ascii chars if no string/comment marker is in front of it

This is what it finds for Plotly-related files:

./plotly.js/dist/plotly-mapbox.js:67624:    normal: function(µ, σ) {
./plotly.js/dist/plotly-mapbox.js:67627:      if (n < 1) µ = 0;
./plotly.js/dist/plotly-mapbox.js:67635:        return µ + σ * x * Math.sqrt(-2 * Math.log(r) / r);
./plotly.js/dist/plotly-geo.js:66473:    normal: function(µ, σ) {
./plotly.js/dist/plotly-geo.js:66476:      if (n < 1) µ = 0;
./plotly.js/dist/plotly-geo.js:66484:        return µ + σ * x * Math.sqrt(-2 * Math.log(r) / r);
./plotly.js/dist/plotly.js:125477:    normal: function(µ, σ) {
./plotly.js/dist/plotly.js:125480:      if (n < 1) µ = 0;
./plotly.js/dist/plotly.js:125488:        return µ + σ * x * Math.sqrt(-2 * Math.log(r) / r);
./plotly.js/dist/plotly-cartesian.js:79013:    normal: function(µ, σ) {
./plotly.js/dist/plotly-cartesian.js:79016:      if (n < 1) µ = 0;
./plotly.js/dist/plotly-cartesian.js:79024:        return µ + σ * x * Math.sqrt(-2 * Math.log(r) / r);
./plotly.js/dist/plotly-finance.js:73066:    normal: function(µ, σ) {
./plotly.js/dist/plotly-finance.js:73069:      if (n < 1) µ = 0;
./plotly.js/dist/plotly-finance.js:73077:        return µ + σ * x * Math.sqrt(-2 * Math.log(r) / r);
./plotly.js/dist/plotly-strict.js:125611:    normal: function(µ, σ) {
./plotly.js/dist/plotly-strict.js:125614:      if (n < 1) µ = 0;
./plotly.js/dist/plotly-strict.js:125622:        return µ + σ * x * Math.sqrt(-2 * Math.log(r) / r);
./plotly.js/dist/plotly-gl3d.js:72393:    normal: function(µ, σ) {
./plotly.js/dist/plotly-gl3d.js:72396:      if (n < 1) µ = 0;
./plotly.js/dist/plotly-gl3d.js:72404:        return µ + σ * x * Math.sqrt(-2 * Math.log(r) / r);
./plotly.js/dist/plotly-gl2d.js:76186:    normal: function(µ, σ) {
./plotly.js/dist/plotly-gl2d.js:76189:      if (n < 1) µ = 0;
./plotly.js/dist/plotly-gl2d.js:76197:        return µ + σ * x * Math.sqrt(-2 * Math.log(r) / r);
./plotly.js/dist/plotly-basic.js:66715:    normal: function(µ, σ) {
./plotly.js/dist/plotly-basic.js:66718:      if (n < 1) µ = 0;
./plotly.js/dist/plotly-basic.js:66726:        return µ + σ * x * Math.sqrt(-2 * Math.log(r) / r);
./plotly.js/dist/plotly-with-meta.js:127198:    normal: function(µ, σ) {
./plotly.js/dist/plotly-with-meta.js:127201:      if (n < 1) µ = 0;
./plotly.js/dist/plotly-with-meta.js:127209:        return µ + σ * x * Math.sqrt(-2 * Math.log(r) / r);
./@plotly/d3/src/geom/voronoi/cell.js:3:function d3_geom_voronoiCell(site) {
./@plotly/d3/src/math/random.js:2:  normal: function(µ, σ) {
./@plotly/d3/src/math/random.js:5:    if (n < 1) µ = 0;
./@plotly/d3/src/math/random.js:13:      return µ + σ * x * Math.sqrt(-2 * Math.log(r) / r);
./@plotly/d3/d3.js:4873:    normal: function(µ, σ) {
./@plotly/d3/d3.js:4876:      if (n < 1) µ = 0;
./@plotly/d3/d3.js:4884:        return µ + σ * x * Math.sqrt(-2 * Math.log(r) / r);

This finds a bunch of instances of this code, bundled into various files but no other code in Plotly that uses greek letters. That one instance in voronoi/cell.js is a no-break space that someone likely accidentally inserted, i'll fix that as well.

@archmoj
Copy link

archmoj commented May 8, 2024

Thanks very much for the PR.
💃

@archmoj archmoj merged commit b7fc244 into plotly:master May 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants