Skip to content
Snippets Groups Projects
Commit d58f27ea authored by Alexander Rose's avatar Alexander Rose
Browse files

assemblyId url param

parent bbad6f98
No related branches found
No related tags found
No related merge requests found
......@@ -31,11 +31,11 @@ export class App {
}
}
async loadPdbId(id: string) {
async loadPdbId(id: string, assemblyId?: string) {
if (this.structureView) this.structureView.destroy()
const cif = await getCifFromUrl(`https://files.rcsb.org/download/${id}.cif`)
const models = await getModelsFromMmcif(cif)
this.structureView = await StructureView(this.viewer, models)
this.structureView = await StructureView(this.viewer, models, { assemblyId })
this.pdbIdLoaded.next(this.structureView)
}
}
\ No newline at end of file
......@@ -19,5 +19,6 @@ if (!elm) throw new Error('Can not find element with id "app".')
const app = new App()
ReactDOM.render(React.createElement(AppComponent, { app }), elm);
const pdbid = urlQueryParameter('pdbid')
if (pdbid) app.loadPdbId(pdbid)
\ No newline at end of file
const assemblyId = urlQueryParameter('assembly')
const pdbId = urlQueryParameter('pdb')
if (pdbId) app.loadPdbId(pdbId, assemblyId)
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment