index.ts 809 B

1234567891011121314151617181920212223242526
  1. /**
  2. * Copyright (c) 2018 mol* contributors, licensed under MIT, See LICENSE file for more info.
  3. *
  4. * @author Alexander Rose <alexander.rose@weirdbyte.de>
  5. */
  6. import * as React from 'react'
  7. import * as ReactDOM from 'react-dom'
  8. import './index.html'
  9. import { App } from './app';
  10. import { AppComponent } from './component/app';
  11. import { urlQueryParameter } from 'mol-util/url-query';
  12. const elm = document.getElementById('app') as HTMLElement
  13. if (!elm) throw new Error('Can not find element with id "app".')
  14. const app = new App()
  15. ReactDOM.render(React.createElement(AppComponent, { app }), elm);
  16. const assemblyId = urlQueryParameter('assembly')
  17. const pdbId = urlQueryParameter('pdb')
  18. if (pdbId) app.loadPdbIdOrMmcifUrl(pdbId, { assemblyId })
  19. app.loadCcp4Url('http://localhost:8091/ngl/data/betaGal.mrc')