May 2019
Beginner to intermediate
650 pages
14h 50m
English
The moons are still not being updated correctly. They are only added once, when the circle is created, and appended to the DOM tree. When all of the elements already exist, the _enter array is empty, so nothing after enter() ever gets called (this is the expected behavior). To fix this, you need to update two selections: the enter selection, if it exists, appending new circles and setting initial properties (this is already working), and the update selection, selecting elements previously updated and applying new values to their properties (this is what needs to be done). You can reuse the same code for the updates if you merge the selections.
You need to save a reference to the original selection ...
Read now
Unlock full access