Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get HTML from py2cytoscape.cytoscapejs.viewer.render #36

Open
gilesc opened this issue Jun 16, 2017 · 0 comments
Open

Get HTML from py2cytoscape.cytoscapejs.viewer.render #36

gilesc opened this issue Jun 16, 2017 · 0 comments
Assignees

Comments

@gilesc
Copy link

gilesc commented Jun 16, 2017

I would like to render cytoscapejs HTML outside of IPython notebook (i.e. in my own webapp). Unfortunately, the function py2cytoscape.cytoscapejs.viewer.render does not return HTML, it calls display(HTML(html_string)), then returns None. This means (AFAIK), I cannot directly access the HTML that is generated from this function.

I suggest that there be two functions in py2cytoscape.cytoscapejs.viewer, one to render HTML from a graph, and another to both render and display the result in IPython notebook. Or even more simply, the function could remain as is, but just return the html string from the rendered template (but I am not sure if this would interfere with usage in ipynb).

Another possible approach would be to allow the caller to select the IPython frontend that is called by display and return the DisplayHandle object used by IPython, which might let the user control how and where the HTML is rendered. But I think the first approach is simpler and more flexible.

@jorgeboucas jorgeboucas self-assigned this Jul 18, 2019
@jorgeboucas jorgeboucas pinned this issue Jul 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants