How to pined a node to another node?

hi walter ,i want to pined node A to node B, how to do it ? when dragging node B ,node A should be followed.

If node B is a Group and if node A is a member of node B, then moving B will automatically move A. (Also, node A is copied when node B is copied, and node A is deleted when node B is deleted.) See samples such as http://gojs.net/latest/samples/regrouping.html.

If there is a Link from node B to node A (even if it is not seen), and if DraggingTool.dragsTree is true, then dragging node B will automatically drag node A (both move and copy). See samples such as http://gojs.net/latest/samples/incrementalTree.html.

More generally, you can override DraggingTool.computeEffectiveCollection to make arbitrary or dynamic decisions regarding what other Parts should be dragged besides the Diagram.selection. See samples such as http://gojs.net/latest/samples/pipes.html or http://gojs.net/latest/samples/seatingChart.html.