If you don’t want to deal with generators, you could initialize gw via requestAnimationFrame:
function draw_gw(props) {
const div = htl.html`<div>`;
requestAnimationFrame(() => gw.embedGraphicWalker(div, props));
return div;
}
Note that you should avoid using global selectors in Observable notebooks, including referencing elements by their ID, as modifying the output of other cells breaks Observable’s dataflow and may have unexpected results.