graphistry.layout package#
Subpackages#
- graphistry.layout.gib package
- Submodules
- graphistry.layout.gib.gib module
- graphistry.layout.gib.layout_bulk module
- graphistry.layout.gib.layout_non_bulk module
- graphistry.layout.gib.partition module
- graphistry.layout.gib.partitioned_layout module
- graphistry.layout.gib.style module
- graphistry.layout.gib.treemap module
- Module contents
- graphistry.layout.graph package
- Submodules
- graphistry.layout.graph.edge module
- graphistry.layout.graph.edgeBase module
- graphistry.layout.graph.graph module
GraphGraph.N()Graph.add_edge()Graph.add_edges()Graph.add_vertex()Graph.component_classGraph.connected()Graph.deg_avg()Graph.deg_max()Graph.deg_min()Graph.edges()Graph.eps()Graph.get_vertex_from_data()Graph.get_vertices_count()Graph.norm()Graph.order()Graph.path()Graph.remove_edge()Graph.remove_vertex()Graph.vertices()
- graphistry.layout.graph.graphBase module
GraphBaseGraphBase.N()GraphBase.add_edge()GraphBase.add_single_vertex()GraphBase.complement()GraphBase.constant_function()GraphBase.contract()GraphBase.deg_avg()GraphBase.deg_max()GraphBase.deg_min()GraphBase.dft()GraphBase.dijkstra()GraphBase.edges()GraphBase.eps()GraphBase.get_scs_with_feedback()GraphBase.leaves()GraphBase.matrix()GraphBase.norm()GraphBase.order()GraphBase.partition()GraphBase.path()GraphBase.remove_edge()GraphBase.remove_vertex()GraphBase.roots()GraphBase.spans()GraphBase.union_update()GraphBase.vertices()
- graphistry.layout.graph.vertex module
- graphistry.layout.graph.vertexBase module
- Module contents
- graphistry.layout.modularity_weighted package
- graphistry.layout.ring package
- graphistry.layout.sugiyama package
- Submodules
- graphistry.layout.sugiyama.sugiyamaLayout module
SugiyamaLayoutSugiyamaLayout.arrange()SugiyamaLayout.create_dummies()SugiyamaLayout.ctrlsSugiyamaLayout.dirhSugiyamaLayout.dirvSugiyamaLayout.dirvhSugiyamaLayout.draw_step()SugiyamaLayout.dummyctrl()SugiyamaLayout.ensure_root_is_vertex()SugiyamaLayout.find_nearest_layer()SugiyamaLayout.graph_from_pandas()SugiyamaLayout.has_cycles()SugiyamaLayout.initialize()SugiyamaLayout.layersSugiyamaLayout.layout()SugiyamaLayout.layoutVerticesSugiyamaLayout.layout_edges()SugiyamaLayout.ordering_step()SugiyamaLayout.set_coordinates()SugiyamaLayout.set_topological_coordinates()SugiyamaLayout.xspaceSugiyamaLayout.yspace
- Module contents
- graphistry.layout.utils package
- Submodules
- graphistry.layout.utils.dummyVertex module
- graphistry.layout.utils.geometry module
- graphistry.layout.utils.layer module
- graphistry.layout.utils.layoutVertex module
- graphistry.layout.utils.poset module
- graphistry.layout.utils.rectangle module
- graphistry.layout.utils.routing module
- Module contents
Submodules#
graphistry.layout.circle module#
- graphistry.layout.circle.circle_layout(self, bounding_box=None, ring_spacing=None, point_spacing=None, partition_by=None, sort_by=None, ascending=True, na_position='last', ignore_index=True, engine=EngineAbstract.AUTO)#
Arranges nodes in a circular layout
If partition_by and and bounding_box df are provided, do as multiple circles
Node order around each circle is by node id (within partition), always. See the
sort_bynote below.The ring radius is set to circumscribe the bounding box of the nodes
Parameters#
- param self:
Plottable
- type self:
Plottable
- param bounding_box:
The bounding box for the circular layout, in the format (cx, cy, width, height), or a partition-keyed dataframe of the same. If not provided, the nodes must already carry x/y positions, from which the bounding box is derived. The dataframe form requires columns partition_key, cx, cy, w, h, at most one row per partition.
- type bounding_box:
Optional[Tuple[float, float, float, float] | df[[partition_key, cx, cy, w, h]]]
- param ring_spacing:
The spacing between successive rings. Defaults to 1.0 if not provided.
- type ring_spacing:
Optional[float]
- param point_spacing:
The distance between nodes within a ring, along the circumference. Defaults to ring_spacing * 0.1 if not provided.
- type point_spacing:
Optional[float]
- param partition_by:
Column name or list of column names to partition nodes by, laying out one circle per partition. The partition columns must have no null values. Defaults to None, in which case a single circle is used.
- type partition_by:
Optional[Union[str, List[str]]]
- param sort_by:
Currently has NO effect on the layout. Node order around each circle is always determined by node id (within partition); the sort this parameter performs is discarded by that ordering before any position is assigned. Passing a column that does not exist still raises KeyError, and leaving it None additionally attaches degree columns (
degree,degree_in,degree_out) to the output nodes.- type sort_by:
Optional[Union[str, List[str]]]
- param ascending:
Currently has NO effect on the layout; consumed only by the discarded sort described under
sort_by.- type ascending:
Union[bool, List[bool]]
- param na_position:
Currently has NO effect on the layout; consumed only by the discarded sort described under
sort_by. Defaults to ‘last’.- type na_position:
str
- param ignore_index:
Currently has NO effect on the layout; consumed only by the discarded sort described under
sort_by. Defaults to True.- type ignore_index:
bool
- param engine:
The engine to use for computations (either ‘pandas’ or ‘cudf’). Defaults to EngineAbstract.AUTO.
- type engine:
Union[EngineAbstract, str]
Returns#
- Plottable
A graph object with nodes arranged in a circular layout.
- Parameters:
self (Plottable)
bounding_box (Tuple[float, float, float, float] | Any | None)
ring_spacing (float | None)
point_spacing (float | None)
partition_by (str | List[str] | None)
sort_by (str | List[str] | None)
ascending (bool | List[bool])
na_position (str)
ignore_index (bool)
engine (EngineAbstract | str)
- Return type:
- graphistry.layout.circle.print_gpu_memory_usage(prefix='')#
graphistry.layout.fa2 module#
- graphistry.layout.fa2.compute_bounding_boxes(self, partition_key, engine)#
Returns the bounding boxes for each partition based on the center coordinates and dimensions of the nodes. DF keys: - cx: Center x-coordinate - cy: Center y-coordinate - w: Width - h: Height - partition_key: Partition key
- Parameters:
self (Plottable)
partition_key (str)
engine (Engine)
- Return type:
Any
- graphistry.layout.fa2.fa2_layout(self, fa2_params=None, circle_layout_params=None, singleton_layout=None, partition_key=None, engine=EngineAbstract.AUTO, allow_cpu_fallback=False)#
Applies FA2 layout for connected nodes and circle layout for singleton (edgeless) nodes
Allows optional parameterization of the circle layout, e.g., ring and point spacing
- Parameters:
self (graphistry.Plottable.Plottable) – The graph object with nodes and edges, in a format compatible with Graphistry’s Plottable object.
fa2_params (Optional[Dict[str, Any]]) – Optional parameters for the underlying force-directed layout, forwarded as params= to layout_cugraph(‘force_atlas2’, …) on GPU or layout_igraph(‘fr’, …) on CPU.
circle_layout_params (Optional[Dict[str, Any]]) – Optional parameters for customizing the circle layout, passed through to
graphistry.layout.circle.circle_layout(). Can include: - partition_by: Node column(s) selecting one circle per partition. - ring_spacing: Spacing between rings in the circle layout. - point_spacing: Spacing between points in each ring. - sort_by / ascending: accepted, but currently have no effect on positions (see circle_layout).singleton_layout (Optional[Callable[[Plottable, Tuple[float, float, float, float] | Any], Plottable]]) – Optional custom layout function for singleton nodes (default: circle_layout).
partition_key (Optional[str]) – The key for partitioning nodes (used for picking bounding box type). Default is None.
allow_cpu_fallback (bool) – When True, allow a CPU (igraph Fruchterman-Reingold) fallback instead of raising. Only intended for internal callers that explicitly expect the approximation.
engine (EngineAbstract | str)
- Returns:
A graph object with FA2 and circle layouts applied.
- Return type: