network#
Fury UI module.
|
Network actor that simulates force-directed layout on the GPU. |
|
Compute Shader implementing Fruchterman-Reingold layout. |
|
Material handling simulation parameters for the Network. |
|
Parse string data into network arrays. |
|
Register and return compute and rendering shader steps for the actor pipeline. |
|
Convert network arrays into a string of the specified format. |
Module: network.core#
Network actors.
|
Network actor that simulates force-directed layout on the GPU. |
|
Register and return compute and rendering shader steps for the actor pipeline. |
Module: network.parser#
Network Parsing Functionality.
Abstract base class for all network file format parsers. |
|
Parses and Writes GEXF XML format natively into NumPy arrays. |
|
Parses and Writes GML (Graph Modeling Language) efficiently. |
|
Parses and Writes XNET format (Line-based format) directly into NumPy arrays. |
|
|
Parse string data into network arrays. |
|
Convert network arrays into a string of the specified format. |
Network#
- class fury.network.Network(nodes, edges, colors=None, k=10.0, damping=0.9, repulsion_strength=1.0, speed=1.0, point_size=15.0, edge_opacity=0.5)[source]#
Bases:
WorldObject,ActorNetwork actor that simulates force-directed layout on the GPU.
- Parameters:
nodes (ndarray, shape (N, 3)) – Initial positions of the nodes.
edges (ndarray, shape (M, 2)) – Indices of connected nodes.
colors (ndarray, shape (N, 4), optional) – Colors of the nodes.
k (float, optional) – Optimal distance constant (affects equilibrium length).
damping (float, optional) – Damping factor for velocity (0.0 to 1.0).
repulsion_strength (float, optional) – Multiplier for repulsive forces.
speed (float, optional) – Simulation speed factor.
point_size (float, optional) – Size of the rendered nodes.
edge_opacity (float, optional) – Opacity of the edges (0.0 to 1.0).
- __init__(nodes, edges, colors=None, k=10.0, damping=0.9, repulsion_strength=1.0, speed=1.0, point_size=15.0, edge_opacity=0.5)[source]#
Initialize the network actor instance.
- Parameters:
nodes (ndarray, shape (N, 3)) – Initial positions of the nodes.
edges (ndarray, shape (M, 2)) – Indices of connected nodes.
colors (ndarray, shape (N, 4), optional) – Colors of the nodes.
k (float, optional) – Optimal distance constant (affects equilibrium length).
damping (float, optional) – Damping factor for velocity (0.0 to 1.0).
repulsion_strength (float, optional) – Multiplier for repulsive forces.
speed (float, optional) – Simulation speed factor.
point_size (float, optional) – Size of the rendered nodes.
edge_opacity (float, optional) – Opacity of the edges (0.0 to 1.0).
NetworkComputeShader#
- class fury.network.NetworkComputeShader(wobject)[source]#
Bases:
BaseShaderCompute Shader implementing Fruchterman-Reingold layout.
- Parameters:
wobject (Network) – The target network actor instance utilizing this shader.
- __init__(wobject)[source]#
Initialize the compute shader instance.
- Parameters:
wobject (Network) – The target network actor instance utilizing this shader.
- get_bindings(wobject, _shared, _scene)[source]#
Define and structure pipeline data resources for compute stages.
- get_code()[source]#
Get the structural WGSL computer execution source block string.
- Returns:
The layout compute kernel source code string.
- Return type:
- get_render_info(wobject, _shared)[source]#
Get workgroup dispatch sizing metrics for the compute pipeline.
- type = 'compute'#
NetworkMaterial#
- class fury.network.NetworkMaterial(k=10.0, damping=0.9, speed=1.0, repulsion_strength=1.0, size=10.0, **kwargs)[source]#
Bases:
PointsMaterialMaterial handling simulation parameters for the Network.
- Parameters:
k (float, optional) – Optimal distance constant.
damping (float, optional) – Damping factor for velocity.
speed (float, optional) – Simulation speed factor.
repulsion_strength (float, optional) – Multiplier for repulsive forces.
size (float, optional) – Size of the rendered nodes.
**kwargs (dict) – Additional parameters passed to PointsMaterial.
- __init__(k=10.0, damping=0.9, speed=1.0, repulsion_strength=1.0, size=10.0, **kwargs)[source]#
Initialize the material instance.
- Parameters:
k (float, optional) – Optimal distance constant.
damping (float, optional) – Damping factor for velocity.
speed (float, optional) – Simulation speed factor.
repulsion_strength (float, optional) – Multiplier for repulsive forces.
size (float, optional) – Size of the rendered nodes.
**kwargs (dict) – Additional parameters passed to PointsMaterial.
- property k#
Get the optimal distance constant.
- Returns:
The optimal distance constant.
- Return type:
- property repulsion_strength#
Get the repulsive force multiplier.
- Returns:
The repulsion strength multiplier.
- Return type:
- property speed#
Get the simulation speed factor.
- Returns:
The simulation speed factor.
- Return type:
parse_network#
- fury.network.parse_network(data, format)[source]#
Parse string data into network arrays.
- Parameters:
- Returns:
A tuple containing: - nodes_xyz (np.ndarray): Shape (N, 3) float32 array of node positions. - edges_indices (np.ndarray): Shape (E, 2) int32 array of edge connections. - colors (np.ndarray): Shape (N, 4) float32 array of node colors (RGBA).
- Return type:
register_network_shaders#
stringify_network#
- fury.network.stringify_network(network_data, format)[source]#
Convert network arrays into a string of the specified format.
- Parameters:
network_data (tuple) – A tuple containing: - nodes_xyz (np.ndarray): Shape (N, 3) float32 array of node positions. - edges_indices (np.ndarray): Shape (E, 2) int32 array of edge connections. - colors (np.ndarray): Shape (N, 4) float32 array of node colors (RGBA).
format (str) – The exported configuration selector string (‘gexf’, ‘gml’, or ‘xnet’).
- Returns:
The formatted serial layout text output stream.
- Return type:
Network#
- class fury.network.core.Network(nodes, edges, colors=None, k=10.0, damping=0.9, repulsion_strength=1.0, speed=1.0, point_size=15.0, edge_opacity=0.5)[source]#
Bases:
WorldObject,ActorNetwork actor that simulates force-directed layout on the GPU.
- Parameters:
nodes (ndarray, shape (N, 3)) – Initial positions of the nodes.
edges (ndarray, shape (M, 2)) – Indices of connected nodes.
colors (ndarray, shape (N, 4), optional) – Colors of the nodes.
k (float, optional) – Optimal distance constant (affects equilibrium length).
damping (float, optional) – Damping factor for velocity (0.0 to 1.0).
repulsion_strength (float, optional) – Multiplier for repulsive forces.
speed (float, optional) – Simulation speed factor.
point_size (float, optional) – Size of the rendered nodes.
edge_opacity (float, optional) – Opacity of the edges (0.0 to 1.0).
- __init__(nodes, edges, colors=None, k=10.0, damping=0.9, repulsion_strength=1.0, speed=1.0, point_size=15.0, edge_opacity=0.5)[source]#
Initialize the network actor instance.
- Parameters:
nodes (ndarray, shape (N, 3)) – Initial positions of the nodes.
edges (ndarray, shape (M, 2)) – Indices of connected nodes.
colors (ndarray, shape (N, 4), optional) – Colors of the nodes.
k (float, optional) – Optimal distance constant (affects equilibrium length).
damping (float, optional) – Damping factor for velocity (0.0 to 1.0).
repulsion_strength (float, optional) – Multiplier for repulsive forces.
speed (float, optional) – Simulation speed factor.
point_size (float, optional) – Size of the rendered nodes.
edge_opacity (float, optional) – Opacity of the edges (0.0 to 1.0).
register_network_shaders#
BaseParser#
- class fury.network.parser.BaseParser[source]#
Bases:
objectAbstract base class for all network file format parsers.
- __init__()#
- parse(data)[source]#
Parse raw content string into a Network instance.
- Parameters:
data (str) – The raw text string sequence content to parse.
- Returns:
A tuple containing: - nodes_xyz (np.ndarray): Shape (N, 3) float32 array of node positions. - edges_indices (np.ndarray): Shape (E, 2) int32 array of edge connections. - colors (np.ndarray): Shape (N, 4) float32 array of node colors (RGBA).
- Return type:
GEXFParser#
- class fury.network.parser.GEXFParser[source]#
Bases:
BaseParserParses and Writes GEXF XML format natively into NumPy arrays.
- __init__()#
- parse(xml_string)[source]#
Parse raw GEXF XML directly into NumPy arrays.
- Parameters:
xml_string (str) – The raw GEXF XML text context.
- Returns:
A tuple containing: - nodes_xyz (np.ndarray): Shape (N, 3) float32 array of node positions. - edges_indices (np.ndarray): Shape (E, 2) int32 array of edge connections. - colors (np.ndarray): Shape (N, 4) float32 array of node colors (RGBA).
- Return type:
GMLParser#
- class fury.network.parser.GMLParser[source]#
Bases:
BaseParserParses and Writes GML (Graph Modeling Language) efficiently.
- __init__()#
- parse(data)[source]#
Parse raw GML structured content tokens directly into NumPy arrays.
- Parameters:
data (str) – The raw text string block processing context data content.
- Returns:
A tuple containing: - nodes_xyz (np.ndarray): Shape (N, 3) float32 array of node positions. - edges_indices (np.ndarray): Shape (E, 2) int32 array of edge connections. - colors (np.ndarray): Shape (N, 4) float32 array of node colors (RGBA).
- Return type:
XNETParser#
- class fury.network.parser.XNETParser[source]#
Bases:
BaseParserParses and Writes XNET format (Line-based format) directly into NumPy arrays.
- __init__()#
- parse(data)[source]#
Parse raw XNET format tokens directly into NumPy arrays.
- Parameters:
data (str) – The raw text string block processing context data content.
- Returns:
A tuple containing: - nodes_xyz (np.ndarray): Shape (N, 3) float32 array of node positions. - edges_indices (np.ndarray): Shape (E, 2) int32 array of edge connections. - colors (np.ndarray): Shape (N, 4) float32 array of node colors (RGBA).
- Return type:
parse_network#
- fury.network.parser.parse_network(data, format)[source]#
Parse string data into network arrays.
- Parameters:
- Returns:
A tuple containing: - nodes_xyz (np.ndarray): Shape (N, 3) float32 array of node positions. - edges_indices (np.ndarray): Shape (E, 2) int32 array of edge connections. - colors (np.ndarray): Shape (N, 4) float32 array of node colors (RGBA).
- Return type:
stringify_network#
- fury.network.parser.stringify_network(network_data, format)[source]#
Convert network arrays into a string of the specified format.
- Parameters:
network_data (tuple) – A tuple containing: - nodes_xyz (np.ndarray): Shape (N, 3) float32 array of node positions. - edges_indices (np.ndarray): Shape (E, 2) int32 array of edge connections. - colors (np.ndarray): Shape (N, 4) float32 array of node colors (RGBA).
format (str) – The exported configuration selector string (‘gexf’, ‘gml’, or ‘xnet’).
- Returns:
The formatted serial layout text output stream.
- Return type: