diff --git a/.eslintrc.json b/.eslintrc.json index 76990ee25dfdfa24044e1bb28ca27455c716ebc9..ca46ec3cef678b76d0d53677132024b3e2127ec1 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -42,7 +42,8 @@ "no-throw-literal": "error", "key-spacing": "error", "object-curly-spacing": ["error", "always"], - "array-bracket-spacing": "error" + "array-bracket-spacing": "error", + "space-in-parens": "error" }, "overrides": [ { diff --git a/src/cli/structure-info/volume.ts b/src/cli/structure-info/volume.ts index 4e3ad62cd2a8887a8a631bc8ed9f9109d658c57d..23bf618afea516c5b252966060b0a7082f04d646 100644 --- a/src/cli/structure-info/volume.ts +++ b/src/cli/structure-info/volume.ts @@ -38,7 +38,7 @@ function print(volume: Volume) { } async function doMesh(volume: Volume, filename: string) { - const mesh = await Task.create('', runtime => createVolumeIsosurfaceMesh({ runtime }, volume, Theme.createEmpty(), { isoValue: Volume.IsoValue.absolute(1.5) } )).run(); + const mesh = await Task.create('', runtime => createVolumeIsosurfaceMesh({ runtime }, volume, Theme.createEmpty(), { isoValue: Volume.IsoValue.absolute(1.5) })).run(); console.log({ vc: mesh.vertexCount, tc: mesh.triangleCount }); // Export the mesh in OBJ format. diff --git a/src/extensions/cellpack/curve.ts b/src/extensions/cellpack/curve.ts index 1653695df119a9f8a437a13a95d2f5485144bc8a..a9a9c02e1bc42c5402a4aa4c140782b494f5cccd 100644 --- a/src/extensions/cellpack/curve.ts +++ b/src/extensions/cellpack/curve.ts @@ -211,7 +211,7 @@ export function getMatFromResamplePoints(points: NumberArray, segmentLength: num if (d >= segmentLength) { // use twist or random? const quat = Quat.rotationTo(Quat.zero(), Vec3.create(0, 0, 1), frames[i].t); // Quat.rotationTo(Quat.zero(), Vec3.create(0,0,1),new_normal[i]);//Quat.rotationTo(Quat.zero(), Vec3.create(0,0,1),direction);new_normal - const rq = Quat.setAxisAngle(Quat.zero(), frames[i].t, Math.random() * 3.60 ); // Quat.setAxisAngle(Quat.zero(),direction, Math.random()*3.60 );//Quat.identity();// + const rq = Quat.setAxisAngle(Quat.zero(), frames[i].t, Math.random() * 3.60); // Quat.setAxisAngle(Quat.zero(),direction, Math.random()*3.60 );//Quat.identity();// const m = Mat4.fromQuat(Mat4.zero(), Quat.multiply(Quat.zero(), rq, quat)); // Mat4.fromQuat(Mat4.zero(),Quat.multiply(Quat.zero(),quat1,quat2));//Mat4.fromQuat(Mat4.zero(),quat);//Mat4.identity();//Mat4.fromQuat(Mat4.zero(),Quat.multiply(Quat.zero(),rq,quat)); // let pos:Vec3 = Vec3.add(Vec3.zero(),pti1,pti) // pos = Vec3.scale(pos,pos,1.0/2.0); diff --git a/src/extensions/cellpack/model.ts b/src/extensions/cellpack/model.ts index 6d58b68023a2315f57633affb44451e26a5afc9f..9e31e32db98b31165ba53750a2bf1fd15e85a593 100644 --- a/src/extensions/cellpack/model.ts +++ b/src/extensions/cellpack/model.ts @@ -415,7 +415,7 @@ export function createStructureFromCellPack(plugin: PluginContext, packing: Cell if (ctx.shouldUpdate) await ctx.update(`${name} - structure`); const structure = Structure.create(units); - for( let i = 0, il = structure.models.length; i < il; ++i) { + for(let i = 0, il = structure.models.length; i < il; ++i) { Model.TrajectoryInfo.set(structure.models[i], { size: il, index: i }); } return { structure, assets, colors: skipColors ? undefined : colors }; @@ -544,7 +544,7 @@ async function loadPackings(plugin: PluginContext, runtime: RuntimeContext, stat representation: params.preset.representation, }; await CellpackPackingPreset.apply(packing, packingParams, plugin); - if ( packings[i].location === 'surface' && params.membrane){ + if (packings[i].location === 'surface' && params.membrane){ await loadMembrane(plugin, packings[i].name, state, params); } } diff --git a/src/extensions/cellpack/state.ts b/src/extensions/cellpack/state.ts index b5fabdf4f2080bd1932fdb5e45656e3cf6b284ac..6b614dc80a6aee1cb94b0e3b6285e0026d65d16f 100644 --- a/src/extensions/cellpack/state.ts +++ b/src/extensions/cellpack/state.ts @@ -137,7 +137,7 @@ const StructureFromAssemblies = PluginStateTransform.BuiltIn({ offsetInvariantId += maxInvariantId + 1; } structure = builder.getStructure(); - for( let i = 0, il = structure.models.length; i < il; ++i) { + for(let i = 0, il = structure.models.length; i < il; ++i) { Model.TrajectoryInfo.set(structure.models[i], { size: il, index: i }); } } diff --git a/src/extensions/dnatco/confal-pyramids/behavior.ts b/src/extensions/dnatco/confal-pyramids/behavior.ts index 3c38c9f5472fd9a0f9e084462d2ea160bc19306c..a8e03566a3701cc54b096fadd87f6732e6921ac0 100644 --- a/src/extensions/dnatco/confal-pyramids/behavior.ts +++ b/src/extensions/dnatco/confal-pyramids/behavior.ts @@ -41,7 +41,7 @@ export const DnatcoConfalPyramidsPreset = StructureRepresentationPresetProvider( let pyramidsRepr; if (representations) - pyramidsRepr = builder.buildRepresentation(update, pyramids, { type: ConfalPyramidsRepresentationProvider, typeParams, color: ConfalPyramidsColorThemeProvider }, { tag: 'confal-pyramdis' } ); + pyramidsRepr = builder.buildRepresentation(update, pyramids, { type: ConfalPyramidsRepresentationProvider, typeParams, color: ConfalPyramidsColorThemeProvider }, { tag: 'confal-pyramdis' }); await update.commit({ revertOnError: true }); return { components: { ...components, pyramids }, representations: { ...representations, pyramidsRepr } }; diff --git a/src/mol-canvas3d/passes/multi-sample.ts b/src/mol-canvas3d/passes/multi-sample.ts index 51376216a8b93cb41cda3985701e603eff858e26..7df8188159ee332192ef78e40d81906ac8631681 100644 --- a/src/mol-canvas3d/passes/multi-sample.ts +++ b/src/mol-canvas3d/passes/multi-sample.ts @@ -244,7 +244,7 @@ export class MultiSamplePass { compose.render(); sampleIndex += 1; - if (sampleIndex >= offsetList.length ) break; + if (sampleIndex >= offsetList.length) break; } } diff --git a/src/mol-geo/primitive/torus.ts b/src/mol-geo/primitive/torus.ts index 0e777084db56292eeae9c717f3e306e8f4be8c81..593c42c40b130948bda4d3289580009146ed31ef 100644 --- a/src/mol-geo/primitive/torus.ts +++ b/src/mol-geo/primitive/torus.ts @@ -47,7 +47,7 @@ export function Torus(props?: TorusProps): Primitive { vertices.push(...vertex); // normal - Vec3.set(center, radius * Math.cos(u), radius * Math.sin(u), 0 ); + Vec3.set(center, radius * Math.cos(u), radius * Math.sin(u), 0); Vec3.sub(normal, vertex, center); Vec3.normalize(normal, normal); normals.push(...normal); diff --git a/src/mol-geo/util/marching-cubes/builder.ts b/src/mol-geo/util/marching-cubes/builder.ts index 7ef3bc46f858c343bf4c15880b0c01bf439d2c28..ab9ddf1b130fcdcef44a84760217ade6ad622731 100644 --- a/src/mol-geo/util/marching-cubes/builder.ts +++ b/src/mol-geo/util/marching-cubes/builder.ts @@ -35,10 +35,10 @@ export function MarchinCubesMeshBuilder(vertexChunkSize: number, mesh?: Mesh): M return { addVertex: (x: number, y: number, z: number) => { ++vertexCount; - return ChunkedArray.add3(vertices, x, y, z ); + return ChunkedArray.add3(vertices, x, y, z); }, addNormal: (x: number, y: number, z: number) => { - ChunkedArray.add3(normals, x, y, z ); + ChunkedArray.add3(normals, x, y, z); }, addGroup: (group: number) => { ChunkedArray.add(groups, group); diff --git a/src/mol-gl/webgl/state.ts b/src/mol-gl/webgl/state.ts index 4e9c188362a85700fc60c2d33c13ee0220b25901..a10aa9c50b6f93c99327bd29858c6a170682dd82 100644 --- a/src/mol-gl/webgl/state.ts +++ b/src/mol-gl/webgl/state.ts @@ -85,7 +85,7 @@ export function createState(gl: GLRenderingContext): WebGLState { currentRenderItemId: -1, enable: (cap: number) => { - if (enabledCapabilities[cap] !== true ) { + if (enabledCapabilities[cap] !== true) { gl.enable(cap); enabledCapabilities[cap] = true; } diff --git a/src/mol-io/common/file-handle.ts b/src/mol-io/common/file-handle.ts index c027c9ac172f97566920e0ac30ce405028464f27..e0b18b39c524a3ad4309400815b6f032aa68b498 100644 --- a/src/mol-io/common/file-handle.ts +++ b/src/mol-io/common/file-handle.ts @@ -73,7 +73,7 @@ export namespace FileHandle { console.error('.writeBuffer not implemented for FileHandle.fromBuffer'); return Promise.resolve(0); }, - writeBufferSync: (position: number, buffer: SimpleBuffer, length?: number, ) => { + writeBufferSync: (position: number, buffer: SimpleBuffer, length?: number,) => { length = defaults(length, buffer.length); console.error('.writeSync not implemented for FileHandle.fromBuffer'); return 0; diff --git a/src/mol-math/geometry/gaussian-density/gpu.ts b/src/mol-math/geometry/gaussian-density/gpu.ts index 90bfb8cae0636f7a7961f2113d32f17f192925f2..264c3fed054061a46c473e93149304e680b7a962 100644 --- a/src/mol-math/geometry/gaussian-density/gpu.ts +++ b/src/mol-math/geometry/gaussian-density/gpu.ts @@ -454,7 +454,7 @@ function fieldFromTexture2d(ctx: WebGLContext, texture: Texture, dim: Vec3, texD let tmpCol = 0; let tmpRow = 0; for (let iz = 0; iz < dz; ++iz) { - if (tmpCol >= fboTexCols ) { + if (tmpCol >= fboTexCols) { tmpCol = 0; tmpRow += dy; } diff --git a/src/mol-math/histogram.ts b/src/mol-math/histogram.ts index f038940563d069003a50f9116dc4ad4ac7709a17..733d0c60ed844727aaaf7b996c94489d003ff8d1 100644 --- a/src/mol-math/histogram.ts +++ b/src/mol-math/histogram.ts @@ -13,7 +13,7 @@ export interface Histogram { counts: Int32Array } -export function calculateHistogram(data: ArrayLike<number>, binCount: number, options?: { min: number, max: number, } ): Histogram { +export function calculateHistogram(data: ArrayLike<number>, binCount: number, options?: { min: number, max: number, }): Histogram { if (!options) { const [min, max] = arrayMinMax(data); return _calcHistogram(data, binCount, min, max); diff --git a/src/mol-math/linear-algebra/3d/quat.ts b/src/mol-math/linear-algebra/3d/quat.ts index 31707d8099acfb3a07d75ac5a84c5aa9699db15b..b38163e6d470448aeeecf3568b2da2a934912d2a 100644 --- a/src/mol-math/linear-algebra/3d/quat.ts +++ b/src/mol-math/linear-algebra/3d/quat.ts @@ -183,7 +183,7 @@ namespace Quat { // calc cosine cosom = ax * bx + ay * by + az * bz + aw * bw; // adjust signs (if necessary) - if ( cosom < 0.0 ) { + if (cosom < 0.0) { cosom = -cosom; bx = - bx; by = - by; @@ -191,7 +191,7 @@ namespace Quat { bw = - bw; } // calculate coefficients - if ( (1.0 - cosom) > 0.000001 ) { + if ((1.0 - cosom) > 0.000001) { // standard case (slerp) omega = Math.acos(cosom); sinom = Math.sin(omega); @@ -250,7 +250,7 @@ namespace Quat { const fTrace = m[0] + m[4] + m[8]; let fRoot; - if ( fTrace > 0.0 ) { + if (fTrace > 0.0) { // |w| > 1/2, may as well choose w > 1/2 fRoot = Math.sqrt(fTrace + 1.0); // 2w out[3] = 0.5 * fRoot; @@ -261,8 +261,8 @@ namespace Quat { } else { // |w| <= 1/2 let i = 0; - if ( m[4] > m[0] ) i = 1; - if ( m[8] > m[i * 3 + i] ) i = 2; + if (m[4] > m[0]) i = 1; + if (m[8] > m[i * 3 + i]) i = 2; let j = (i + 1) % 3; let k = (i + 2) % 3; diff --git a/src/mol-math/linear-algebra/3d/vec3.ts b/src/mol-math/linear-algebra/3d/vec3.ts index c4815f45597405ee30939d3b9f020aaa2ae80972..c65a310db89b8fb7c98f5d19906df9f2a5589ea7 100644 --- a/src/mol-math/linear-algebra/3d/vec3.ts +++ b/src/mol-math/linear-algebra/3d/vec3.ts @@ -545,7 +545,7 @@ namespace Vec3 { return add(out, scale(out, copy(out, vector), scalar), origin); } - export function projectOnVector(out: Vec3, p: Vec3, vector: Vec3 ) { + export function projectOnVector(out: Vec3, p: Vec3, vector: Vec3) { const scalar = dot(vector, p) / squaredMagnitude(vector); return scale(out, vector, scalar); } diff --git a/src/mol-math/linear-algebra/tensor.ts b/src/mol-math/linear-algebra/tensor.ts index 2632e9eb25528f9c2bcd1e4da3eec2b039e7b5d9..94a6df386d7d1fb1ae28582efb1f240e942e29a2 100644 --- a/src/mol-math/linear-algebra/tensor.ts +++ b/src/mol-math/linear-algebra/tensor.ts @@ -140,8 +140,8 @@ export namespace Tensor { const u = dimensions[0], v = dimensions[1], uv = u * v; return { get: (t, i, j, k) => t[i + j * u + k * uv], - set: (t, i, j, k, x ) => t[i + j * u + k * uv] = x, - add: (t, i, j, k, x ) => t[i + j * u + k * uv] += x, + set: (t, i, j, k, x) => t[i + j * u + k * uv] = x, + add: (t, i, j, k, x) => t[i + j * u + k * uv] += x, dataOffset: (i, j, k) => i + j * u + k * uv, getCoords: (o, c) => { const p = Math.floor(o / u); @@ -156,8 +156,8 @@ export namespace Tensor { const u = dimensions[0], v = dimensions[2], uv = u * v; return { get: (t, i, j, k) => t[i + k * u + j * uv], - set: (t, i, j, k, x ) => t[i + k * u + j * uv] = x, - add: (t, i, j, k, x ) => t[i + k * u + j * uv] += x, + set: (t, i, j, k, x) => t[i + k * u + j * uv] = x, + add: (t, i, j, k, x) => t[i + k * u + j * uv] += x, dataOffset: (i, j, k) => i + k * u + j * uv, getCoords: (o, c) => { const p = Math.floor(o / u); @@ -172,8 +172,8 @@ export namespace Tensor { const u = dimensions[1], v = dimensions[0], uv = u * v; return { get: (t, i, j, k) => t[j + i * u + k * uv], - set: (t, i, j, k, x ) => t[j + i * u + k * uv] = x, - add: (t, i, j, k, x ) => t[j + i * u + k * uv] += x, + set: (t, i, j, k, x) => t[j + i * u + k * uv] = x, + add: (t, i, j, k, x) => t[j + i * u + k * uv] += x, dataOffset: (i, j, k) => j + i * u + k * uv, getCoords: (o, c) => { const p = Math.floor(o / u); @@ -188,8 +188,8 @@ export namespace Tensor { const u = dimensions[1], v = dimensions[2], uv = u * v; return { get: (t, i, j, k) => t[j + k * u + i * uv], - set: (t, i, j, k, x ) => t[j + k * u + i * uv] = x, - add: (t, i, j, k, x ) => t[j + k * u + i * uv] += x, + set: (t, i, j, k, x) => t[j + k * u + i * uv] = x, + add: (t, i, j, k, x) => t[j + k * u + i * uv] += x, dataOffset: (i, j, k) => j + k * u + i * uv, getCoords: (o, c) => { const p = Math.floor(o / u); @@ -204,8 +204,8 @@ export namespace Tensor { const u = dimensions[2], v = dimensions[0], uv = u * v; return { get: (t, i, j, k) => t[k + i * u + j * uv], - set: (t, i, j, k, x ) => t[k + i * u + j * uv] = x, - add: (t, i, j, k, x ) => t[k + i * u + j * uv] += x, + set: (t, i, j, k, x) => t[k + i * u + j * uv] = x, + add: (t, i, j, k, x) => t[k + i * u + j * uv] += x, dataOffset: (i, j, k) => k + i * u + j * uv, getCoords: (o, c) => { const p = Math.floor(o / u); @@ -220,8 +220,8 @@ export namespace Tensor { const u = dimensions[2], v = dimensions[1], uv = u * v; return { get: (t, i, j, k) => t[k + j * u + i * uv], - set: (t, i, j, k, x ) => t[k + j * u + i * uv] = x, - add: (t, i, j, k, x ) => t[k + j * u + i * uv] += x, + set: (t, i, j, k, x) => t[k + j * u + i * uv] = x, + add: (t, i, j, k, x) => t[k + j * u + i * uv] += x, dataOffset: (i, j, k) => k + j * u + i * uv, getCoords: (o, c) => { const p = Math.floor(o / u); diff --git a/src/mol-plugin-ui/controls/line-graph/line-graph-component.tsx b/src/mol-plugin-ui/controls/line-graph/line-graph-component.tsx index dcc371dbd7c283ddf649fee5713fecf89ef7cad9..11c0aaed7bace2832ea9bdd510d3eaaaca6b492b 100644 --- a/src/mol-plugin-ui/controls/line-graph/line-graph-component.tsx +++ b/src/mol-plugin-ui/controls/line-graph/line-graph-component.tsx @@ -166,7 +166,7 @@ export class LineGraphComponent extends React.Component<any, LineGraphComponentS updatedCopyPoint = Vec2.create(this.updatedX, this.updatedY); } else if (svgP.x < padding) { updatedCopyPoint = Vec2.create(padding, svgP.y); - } else if( svgP.x > (this.width + (padding))) { + } else if(svgP.x > (this.width + (padding))) { updatedCopyPoint = Vec2.create(this.width + padding, svgP.y); } else if (svgP.y > (this.height + (padding))) { updatedCopyPoint = Vec2.create(svgP.x, this.height + padding); @@ -239,7 +239,7 @@ export class LineGraphComponent extends React.Component<any, LineGraphComponentS const points = this.state.points; const padding = this.padding / 2; - if( svgP.x < (padding) || + if(svgP.x < (padding) || svgP.x > (this.width + (padding)) || svgP.y > (this.height + (padding)) || svgP.y < (this.padding / 2)) { diff --git a/src/mol-plugin-ui/structure/superposition.tsx b/src/mol-plugin-ui/structure/superposition.tsx index 779e2bfdbfd6aaa81c6b193dea95623b891a7b69..32f49650d8923b0383efc3fcbc6b10ae44a42669 100644 --- a/src/mol-plugin-ui/structure/superposition.tsx +++ b/src/mol-plugin-ui/structure/superposition.tsx @@ -94,7 +94,7 @@ export class SuperpositionControls extends PurePluginUIComponent<{ }, Superposit }); this.subscribe(this.plugin.managers.structure.hierarchy.behaviors.selection, sel => { - this.setState({ canUseDb: sel.structures.every(s => !!s.cell.obj?.data && s.cell.obj.data.models.some(m => BestDatabaseSequenceMapping.Provider.isApplicable(m)) ) }); + this.setState({ canUseDb: sel.structures.every(s => !!s.cell.obj?.data && s.cell.obj.data.models.some(m => BestDatabaseSequenceMapping.Provider.isApplicable(m))) }); }); } diff --git a/src/mol-plugin/util/viewport-screenshot.ts b/src/mol-plugin/util/viewport-screenshot.ts index dcbc7ea57c4b4c662a59bb2bc3df0364f2f0c522..fc95938fae5b9e77fa459c6d9982dcd2b90ca851 100644 --- a/src/mol-plugin/util/viewport-screenshot.ts +++ b/src/mol-plugin/util/viewport-screenshot.ts @@ -96,7 +96,7 @@ class ViewportScreenshotHelper extends PluginComponent { private getSize() { const values = this.values; - switch (values.resolution.name ) { + switch (values.resolution.name) { case 'viewport': return this.getCanvasSize(); case 'hd': return { width: 1280, height: 720 }; case 'full-hd': return { width: 1920, height: 1080 }; diff --git a/src/mol-repr/shape/loci/angle.ts b/src/mol-repr/shape/loci/angle.ts index 15ed7ba945884751fe43c810477c41dfd0c32b78..ef1aa9e52360923533294618258754afabdf8852 100644 --- a/src/mol-repr/shape/loci/angle.ts +++ b/src/mol-repr/shape/loci/angle.ts @@ -204,7 +204,7 @@ function buildSectorMesh(data: AngleData, props: AngleProps, mesh?: Mesh): Mesh function getSectorShape(ctx: RuntimeContext, data: AngleData, props: AngleProps, shape?: Shape<Mesh>) { const mesh = buildSectorMesh(data, props, shape && shape.geometry); const name = getAngleName(data); - const getLabel = (groupId: number ) => angleLabel(data.triples[groupId]); + const getLabel = (groupId: number) => angleLabel(data.triples[groupId]); return Shape.create(name, data, mesh, () => props.color, () => 1, getLabel); } @@ -231,7 +231,7 @@ function buildText(data: AngleData, props: AngleProps, text?: Text): Text { function getTextShape(ctx: RuntimeContext, data: AngleData, props: AngleProps, shape?: Shape<Text>) { const text = buildText(data, props, shape && shape.geometry); const name = getAngleName(data); - const getLabel = (groupId: number ) => angleLabel(data.triples[groupId]); + const getLabel = (groupId: number) => angleLabel(data.triples[groupId]); return Shape.create(name, data, text, () => props.textColor, () => props.textSize, getLabel); } diff --git a/src/mol-repr/shape/loci/dihedral.ts b/src/mol-repr/shape/loci/dihedral.ts index 177210cc9254672941470af70cccd05769d0b4b8..fd6bac07d804b710e6f2c131343fd24f4294a02f 100644 --- a/src/mol-repr/shape/loci/dihedral.ts +++ b/src/mol-repr/shape/loci/dihedral.ts @@ -309,7 +309,7 @@ function buildSectorMesh(data: DihedralData, props: DihedralProps, mesh?: Mesh): function getSectorShape(ctx: RuntimeContext, data: DihedralData, props: DihedralProps, shape?: Shape<Mesh>) { const mesh = buildSectorMesh(data, props, shape && shape.geometry); const name = getDihedralName(data); - const getLabel = (groupId: number ) => dihedralLabel(data.quads[groupId]); + const getLabel = (groupId: number) => dihedralLabel(data.quads[groupId]); return Shape.create(name, data, mesh, () => props.color, () => 1, getLabel); } @@ -337,7 +337,7 @@ function buildText(data: DihedralData, props: DihedralProps, text?: Text): Text function getTextShape(ctx: RuntimeContext, data: DihedralData, props: DihedralProps, shape?: Shape<Text>) { const text = buildText(data, props, shape && shape.geometry); const name = getDihedralName(data); - const getLabel = (groupId: number ) => dihedralLabel(data.quads[groupId]); + const getLabel = (groupId: number) => dihedralLabel(data.quads[groupId]); return Shape.create(name, data, text, () => props.textColor, () => props.textSize, getLabel); } diff --git a/src/mol-repr/shape/loci/distance.ts b/src/mol-repr/shape/loci/distance.ts index 900fabfdf3e4fada85197de5ee5858cc903d3ce8..a9bf9610ab3ed81379190e816a7609d0d07b18f7 100644 --- a/src/mol-repr/shape/loci/distance.ts +++ b/src/mol-repr/shape/loci/distance.ts @@ -105,7 +105,7 @@ function buildLines(data: DistanceData, props: DistanceProps, lines?: Lines): Li function getLinesShape(ctx: RuntimeContext, data: DistanceData, props: DistanceProps, shape?: Shape<Lines>) { const lines = buildLines(data, props, shape && shape.geometry); const name = getDistanceName(data, props.unitLabel); - const getLabel = (groupId: number ) => distanceLabel(data.pairs[groupId], props); + const getLabel = (groupId: number) => distanceLabel(data.pairs[groupId], props); return Shape.create(name, data, lines, () => props.linesColor, () => props.linesSize, getLabel); } @@ -127,7 +127,7 @@ function buildText(data: DistanceData, props: DistanceProps, text?: Text): Text function getTextShape(ctx: RuntimeContext, data: DistanceData, props: DistanceProps, shape?: Shape<Text>) { const text = buildText(data, props, shape && shape.geometry); const name = getDistanceName(data, props.unitLabel); - const getLabel = (groupId: number ) => distanceLabel(data.pairs[groupId], props); + const getLabel = (groupId: number) => distanceLabel(data.pairs[groupId], props); return Shape.create(name, data, text, () => props.textColor, () => props.textSize, getLabel); } diff --git a/src/mol-repr/shape/loci/orientation.ts b/src/mol-repr/shape/loci/orientation.ts index 52b92c7fdae544bf138b3d8f0daea5543385cfe8..4a5b120ec8acf1b73722a4c90d56db084290672a 100644 --- a/src/mol-repr/shape/loci/orientation.ts +++ b/src/mol-repr/shape/loci/orientation.ts @@ -92,7 +92,7 @@ function buildAxesMesh(data: OrientationData, props: OrientationProps, mesh?: Me function getAxesShape(ctx: RuntimeContext, data: OrientationData, props: OrientationProps, shape?: Shape<Mesh>) { const mesh = buildAxesMesh(data, props, shape && shape.geometry); const name = getOrientationName(data); - const getLabel = function (groupId: number ) { + const getLabel = function (groupId: number) { return orientationLabel(data.locis[groupId]); }; return Shape.create(name, data, mesh, () => props.color, () => 1, getLabel); @@ -115,7 +115,7 @@ function buildBoxMesh(data: OrientationData, props: OrientationProps, mesh?: Mes function getBoxShape(ctx: RuntimeContext, data: OrientationData, props: OrientationProps, shape?: Shape<Mesh>) { const mesh = buildBoxMesh(data, props, shape && shape.geometry); const name = getOrientationName(data); - const getLabel = function (groupId: number ) { + const getLabel = function (groupId: number) { return orientationLabel(data.locis[groupId]); }; return Shape.create(name, data, mesh, () => props.color, () => 1, getLabel); @@ -144,7 +144,7 @@ function buildEllipsoidMesh(data: OrientationData, props: OrientationProps, mesh function getEllipsoidShape(ctx: RuntimeContext, data: OrientationData, props: OrientationProps, shape?: Shape<Mesh>) { const mesh = buildEllipsoidMesh(data, props, shape && shape.geometry); const name = getOrientationName(data); - const getLabel = function (groupId: number ) { + const getLabel = function (groupId: number) { return orientationLabel(data.locis[groupId]); }; return Shape.create(name, data, mesh, () => props.color, () => 1, getLabel); diff --git a/src/mol-repr/structure/visual/nucleotide-ring-mesh.ts b/src/mol-repr/structure/visual/nucleotide-ring-mesh.ts index 5d1cb9eb5439796a4017d416bef901c81abd2fa0..f7b75862694ab757bc4d1ce591906e0a22342e5a 100644 --- a/src/mol-repr/structure/visual/nucleotide-ring-mesh.ts +++ b/src/mol-repr/structure/visual/nucleotide-ring-mesh.ts @@ -143,7 +143,7 @@ function createNucleotideRingMesh(ctx: VisualContext, unit: Unit, structure: Str addSphere(builderState, pN9, radius, detail); } - if (idxN1 !== -1 && idxC2 !== -1 && idxN3 !== -1 && idxC4 !== -1 && idxC5 !== -1 && idxC6 !== -1 && idxN7 !== -1 && idxC8 !== -1 && idxN9 !== -1 ) { + if (idxN1 !== -1 && idxC2 !== -1 && idxN3 !== -1 && idxC4 !== -1 && idxC5 !== -1 && idxC6 !== -1 && idxN7 !== -1 && idxC8 !== -1 && idxN9 !== -1) { pos(idxN1, pN1); pos(idxC2, pC2); pos(idxN3, pN3); pos(idxC4, pC4); pos(idxC5, pC5); pos(idxC6, pC6); pos(idxN7, pN7); pos(idxC8, pC8); Vec3.triangleNormal(normal, pN1, pC4, pC5); diff --git a/src/mol-state/action.ts b/src/mol-state/action.ts index 5233b91afd828d79cafda09b32428231ed3ed90d..b6416e63f626fa7fd0ebea77692c99c55cd345cf 100644 --- a/src/mol-state/action.ts +++ b/src/mol-state/action.ts @@ -62,7 +62,7 @@ namespace StateAction { create(params) { return { action, params }; }, id: UUID.create22(), definition, - createDefaultParams(a, globalCtx) { return definition.params ? PD.getDefaultValues( definition.params(a, globalCtx)) : {} as any; } + createDefaultParams(a, globalCtx) { return definition.params ? PD.getDefaultValues(definition.params(a, globalCtx)) : {} as any; } }; return action; } diff --git a/src/mol-state/transformer.ts b/src/mol-state/transformer.ts index 9770ab58d2a2e7bd5634ada31e9ab88130514eb9..0656babb8f3a526776075368a9ca22d45b6b2b41 100644 --- a/src/mol-state/transformer.ts +++ b/src/mol-state/transformer.ts @@ -179,7 +179,7 @@ namespace Transformer { namespace, id, definition, - createDefaultParams(a, globalCtx) { return definition.params ? PD.getDefaultValues( definition.params(a, globalCtx)) : {} as any; } + createDefaultParams(a, globalCtx) { return definition.params ? PD.getDefaultValues(definition.params(a, globalCtx)) : {} as any; } }; registry.set(id, t); _index(t); diff --git a/src/mol-util/polyfill.ts b/src/mol-util/polyfill.ts index ab18a367773a67997eee753498d45b893fd00d45..aea55bd4a2caa965acef734510b4660abbace36e 100644 --- a/src/mol-util/polyfill.ts +++ b/src/mol-util/polyfill.ts @@ -490,7 +490,7 @@ if (Object.defineProperty !== undefined) { if (!Object.entries) { Object.entries = function(obj: any){ - let ownProps = Object.keys( obj ), + let ownProps = Object.keys(obj), i = ownProps.length, resArray = new Array(i); // preallocate the Array while (i--) diff --git a/src/mol-util/zip/bin.ts b/src/mol-util/zip/bin.ts index 9d2192f6ac3c7323bf8571c6acf0b09597026d01..8ef3f163411dd398fe1f5e9367468087abc59745 100644 --- a/src/mol-util/zip/bin.ts +++ b/src/mol-util/zip/bin.ts @@ -64,7 +64,7 @@ export function writeUTF8(buff: Uint8Array, p: number, str: string) { for(let ci = 0; ci < strl; ci++) { const code = str.charCodeAt(ci); if((code & (0xffffffff - (1 << 7) + 1)) === 0) { - buff[p + i] = ( code ); + buff[p + i] = (code); i++; } else if((code & (0xffffffff - (1 << 11) + 1)) === 0) { buff[p + i] = (192 | (code >> 6)); diff --git a/src/mol-util/zip/deflate.ts b/src/mol-util/zip/deflate.ts index 7b576c8000a2bd187d6b2447a9b1abd2a85451d6..37d67eee818ec9d0437319a19fbb81e8d30e59ac 100644 --- a/src/mol-util/zip/deflate.ts +++ b/src/mol-util/zip/deflate.ts @@ -221,7 +221,7 @@ function _writeBlock(BFINAL: number, lits: Uint32Array, li: number, ebits: numbe for(let j = 0; j < 30; j++) U.dhst[j] = 0; for(let j = 0; j < 19; j++) U.ihst[j] = 0; - const BTYPE = (cstSize < fxdSize && cstSize < dynSize) ? 0 : ( fxdSize < dynSize ? 1 : 2 ); + const BTYPE = (cstSize < fxdSize && cstSize < dynSize) ? 0 : (fxdSize < dynSize ? 1 : 2); _putsF(out, pos, BFINAL); _putsF(out, pos + 1, BTYPE); pos += 3; diff --git a/src/mol-util/zip/inflate.ts b/src/mol-util/zip/inflate.ts index bc0c397ee5186da5fd95b31777bc13e49adaba87..75a0c4bd345c1b234678d4d586bf4c137613e50d 100644 --- a/src/mol-util/zip/inflate.ts +++ b/src/mol-util/zip/inflate.ts @@ -221,5 +221,5 @@ function _bitsF(dt: NumberArray, pos: number, length: number) { } function _get17(dt: NumberArray, pos: number) { // return at least 17 meaningful bytes - return (dt[pos >>> 3] | (dt[(pos >>> 3) + 1] << 8) | (dt[(pos >>> 3) + 2] << 16) ) >>> (pos & 7); + return (dt[pos >>> 3] | (dt[(pos >>> 3) + 1] << 8) | (dt[(pos >>> 3) + 2] << 16)) >>> (pos & 7); } \ No newline at end of file diff --git a/src/mol-util/zip/util.ts b/src/mol-util/zip/util.ts index c734821196eeac1fbc4adecc2dbbd09cbc541afd..45eb54ebb6ac10a1d0d7e7ef6cc9929cc92cc913 100644 --- a/src/mol-util/zip/util.ts +++ b/src/mol-util/zip/util.ts @@ -19,14 +19,14 @@ export const U = (function(){ df0: [1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, 8193, 12289, 16385, 24577, 65535, 65535], dxb: [0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 0, 0], ddef: new u32(32), - flmap: new u16( 512), fltree: [] as number[], - fdmap: new u16( 32), fdtree: [] as number[], + flmap: new u16(512), fltree: [] as number[], + fdmap: new u16(32), fdtree: [] as number[], lmap: new u16(32768), ltree: [] as number[], ttree: [] as number[], dmap: new u16(32768), dtree: [] as number[], - imap: new u16( 512), itree: [] as number[], + imap: new u16(512), itree: [] as number[], // rev9 : new u16( 512) rev15: new u16(1 << 15), - lhst: new u32(286), dhst: new u32( 30), ihst: new u32(19), + lhst: new u32(286), dhst: new u32(30), ihst: new u32(19), lits: new u32(15000), strt: new u16(1 << 16), prev: new u16(1 << 15) diff --git a/src/mol-util/zip/zip.ts b/src/mol-util/zip/zip.ts index 8086d307cc054522e205c8c89886d306b90b3e79..a7ef6a3d610ee646ac082ea1fad8f00b274217aa 100644 --- a/src/mol-util/zip/zip.ts +++ b/src/mol-util/zip/zip.ts @@ -237,7 +237,7 @@ export async function zip(runtime: RuntimeContext, obj: { [k: string]: Uint8Arra writeUshort(data, o, i); o += 2; writeUshort(data, o, i); o += 2; // number of c d records writeUint(data, o, csize); o += 4; - writeUint(data, o, ioff ); o += 4; + writeUint(data, o, ioff); o += 4; o += 2; return data.buffer; }