Closed cschlick closed 2 years ago
@Jhsmit . Do you know this?
Yes, you can also use Jupyter directly, without the need for panel static dirs
For example like this, when you start jupyter notebook in the panel-chemistry root directory
PDBeMolStar(
name='Local File',
sizing_mode='stretch_width',
height=500,
custom_data = {
'url': 'http://localhost:8888/files/examples/assets/1qyn.pdb',
'format': 'pdb'
},
)
I've made a PR for add docs but looks like there is a problem with the tests at the moment
How come http://localhost:8888/files/...
works @Jhsmit? (I did not know that :-)).
Since you can 'download' all your files and subdirectories from where you run jupyter notebook
, I guess some part of jupyter serves all your files on an http server or something like that. Which is of course usually used for downloading your files if you run jupyter remotely, but if you run things locally you can use it to serve your files to PDBeMolStar directly.
It should also be possible to serve local files through something like python's SimpleHTTPServer
, but I havent tested this.
Thanks so much guys. I also didn't know about the /files/ aspect to Jupyter, but that works really well for me.
Hi, I've been working with the pdbe molstar code and I think it's fantastic. I'm a little confused about how static files would work for panel in a jupyter notebook though. Is there a way to specify an assets directory in a notebook without running panel serve --static-dirs from the command line?