Mercurial > repos > goeckslab > vitessce_spatial
comparison index.html @ 5:97be83fc3677 draft
planemo upload for repository https://github.com/goeckslab/tools-mti/tree/main/tools/vitessce commit 90f081e58b5ee41bba3a7e6f01d97b5bd9392759
| author | goeckslab |
|---|---|
| date | Wed, 28 May 2025 21:14:59 +0000 |
| parents | 068da7f7cd83 |
| children |
comparison
equal
deleted
inserted
replaced
| 4:068da7f7cd83 | 5:97be83fc3677 |
|---|---|
| 25 import React from 'react'; | 25 import React from 'react'; |
| 26 import { createRoot } from 'react-dom/client'; | 26 import { createRoot } from 'react-dom/client'; |
| 27 import { Vitessce } from 'vitessce'; | 27 import { Vitessce } from 'vitessce'; |
| 28 import { config } from './config.js'; | 28 import { config } from './config.js'; |
| 29 | 29 |
| 30 console.log('here be url: '+window.location.href); | |
| 31 var current_url = window.location.href.replace(new RegExp('\/[^\/]*$'), ''); | |
| 32 console.log(current_url); | |
| 33 function rewriteURL(input) { | |
| 34 for (let k in input) { | |
| 35 if (typeof input[k] === 'string' || input[k] instanceof String) { | |
| 36 input[k] = input[k].replace('http://localhost', current_url) | |
| 37 } | |
| 38 else { | |
| 39 input[k] = rewriteURL(input[k]) | |
| 40 } | |
| 41 } | |
| 42 return input; | |
| 43 }; | |
| 44 var fixed_conf = {...config}; | |
| 45 fixed_conf = rewriteURL(fixed_conf); | |
| 46 console.log('conf fixed:'); | |
| 47 console.log(fixed_conf); | |
| 48 function MyApp() { | 30 function MyApp() { |
| 49 return React.createElement( | 31 return React.createElement( |
| 50 Vitessce, | 32 Vitessce, |
| 51 { | 33 { |
| 52 height: 1000, | 34 height: 1000, |
| 53 theme: 'dark', | 35 theme: 'dark', |
| 54 config: fixed_conf, | 36 config: config, |
| 55 } | 37 } |
| 56 ); | 38 ); |
| 57 } | 39 } |
| 58 | 40 |
| 59 const container = document.getElementById('root'); | 41 const container = document.getElementById('root'); |
