plotting – Move dynamic plot inside DynamicModule

I am trying to understand Dynamic a bit better for some classroom presentations, so I tried to make a dynamic list plot. As far as I can tell, this still requires repeatedly replotting the entire plot, but I think superceded plots can immediately be garbage collected. (Right?)

Anyway, consider the following simple example, which I believe captures my core considerations. (The Pause just allows enough time to watch the animation.)

traj = Sin@Subdivide(0, 2 Pi, 50)  (* the trajectory to plot *)
Dynamic(ListPlot(traj((;; tmax)),
  DataRange -> {0, 2 Pi*tmax/50}, 
  PlotRange -> {{0, 2 Pi}, {-1, 1}}), None)
Do(FinishDynamic(); Pause(0.01); tmax = n, {n, 1, 51})
  1. Is this basically correct as an approach to my problem of dynamic plotting?
  2. Does ListAnimate have advantages over this approach, aside from this approach a. introducing an otherwise unneeded global variable and b. not being able (afaict) to save the animation?
  3. How can I do this inside a DynamicModule, to avoid introducing dynamic global variables?


A stated in the question, a key goal here is to better understand Dynamic and relations. For the simple example above, Animate works just fine.