ExposoGraph.cytoscape_adapter

Build Cytoscape-ready JSON bundles, stylesheets, layouts, and saved position artifacts for the advanced Dash viewer.

Cytoscape-oriented graph export helpers for the advanced viewer.

class ExposoGraph.cytoscape_adapter.ViewerLayoutMode(value)[source]
COSE = 'cose'
BREADTHFIRST = 'breadthfirst'
CIRCLE = 'circle'
PRESET = 'preset'
class ExposoGraph.cytoscape_adapter.CytoscapeBundle(elements: 'list[dict[str, Any]]', stylesheet: 'list[dict[str, Any]]', layout: 'dict[str, Any]', metadata: 'dict[str, Any]', positions: 'dict[str, dict[str, float]]')[source]
Parameters:
elements: list[dict[str, Any]]
stylesheet: list[dict[str, Any]]
layout: dict[str, Any]
metadata: dict[str, Any]
positions: dict[str, dict[str, float]]
to_dict()[source]
Return type:

dict[str, Any]

classmethod from_dict(data)[source]
Parameters:

data (Mapping[str, Any])

Return type:

CytoscapeBundle

ExposoGraph.cytoscape_adapter.normalize_viewer_layout_mode(value)[source]
Parameters:

value (str | ViewerLayoutMode | None)

Return type:

ViewerLayoutMode

ExposoGraph.cytoscape_adapter.compute_viewer_positions(graph, *, visibility=GraphVisibility.ALL, seed=42, width=1400, height=980)[source]
Parameters:
Return type:

dict[str, dict[str, float]]

ExposoGraph.cytoscape_adapter.load_viewer_positions(path)[source]
Parameters:

path (str | Path)

Return type:

dict[str, dict[str, float]]

ExposoGraph.cytoscape_adapter.load_cytoscape_bundle(path)[source]
Parameters:

path (str | Path)

Return type:

CytoscapeBundle

ExposoGraph.cytoscape_adapter.write_viewer_positions(graph, path, *, visibility=GraphVisibility.ALL, seed=42, positions=None)[source]
Parameters:
Return type:

Path

ExposoGraph.cytoscape_adapter.viewer_stylesheet()[source]
Return type:

list[dict[str, Any]]

ExposoGraph.cytoscape_adapter.viewer_layout(layout_mode=ViewerLayoutMode.COSE, *, edge_weights=None)[source]

Return Cytoscape layout config.

When edge_weights is supplied and the layout mode is COSE, the idealEdgeLength is scaled per-edge using the weight (higher weight = shorter edge). The weights dict maps "source->target" keys to float values in (0, 1].

Parameters:
Return type:

dict[str, Any]

ExposoGraph.cytoscape_adapter.build_cytoscape_elements(graph, *, visibility=GraphVisibility.ALL, positions=None)[source]
Parameters:
Return type:

list[dict[str, Any]]

ExposoGraph.cytoscape_adapter.build_cytoscape_metadata(graph, *, visibility=GraphVisibility.ALL, layout_mode=ViewerLayoutMode.COSE)[source]
Parameters:
Return type:

dict[str, Any]

ExposoGraph.cytoscape_adapter.build_cytoscape_bundle(graph, *, visibility=GraphVisibility.ALL, positions=None, layout_mode=ViewerLayoutMode.COSE)[source]
Parameters:
Return type:

CytoscapeBundle

ExposoGraph.cytoscape_adapter.write_cytoscape_bundle(graph, path, *, visibility=GraphVisibility.ALL, positions=None, layout_mode=ViewerLayoutMode.COSE)[source]
Parameters:
Return type:

Path