// Drop the cached scope so the next eles / nodes read the graph as it now is (118.3): a whole-graph scope is materialized once per run, and a force layout's infinite run rebuilds its sim on an add or remove
ctx.refreshScope(): voidDrop the cached scope so the next eles / nodes read the graph as it now is (118.3): a whole-graph scope is materialized once per run, and a force layout's infinite run rebuilds its sim on an add or remove. A subset scope (eles.layout()) is the caller's collection and stays what it was.
Returns
voidExample
cy.layout({ impl: { run(ctx) { cy.add({ data: { id: 'd' } }); ctx.refreshScope(); console.log(ctx.nodes.length); // 4} } }).run();