networkit.csbridge

networkit.csbridge.widget_from_graph(G, node_scores=None, node_partition=None, node_palette=None, show_ids=True)

Note

DEPRECATED. Use networkit.vizbridges.widgetFromGraph() instead.

Creates a ipycytoscape-widget from a given graph. The returned widget already contains all nodes and edges from the graph. The graph is colored using an array of norm. rgb-values based on seaborn perceptually uniform color map (rocket) or a user given custom color array. See matplotlib color maps for the correct formatting: https://matplotlib.org/api/_as_gen/matplotlib.colors.Colormap.html#matplotlib.colors.Colormap

Parameters
  • G (networkit.graph.Graph) – Graph (nodes, edges), which should be visualized

  • node_scores (list of numbers, optional) – List of scores for each nodes, for example scores from a centrality measure. This is used for color-calculation of the nodes (continuous distribution). Provide either node_scores or node_partition - not both. Default: None

  • node_partition (networkit.structures.Partition, optional) – Partition object. This is used for color-calculation of the nodes (discrete distribution). Provide either node_scores or node_partition - not both. Default: None

  • node_palette (list of tuples, optional) – Array consisting of normalized rgb-values. If none is given, seaborn.color_palette.colors is used. Default: None

  • show_ids (boolean, optional) – Set whether node ids should be visible in plot-widget. Is set to True by default. Default: None