I’m still trying to understand the .join of d3. I have this notebook that works fine 1st time, but for I run the dis cell a second time, it freaks out.
On the first run there are no divs inside the container, and join creates a div for each datum; but then the code adds others divs as children of those divs. On the second run, the selectAll(“div”) doesn’t discriminate between the div you have joined and their children, and it doesn’t go well.
To fix the issue you could selectAll(".thing") and add a “thing” class on the divs you join. You’ll then have another issue to fix, which is that the code will still want to add the same contents to divs that already have contents.