Skip to content

Commit

Permalink
checkboxes can use molstar info to display component availability
Browse files Browse the repository at this point in the history
  • Loading branch information
bioinsilico committed Mar 8, 2024
1 parent 2c9e2d3 commit de151a0
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 10 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

[Semantic Versioning](https://semver.org/)

## [4.0.11] - 2024-03-08
### Improvement
- 1D3D checkboxes can use molstar info to display component availability.
This is useful for non PDB entries

## [4.0.10] - 2024-03-06
### Improvement
- div delimiter increased width && transparent
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@rcsb/rcsb-saguaro-3d",
"version": "4.0.10",
"version": "4.0.11",
"description": "RCSB Molstar/Saguaro Web App",
"main": "build/dist/app.js",
"files": [
Expand All @@ -20,6 +20,7 @@
"buildDoc": "typedoc --excludeExternals --externalPattern \"**/node_modules/**\" --plugin typedoc-plugin-missing-exports --plugin typedoc-theme-hierarchy --theme hierarchy --entryPointStrategy expand ./src && sed -i '' '/---/d' docs/index.html",
"clean": "del-cli lib && del-cli build",
"publishApp": "npm publish",
"packApp": "npm run buildApp && npm pack",
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,12 +164,8 @@ export class MsaRowTitleCheckboxComponent extends React.Component <MsaRowTitleCh
isVisible:boolean;
pdb: {entryId:string;entityId:string;} | {entryId:string;instanceId:string;};
}): Promise<void> {
if(this.compId() == this.getRcsbId(data.pdb) && this.props.tag == data.tag){
if( data.isVisible)
this.setState({checked: true, opacity: await this.opacity()})
else
this.setState({checked: false, opacity: await this.opacity()})
}
if(this.compId() == this.getRcsbId(data.pdb) && this.props.tag == data.tag)
this.setState({checked: data.isVisible, opacity: data.isComponent ? 1 : await this.opacity()})
}

private requestInfo(): void {
Expand All @@ -190,16 +186,23 @@ export class MsaRowTitleCheckboxComponent extends React.Component <MsaRowTitleCh
}

private async opacity(): Promise<0 | 1> {
switch (this.props.tag){
case "aligned":
if(this.props.tag == "aligned")
return 1;
return await this.componentOpacity(this.props.tag);

}

private async componentOpacity(componentType: "polymer" | "non-polymer"): Promise<0|1> {
if(!TagDelimiter.isRcsbId(this.props.entryId))
return 0;
switch (componentType) {
case "polymer":
return await this.polymerTest() ? 1 : 0;
case "non-polymer":
return await this.nonPolymerTest() ? 1 : 0;
}

}

private async polymerTest(): Promise<boolean> {
const entryId = this.props.entryId;
const entryInfo = (await rcsbRequestCtxManager.getEntryProperties(entryId))[0];
Expand Down

0 comments on commit de151a0

Please sign in to comment.