this sounds counter-intuitive but when that happens you should stand up immediately. "pointing" your toes at any angle downward prolongs it and then you get this video
Same thing for me. This used to happen to me back when I wasn't getting much of any exercise; sometimes I'd wake up, stretch my legs, and then one bundle of muscle fiber would go apeshit and refuse to relax. It still happens, now that I bicycle / go for hikes / etc a lot, but very rarely, and never as intensely. (That said, my exercise regimen still has me hobbling around like Torgo a fair amount, and I am disappointed that nobody understands why I sometimes whistle the Torgo theme.)
I had this happen to both of my calves after my fastest marathon last year. I did my best not to look like a complete idiot and just sat on the ground while I could physically see my muscles move into crsmp mode. Fuck that was miserable.