v0.3 · Author diagrams
Keep engineering labels crisp
Use bounded micro-math scripts and Unicode without a browser text-measurement pass.
01 / TextCompose scripts without baseline drift
Labels support grouped _ and ^ scripts plus bounded commands such as \Omega, \pi, \theta, and \infty. Every generated tspan carries an explicit baseline correction; component rotation never rotates the outer label.
source:V1 "V_{in}^{AC}" at (100, 150) #blue [type=voltage-ac]
resistor:R1 "10 k\Omega" at (330, 150) #amber [orientation=down]
qgate:Q1 "R_z" at (570, 150) #purple [parameter="\theta/2" phase="e^{i\phi}"]
port:O1 "f_c = \infty" at (800, 150) #emeraldThe width estimator is deterministic and conservative. Long labels enlarge component bounds before placement validation rather than relying on SSR-incompatible getBBox().
02 / QuantumUse polished custom gate rows
Plain qgate shares the same shell geometry, stub lengths, corner radius, focus treatment, and ports as hadamard. Detail rows increase the body deterministically.
prepare:P "|0\rangle" at (80, 130) #blue
hadamard:H "H" at (260, 130) #cyan
qgate:U "U" at (470, 130) #purple [parameter="\theta" matrix="[a,b;c,d]"]
measure:M "M_z" at (690, 130) #emerald
P.out -> H.in #blue [quantum line]
H.out -> U.in #cyan [quantum line]
U.out -> M.in #purple [quantum line]