Hi,
I have created a chart visualizing JSON data, which in the notebook looks great and works well. However, when I try to embed the cell the preview always returns chart = null. I looked at many example codes which all look similar to mine, yet I get this issue. Any idea what could be the reason?
Note that the chart in your notebook doesnāt return or yield an image; rather it d3.selects another node (by id) and places the image there. A quick fix (that I donāt recommend) would be to name the other node and embed that.
Note, though, that the global d3.select by id is not generally recommended in Observable. Iād recommend creating an SVG and yielding that right from the same cell. Hereās a fork of your notebook that seems to embed the graphic well: