Skip to content

FIREFLY-2117: Restrict spectral charts xaxis range when spectral lines go outside data range - #2040

Merged
jaladh-singhal merged 1 commit into
devfrom
FIREFLY-2117-restrict-sp-line-range
Oct 13, 2026
Merged

jaladh-singhal merged 1 commit into
devfrom
FIREFLY-2117-restrict-sp-line-range

Conversation

@jaladh-singhal

Copy link
Copy Markdown
Member

Fixes FIREFLY-2117

Spectral lines far outside the data (e.g. Herschel far-IR lines on a 5–9 µm Spitzer spectrum) stretched the x axis to ~650 µm, since Plotly counts shapes in autorange with no per-shape opt-out. Added makeShapesAutorangeLayout (ChartUtil.js), which clips x autorange to the padded data extent using Plotly's autorangeoptions.clipmin/clipmax, so autorange (initial plotting, 1x button, filter resets) still fits the data while lines beyond it still show when zoomed out.

Testing

https://firefly-2117-restrict-sp-line-range.irsakubedev.ipac.caltech.edu/firefly/

  • Upload a spectrum (Spitzer_IRS_SL_PBCD-topocenter.vot in ticket) -> Spectral lines dialog -> load Spitzer PAHFIT + Herschel HSPOT -> x axis should fit the data, not the lines unlike the screenshot in the ticket.
  • Zoom in -> 1x: back to the data range; filter the table (e.g. wavelength < 6.5): axis shrinks to the filtered data
  • Deselect all lines: normal autorange returns; reselect: clipped again
  • Chart Options: X Min/Max wider than the data (e.g. 3–12) should be applied as is, showing lines beyond the data; also check observed/rest frame with a redshift (e.g. 0.4), reverse and log
  • Regression: a non-spectrum chart (no lines) is unaffected

@jaladh-singhal jaladh-singhal added this to the 2026.4 milestone Oct 9, 2026
@jaladh-singhal
jaladh-singhal requested a review from loitly October 9, 2026 01:31
@jaladh-singhal jaladh-singhal self-assigned this Oct 9, 2026
@jaladh-singhal jaladh-singhal added enhancement Charts Anything related to charts labels Oct 9, 2026

@loitly loitly left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Tested and it worked as described. Changes look good. Ready to go.

@lrebull

lrebull commented Oct 12, 2026

Copy link
Copy Markdown
Contributor

this is amazing! works great!

@jaladh-singhal
jaladh-singhal merged commit f22366e into dev Oct 13, 2026
2 checks passed
@jaladh-singhal
jaladh-singhal deleted the FIREFLY-2117-restrict-sp-line-range branch October 13, 2026 00:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Charts Anything related to charts enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants