Browse Source

additional `ball-and-stick` representation

bioinsilico 1 year ago
parent
commit
b697a37aca

+ 7 - 0
CHANGELOG.md

@@ -2,6 +2,13 @@
 
 [Semantic Versioning](https://semver.org/)
 
+## [3.0.13] - 2023-08-16
+### Improvements
+- Non `ball-and-stick` representations for ligands will always include an additional `ball-and-stick` representation
+ 
+### Dependency update
+- @rcsb/rcsb-molstar v3.7.3
+
 ## [3.0.12] - 2023-08-10
 ### Dependency update
 - @rcsb/rcsb-molstar v3.7.2

+ 13 - 13
package-lock.json

@@ -1,12 +1,12 @@
 {
   "name": "@rcsb/rcsb-saguaro-3d",
-  "version": "3.0.12",
+  "version": "3.0.13",
   "lockfileVersion": 2,
   "requires": true,
   "packages": {
     "": {
       "name": "@rcsb/rcsb-saguaro-3d",
-      "version": "3.0.12",
+      "version": "3.0.13",
       "license": "MIT",
       "dependencies": {
         "@rcsb/rcsb-api-tools": "^4.1.13",
@@ -55,7 +55,7 @@
         "webpack-dev-server": "^4.15.1"
       },
       "peerDependencies": {
-        "@rcsb/rcsb-molstar": "^2.7.2",
+        "@rcsb/rcsb-molstar": "^2.7.3",
         "molstar": "^3.38.3"
       }
     },
@@ -3298,14 +3298,14 @@
       }
     },
     "node_modules/@rcsb/rcsb-molstar": {
-      "version": "2.7.2",
-      "resolved": "https://registry.npmjs.org/@rcsb/rcsb-molstar/-/rcsb-molstar-2.7.2.tgz",
-      "integrity": "sha512-3Olqo7aqUMNgPAVWXFhFJYKYHaeXZEzIaGh7ZWma2xorple3ZskgN5QsqorvGAlGKXeGAu5fYPER2b4shW26BQ==",
+      "version": "2.7.3",
+      "resolved": "https://registry.npmjs.org/@rcsb/rcsb-molstar/-/rcsb-molstar-2.7.3.tgz",
+      "integrity": "sha512-3nYHMDQQ0rmY9oxDWCpIPV9wZ8AsOnrK8bGGwaVF5gZ6pzxIENbWBEkRWfKUhlWmIGe+AXrbpZYtMOVVBsisXA==",
       "peer": true,
       "dependencies": {
-        "@types/react": "^18.2.16",
+        "@types/react": "^18.2.20",
         "@types/react-dom": "^18.2.7",
-        "molstar": "^3.38.2",
+        "molstar": "^3.38.3",
         "react": "^18.2.0",
         "react-dom": "^18.2.0",
         "rxjs": "^7.8.1",
@@ -16898,14 +16898,14 @@
       }
     },
     "@rcsb/rcsb-molstar": {
-      "version": "2.7.2",
-      "resolved": "https://registry.npmjs.org/@rcsb/rcsb-molstar/-/rcsb-molstar-2.7.2.tgz",
-      "integrity": "sha512-3Olqo7aqUMNgPAVWXFhFJYKYHaeXZEzIaGh7ZWma2xorple3ZskgN5QsqorvGAlGKXeGAu5fYPER2b4shW26BQ==",
+      "version": "2.7.3",
+      "resolved": "https://registry.npmjs.org/@rcsb/rcsb-molstar/-/rcsb-molstar-2.7.3.tgz",
+      "integrity": "sha512-3nYHMDQQ0rmY9oxDWCpIPV9wZ8AsOnrK8bGGwaVF5gZ6pzxIENbWBEkRWfKUhlWmIGe+AXrbpZYtMOVVBsisXA==",
       "peer": true,
       "requires": {
-        "@types/react": "^18.2.16",
+        "@types/react": "^18.2.20",
         "@types/react-dom": "^18.2.7",
-        "molstar": "^3.38.2",
+        "molstar": "^3.38.3",
         "react": "^18.2.0",
         "react-dom": "^18.2.0",
         "rxjs": "^7.8.1",

+ 2 - 2
package.json

@@ -1,6 +1,6 @@
 {
   "name": "@rcsb/rcsb-saguaro-3d",
-  "version": "3.0.12",
+  "version": "3.0.13",
   "description": "RCSB Molstar/Saguaro Web App",
   "main": "build/dist/app.js",
   "files": [
@@ -92,7 +92,7 @@
     "@rcsb/rcsb-saguaro-app": "^5.0.8"
   },
   "peerDependencies": {
-    "@rcsb/rcsb-molstar": "^2.7.2",
+    "@rcsb/rcsb-molstar": "^2.7.3",
     "molstar": "^3.38.3"
   },
   "bugs": {

+ 8 - 2
src/RcsbFvStructure/StructureViewers/MolstarViewer/TrajectoryPresetProvider/AlignmentRepresentationPresetProvider.ts

@@ -202,7 +202,6 @@ export const AlignmentRepresentationPresetProvider = StructureRepresentationPres
 
         await update.commit({ revertOnError: false });
 
-        let anyLigComp;
         for(const expression of createSelectionExpressions(entryId)){
             if(expression.tag == "polymer")
                 continue;
@@ -227,13 +226,20 @@ export const AlignmentRepresentationPresetProvider = StructureRepresentationPres
                     isHidden:true
                 }
             });
+            if(expression.type !== "ball-and-stick")
+                representationMap[expression.tag + "#ball-and-stick"] = builder.buildRepresentation(update, comp, {
+                    type: "ball-and-stick"
+                },{
+                    initialState:{
+                        isHidden:true
+                    }
+                });
 
             if (comp?.cell?.state ) {
                 StateTransform.assignState(comp?.cell?.state, { isHidden: true });
             }
 
             await update.commit({ revertOnError: false });
-            if(comp && expression.tag != "water") anyLigComp = comp;
         }
 
         structure.inheritedPropertyData.reprList = Object.values(representationMap).filter(repr=>typeof repr != "undefined");

+ 8 - 0
src/RcsbFvStructure/StructureViewers/MolstarViewer/TrajectoryPresetProvider/AssemblyRepresentationPresetProvider.ts

@@ -98,6 +98,14 @@ export const AssemblyRepresentationPresetProvider = StructureRepresentationPrese
                     isHidden: expression.tag == "water"
                 }
             });
+            if(expression.type !== "ball-and-stick")
+                representationMap[expression.tag + "#ball-and-stick"] = builder.buildRepresentation(update, comp, {
+                        type: "ball-and-stick"
+                    },{
+                        initialState:{
+                        isHidden: expression.tag == "water"
+                    }
+                });
             if (comp?.cell?.state && expression.tag == "water") {
                 StateTransform.assignState(comp?.cell?.state, { isHidden: true });
             }