https://observablehq.com/@d3/force-directed-lattice?collection=@d3/d3-drag
there is a line
invalidation.then(() => simulation.stop());
what is this invalidation? by the console.log, it is a promise, but I don't see it defined anywhere.
https://observablehq.com/@d3/force-directed-lattice?collection=@d3/d3-drag
there is a line
invalidation.then(() => simulation.stop());
what is this invalidation? by the console.log, it is a promise, but I don't see it defined anywhere.
Observablehq loads the standard library, which provides the invalidation
method. According to the documentation, invalidation
is...
A promise that resolves when the current cell is re-evaluated: when the cell’s code changes, when it is run using Shift-Enter, or when a referenced input changes.
This notebook explains it in details: https://observablehq.com/@observablehq/invalidation
© 2022 - 2024 — McMap. All rights reserved.