Author diagrams
Keep engineering labels crisp
Use bounded micro-math scripts and Unicode without a browser text-measurement pass.
- sheet
- 4 / 15
- rev
- v0.7
- 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:V3 "V_{ref}^{AC}" at (100, 150) #blue [type=voltage-ac]
inductor:L3 "4.7 \mu H" at (330, 150) #cyan [orientation=up]
qgate:Q3 "R_z" at (570, 150) #purple [parameter="\lambda/2" phase="e^{i\pi/8}"]
port:O3 "\phi = \pi/3" 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:PC "|0\rangle" at (80, 130) #blue
ry:RC "R_y" at (270, 130) #cyan [parameter="\theta/2"]
qgate:UC "U" at (480, 130) #purple [parameter="\alpha" matrix="[p,q;r,s]"]
measure:MC "M_y" at (700, 130) #emerald
PC.out -> RC.in #blue [quantum line]
RC.out -> UC.in #cyan [quantum line]
UC.out -> MC.in #purple [quantum line]