Keynote stretch line animation
I would do the animation of the line as a Magic Move. To do that, start with the line on a slide. In the Slide Navigator, duplicate the slide. On the second slide, adjust the length of the line (and position if you wish). Select the first slide in the Slide Navigator and apply the Magic Move transition.

I like using Magic Moves for things like this because it makes it easier to deal with multiple elements on the slide.