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:
- ExposoGraph.cytoscape_adapter.normalize_viewer_layout_mode(value)[source]¶
- Parameters:
value (str | ViewerLayoutMode | None)
- Return type:
- ExposoGraph.cytoscape_adapter.compute_viewer_positions(graph, *, visibility=GraphVisibility.ALL, seed=42, width=1400, height=980)[source]¶
- Parameters:
graph (GraphEngine | KnowledgeGraph)
visibility (GraphVisibility | str)
seed (int)
width (int)
height (int)
- Return type:
- ExposoGraph.cytoscape_adapter.write_viewer_positions(graph, path, *, visibility=GraphVisibility.ALL, seed=42, positions=None)[source]¶
- Parameters:
graph (GraphEngine | KnowledgeGraph)
visibility (GraphVisibility | str)
seed (int)
- Return type:
- 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
idealEdgeLengthis scaled per-edge using the weight (higher weight = shorter edge). The weights dict maps"source->target"keys to float values in(0, 1].
- ExposoGraph.cytoscape_adapter.build_cytoscape_elements(graph, *, visibility=GraphVisibility.ALL, positions=None)[source]¶
- Parameters:
graph (GraphEngine | KnowledgeGraph)
visibility (GraphVisibility | str)
- Return type:
- ExposoGraph.cytoscape_adapter.build_cytoscape_metadata(graph, *, visibility=GraphVisibility.ALL, layout_mode=ViewerLayoutMode.COSE)[source]¶
- Parameters:
graph (GraphEngine | KnowledgeGraph)
visibility (GraphVisibility | str)
layout_mode (ViewerLayoutMode | str)
- Return type:
- ExposoGraph.cytoscape_adapter.build_cytoscape_bundle(graph, *, visibility=GraphVisibility.ALL, positions=None, layout_mode=ViewerLayoutMode.COSE)[source]¶
- Parameters:
graph (GraphEngine | KnowledgeGraph)
visibility (GraphVisibility | str)
layout_mode (ViewerLayoutMode | str)
- Return type:
- ExposoGraph.cytoscape_adapter.write_cytoscape_bundle(graph, path, *, visibility=GraphVisibility.ALL, positions=None, layout_mode=ViewerLayoutMode.COSE)[source]¶
- Parameters:
graph (GraphEngine | KnowledgeGraph)
visibility (GraphVisibility | str)
layout_mode (ViewerLayoutMode | str)
- Return type: