That does sound a bit like my son who has Aspergers and ADHD and Bipolar NOS. He can go from happy to angry at the drop of a hat. Any of the above diagnosis can do that though - so pinning down why can be tricky. ASD kiddos have mood swings related to low frustration tolerance. ADHD kids have outbursts because they have difficulty controlling their impulses, and Bipolar kids get angry and irritable because of wide changes in brain chemistry. Same behavior, different causes.
I guess I am saying there are many reasons a child's moods might swing. Sometimes its just a temperament issue. Some kids are just more intense with their emotions. She's 4 right? IME 4 year olds can go through a downright nasty stage. Think terrible twos with ability to be articulate and argue! Not exactly fun. In my work with very NT 4-5 year olds, this was a common concern. So keep developmental stuff in mind. She may just have an intense temperament and some developmental stuff going on that is making her more volatile. Is her sensory stuff being triggered lately? I know that sensory issues combined with little simple frustrations of the day can send my boys through the roof. It seems to come out of nowhere, but the truth is there are rumblings before the storm. I just miss them if I am not paying attention.
Sometimes in our efforts to comfort our children during their emotional storms, we inadvertently reinforce the negative behavior. My oldest son had a lot of attention-seeking behaviors starting in early childhood, The more empathy I showed, the more I tried to convince him that what he was saying wasn't true, the more invested he became in convincing me (and himself) that it was. It could quickly go from "I'm mad" to "you hate me" to "the world is a horrible place" to worse. By the time he was in his teens, he fed off these interchanges and it was terribly difficult to break that cycle. We worked with a team of therapists and doctors who advised we stay very matter-of-fact and calm with him, and not engage. Not flat out ignore him, but just somewhat disconnect from him when he'd go into one of his tirades. Think of it like a verbal temper tantrum. Just like a physical tantrum, you can't reason with a child in that state. So it might go something like this:
DS "You hate me!"
Me: "You know that is not true." (stated calmly, not emotionally charged)
DS: "Yes it is! You probably wish I wasn't born!!!." (getting louder)
Me: "Oops. Not ok to talk to mom that way son. Time to calm down."
DS: "I will run away! You will never see me again."
Me: "Calm down time. You can choose to either _______ or __________."
DS: " Fine!" *stomps off and slams door to his room*
Not fun, but infinitely better than the alternative which is 30+ minutes of drama that never comes to therapeutic end! Fill in the blanks with calm-down activities or consequences that are decided ahead of time. TBH my DS would never choose one of the calm down activities. He usually always escalated to a consequence. Its like he didn't want to calm down, he wanted to fight and try to get me upset. The doctors said it was crucial I didn't react to this. It was really, really hard for me. I am an empathetic person, I love to talk things out, and I love this boy to pieces! But for his best interest, I had to teach him that certain behaviors are not ok, even when we are mad. Saying hurtful things about others, about himself, etc. were not ok. It can be scary when your child is saying these things, but when they are calm chances are they'll admit they didn't mean it and were just mad.
I would start tracking her outbursts using the ABC method. A = the antecedent (describe what was going on right before) For example "we were playing outside and I told her it was time to go in. It was hot, and we were late for lunch". B= behavior "she yelled, she threatened to run away and took off", and C= consequence (what happened right after the behavior) "I chased her and carried her back to the house". The consequence is whatever happened after, its not necessarily what discipline you later gave, though add that too. This is important because sometimes the consequence can be triggering the behavior as much as the antecedent. The point of ABC behavior chains is to help you pin point what is triggering her and make adjustments that will help her learn better behavior. I used this tool to help the Special Ed teachers evaluate some of my students who were having behavioral issues, and then when we were in therapy they recommended we do it to help clarify DS's issues and make adjustments. Its really hard when you are living it 24/7 to step back and be objective and this helps. After a while you can see patterns, "Oh. He always tantrums when we change an activity he likes. Lets try giving him more notice that we are about to transition to something new." or "he yells or hits every day when I am making dinner. Maybe the smells of cooking are bothering him. Maybe he's hungry and needs a snack mid-afternoon". If there seems to be no rhyme or reason to it ever, that is when I would start to suspect bipolar and approach my doctor with those concerns.