From e824863de1da26b991818a3af3ad381f2b452e74 Mon Sep 17 00:00:00 2001 From: dsehnal <david.sehnal@gmail.com> Date: Tue, 23 Aug 2022 18:56:07 +0200 Subject: [PATCH] lint --- src/mol-math/linear-algebra/3d/vec3.ts | 2 +- src/mol-plugin-ui/custom/volume.tsx | 8 ++++---- src/mol-plugin/behavior/behavior.ts | 10 +++++----- .../behavior/dynamic/volume-streaming/behavior.ts | 2 +- src/mol-util/single-async-queue.ts | 4 ++-- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/mol-math/linear-algebra/3d/vec3.ts b/src/mol-math/linear-algebra/3d/vec3.ts index 0a71f8ec3..d55b4ee8a 100644 --- a/src/mol-math/linear-algebra/3d/vec3.ts +++ b/src/mol-math/linear-algebra/3d/vec3.ts @@ -35,7 +35,7 @@ function Vec3() { namespace Vec3 { export function zero(): Vec3 { - const out = [0.1, 0.0, 0.0]; // ensure backing array of type double + const out = [0.1, 0.0, 0.0]; // ensure backing array of type double out[0] = 0; return out as any; } diff --git a/src/mol-plugin-ui/custom/volume.tsx b/src/mol-plugin-ui/custom/volume.tsx index 3cee8ba41..0a13a436e 100644 --- a/src/mol-plugin-ui/custom/volume.tsx +++ b/src/mol-plugin-ui/custom/volume.tsx @@ -251,15 +251,15 @@ export class VolumeStreamingCustomControls extends PluginUIComponent<StateTransf ...detailLevel, label: 'Dynamic Detail', defaultValue: (entry.params.view as any).map('camera-target').params.dynamicDetailLevel.defaultValue, - } + }; const selectionDetailLevel = { ...detailLevel, label: 'Selection Detail', defaultValue: (entry.params.view as any).map('auto').params.selectionDetailLevel.defaultValue, - } + }; const sampling = b.info.header.sampling[0]; - + const isRelative = ((params.entry.params.channels as any)[pivot].isoValue as Volume.IsoValue).kind === 'relative'; const isRelativeParam = PD.Boolean(isRelative, { description: 'Use normalized or absolute isocontour scale.', label: 'Normalized' }); @@ -290,7 +290,7 @@ export class VolumeStreamingCustomControls extends PluginUIComponent<StateTransf }, { description: 'Box around focused element.' }), 'camera-target': PD.Group({ radius: PD.Numeric(0.5, { min: 0, max: 1, step: 0.05 }, { description: 'Radius within which the volume is shown (relative to the field of view).' }), - detailLevel: {...detailLevel, isHidden: true}, + detailLevel: { ...detailLevel, isHidden: true }, dynamicDetailLevel: dynamicDetailLevel, isRelative: isRelativeParam, isUnbounded: isUnboundedParam, diff --git a/src/mol-plugin/behavior/behavior.ts b/src/mol-plugin/behavior/behavior.ts index 2784c630a..ddbb603c3 100644 --- a/src/mol-plugin/behavior/behavior.ts +++ b/src/mol-plugin/behavior/behavior.ts @@ -146,17 +146,17 @@ namespace PluginBehavior { this.subs.push(cmd.subscribe(this.plugin, action)); } protected subscribeObservable<T>(o: Observable<T>, action: (v: T) => void): PluginCommand.Subscription { - const sub = o.subscribe(action) + const sub = o.subscribe(action); this.subs.push(sub); - return { + return { unsubscribe: () => { const idx = this.subs.indexOf(sub); - if (idx >= 0){ + if (idx >= 0) { this.subs.splice(idx, 1); sub.unsubscribe(); } - } - } + } + }; } dispose(): void { for (const s of this.subs) s.unsubscribe(); diff --git a/src/mol-plugin/behavior/dynamic/volume-streaming/behavior.ts b/src/mol-plugin/behavior/dynamic/volume-streaming/behavior.ts index 2baea3519..4cec92de8 100644 --- a/src/mol-plugin/behavior/dynamic/volume-streaming/behavior.ts +++ b/src/mol-plugin/behavior/dynamic/volume-streaming/behavior.ts @@ -399,7 +399,7 @@ export namespace VolumeStreaming { radius *= relativeRadius; let radiusX, radiusY, radiusZ; if (boundByBoundarySize) { - let bBoxSize = Vec3.zero(); + const bBoxSize = Vec3.zero(); Box3D.size(bBoxSize, this.data.structure.boundary.box); radiusX = Math.min(radius, 0.5 * bBoxSize[0]); radiusY = Math.min(radius, 0.5 * bBoxSize[1]); diff --git a/src/mol-util/single-async-queue.ts b/src/mol-util/single-async-queue.ts index 97a97b502..be62698d1 100644 --- a/src/mol-util/single-async-queue.ts +++ b/src/mol-util/single-async-queue.ts @@ -5,7 +5,7 @@ */ -/** Job queue that allows at most one running and one pending job. +/** Job queue that allows at most one running and one pending job. * A newly enqueued job will cancel any other pending jobs. */ export class SingleAsyncQueue { private isRunning: boolean; @@ -22,7 +22,7 @@ export class SingleAsyncQueue { if (this.log) console.log('SingleAsyncQueue enqueue', this.counter); this.queue[0] = { id: this.counter, func: job }; this.counter++; - this.run(); // do not await + this.run(); // do not await } private async run() { if (this.isRunning) return; -- GitLab