  The large number of observed exoplanets ($\gtrsim $ 700) provides important
constraints on their origin as deduced from the mass-period diagram of planets.
The most surprising features in the diagram are 1) the (apparent) pile up of
gas giants at a period of $\sim 500$ days ($\sim1$ AU) and 2) the so-called
mass-period relation which indicates that planetary mass is an increasing
function of orbital period. We construct the evolutionary tracks of growing
planets at planet traps in evolving protoplanetary disks and show that they
provide a good physical understanding of how these observational properties
arise. The fundamental feature of our model is that inhomogeneities in
protoplanetary disks give rise to multiple (up to 3) trapping sites for rapid
(type I) planetary migration of planetary cores. The viscous evolution of disks
results in the slow radial movement of the traps and their cores from large to
small orbital periods. In our model, the slow inward motion of planet traps is
coupled with the standard core accretion scenario for planetary growth. As
planets grow, type II migration takes over. Planet growth and radial movement
are ultimately stalled by the dispersal of gas disks via photoevaporation. Our
model makes a number of important predictions: that distinct sub-populations of
planets that reflect the properties of planet traps where they have grown
result in the mass-period relation; that the presence of these sub-populations
naturally explains a pile-up of planets at $\sim 1$ AU; and that evolutionary
tracks from the ice line do put planets at short periods and fill an earlier
claimed "planet desert" - sparse population of planets in the mass-semi-major
axis diagram.
