How to manually create dependent dropdowns

The documentation section Manually Creating Custom Fields provides a good description of creating fields using the module loader, including dropdowns. But how can I do the same thing for dependent dropdowns, where I need to specify a parent dropdown and visibility in the $fields array?