There seem to be 2 ways of rendering a chart in Observable:
-
Returning
Container.node()
at the end of your chart-drawing function -
Calling your chart-drawing function within a block of html, e.g. Elijah Meeks - Particle Sankey / Ben Davis / Observable
However, the latter will only work if you use “yield” before your html tags.
E.g.:
{yield html
<div id = 'container'> </div>
drawChart()}
Why is this? What job is yield
doing here?
Many thanks,
Ben