MCPcopy
hub / github.com/d3/d3 / observed

Function observed

docs/components/PlotRender.js:152–155  ·  docs/components/PlotRender.js::observed
()

Source from the content-addressed store, hash-verified

150 const mounted = (el) => {
151 disconnect(); class="cm">// remove old listeners
152 function observed() {
153 unmounted(el); class="cm">// remove old plot (and listeners)
154 el.append(Plot[method](options));
155 }
156 const rect = el.getBoundingClientRect();
157 if (rect.bottom > 0 && rect.top < window.innerHeight) {
158 observed();

Callers 1

mountedFunction · 0.85

Calls 1

unmountedFunction · 0.85

Tested by

no test coverage detected