If you have an enormous composition graph, you can prevent erdantic from walking the entire tree by specifying certain models as terminal nodes. These models will act as leaf nodes in the diagram.
Using the CLI
Use the -t flag followed by the dotted path of the model to be treated as a terminus. You can use multiple -t flags to specify multiple terminal models.
Using the Python library
Pass a list of model classes to the terminal_models keyword argument in erd.create().
# CLI: Terminate the graph at the 'Quest' class
# Use repeated -t flags for multiple terminal models
erdantic erdantic.examples.msgspec.Party -t erdantic.examples.msgspec.Quest -o party.png
# Python: Terminate the graph at the 'Quest' class
from erdantic.examples.msgspec import Party, Quest
import erdantic as erd
diagram = erd.create(Party, terminal_models=[Quest])