pycortex icon indicating copy to clipboard operation
pycortex copied to clipboard

it would be *really nice* to be able to render 3D views headlessly (i.e. without opening a web browser)

Open alexhuth opened this issue 10 years ago • 3 comments

Currently it's possible to render flatmaps headlessly, but not 3D views. To render a 3D view, a browser window needs to open to create the webgl context. This means it's impossible to render 3D views on headless cluster machines (that don't run X) without opening a browser window on a separate local machine.

We could potentially solve this by using some headless webgl library, such as https://github.com/stackgl/headless-gl

alexhuth avatar Oct 30 '15 22:10 alexhuth

Might be worth looking into how plotly does this for their interactive plotting (w/ jupyter notebooks). To my knowledge they use WebGL and basically create a <div> output where they dump the viz. Check out:

https://github.com/plotly/plotly.py/blob/master/plotly/tools.py#L286

Which has some extra baggage because they're parsing plotly links, but it should have the guts for how the embedded plotting works.

choldgraf avatar May 24 '16 17:05 choldgraf

isn't that always in browser though?

bendichter avatar Jun 03 '16 22:06 bendichter

yep - they do embedded plotting, but under-the-hood it's just creating a bunch of HTML, then I think they just render it with a final call to IPython.display.HTML, so it could be possible to do the number crunching, and then save that HTML to a JSON file or something. Though I'm not sure as to @alexhuth's usecase here so maybe that wouldn't be useful.

choldgraf avatar Jun 08 '16 19:06 choldgraf