Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fix issue causing empty ScatterGL plots when using text elements#7563

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
emilykl merged 6 commits intomasterfromfix-missing-json-font-attrs
Sep 26, 2025

Conversation

@emilykl
Copy link
Contributor

@emilyklemilykl commentedSep 26, 2025
edited
Loading

Closes#7353 ,#7441

  • The error wasUncaught TypeError: systemFontKeywords.indexOf is not a function
  • This was due to a JSON file in thecss-system-font-keywords (sub-)dependency not being included properly during the build process
  • It turns out the build step where we strip out some metadata attributes (to reduce bundle size) was also inadvertently causing JSON files to be processed as JavaScript files, which resulted in them showing up 'blank' in the final build
  • I've replaced that build step with a native ESBuild plugin with the same functionality
  • This also allows us to remove one dev dependency, which is a nice bonus

Thanks to@ayjayt for helping diagnose and to@WeisSeb and@pawel-paciorek-at-metrohm for reporting.

Minimal HTML/JS example demonstrating issue

(Based on@WeisSeb 's example in#7353)

<!DOCTYPE html><html><head><title>Scattergl empty</title><scriptsrc="dist/plotly.js"></script></head><body><divid="graph"style="width:600px;height:400px;"></div><script>Plotly.newPlot('graph',[{type:'scattergl',x:[1],y:[1],text:'some text',mode:'text+markers',textposition:'top center',},]);</script></body></html>

Should look like:
Screenshot 2025-09-26 at 12 35 57 PM

Steps for testing

  1. Check out this branch
  2. Runnpm i && npm run build
  3. Place the above HTML in a file in the root of yourplotly.js/ directory and visit in your browser
  4. The chart should look like the image above

@emilyklemilykl changed the titleFix empty ScatterGL plots when using text elementsFix issue causing empty ScatterGL plots when using text elementsSep 26, 2025
@emilykl
Copy link
ContributorAuthor

Also should resolveplotly/plotly.py#5336 but that won't be closed until this fix is included in Plotly.py.

@emilyklemilyklforce-pushed thefix-missing-json-font-attrs branch fromcdf9dcc to443b385CompareSeptember 26, 2025 18:18
Copy link
Contributor

@camdecostercamdecoster left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

This worked for me. I made a couple of small comments for formatting changes.

makeStringRegex('hrName')
];

varesbuildPluginStripMeta={
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Suggested change
varesbuildPluginStripMeta={
constesbuildPluginStripMeta={

emilykl reacted with thumbs up emoji
@emilykl
Copy link
ContributorAuthor

emilykl commentedSep 26, 2025
edited
Loading

Another bonus: Possibly reduces build time

(this is just one data point, wanted to do a sanity check to make sure it wasn't massively slower)

time npm run build onmaster
npm run build 20.12s user 2.54s system 185% cpu 12.191 total

time npm run build onfix-missing-json-font-attrs
npm run build 13.88s user 1.99s system 131% cpu 12.086 total

@gvwilson
Copy link
Contributor

faster is gooder

@emilykl
Copy link
ContributorAuthor

emilykl commentedSep 26, 2025
edited
Loading

This bug should have been caught by the CI, but it turns out that we weren't actually running thecompress_attributes step in the CI build process 🤦. So the build in the CI did not experience this issue. I've pushed33c46a4 to fix that.

(And the tests onthis branch I just created prove thatmany baseline images fail to generate when we are using the correct build process in the CI.)

@emilyklemilykl merged commitc624d3d intomasterSep 26, 2025
6 checks passed
@emilyklemilykl deleted the fix-missing-json-font-attrs branchSeptember 26, 2025 22:13
@xzm9gqzc65-maker
Copy link

Closes#7353 ,#7441

  • The error wasUncaught TypeError: systemFontKeywords.indexOf is not a function
  • This was due to a JSON file in thecss-system-font-keywords (sub-)dependency not being included properly during the build process
  • It turns out the build step where we strip out some metadata attributes (to reduce bundle size) was also inadvertently causing JSON files to be processed as JavaScript files, which resulted in them showing up 'blank' in the final build
  • I've replaced that build step with a native ESBuild plugin with the same functionality
  • This also allows us to remove one dev dependency, which is a nice bonus

Thanks to@ayjayt for helping diagnose and to@WeisSeb and@pawel-paciorek-at-metrohm for reporting.

Minimal HTML/JS example demonstrating issue

(Based on@WeisSeb 's example in#7353)

<!DOCTYPE html><html><head>    <title>Scattergl empty</title>    <script src="dist/plotly.js"></script></head><body>    <div></div>    <script>        Plotly.newPlot('graph', [{            type: 'scattergl',            x: [1],            y: [1],            text: 'some text',            mode: 'text+markers',            textposition: 'top center',        },]);    </script></body></html>

Should look like:Screenshot 2025-09-26 at 12 35 57 PM

Steps for testing

  1. Check out this branch
  2. Runnpm i && npm run build
  3. Place the above HTML in a file in the root of yourplotly.js/ directory and visit in your browser
  4. The chart should look like the image above

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@camdecostercamdecostercamdecoster approved these changes

@gvwilsongvwilsonAwaiting requested review from gvwilson

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

"TypeError: POt.indexOf is not a function" with mode: text and type: scattergl

5 participants

@emilykl@gvwilson@xzm9gqzc65-maker@camdecoster

[8]ページ先頭

©2009-2025 Movatter.jp