pstjohn / d3flux

D3.js based visualizations of cobrapy metabolic models
MIT License
40 stars 9 forks source link

Implement headless map generation #4

Open shubhamkmr47 opened 7 years ago

shubhamkmr47 commented 7 years ago

After this command present in example: flux_map(model, display_name_format=lambda x: str(x.id), figsize=(300,250))

an ipython html object is created. How to visualise it? I am using ubuntu-14 and executing program through terminal.

pstjohn commented 7 years ago

Ah, good question. I think this will only work through the jupyter notebook sadly. The problem is that we use d3.js (a javascript library) to do a lot of the rendering. So we pretty much build an HTML object and embed in the javascript source, then rely on the browser to do the heavy lifting in terms of generating the image. 'Headless SVG generation' is probably possible in theory, but would probably be hard enough to keep me from doing it in the near future.

pstjohn commented 7 years ago

This would probably be possible using puppeter to generate standalone images in different formats (png, pdf).