Update the state diagram.