Skip to content

Commit

Permalink
Update dependencies and fix lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
paulsmirnov committed Sep 25, 2020
1 parent 1331f7a commit 3b2eee7
Show file tree
Hide file tree
Showing 36 changed files with 2,030 additions and 2,087 deletions.
4 changes: 0 additions & 4 deletions packages/lib/demo/scripts/ui/Menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,6 @@ Menu.prototype._fillSelectionColorCombo = function (paletteID) {
});
};


Menu.prototype._fillCombo = function (type, name, path, entityList) {
const self = this;
const frag = document.createDocumentFragment();
Expand Down Expand Up @@ -316,7 +315,6 @@ Menu.prototype._initReprListItemListeners = function (index) {

reprList.find(`.panel:eq(${index}) input[type=checkbox]`).bootstrapSwitch();


reprList.find(`.panel:eq(${index}) .panel-heading .btn-visible`).on('click', () => {
reprList.find(`.panel:eq(${index}) .panel-heading .btn-visible`).hide();
reprList.find(`.panel:eq(${index}) .panel-heading .btn-invisible`).show();
Expand Down Expand Up @@ -868,7 +866,6 @@ Menu.prototype._init = function () {
self._xs = self._isXS();
$(`${self._menuId} [data-value="${self._curPanelID}"]`).toggleClass('active');


$(`${self._menuId} [data-toggle=miew-main-menu]`).on('click', function () {
const state = this.getAttribute('data-state');
if (state === 'on') {
Expand Down Expand Up @@ -1570,7 +1567,6 @@ function getAltLocNames(viewer) {
return visual ? visual.getComplex().getAltLocNames() : 0;
}


Menu.prototype._initSelectionPanel = function () {
const self = this;
const selectionPanel = $(`${self._menuId} [data-panel-type=miew-menu-panel-selection]`);
Expand Down
1 change: 1 addition & 0 deletions packages/lib/demo/styles/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,7 @@ $selection-panel-row-height: 42px;
margin-bottom: 0;
// border-color: #aaa;
// border-radius: 0;

border: none;
background-color: #eee;
height: 100%;
Expand Down
1 change: 1 addition & 0 deletions packages/lib/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@
"jquery": "3.4.1",
"jquery.terminal": "=2.1.0",
"jsdoc": "^3.6.3",
"lerna": "^3.21.0",
"mini-css-extract-plugin": "^0.9.0",
"mkdirp": "^1.0.3",
"mocha": "^7.1.2",
Expand Down
1 change: 0 additions & 1 deletion packages/lib/src/ComplexVisual.js
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,6 @@ class ComplexVisual extends Visual {
return { desc, index, status: '' };
}


/**
* Get representation (not just description) by index.
* @param {number=} index - Zero-based index, up to {@link Miew#repCount()}. Defaults to the current one.
Expand Down
2 changes: 0 additions & 2 deletions packages/lib/src/ComplexVisualEdit.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,6 @@ class ComplexComponentEditor extends ComplexEditor {
}
}


class ComplexFragmentEditor extends ComplexEditor {
constructor(complexVisual) {
super();
Expand Down Expand Up @@ -379,7 +378,6 @@ class ComplexFragmentEditor extends ComplexEditor {
}
}


export default {
ComponentEditor: ComplexComponentEditor,
FragmentEditor: ComplexFragmentEditor,
Expand Down
2 changes: 0 additions & 2 deletions packages/lib/src/Miew-cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ class RepresentationMap {
}
}


const representationsStorage = new RepresentationMap();

function keyRemap(key) {
Expand Down Expand Up @@ -270,7 +269,6 @@ class CLIUtils {
}
// repIndexOrRepMap could be RepresentationMap or index


const utilFunctions = new CLIUtils();

function CreateObjectPair(a, b) {
Expand Down
2 changes: 0 additions & 2 deletions packages/lib/src/Miew.js
Original file line number Diff line number Diff line change
Expand Up @@ -2255,7 +2255,6 @@ Miew.prototype._onLoad = function (dataSource, opts) {
this._opts._objects = null;
}


if (dataSource.id === 'Complex') {
const complex = dataSource;

Expand Down Expand Up @@ -2487,7 +2486,6 @@ Miew.prototype.rebuild = function () {
Promise.all(rebuildActions).then(() => {
self._spinner.stop();


self._needRender = true;

self._refreshTitle();
Expand Down
1 change: 0 additions & 1 deletion packages/lib/src/Visual.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,4 @@ class Visual extends gfxutils.RCGroup {
}
}


export default Visual;
1 change: 0 additions & 1 deletion packages/lib/src/chem/AromaticLoopsMarker.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ const cAromaticAtoms = [
// Element.ByName.S.number,
];


/** Conditions for bonds:
* - Cross product with each subsequent bond to add is collinear and point to the same direction
* - Each pair of a adjacent bonds belong to not more than one cycle
Expand Down
1 change: 0 additions & 1 deletion packages/lib/src/gfx/CSS2DObject.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,4 @@ class CSS2DObject extends THREE.Object3D {
}
}


export default CSS2DObject;
1 change: 0 additions & 1 deletion packages/lib/src/gfx/FrameInfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,6 @@ class FrameInfo {
return vec;
}


getResidues() {
if (this._cachedResidues) {
return this._residues;
Expand Down
1 change: 0 additions & 1 deletion packages/lib/src/gfx/Representation.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ class Representation {
this.setMode(mode);
}


markAtoms(complex) {
this.count = complex.markAtoms(this.selector, 1 << this.index);
this.needsRebuild = true;
Expand Down
2 changes: 0 additions & 2 deletions packages/lib/src/gfx/VolumeMesh.js
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,6 @@ class VolumeMesh extends THREE.Mesh {
const matrixWorldToLocal = VolumeMesh._matrixWorldToLocal;
const clipPlane = VolumeMesh._clipPlane;


this._updateIsoLevel();

// get clip plane in local space
Expand Down Expand Up @@ -429,5 +428,4 @@ class VolumeMesh extends THREE.Mesh {
}
}


export default VolumeMesh;
1 change: 0 additions & 1 deletion packages/lib/src/gfx/colorers/ConditionalColorer.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import Colorer from './Colorer';
import selectors from '../../chem/selectors';


/**
* Create new colorer.
*
Expand Down
5 changes: 0 additions & 5 deletions packages/lib/src/gfx/geometries/ContactSurface.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,11 @@ function AVHash(posRad, min, max, maxDistance) {

const jkDim = jDim * kDim;


/* Get cellID for cartesian x,y,z */
const cellID = function (x, y, z) {
return (((hashFunc(x, minX) * jDim) + hashFunc(y, minY)) * kDim) + hashFunc(z, minZ);
};


/* Initial building, could probably be optimized further */
const preHash = [];
let i;
Expand Down Expand Up @@ -188,7 +186,6 @@ function ContactSurface(packedArrays, boundaries, params, _indexList) {
let atomMap = null;
let visibilitySelector = null;


// grid indices -> xyz coords
let gridx;
let gridy;
Expand Down Expand Up @@ -241,7 +238,6 @@ function ContactSurface(packedArrays, boundaries, params, _indexList) {
atomMap = [];
}


gridx = utils.allocateTyped(Float32Array, dim[0]);
gridy = utils.allocateTyped(Float32Array, dim[1]);
gridz = utils.allocateTyped(Float32Array, dim[2]);
Expand Down Expand Up @@ -402,7 +398,6 @@ function ContactSurface(packedArrays, boundaries, params, _indexList) {
const dx = gridx[ix] - ax;
const d2 = dzy2 + dx * dx;


if (d2 < ar2) {
const w = Math.exp(-d2 * sigma2Inv);
const cIdx = idx * 3;
Expand Down
3 changes: 0 additions & 3 deletions packages/lib/src/gfx/geometries/CylinderBufferGeometry.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ class CylinderBufferGeometry extends THREE.BufferGeometry {
const thetaStart = 0;
const thetaLength = 2 * Math.PI;


this.type = 'CylinderBufferGeometry';

this.parameters = {
Expand Down Expand Up @@ -108,7 +107,6 @@ class CylinderBufferGeometry extends THREE.BufferGeometry {
normals.setXYZ(currVtxIdx, 0, 1, 0);
uvs.setXY(currVtxIdx, 1, 1);


const nextTVtx = startTIdx + ((fTIdx + 1) % radialSegments);
indices.setXYZ(currFaceIdx * PTS_PER_TRIANGLE, currVtxIdx, nextTVtx, lastIdx);
currFaceIdx++;
Expand All @@ -134,7 +132,6 @@ class CylinderBufferGeometry extends THREE.BufferGeometry {
normals.setXYZ(currVtxIdx, 0, -1, 0);
uvs.setXY(currVtxIdx, 0, 0);


const nextBVtx = startBIdx + ((fBIdx + 1) % radialSegments);
indices.setXYZ(currFaceIdx * PTS_PER_TRIANGLE, nextBVtx, currVtxIdx, lastBIdx);
currFaceIdx++;
Expand Down
1 change: 0 additions & 1 deletion packages/lib/src/gfx/geometries/IsoSurface.js
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,6 @@ class IsoSurface {
triangles[j] = new Triangle();
}


let appendVertex;
const self = this;
const positions = this._position;
Expand Down
1 change: 0 additions & 1 deletion packages/lib/src/gfx/geometries/IsosurfaceBuildNormals.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ class IsosurfaceBuildNormals {
} // for (i)
// maxAtomsRefs = numAtoms * MAX_ATOMS_IN_SINGLE_VOXEL;


this._voxelList = utils.allocateTyped(Int32Array, side3);
const atomsList = [];
atomsList.length = maxAtomsRefs;
Expand Down
3 changes: 0 additions & 3 deletions packages/lib/src/gfx/geometries/RaycastableBufferGeometry.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,14 @@ class RaycastableBufferGeometry extends THREE.BufferGeometry {

static _vC = new THREE.Vector3();


static _uvA = new THREE.Vector2();

static _uvB = new THREE.Vector2();

static _uvC = new THREE.Vector2();


static _barycoord = new THREE.Vector3();


static _intersectionPoint = new THREE.Vector3();

uvIntersection(point, p1, p2, p3, uv1, uv2, uv3) {
Expand Down
2 changes: 0 additions & 2 deletions packages/lib/src/gfx/geometries/SSIsosurfaceGeometry.js
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,6 @@ class SSIsosurfaceGeometry extends IsoSurfaceGeometry {
cube.pointsValuesLinear[indPointValues + 6 * 3 + 1] += vCellStep.y;
cube.pointsValuesLinear[indPointValues + 7 * 3 + 1] += vCellStep.y;


// now current cell has intersections (from -x to +x) on some cube edges
const indValues = indPointValues + 24;
for (let i = 0; i < cNumVerts; ++i) {
Expand Down Expand Up @@ -437,7 +436,6 @@ class SSIsosurfaceGeometry extends IsoSurfaceGeometry {
return atomT[letter * 2];
}


/**
* Calculate values for marching cube grid points
* positive values are outside sphere, negative - is inside
Expand Down
3 changes: 0 additions & 3 deletions packages/lib/src/gfx/geometries/Simple2CCylindersGeometry.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ const centerPos = new THREE.Vector3();
const tmpVector = new THREE.Vector3();
const normMtx = new THREE.Matrix3();


class Simple2CCylindersGeometry extends ChunkedObjectsGeometry {
constructor(instanceCount, polyComplexity) {
const cylGeometry = new THREE.CylinderBufferGeometry(1, 1, 1.0, Math.max(3, polyComplexity), 2, true);
Expand All @@ -20,7 +19,6 @@ class Simple2CCylindersGeometry extends ChunkedObjectsGeometry {
this._tmpVector = utils.allocateTyped(Float32Array, chunkSize * VEC_SIZE);
}


setItem(itemIdx, botPos, topPos, itemRad) {
const chunkSize = this._chunkSize;
const firstOffset = chunkSize * 2 * itemIdx * VEC_SIZE;
Expand Down Expand Up @@ -63,7 +61,6 @@ class Simple2CCylindersGeometry extends ChunkedObjectsGeometry {
this._normals.set(tmpArray, secondOffset);
}


setColor(itemIdx, colorVal1, colorVal2) {
const first = 2 * itemIdx;
super.setColor(first, colorVal1);
Expand Down
1 change: 0 additions & 1 deletion packages/lib/src/gfx/geometries/ThickLinesGeometry.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,5 +167,4 @@ class ThickLinesGeometry extends THREE.BufferGeometry {
}
}


export default ThickLinesGeometry;
1 change: 0 additions & 1 deletion packages/lib/src/gfx/geometries/TwoColorLinesGeometry.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import Simple2CCylindersGeometry from './Simple2CCylindersGeometry';
const COLLISION_RAD = 0.3;
const tmpVector = new THREE.Vector3();


class TwoColorLinesGeometry extends LinesGeometry {
constructor(segmentsCount) {
super(segmentsCount * 2);
Expand Down
3 changes: 0 additions & 3 deletions packages/lib/src/gfx/gfxutils.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ THREE.WebGLRenderer.prototype.renderScreenQuad = (function () {
const _camera = new THREE.OrthographicCamera(-0.5, 0.5, 0.5, -0.5, -10000, 10000);
_camera.position.z = 100;


return function (material) {
_quad.material = material;
this.render(_scene, _camera);
Expand Down Expand Up @@ -122,7 +121,6 @@ THREE.WebGLRenderer.prototype.renderScreenQuadFromTex = (function () {
transparent: true,
});


return function (srcTex, opacity) {
_material.uniforms.srcTex.value = srcTex;
_material.transparent = (opacity < 1.0);
Expand All @@ -137,7 +135,6 @@ THREE.WebGLRenderer.prototype.renderScreenQuadFromTexWithDistortion = (function
fragmentShader: fragmentScreenQuadFromTexWithDistortion,
});


return function (srcTex, coef) {
_material.uniforms.srcTex.value = srcTex;
_material.uniforms.coef.value = coef;
Expand Down
1 change: 0 additions & 1 deletion packages/lib/src/gfx/modes/Mode.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ class Mode {
this.opts = _.merge(utils.deriveDeep(this.settings.now.modes[this.id], true), opts);
}


/**
* Get mode identification, probably with options.
* @returns {string|Array} Mode identifier string ({@link Mode#id}) or two-element array containing both mode
Expand Down
1 change: 0 additions & 1 deletion packages/lib/src/gfx/modes/groups/AromaticGroup.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ class AromaticGroup extends AtomsGroup {
currVector.subVectors(currPos, center);
const upDir = currVector.clone().cross(prevVector).normalize();


for (; i < n; ++i) {
const omega = prevVector.angleTo(currVector);
tmpDir[i] = _slerp(omega, prevVector, currVector, 0.5).normalize();
Expand Down
2 changes: 0 additions & 2 deletions packages/lib/src/gfx/palettes/Palette.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ function lerpColor(c1, c2, alpha) {
return (r << 16) | (g << 8) | b;
}


class Palette {
constructor(name, id) {
this.name = name || 'Custom';
Expand Down Expand Up @@ -283,7 +282,6 @@ _.assign(Palette.prototype, {
},
});


const { namedColorsArray, namedColors } = Palette.prototype;

for (let i = 0, { length } = namedColorsArray; i < length; ++i) {
Expand Down
1 change: 0 additions & 1 deletion packages/lib/src/io/parsers/CCP4Parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ class Ccp4Model extends VolumeModel {
xyz2crs[crs2xyz[2] - 1] = 2; // section
}


_setOrigins() {
const [xaxis, yaxis, zaxis] = this._getAxis();
this._setAxisIndices();
Expand Down
2 changes: 0 additions & 2 deletions packages/lib/src/io/parsers/CIFParser.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,6 @@ class CIFParser extends Parser {
return complex;
}


/**
* Extract metadata
* @param complex structure to fill
Expand Down Expand Up @@ -470,7 +469,6 @@ class CIFParser extends Parser {
}
}


/**
* Extract biological assemblies information from CIF structure and fill complex
* @param {Complex} complex
Expand Down

0 comments on commit 3b2eee7

Please sign in to comment.