staging: Fix Plotly plots not rendering on AWS by loading plotly.js via CDN#65
Merged
Merged
Conversation
…ia CDN Source-commit: LCOGT/mop@4e06b46 plotly.offline.plot() defaults to include_plotlyjs=True, which embeds the full ~3-4MB Plotly.js library inline in every plot's HTML. Three independent plots on the TargetDetail page (photometry, moon distance/visibility, spectroscopy) each did this, inflating the page to ~9MB. Something in the AWS delivery path was truncating those large inline scripts, leaving "Plotly is not defined" errors in the browser console and no plots rendering. Fixed mop_photometry directly. target_plan/moon_distance (tom_targets) and spectroscopy_for_target (tom_dataproducts) are third-party code, so added MOP-owned equivalents (mop_target_plan, mop_moon_distance, mop_spectroscopy_for_target) that mirror the upstream logic exactly except for include_plotlyjs='cdn', and pointed target_detail.html at those instead. Verified: page size drops from ~9MB to ~85KB, each plot now references cdn.plot.ly instead of embedding the library, full test suite shows no regressions. Co-authored-by: Rachel Street <10391660+rachel3834@users.noreply.github.com>
|
Application staging-mop is now running new version of deployments manifests. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Source-commit: LCOGT/mop@4e06b46
plotly.offline.plot() defaults to include_plotlyjs=True, which embeds
the full ~3-4MB Plotly.js library inline in every plot's HTML. Three
independent plots on the TargetDetail page (photometry, moon
distance/visibility, spectroscopy) each did this, inflating the page
to ~9MB. Something in the AWS delivery path was truncating those large
inline scripts, leaving "Plotly is not defined" errors in the browser
console and no plots rendering.
Fixed mop_photometry directly. target_plan/moon_distance (tom_targets)
and spectroscopy_for_target (tom_dataproducts) are third-party code,
so added MOP-owned equivalents (mop_target_plan, mop_moon_distance,
mop_spectroscopy_for_target) that mirror the upstream logic exactly
except for include_plotlyjs='cdn', and pointed target_detail.html at
those instead.
Verified: page size drops from ~9MB to ~85KB, each plot now
references cdn.plot.ly instead of embedding the library, full test
suite shows no regressions.