🏠 back to Observable

svg = TypeError: t is null (bug in D3?)

In https://observablehq.com/d/b6017d7ee9b2b556@141 I try to bind data represented by a nested array.

image

And while D3 6 docs say that any iterable is accepted, I get this t is null TypeError.

image

Is it a D3 bug?

You need to selectAll before your data join.

  d3.select(svg)
    .selectAll("circle")
    .data(sorted)
    .join("circle")
    …

Thanks! Reading on https://bost.ocks.org/mike/join/ to understand how it works.