-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Fix broken styling of map attributions #7526
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
Conversation
As we discussed, with this change, I think that this section can be removed: plotly.js/tasks/util/bundle_wrapper.mjs Lines 49 to 57 in 04441f9
|
9ee114c
to
70e96f8
Compare
@birkskyum What's your take on the best way to include the MapLibre stylesheet in the Plotly.js bundle? It turns out the CSS was never being correctly included following the switch to ESbuild, since we distribute only a single |
For future reference if we want to understand the history this issue: |
Some notes on this change:
|
70e96f8
to
c8af613
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. This will fix things for all but those that disallow inline CSS, and I don't think that's a big number of users. Could you please create an issue to follow up on this in the future and either trim the CSS or address the inline CSS?
Issues opened:
|
yay! |
Closes https://github.com/plotly/plotly-studio/issues/1175
Map attributions were styled incorrectly for plots using MapLibre (
scattermap
,densitymap
,scattermap
traces).This was because a MapLibre stylesheet was missing due to being incorrectly handled in the bundling process.
The bug was introduced by the migration to esbuild (#6909) and present as of Plotly.js 3.0.0.
This PR fixes that issue by using a different tool to inline the missing CSS directly into the JS bundle.
Before fix:

After fix:

This commit demonstrates the resulting difference in the
dist/plotly.js
file (not included in this PR since we only updatedist/
during the release process).As an aside, this was not caught by the image tests because the
Plotly.toImage()
function for MapLibre plots callsmap.getCanvas()
which does not include the attribution, so Plotly.js manually adds the attribution to the generated image.