graphane
Version:
Data Visualization Microframework
1 lines • 799 B
JavaScript
/* graphane - 1.0.1 [plugin.intersection] */ (()=>{var a="intersection.enter",f="intersection.exit",o=Symbol();function h(e){let s=t=>this.dispatchEvent(new CustomEvent(t,{bubbles:!0,cancelable:!0,composed:!0})),i=!1;this[o]&&this[o].disconnect(),this[o]=new IntersectionObserver(t=>{t.forEach(n=>{n.isIntersecting&&n.intersectionRatio>=e?i||(i=!0,s(a)):(i=!1,s(f))})},{root:null,rootMargin:"0px",threshold:Array(21).fill(0).map((t,n)=>n*.05)}),this[o].observe(this._el||this)}var l=h;function m(e){e.extendInstance({intersection:l}),e.extendTemplate&&e.extendTemplate.defineDirective({name:"g-intersection",exec(s,{expr:i,evalExpr:t,data:n}){let c=t(i,n);s.intersection(c)}})}var r=m;globalThis.gSVG&&globalThis.gSVG.install(r);customElements.whenDefined("g-composer").then(e=>{e.install(r)});})();