network#

Fury UI module.

Network(nodes, edges[, colors, k, damping, ...])

Network actor that simulates force-directed layout on the GPU.

NetworkComputeShader(wobject)

Compute Shader implementing Fruchterman-Reingold layout.

NetworkMaterial([k, damping, speed, ...])

Material handling simulation parameters for the Network.

parse_network(data, format)

Parse string data into network arrays.

register_network_shaders(wobject)

Register and return compute and rendering shader steps for the actor pipeline.

stringify_network(network_data, format)

Convert network arrays into a string of the specified format.

Module: network.core#

Network actors.

Network(nodes, edges[, colors, k, damping, ...])

Network actor that simulates force-directed layout on the GPU.

register_network_shaders(wobject)

Register and return compute and rendering shader steps for the actor pipeline.

Module: network.parser#

Network Parsing Functionality.

BaseParser()

Abstract base class for all network file format parsers.

GEXFParser()

Parses and Writes GEXF XML format natively into NumPy arrays.

GMLParser()

Parses and Writes GML (Graph Modeling Language) efficiently.

XNETParser()

Parses and Writes XNET format (Line-based format) directly into NumPy arrays.

parse_network(data, format)

Parse string data into network arrays.

stringify_network(network_data, format)

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, Actor

Network 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: BaseShader

Compute 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.

Parameters:
  • wobject (Network) – The network object instance providing buffer bindings.

  • _shared (Any) – Shared context pipeline references.

  • _scene (Any) – The scene object context.

Returns:

A layout dictionary index mapping configured binding structures.

Return type:

dict

get_code()[source]#

Get the structural WGSL computer execution source block string.

Returns:

The layout compute kernel source code string.

Return type:

str

get_pipeline_info(_wobject, _shared)[source]#

Return an empty pipeline structure map configuration.

Parameters:
  • _wobject (Network) – The target network instance.

  • _shared (Any) – Shared pipeline context metadata.

Returns:

An empty dictionary.

Return type:

dict

get_render_info(wobject, _shared)[source]#

Get workgroup dispatch sizing metrics for the compute pipeline.

Parameters:
  • wobject (Network) – The network object instance being simulated.

  • _shared (Any) – Shared context pipeline references.

Returns:

A dictionary containing workgroup dimension sizes.

Return type:

dict

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: PointsMaterial

Material 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 damping#

Get the velocity damping factor.

Returns:

The damping factor.

Return type:

float

property k#

Get the optimal distance constant.

Returns:

The optimal distance constant.

Return type:

float

property repulsion_strength#

Get the repulsive force multiplier.

Returns:

The repulsion strength multiplier.

Return type:

float

property speed#

Get the simulation speed factor.

Returns:

The simulation speed factor.

Return type:

float

uniform_type: ClassVar[dict[str, str]] = {'alpha_test': 'f4', 'clipping_planes': '0*4xf4', 'color': '4xf4', 'damping': 'f4', 'k': 'f4', 'maprange': '2xf4', 'opacity': 'f4', 'repulsion_strength': 'f4', 'rotation': 'f4', 'size': 'f4', 'speed': 'f4'}#

parse_network#

fury.network.parse_network(data, format)[source]#

Parse string data into network arrays.

Parameters:
  • data (str) – The raw data containing network details.

  • format (str) – The file layout format (‘gexf’, ‘gml’, or ‘xnet’).

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:

tuple

register_network_shaders#

fury.network.register_network_shaders(wobject)[source]#

Register and return compute and rendering shader steps for the actor pipeline.

Parameters:

wobject (Network) – The target network object component context.

Returns:

The configured compute shader and render shader pair layout tuple.

Return type:

tuple

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:

str

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, Actor

Network 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#

fury.network.core.register_network_shaders(wobject)[source]#

Register and return compute and rendering shader steps for the actor pipeline.

Parameters:

wobject (Network) – The target network object component context.

Returns:

The configured compute shader and render shader pair layout tuple.

Return type:

tuple

BaseParser#

class fury.network.parser.BaseParser[source]#

Bases: object

Abstract 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:

tuple

stringify(parsed_data)[source]#

Serialize a parsed network data into a formatted string layout.

Parameters:

parsed_data (tuple) – The output tuple (nodes_xyz, edges_indices, colors) from self.parse().

Returns:

The formatted exported string file layout representation.

Return type:

str

GEXFParser#

class fury.network.parser.GEXFParser[source]#

Bases: BaseParser

Parses 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:

tuple

stringify(parsed_data)[source]#

Serialize extracted arrays back into a valid GEXF XML string format.

This makes stringify(parse(gexf_file)) output a validated equivalent.

Parameters:

parsed_data (tuple) – The output tuple (nodes_xyz, edges_indices, colors) from self.parse().

Returns:

The exported XML GEXF string context.

Return type:

str

GMLParser#

class fury.network.parser.GMLParser[source]#

Bases: BaseParser

Parses 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:

tuple

stringify(parsed_data)[source]#

Convert extracted arrays back into an explicit GML structural text layout.

This accepts the exact output of parse(), effectively making: stringify(parse(gml_file)) output a cleanly validated GML equivalent.

Parameters:

parsed_data (tuple) – The output tuple (nodes_xyz, edges_indices, colors) from self.parse().

Returns:

The exported plain GML string representation document block.

Return type:

str

XNETParser#

class fury.network.parser.XNETParser[source]#

Bases: BaseParser

Parses 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:

tuple

stringify(parsed_data)[source]#

Serialize extracted arrays back into a valid structural XNET format.

This accepts the exact output of parse(), effectively making: stringify(parse(xnet_file)) output a cleanly validated XNET equivalent.

Parameters:

parsed_data (tuple) – The output tuple (nodes_xyz, edges_indices, colors) from self.parse().

Returns:

The exported plain XNET string document mapping.

Return type:

str

parse_network#

fury.network.parser.parse_network(data, format)[source]#

Parse string data into network arrays.

Parameters:
  • data (str) – The raw data containing network details.

  • format (str) – The file layout format (‘gexf’, ‘gml’, or ‘xnet’).

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:

tuple

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:

str