From 8771de199c9d0dcc4b39362fa5e95c0930961819 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 21 Nov 2025 21:49:27 +0000 Subject: [PATCH 1/4] Bump js-yaml from 3.14.1 to 3.14.2 Bumps [js-yaml](https://github.com/nodeca/js-yaml) from 3.14.1 to 3.14.2. - [Changelog](https://github.com/nodeca/js-yaml/blob/master/CHANGELOG.md) - [Commits](https://github.com/nodeca/js-yaml/compare/3.14.1...3.14.2) --- updated-dependencies: - dependency-name: js-yaml dependency-version: 3.14.2 dependency-type: indirect ... Signed-off-by: dependabot[bot] --- package-lock.json | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index 6e30f554..756fddae 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1310,10 +1310,11 @@ } }, "node_modules/@istanbuljs/load-nyc-config/node_modules/js-yaml": { - "version": "3.14.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", - "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", + "version": "3.14.2", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.2.tgz", + "integrity": "sha512-PMSmkqxr106Xa156c2M265Z+FTrPl+oxd/rgOQy2tijQeK5TxQ43psO1ZCwhVOSdnn+RzkzlRz/eY4BgJBYVpg==", "dev": true, + "license": "MIT", "dependencies": { "argparse": "^1.0.7", "esprima": "^4.0.0" @@ -9037,10 +9038,11 @@ "dev": true }, "node_modules/js-yaml": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", - "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.1.tgz", + "integrity": "sha512-qQKT4zQxXl8lLwBtHMWwaTcGfFOZviOJet3Oy/xmGk2gZH677CJM9EvtfdSkgWcATZhj/55JZ0rmy3myCT5lsA==", "dev": true, + "license": "MIT", "dependencies": { "argparse": "^2.0.1" }, From a20bb6386dc61021d5e55df6fe1546a5a2f5aab9 Mon Sep 17 00:00:00 2001 From: Gavin Bullock Date: Wed, 14 Jan 2026 18:05:53 -0800 Subject: [PATCH 2/4] Add seismograph resolution support --- src/seismograph.ts | 32 ++++++++++++++++++++------------ src/seismographconfig.ts | 2 ++ 2 files changed, 22 insertions(+), 12 deletions(-) diff --git a/src/seismograph.ts b/src/seismograph.ts index 17241227..4d9ce150 100644 --- a/src/seismograph.ts +++ b/src/seismograph.ts @@ -230,6 +230,8 @@ export class Seismograph extends SeisPlotElement { height: number; outerWidth: number; outerHeight: number; + _canvasWidth: number; + _canvasHeight: number; svg: Selection; canvasHolder: null | Selection< SVGForeignObjectElement, @@ -265,7 +267,8 @@ export class Seismograph extends SeisPlotElement { this._debugAlignmentSeisData = []; this.width = 200; this.height = 100; - + this._canvasWidth = 200; + this._canvasHeight = 100; const wrapper = document.createElement("div"); wrapper.setAttribute("class", "wrapper"); @@ -507,7 +510,8 @@ export class Seismograph extends SeisPlotElement { this.canvasHolder.attr("width", this.width).attr("height", this.height); this.canvasHolder.attr("x", this.seismographConfig.margin.left); this.canvasHolder.attr("y", this.seismographConfig.margin.top); - this.canvas.attr("width", this.width).attr("height", this.height); + this.canvas.attr("width", this._canvasWidth).attr("height", this._canvasHeight); + this.canvas.attr("style", `width: ${this.width}px; height: ${this.height}px;`); } else { const svg = d3select(svgEl); this.canvasHolder = svg @@ -526,8 +530,9 @@ export class Seismograph extends SeisPlotElement { .attr("xmlns", XHTML_NS) .attr("x", 0) .attr("y", 0) - .attr("width", this.width) - .attr("height", this.height); + .attr("width", this._canvasWidth) + .attr("height", this._canvasHeight) + .attr("style", `width: ${this.width}px; height: ${this.height}px;`); this.canvas = c as unknown as Selection< HTMLCanvasElement, unknown, @@ -658,12 +663,12 @@ export class Seismograph extends SeisPlotElement { drawAllOnCanvas( canvas, this._seisDataList, - this._seisDataList.map((sdd) => this.timeScaleForSeisDisplayData(sdd)), + this._seisDataList.map((sdd) => this.timeScaleForSeisDisplayData(sdd, true)), this._seisDataList.map((sdd) => this.ampScaleForSeisDisplayData(sdd)), this._seisDataList.map((_sdd, ti) => this.seismographConfig.getColorForIndex(ti), ), - this.seismographConfig.lineWidth, + this.seismographConfig.lineWidth * this.seismographConfig.resolutionScale, this.seismographConfig.connectSegments, this.minmax_sample_pixels, ); @@ -693,7 +698,7 @@ export class Seismograph extends SeisPlotElement { ampScaleForSeisDisplayData( sdd: SeismogramDisplayData, ): ScaleLinear { - const ampScale = this.__initAmpScale(); + const ampScale = this.__initAmpScale(true); if (this.seismographConfig.linkedAmplitudeScale) { const drawHalfWidth = this.amp_scalable.drawHalfWidth; let sensitivityVal = 1; @@ -762,6 +767,7 @@ export class Seismograph extends SeisPlotElement { timeScaleForSeisDisplayData( sdd?: SeismogramDisplayData | Interval, + scaleForResolution: boolean = false, ): axisutil.LuxonTimeScale { let plotInterval; if (sdd) { @@ -783,7 +789,7 @@ export class Seismograph extends SeisPlotElement { plotInterval = util.durationEnd(1, DateTime.utc()); } } - return new axisutil.LuxonTimeScale(plotInterval, [0, this.width]); + return new axisutil.LuxonTimeScale(plotInterval, [0, scaleForResolution ? this._canvasWidth : this.width]); } /** @@ -799,10 +805,10 @@ export class Seismograph extends SeisPlotElement { * @private * @returns amp scale with range set */ - __initAmpScale(): ScaleLinear { + __initAmpScale(scaleForResolution: boolean = false): ScaleLinear { const ampAxisScale = d3scaleLinear(); // don't use top,bot pixel, somehow line at top amp disappears if [this.height, 0] - ampAxisScale.range([this.height - 1, 1]); + ampAxisScale.range([(scaleForResolution ? this._canvasHeight : this.height) - 1, 1]); return ampAxisScale; } @@ -1272,6 +1278,8 @@ export class Seismograph extends SeisPlotElement { this.outerWidth - this.seismographConfig.margin.left - this.seismographConfig.margin.right; + this._canvasHeight = this.height * this.seismographConfig.resolutionScale; + this._canvasWidth = this.width * this.seismographConfig.resolutionScale; this.calcScaleAndZoom(); @@ -1281,10 +1289,10 @@ export class Seismograph extends SeisPlotElement { .attr("height", this.height + 1); } if (this.canvas) { - this.canvas.attr("width", this.width).attr("height", this.height + 1); + this.canvas.attr("width", this._canvasWidth).attr("height", this._canvasHeight + 1); } if (this.panZoomer) { - this.panZoomer.width = this.width; + this.panZoomer.width = this._canvasWidth; } } diff --git a/src/seismographconfig.ts b/src/seismographconfig.ts index 3575768a..c7151b67 100644 --- a/src/seismographconfig.ts +++ b/src/seismographconfig.ts @@ -128,6 +128,7 @@ export class SeismographConfig { amplitudeMode: AMPLITUDE_MODE; doGain: boolean; windowAmp: boolean; + resolutionScale: number; /** @private */ _fixedAmplitudeScale: null | Array; @@ -183,6 +184,7 @@ export class SeismographConfig { this.amplitudeMode = AMPLITUDE_MODE.MinMax; this.doGain = true; this.windowAmp = true; + this.resolutionScale = 1; this._fixedAmplitudeScale = null; this._fixedTimeScale = null; this._linkedAmplitudeScale = new IndividualAmplitudeScale(); From 0c399d339f894cc0fd067857d3b13088820f4fce Mon Sep 17 00:00:00 2001 From: Gavin Bullock Date: Wed, 14 Jan 2026 18:11:25 -0800 Subject: [PATCH 3/4] Revert package-lock.json to match dev --- package-lock.json | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/package-lock.json b/package-lock.json index e4811388..aa6b794a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1656,6 +1656,20 @@ "sprintf-js": "~1.0.2" } }, + "node_modules/@istanbuljs/load-nyc-config/node_modules/find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "license": "MIT", + "dependencies": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/@istanbuljs/load-nyc-config/node_modules/js-yaml": { "version": "3.14.2", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.2.tgz", @@ -13270,4 +13284,4 @@ } } } -} \ No newline at end of file +} From 6fa9e9d7d2a60ca43f3ea94e96f3bb8f58c0ffd7 Mon Sep 17 00:00:00 2001 From: Gavin Bullock Date: Wed, 14 Jan 2026 18:47:33 -0800 Subject: [PATCH 4/4] Added inline comments for resolution changes --- src/seismograph.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/seismograph.ts b/src/seismograph.ts index 4d9ce150..ac7e0709 100644 --- a/src/seismograph.ts +++ b/src/seismograph.ts @@ -510,6 +510,7 @@ export class Seismograph extends SeisPlotElement { this.canvasHolder.attr("width", this.width).attr("height", this.height); this.canvasHolder.attr("x", this.seismographConfig.margin.left); this.canvasHolder.attr("y", this.seismographConfig.margin.top); + // Set canvas size to be resolution-scaled, then set actual size in CSS. This enables resolution support this.canvas.attr("width", this._canvasWidth).attr("height", this._canvasHeight); this.canvas.attr("style", `width: ${this.width}px; height: ${this.height}px;`); } else { @@ -663,7 +664,7 @@ export class Seismograph extends SeisPlotElement { drawAllOnCanvas( canvas, this._seisDataList, - this._seisDataList.map((sdd) => this.timeScaleForSeisDisplayData(sdd, true)), + this._seisDataList.map((sdd) => this.timeScaleForSeisDisplayData(sdd, true)), // Set resolution scaling to true this._seisDataList.map((sdd) => this.ampScaleForSeisDisplayData(sdd)), this._seisDataList.map((_sdd, ti) => this.seismographConfig.getColorForIndex(ti), @@ -698,7 +699,7 @@ export class Seismograph extends SeisPlotElement { ampScaleForSeisDisplayData( sdd: SeismogramDisplayData, ): ScaleLinear { - const ampScale = this.__initAmpScale(true); + const ampScale = this.__initAmpScale(true); // Set resolution scaling to true if (this.seismographConfig.linkedAmplitudeScale) { const drawHalfWidth = this.amp_scalable.drawHalfWidth; let sensitivityVal = 1; @@ -1278,6 +1279,7 @@ export class Seismograph extends SeisPlotElement { this.outerWidth - this.seismographConfig.margin.left - this.seismographConfig.margin.right; + // Scale canvas size to enable resolution support this._canvasHeight = this.height * this.seismographConfig.resolutionScale; this._canvasWidth = this.width * this.seismographConfig.resolutionScale;