Author diagrams
Keep engineering labels crisp
Use bounded micro-math scripts and Unicode without a browser text-measurement pass.
- sheet
- 4 / 15
- rev
- v0.6
- sections
- 2
- compiled
- 2
01 / TextCompose scripts without baseline drift
There is no TeX runtime here, and the labels still read like engineering. Grouped _ and ^ scripts nest, and bounded commands such as \Omega, \pi, \theta, \mu, and \infty resolve to glyphs. Each generated tspan carries an explicit baseline correction, so text following a nested script lands back on the parent baseline rather than drifting. Rotation stops at the vector: the label sits outside the rotated group and stays upright.
source:V2 "I_{bias}^{DC}" at (100, 150) #blue [type=current-dc]
capacitor:C2 "22 \mu F" at (330, 150) #amber [orientation=down]
qgate:Q2 "R_y" at (570, 150) #purple [parameter="\phi/4" phase="e^{-i\theta}"]
port:O2 "Z_{in} = \infty" at (800, 150) #emeraldWidth is estimated, never measured — no font is loaded at any point. The estimator is deterministic and deliberately conservative, and a long label grows the component's bounds before placement is validated. That ordering is what lets the whole thing work without an SSR-incompatible getBBox().
02 / QuantumUse polished custom gate rows
qgate is the escape hatch, and it shares hadamard's exact shell — same stub lengths, corner radius, focus treatment, and ports. Its parameter, phase, and matrix rows grow the body deterministically, so a custom operator can wear its own definition without becoming a different kind of object.
prepare:PB "|+\rangle" at (80, 130) #blue
hadamard:HB "H" at (260, 130) #cyan
qgate:VB "V" at (470, 130) #purple [parameter="\lambda" matrix="[w,x;y,z]"]
measure:MB "M_x" at (690, 130) #emerald
PB.out -> HB.in #blue [quantum line]
HB.out -> VB.in #cyan [quantum line]
VB.out -> MB.in #purple [quantum line]