Hand the base domains to the scatterplot and move the camera to its
starting view, which then shows the whole fitted range.
Draw the points with toNdc over the same base domains. Receiving a scale
makes the scatterplot rewrite both scales' domains from the camera, so each
domain is set just before its own scale is handed over. The camera reset
waits for the size change that set() applies on the next animation frame,
then recomputes the scale domains and fires "view", which the component
uses to redraw its axes.
reset() does all of that at once, but its promise settles only on the next
"draw" event, and there is none before the first points are drawn. Waiting
for it would hold back the very draw it waits for, so this does not.
Hand the base domains to the scatterplot and move the camera to its starting view, which then shows the whole fitted range.
Draw the points with
toNdcover the same base domains. Receiving a scale makes the scatterplot rewrite both scales' domains from the camera, so each domain is set just before its own scale is handed over. The camera reset waits for the size change that set() applies on the next animation frame, then recomputes the scale domains and fires "view", which the component uses to redraw its axes.reset() does all of that at once, but its promise settles only on the next "draw" event, and there is none before the first points are drawn. Waiting for it would hold back the very draw it waits for, so this does not.