In addition to being a runnable CLI tool, D2 can also be used to produce diagrams from Go programs. For examples, see ./docs/examples/lib. This blog post also demos a complete, runnable example of ...
Check out this interesting wideband AC millivoltmeter circuit from 1990. The simple design features 12 ranges, decent accuracy, 200 µV accuracy, and a frequency range from 20 Hz to more than 2 MHz.