inline.py 文件源码

python
阅读 27 收藏 0 点赞 0 评论 0

项目:pybel-tools 作者: pybel 项目源码 文件源码
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
    ))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号