There are the technical specs for implementation of the threading graph and the various button states:

Mail Threading Specs
Mail Threading Specs