Observable Cell Behavior for yield-ed vs return-ed animated svg element

In short, when you write a variable in a cell, you’re not just defining or referencing it like in plain linear JavaScript or Python, you are attaching it to the DOM. So when a variable is already attached and you make a cell with it a second time, Observable does not try to reattach the var or duplicate it. It invokes Inspector to show var type and content.

This is a dynamic Observable feature that I don’t think is explained anywhere except in this notebook by @mootari.

Maybe the inspector should also hint at the bottom of its output that “the variable is already attached (here), see (docs)”. That would make this feature more self-discoverable.

1 Like