def to_jupyter(graph, width=DEFAULT_WIDTH, height=DEFAULT_HEIGHT, color_map=None, replace_cnames=False):
"""Displays the BEL graph inline in a Jupyter notebook.
To use successfully, make run as the last statement in a cell inside a Jupyter notebook.
:param pybel.BELGraph graph: A BEL graph
:param int width: The width of the visualization window to render
:param int height: The height of the visualization window to render
:param dict color_map: A dictionary from PyBEL internal node functions to CSS color strings like #FFEE00. Defaults
to :data:`default_color_map`
:return: An IPython notebook Javascript object
:rtype: :class:`IPython.display.Javascript`
"""
from IPython.display import Javascript
return Javascript(to_jupyter_str(
graph,
width=width,
height=height,
color_map=color_map,
replace_cnames=replace_cnames
))
评论列表
文章目录