Add Resolution Support to Seismographs #65
+24
−12
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.
Description
Hey Philip! When showing the new PNSN website around to coworkers, a common suggestion was to upscale the resolution of the seismogram displays. Once I found out it was relatively simple to add resolution support to HTML canvases, I thought I'd spin something up on Seisplot.js. Let me know what you think!
Makes a lovely difference on our end! Here's a before and after:
Before:

After:

Scope
What's changed:
resolutionScaleparameter to SeismographConfig to control Seismograph canvas resolution_canvasWidthand_canvasHeightprivate helper fields to store the resolution-scaled canvas sizescaleForResolutionparameter totimeScaleForSeisDisplayDataand__initAmpScalemethods for creating time and amplitude scales that are relative to the resolution-scaled canvas size_canvasWidthand_canvasHeight, then style canvas to originalwidthandheightthrough CSSlineWidthbyresolutionScalePotential Risks / Drawbacks
Tested Scenarios
Review Notes / Questions
Checklist