Polls showed Trump with a clear edge to win—though many of the swing states were too close to call.