qecx.ViewerConfig

class qecx.ViewerConfig(circuit_mode='auto', circuit_mpl_max_per_variant=300, circuit_text_max_per_variant=3000, circuit_mpl_total_budget=500, circuit_text_total_budget=5000, circuit_scale=0.8, circuit_fold=-1, figure_format='png', qubit_indices=None, qubit_indices_max_n=50, layout_figsize=None)

Bases: object

Render-tuning configuration for QECXViewer.

Variables:
  • circuit_mode (Literal["auto", "mpl", "text", "none"]) – How circuits render in HTML output. "auto" runs a gate-count cascade per variant and across the document, picking matplotlib ("mpl"), ASCII text drawer ("text"), or a styled placeholder block. "mpl" / "text" / "none" force the named tier and skip the cascade; "none" suppresses circuit rendering entirely.

  • circuit_mpl_max_per_variant (int) – Gate count above which a single variant is downgraded from "mpl" to "text" under "auto".

  • circuit_text_max_per_variant (int) – Gate count above which a single variant is downgraded from "text" to "placeholder" under "auto".

  • circuit_mpl_total_budget (int) – Document-wide gate count above which every variant is downgraded from "mpl" to "text" under "auto". Bounds the aggregate cost of rendering the whole document in one notebook cell.

  • circuit_text_total_budget (int) – Document-wide gate count above which every variant is downgraded from "text" to "placeholder" under "auto".

  • circuit_scale (float) – Initial scale factor for matplotlib circuit images. The HTML viewer’s slider scales relative to this value.

  • circuit_fold (int) – Number of layers after which circuit rendering wraps. -1 disables folding.

  • figure_format (Literal["png", "svg"]) – Embedding format for matplotlib figure output (circuits + layouts) inside HTML rendering. "png" (default) emits a base64 data URL; "svg" emits inline SVG markup with text rendered as vector paths for consistent display across hosts.

  • qubit_indices (bool | None) – Whether draw_layout annotates each qubit dot with its register index. None (default) lets the data-qubit count drive the choice via qubit_indices_max_n.

  • qubit_indices_max_n (int) – Data-qubit count above which qubit_indices=None resolves to False; the annotation layer becomes visually crowded past this threshold.

  • layout_figsize (tuple[float, float] | None) – Default (width, height) in inches for draw_layout figures. None triggers an adaptive size derived from the layout’s coordinate range.