QuantumGraphMermaidVisualizer¶
- class lsst.pipe.base.quantum_graph.visualization.QuantumGraphMermaidVisualizer¶
Bases:
QuantumGraphVisualizer[BaseQuantumGraph,QuantumInfo,DatasetInfo]A visualizer for quantum graphs in the Mermaid language.
Methods Summary
render_dataset(dataset_id, data)Return the representation of a dataset in a graph visualization.
render_edge(a, b, data)Return the representation of an edge a graph visualization.
render_footer(qg, is_bipartite)Return the ending of a graph visualization.
render_header(qg, is_bipartite)Return the beginning of a graph visualization.
render_quantum(quantum_id, data, is_bipartite)Return the representation of a quantum in a graph visualization.
write_bipartite(qg, stream)Write a visualization for graph with both quantum and dataset nodes.
write_quantum_only(qg, stream)Write a visualization for graph with only quantum nodes.
Methods Documentation
- render_dataset(dataset_id: UUID, data: DatasetInfo) str¶
Return the representation of a dataset in a graph visualization.
- Parameters:
- dataset_id
uuid.UUID ID of the dataset.
- data
DatasetInfo Mapping with additional information about the dataset.
- dataset_id
- Returns:
- rendered
str String that represents the dataset. May contain newlines, but an additional newline will automatically be added after the string, before the next node or edge.
- rendered
- render_edge(a: UUID, b: UUID, data: BipartiteEdgeInfo | None) str¶
Return the representation of an edge a graph visualization.
- Parameters:
- a
uuid.UUID ID of the quantum or dataset for which this is an outgoing edge.
- b
uuid.UUID ID of the quantum or dataset for which this is an incoming edge.
- data
BipartiteEdgeInfo Mapping with additional information about the dataset.
- a
- Returns:
- rendered
str String that represents the edge. May contain newlines, but an additional newline will automatically be added after the string, before the next edge.
- rendered
Return the ending of a graph visualization.
- Parameters:
- qg
BaseQuantumGraph Quantum graph to visualize.
- is_bipartite
bool Whether a bipartite graph visualization is being requested.
- qg
- Returns:
- rendered
str String that ends the visualization. May contain newlines, but an additional newline will automatically be added after the string, at the end of the file.
- rendered
- render_header(qg: BaseQuantumGraph, is_bipartite: bool) str¶
Return the beginning of a graph visualization.
- Parameters:
- qg
BaseQuantumGraph Quantum graph to visualize.
- is_bipartite
bool Whether a bipartite graph visualization is being requested.
- qg
- Returns:
- rendered
str String that starts the visualization. May contain newlines, but an additional newline will automatically be added after the string, before the first node.
- rendered
- render_quantum(quantum_id: UUID, data: QuantumInfo, is_bipartite: bool) str¶
Return the representation of a quantum in a graph visualization.
- Parameters:
- quantum_id
uuid.UUID ID of the quantum.
- data
QuantumInfo Mapping with additional information about the quantum.
- is_bipartite
bool Whether a bipartite graph visualization is being requested.
- quantum_id
- Returns:
- rendered
str String that represents the quantum. May contain newlines, but an additional newline will automatically be added after the string, before the next node or edge.
- rendered