Autolayout within subgraph

I have a diagram with subgraph.

Added a context menu option for the subgraph that let the user layout the nodes in the selected subgraph. The way it's implementaed is just like the guide suggest, by creating a network and adding the nodes.
The problem I'm having is that other that laying out the nodes inside the subgraph, it also move the subgraph to top left corner of the document.
Is there an option to autolayout the nodes inside the subgraph without moving the subgraph?

Remember the position before the layout, and then move the subgraph back afterwards. You can decide if you want to keep the Position the same, or the Center, or by some other criteria.