Skip to content

staging: Fix Plotly plots not rendering on AWS by loading plotly.js via CDN#65

Merged
lco-deploy-bot[bot] merged 1 commit into
mainfrom
octopilot-staging-d9d44jttsdp0n7bh7ps0
Jul 17, 2026
Merged

staging: Fix Plotly plots not rendering on AWS by loading plotly.js via CDN#65
lco-deploy-bot[bot] merged 1 commit into
mainfrom
octopilot-staging-d9d44jttsdp0n7bh7ps0

Conversation

@lco-deploy-bot

Copy link
Copy Markdown
Contributor

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.

…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>
@lco-deploy-bot
lco-deploy-bot Bot enabled auto-merge (squash) July 17, 2026 14:56
@lco-deploy-bot
lco-deploy-bot Bot merged commit 2860b2d into main Jul 17, 2026
2 checks passed
@lco-deploy-bot
lco-deploy-bot Bot deleted the octopilot-staging-d9d44jttsdp0n7bh7ps0 branch July 17, 2026 15:02
@lco-argo-cd

lco-argo-cd Bot commented Jul 17, 2026

Copy link
Copy Markdown

Application staging-mop is now running new version of deployments manifests.
See more here: https://cd.lco.earth/applications/staging-mop?operation=true

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant