Power grids are traditionally dominated by synchronous generators (SGs) but are currently undergoing a major transformation through the increasing integration of inverter-based resources (IBRs). The SG-dominated grid is traditionally analyzed in a mechanical-centric view which ignores fast electrical dynamics and focuses on the torque-speed dynamics. By contrast, analysis of the emergent IBR-dominated grid usually takes the electrical-centric view which focuses on the voltage-current interaction. In this article, a port-mapping method is proposed to fill the gap between these approaches and combine them in a unified model. Specifically, the mechanical dynamics are mapped to the electrical impedance seen at the electrical port; and the electrical dynamics are also mapped to the torque coefficient seen at the mechanical port. The bidirectional mapping gives additional flexibility and insights to analyze the sub-system interactions in whole-system dynamics and guide the tuning of parameter. Application of the proposed method is illustrated in three cases with increasing scales, namely a single-SG-infinite-bus system, a single-IBR-weak-grid system, and a modified IEEE 14-bus SG-IBR composite system.