I would like to add a diverter valve to my washer's drain line to facilitate a graywater system. I'm thinking of shortening the washer drain so I can relocate the P-trap higher up and add the diverter valve beneath it on the main stack. If I were to do this, what's the shortest that I could make the washer drain? What does the code say, and what does sanity say? If necessary, I can just move the washer box higher up; it's a little low as it is. Here's a picture to show my thoughts:
The dryer ducting is all going to be removed, and the 220v outlet is going to be relocated, so ignore those. And needless to say, that cast iron is going to be replaced with ABS.