There are a couple schools of thought on fixing this type of behavior. What you have to think about is horses are herd animals, they feel safe with their herd. When you remove her from her herd it causes anxiety because she may not feel safe, she may be more of an alpha mare in which case she is worried she will lose her status in the herd, either way she is not viewing you as her herd leader. You need to to gain her respect and trust and the problem will fix itself.
The way I like to fix herd bound horses is first show them I have control of their feet and can move them in any direction I want, at the speed I want them to go. If they want to be near their buddies that is fine but they will work while they are there. Lots of changes of direction and lots of transitions. When they are focused on me, listening and ready for rest I take them away towards where I want to be. If they get anxious and worried I go back to where they want to be, and go back to work. Eventually they realize being with their buddies means work, being with you means relaxing. You may only get 50 feet before she gets worried that is fine, you have to find your starting point and work from there. Each day make it your goal to move a little farther away until you are able to walk her to the barn without incident. When you get to the barn if she gets antsy take her outside the barn and work her, lots of changing of directions, lots of transitions. Take her back give her an opportunity to rest, groom her, rub her make her feel good for being there. Some people are not advocates of using food or treats, but in some cases especially if they are food motivated this would be a time, after she learns to go with you to the barn without a fuss, that I would give her a little something to munch on when you get there. A little bit of hay, or a few pellets just to reinforce that you are the good guy and have control of the food to like an alpha mare would.
Your not going to "keep her calm" you want to teach her that she is alright to be alone with you, and standing still with you is a much better option then working near her buddies. It will take time it is not an easy fix, you may have to forgo riding for a while until you get the problem fixed. But I bet if you are consistent and just work everyday on moving away from the herd it will only take one week, two weeks at most to get her more confident. Fix the problem now and spend the rest of your days together safely and having fun.