UNPKG

graphane

Version:

Data Visualization Microframework

1 lines 707 B
/* graphane - 1.0.1 [module:plugin.intersection] */ var l="intersection.enter",a="intersection.exit",s=Symbol();function f(n){let o=e=>this.dispatchEvent(new CustomEvent(e,{bubbles:!0,cancelable:!0,composed:!0})),i=!1;this[s]&&this[s].disconnect(),this[s]=new IntersectionObserver(e=>{e.forEach(t=>{t.isIntersecting&&t.intersectionRatio>=n?i||(i=!0,o(l)):(i=!1,o(a))})},{root:null,rootMargin:"0px",threshold:Array(21).fill(0).map((e,t)=>t*.05)}),this[s].observe(this._el||this)}var r=f;function d(n){n.extendInstance({intersection:r}),n.extendTemplate&&n.extendTemplate.defineDirective({name:"g-intersection",exec(o,{expr:i,evalExpr:e,data:t}){let c=e(i,t);o.intersection(c)}})}var m=d;export{m as default};