-
Notifications
You must be signed in to change notification settings - Fork 0
feat: earthquakes near this screen — two files, no libraries #4
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
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
97cdde8
Add Seismic Monitor edge app
Sir-Monke 990b97d
Rename variables for readability
Sir-Monke 0d1f0c4
Refactor: followed the naming guidelines, removed unused code and spl…
Sir-Monke e21e207
refactor: simplify the app into a single readable file
Sir-Monke d48cccd
refactor: nearest-first earthquake list, drop the map and its libraries
Sir-Monke 49cb685
feat: put the nearest quake on a map centred on this screen
Sir-Monke 5142ba8
Potential fix for pull request finding
Sir-Monke 5675e60
Potential fix for pull request finding
Sir-Monke 0be3cd0
feat: hold the screen until the quake data lands, and call out one quake
Sir-Monke File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| .git/ | ||
| .github/ | ||
| screenshots/ | ||
| mock-data.yml | ||
| README.md |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,21 +1,56 @@ | ||
| # GitHub Blueprint | ||
| # Earthquakes Near This Screen — Screenly Edge App | ||
|
|
||
| Blueprint for GitHub repos. | ||
| A map centred on the screen's own location. The nearest earthquake is called out | ||
| — magnitude, place, distance, direction, how long ago — with a dashed line from | ||
| the screen to it. One quake, not a scatter of them: nothing else is marked. | ||
| Nothing moves and nothing animates; the feed is refetched every five minutes. | ||
|
|
||
| ## Usage | ||
| The map runs full bleed and the type sits on it in glass panels: the same paper a | ||
| shade down, blurred, with a hairline edge, so the coastlines still read through | ||
| them. A screen with no location set says exactly that instead of guessing — the | ||
| map and the readout are hidden and it asks for a location. | ||
|
|
||
| ```bash | ||
| $ rsync -aP .github /path/to/repo/ | ||
| ``` | ||
| Two files: `screenly.yml` and `index.html`. No libraries, no build step, no web | ||
| fonts, nothing fetched but the data, one setting (miles or kilometres). Data | ||
| from the public USGS feed, all magnitudes, past 7 days. | ||
|
|
||
| ## How the map works | ||
|
|
||
| The map inlined in `index.html` is a flat (equirectangular) world drawn from | ||
| public-domain Natural Earth outlines, so placing a point is arithmetic rather | ||
| than a mapping library: | ||
| longitude is a fraction across the view, latitude a fraction down. The view is a | ||
| window on it, centred on the screen and sized to hold the ten nearest quakes, | ||
| though only the closest is marked — never narrower than about 900 miles across. | ||
| It is stretched horizontally by 1/cos(latitude) so distances read correctly, | ||
| and the graticule is drawn from the same window. | ||
|
|
||
| ## Repo Configuration | ||
| Tectonic plate boundaries are drawn over it as dashed red lines, from the plate | ||
| data that was already in this repo. They are the reason the quake sits where it | ||
| does. | ||
|
|
||
| * Default branch should be `master` | ||
| * If relevant, `production` is used as the production branc h | ||
| * Branch protection should be enabled on master and production with: | ||
| * `Require a pull request before merging`, `Require approvals` and `Require review from Code Owners` | ||
| * `Require status checks to pass before merging` | ||
| Every size on the page is a multiple of one unit — a hundredth of the screen's | ||
| width, or of its height scaled to 16:9, whichever is smaller — so the layout | ||
| fills the screen whatever its shape, without clipping or letterboxing. The map | ||
| window is fitted to the screen's real aspect ratio, not an assumed one. | ||
|
|
||
| ## Code Owner | ||
| Needs a player: the coordinates, the location name, the units setting and the | ||
| CORS proxy all come from the injected `screenly.js` bridge, so it will not run | ||
| in a plain browser. The bridge hands the coordinates over as strings — they are | ||
| converted on the way in, because `+` on a string silently poisons every sum | ||
| downstream. | ||
|
|
||
| Adjust `.github/CODEOWNERS` to the squad that owns the repo. | ||
| The app holds the screen until it has something to say. `ready_signal: true` | ||
| in the manifest stops the player showing the page the moment it loads, and | ||
| the app calls `screenly.signalReadyForRendering()` once the first feed | ||
| request has settled — so the previous asset stays up through the fetch | ||
| instead of the screen flashing a panel of dashes. It signals whether that | ||
| fetch succeeded or failed; a player that is never told holds the playlist for | ||
| sixty seconds and then abandons the build. A screen with no location has | ||
| nothing to wait for and signals straight away. | ||
|
|
||
| ## Deploy | ||
|
|
||
| ```bash | ||
| screenly edge-app deploy | ||
| ``` |
Large diffs are not rendered by default.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| --- | ||
| syntax: manifest_v1 | ||
| id: 01KZ77RN8V1GWCGTYG53HP1V0T | ||
| description: Calls out the earthquakes around this screen on a map centred on its own location. | ||
| author: Will Cornforth | ||
| homepage_url: https://earthquake.usgs.gov | ||
| categories: | ||
| - Dashboards | ||
| entrypoint: | ||
| type: file | ||
| uri: index.html | ||
| ready_signal: true | ||
| settings: | ||
| units: | ||
| type: string | ||
| default_value: miles | ||
| title: Distance units | ||
| optional: true | ||
| help_text: | ||
| properties: | ||
| help_text: Units for the distances in the labels. | ||
| options: | ||
| - label: Miles | ||
| value: miles | ||
| - label: Kilometres | ||
| value: km | ||
| type: select | ||
| schema_version: 1 | ||
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.