Anaconda Enterprise: Documentation

# bokeh.models.graphs

class `bokeh.models.graphs.``EdgesAndLinkedNodes`(**kwargs)

  Bases: `bokeh.models.graphs.GraphHitTestPolicy`

  With the EdgesAndLinkedNodes policy, inspection or selection of graph edges will result in the inspection or selection of the edge and of the linked graph nodes. There is no direct selection or inspection of graph nodes.

JSON Prototype

    {
      "id": "562ba6f2-533e-4b08-b892-e4a3cecda39a",
      "js_event_callbacks": {},
      "js_property_callbacks": {},
      "name": null,
      "subscribed_events": [],
      "tags": []
    }

class `bokeh.models.graphs.``GraphHitTestPolicy`(**kwargs)

  Bases: `bokeh.model.Model`

  Note

  This is an abstract base class used to help organize the hierarchy of Bokeh model types. It is not useful to instantiate on its own.

JSON Prototype

    {
      "id": "a3dfaf81-0e5b-403d-9145-735efe7e8d97",
      "js_event_callbacks": {},
      "js_property_callbacks": {},
      "name": null,
      "subscribed_events": [],
      "tags": []
    }

class `bokeh.models.graphs.``LayoutProvider`(**kwargs)

  Bases: `bokeh.model.Model`

  Note

  This is an abstract base class used to help organize the hierarchy of Bokeh model types. It is not useful to instantiate on its own.

JSON Prototype

    {
      "id": "43c40500-5edc-4b7c-9dde-f33f13534f8f",
      "js_event_callbacks": {},
      "js_property_callbacks": {},
      "name": null,
      "subscribed_events": [],
      "tags": []
    }

class `bokeh.models.graphs.``NodesAndLinkedEdges`(**kwargs)

  Bases: `bokeh.models.graphs.GraphHitTestPolicy`

  With the NodesAndLinkedEdges policy, inspection or selection of graph nodes will result in the inspection or selection of the node and of the linked graph edges. There is no direct selection or inspection of graph edges.

JSON Prototype

    {
      "id": "d9c23540-ff55-4989-97fa-969193c5ceb5",
      "js_event_callbacks": {},
      "js_property_callbacks": {},
      "name": null,
      "subscribed_events": [],
      "tags": []
    }

class `bokeh.models.graphs.``NodesOnly`(**kwargs)

  Bases: `bokeh.models.graphs.GraphHitTestPolicy`

  With the NodesOnly policy, only graph nodes are able to be selected and inspected. There is no selection or inspection of graph edges.

JSON Prototype

    {
      "id": "509d870d-f232-4335-bfd9-808f5a4bf24a",
      "js_event_callbacks": {},
      "js_property_callbacks": {},
      "name": null,
      "subscribed_events": [],
      "tags": []
    }

class `bokeh.models.graphs.``StaticLayoutProvider`(**kwargs)

  Bases: `bokeh.models.graphs.LayoutProvider`

  `graph_layout`

    property type: `Dict` ( `Either` ( `String` , `Int` ), `Seq` ( `Any` ) )

    The coordinates of the graph nodes in cartesian space. The dictionary keys correspond to a node index and the values are a two element sequence containing the x and y coordinates of the node.

        {
            0 : [0.5, 0.5],
            1 : [1.0, 0.86],
            2 : [0.86, 1],
        }

JSON Prototype

    {
      "graph_layout": {},
      "id": "1f9d9c49-03f0-4974-a0a8-0a050ca7ba65",
      "js_event_callbacks": {},
      "js_property_callbacks": {},
      "name": null,
      "subscribed_events": [],
      "tags": []
    }

`bokeh.models.graphs.``from_networkx`(graph, layout_function, **kwargs)

  Generate a GraphRenderer from a networkx.Graph object and networkx layout function. Any keyword arguments will be passed to the layout function.

  Parameters:

  - graph (networkx.Graph) – a networkx graph to render
  - layout_function (function) – a networkx layout function

  Returns: | instance (GraphRenderer)

  Warning

  Only two dimensional layouts are currently supported.