Code for linkage viewer