block by dribnet 5027819

strokes - General Update Pattern, III

Full Screen

strokes fork and port of mike’s general update pattern tutorial, III.

merge requests should go to the example in the repo


By adding transitions, we can more easily follow the elements as they are entered, updated and exited. Separate transitions are defined for each of the three states.

Note that no transition is applied to the merged enter + update selection; this is because it would supersede the transition already scheduled on entering and updating elements. It’s possible to schedule concurrent elements by using transition.transition or by setting transition.id, but it’s simpler here to only transition the x-position on update; for entering elements, the x-position is assigned statically.

Want to read more? Try these tutorials:

See the D3 wiki for even more resources.

Previous: Key Functions

index.html

gup3.cljs