Skip to content

Commit

Permalink
eslint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ceriottm committed Sep 18, 2023
1 parent cb4e69d commit 2dfa5c2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
8 changes: 4 additions & 4 deletions src/dataset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*/

import { CustomShape, Ellipsoid, Sphere } from './structure/shapes';

Check warning on line 6 in src/dataset.ts

View workflow job for this annotation

GitHub Actions / npm-test (16.x)

'CustomShape' is defined but never used

Check warning on line 6 in src/dataset.ts

View workflow job for this annotation

GitHub Actions / npm-test (16.x)

'Ellipsoid' is defined but never used

Check warning on line 6 in src/dataset.ts

View workflow job for this annotation

GitHub Actions / npm-test (16.x)

'Sphere' is defined but never used

Check warning on line 6 in src/dataset.ts

View workflow job for this annotation

GitHub Actions / npm-test (18.x)

'CustomShape' is defined but never used

Check warning on line 6 in src/dataset.ts

View workflow job for this annotation

GitHub Actions / npm-test (18.x)

'Ellipsoid' is defined but never used

Check warning on line 6 in src/dataset.ts

View workflow job for this annotation

GitHub Actions / npm-test (18.x)

'Sphere' is defined but never used

Check warning on line 6 in src/dataset.ts

View workflow job for this annotation

GitHub Actions / npm-test (20.x)

'CustomShape' is defined but never used

Check warning on line 6 in src/dataset.ts

View workflow job for this annotation

GitHub Actions / npm-test (20.x)

'Ellipsoid' is defined but never used

Check warning on line 6 in src/dataset.ts

View workflow job for this annotation

GitHub Actions / npm-test (20.x)

'Sphere' is defined but never used
import { ShapeParameters, ShapeData } from './structure/shapes';
import { ShapeData, ShapeParameters } from './structure/shapes';

Check warning on line 7 in src/dataset.ts

View workflow job for this annotation

GitHub Actions / npm-test (16.x)

'ShapeData' is defined but never used

Check warning on line 7 in src/dataset.ts

View workflow job for this annotation

GitHub Actions / npm-test (18.x)

'ShapeData' is defined but never used

Check warning on line 7 in src/dataset.ts

View workflow job for this annotation

GitHub Actions / npm-test (20.x)

'ShapeData' is defined but never used

/** A dataset containing all the data to be displayed. */
export interface Dataset {
Expand Down Expand Up @@ -243,7 +243,7 @@ export function validateDataset(o: JsObject): void {
if ('shapes' in o) {
checkShapes(o.shapes as Record<string, JsObject>, structureCount, envCount);

assignShapes(o.shapes as { [name: string]: ShapeParameters }, o.structures);
assignShapes(o.shapes as { [name: string]: ShapeParameters }, o.structures as Structure[]);
}

if (!('properties' in o)) {
Expand Down Expand Up @@ -380,8 +380,8 @@ function assignShapes(shapes: { [name: string]: ShapeParameters }, structures: S
for (let i_structure = 0; i_structure < structures.length; i_structure++) {
const structure = structures[i_structure];
structure.shapes = {};
for (let [name, shape] of Object.entries(shapes)) {
let parameters = {
for (const [name, shape] of Object.entries(shapes)) {
const parameters = {
global: shape.parameters.global,
structure: shape.parameters.structure,
atom: shape.parameters.atom,
Expand Down
4 changes: 2 additions & 2 deletions src/structure/shapes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,9 @@ export class Shape {

// orientation is passed to 3dmol in the (x, y, z, w) convention
constructor(data: Partial<SphereData>) {
let [qx, qy, qz, qw] = data.orientation || [0, 0, 0, 1];
const [qx, qy, qz, qw] = data.orientation || [0, 0, 0, 1];
this.orientation = new Quaternion(qx, qy, qz, qw);
let [x, y, z] = data.position || [0, 0, 0];
const [x, y, z] = data.position || [0, 0, 0];
this.position = { x, y, z };
}

Expand Down
3 changes: 1 addition & 2 deletions src/structure/viewer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -958,7 +958,7 @@ export class MoleculeViewer {
assert(i < current_shape.parameters.atom.length);
const atom_pars = current_shape.parameters.atom[i];
shape_data = { ...shape_data, ...atom_pars };
console.log('atom pars', atom_pars);

let position: [number, number, number] = [
structure.x[i],
structure.y[i],
Expand Down Expand Up @@ -986,7 +986,6 @@ export class MoleculeViewer {
shape.outputTo3Dmol(shape_data.color || 0xffffff)
);
} else if (current_shape.kind === 'ellipsoid') {
console.log('shape data', shape_data);
const shape = new Ellipsoid(shape_data);
this._viewer.addCustom(
shape.outputTo3Dmol(shape_data.color || 0xffffff)
Expand Down

0 comments on commit 2dfa5c2

Please sign in to comment.