TorchLean API

NN.Widgets.Core.UI

Widgets UI helpers #

TorchLean has multiple ProofWidgets-based viewers (IR graphs, autograd tapes, RL rollouts, etc.). Several widgets share the same compact HTML helpers (monospace, pill, status badges, DOT label escaping).

This file centralizes those helpers so:

Design notes:

References:

Render a string as monospace code, using VS Code theme fonts when available.

Instances For

    Render a small “pill” badge (used for compact key/value metadata).

    Instances For

      Render an “OK” badge with accent color.

      Instances For

        Render a warning badge.

        Instances For

          Render an error badge.

          Instances For

            Render a boolean "flag" badge: green when true, muted when false.

            Instances For

              Escape a string so it is safe to embed inside a double-quoted DOT node label.

              Instances For