Skip to content

Initial simple - #2

Open
Sir-Monke wants to merge 4 commits into
masterfrom
initial-simple
Open

Initial simple#2
Sir-Monke wants to merge 4 commits into
masterfrom
initial-simple

Conversation

@Sir-Monke

Copy link
Copy Markdown

Pull Request Template

Fixes Issue

Simplify Code

Description of Change

Same app but just less of it.
Own code goes from ~990 lines to ~450, and from three JS files to one.

No change to the settings, the manifest, the USGS feed, Leaflet, or the bundled map data.

  • Are these changes breaking any existing functionality? If so, please provide details.
  • Have tests been added/updated to cover the changes?

Checklist

Before submitting this PR, please ensure that you have completed the following:

  • I have performed a self-review of my own code
  • I have commented on my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

Same app, less of it. Own code goes from ~990 lines to ~450.

- merge maths.js and render.js into app.js; both files are gone
- the map label is now a Leaflet tooltip, so Leaflet places it. Drops the
  screen projection, the label-area measuring, the card position clamping
  and the leader-line geometry (~200 lines)
- only quakes currently on screen can be labelled, which is one call to
  map.getBounds().contains instead of the old on-screen test
- drop the Pacific-centred world view. It needed every longitude wrapped
  and the whole map drawn twice to fill past the date line. Map is now
  centred on 0, so wrapLongitude, shiftGeoJsonEast and drawWorldCopies go
- magnitude colours move from CSS variables into app.js, so pickMagnitudeColor
  no longer reads them back out of the stylesheet
- the screen scale factor is worked out once at startup instead of being
  re-read inside six draw functions
- add magnitudeOf/locationOf/timeOf so nothing else has to know that
  coordinates[1] means latitude
- the map now stops where the rail starts, so nothing drawn can hide under it

Kept as they were: config and readSetting, pickMagnitudeColor, the plate
boundaries, Leaflet and the offline world data.

No change to the settings, the feed, or what the player sees apart from the
world view no longer being Pacific-centred.
@Sir-Monke
Sir-Monke requested a review from a team as a code owner August 12, 2026 11:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant