diet vs mood

i’ve been severely unhappy and overweight (not necessarily due to each other) for the past three years. about a month ago, i radically changed my diet and began eating real, good, whole foods and immediately i found that a lot of my pointless sadness and anxiety was near gone. this past weekend i went on vacation and my diet, naturally, went to shit because i was eating whatever i wanted. now i find myself sad and anxious again over nothing!!! is this a complete coincidence or is this change in what i normally eat possibly the reason for this sudden mood change?