UNPKG

@arcgis/core

Version:

ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API

6 lines (5 loc) 6.17 kB
/* All material copyright ESRI, All Rights Reserved, unless otherwise specified. See https://js.arcgis.com/4.33/esri/copyright.txt for details. */ import{getAssetUrl as e}from"../../assets.js";let t,r=null;function n(){return!!r}function a(){return t||(t=import("../../chunks/lclayout.js").then((e=>e.l)).then((({default:t})=>t({locateFile:t=>e(`esri/libs/linkchartlayout/${t}`)}))).then((e=>{s(e)})),t)}function s(e){r=e}var i,o,u,l;!function(e){e[e.None=0]="None",e[e.IsMovable=1]="IsMovable",e[e.IsGeographic=2]="IsGeographic",e[e.IsRoot=4]="IsRoot",e[e.IsOld=8]="IsOld"}(i||(i={})),function(e){e[e.Success=0]="Success",e[e.Error=1]="Error",e[e.Canceled=2]="Canceled"}(o||(o={})),function(e){e[e.Regular=0]="Regular",e[e.Curved=1]="Curved",e[e.Recursive=2]="Recursive"}(u||(u={})),function(e){e[e.right=0]="right",e[e.left=1]="left",e[e.top=2]="top",e[e.bottom=3]="bottom"}(l||(l={}));const c={none:0,"start-only":1,"start-and-end":2};function y(e){const t={...{timeDirection:"right",timeBannerUTCOffsetInMinutes:0,eventsTicksVisualization:"start-and-end",showDurationLineForNonZeroDurationEntityEvents:!0,durationLineWidth:5,entityPositionAtDurationRatio:1,showNonZeroDurationIntervalBounds:!1,separateTimeOverlaps:!0,separateTimelineOverlaps:!0,moveFirstBends:!0,secondBendRatio:.3,lineSeparationMultiplier:1,spaceSeparatedLinesEvenly:!1,useBezierCurves:!1,separatedLineShapeRatio:0},...e?.toJSON()??{},eventsTicksVisualization:e?.eventsTicksVisualization??"start-and-end"};return{...t,timeDirection:{value:l[t.timeDirection]??l.right},eventsTicksVisualization:{value:c[t.eventsTicksVisualization]??c["start-and-end"]}}}function E(e,t,n,a,s,i){const u=n.length,l=s.length,c=Float64Array.BYTES_PER_ELEMENT,y=Uint32Array.BYTES_PER_ELEMENT,E=Uint8Array.BYTES_PER_ELEMENT,p=16,f=p+u*(E+2*c)+l*(2*y),d=r._malloc(f);try{const E=d+p-d%p,f=E+u*c,v=f+u*c,A=v+l*y,b=A+l*y,P=()=>[r.HEAPF64.subarray(E>>3,(E>>3)+u),r.HEAPF64.subarray(f>>3,(f>>3)+u),r.HEAPU32.subarray(v>>2,(v>>2)+l),r.HEAPU32.subarray(A>>2,(A>>2)+l),r.HEAPU8.subarray(b,b+u)],[_,h,m,L,g]=P();_.set(n),h.set(a),m.set(s),L.set(i),g.set(t);const C=e(u,b,E,f,l,v,A);let H=null,F=null;if(C.value===o.Success){const e=r.getLayoutLinksTypes(),t=r.getLayoutLinksVerticesEndIndices(),n=r.getLayoutLinksVertices(),a=r.countLayoutLinksVertices();!l||e&&t?a&&!n?C.value=o.Error:(H={types:new Uint8Array(r.HEAPU8.subarray(e,e+l)),vertexEndIndex:new Uint32Array(r.HEAPU32.subarray(t>>2,(t>>2)+l)),vertices:new Float64Array(r.HEAPF64.subarray(n>>3,(n>>3)+2*a))},F=r.getAuxiliaryGraphicElements()):C.value=o.Error}const[T,R,B,U,N]=P();return n.set(T),a.set(R),s.set(B),i.set(U),t.set(N),{status:C.value,links:H,graphics:F}}finally{r._free(d),r.cleanupLayout()}}const p=2,f=1,d=-1;var v,A,b,P,_,h,m,L,g;function C(e,t,n,a,s,i,o,u,l,c,y,E,p,f,d){const v=t.length,A=Float64Array.BYTES_PER_ELEMENT,b=Uint32Array.BYTES_PER_ELEMENT,P=16,_=P+e*(8*A)+v*(3*b),h=r._malloc(_);try{const _=h+P-h%P,m=_+e*A,L=m+e*A,g=L+e*A,C=g+e*A,H=C+e*A,F=H+e*A,T=F+e*A,R=T+e*A,B=R+v*b,U=B+v*b,N=()=>[r.HEAPF64.subarray(_>>3,(_>>3)+e),r.HEAPF64.subarray(m>>3,(m>>3)+e),r.HEAPF64.subarray(L>>3,(L>>3)+e),r.HEAPF64.subarray(g>>3,(g>>3)+e),r.HEAPF64.subarray(C>>3,(C>>3)+e),r.HEAPF64.subarray(H>>3,(H>>3)+e),r.HEAPF64.subarray(F>>3,(F>>3)+e),r.HEAPF64.subarray(T>>3,(T>>3)+e),r.HEAPU32.subarray(R>>2,(R>>2)+v),r.HEAPU32.subarray(B>>2,(B>>2)+v),r.HEAPU32.subarray(U>>2,(U>>2)+v)],[S,I,k,M,z,D,V,w,O,Y,G]=N();S.set(u),I.set(l),k.set(c),M.set(y),z.set(E),D.set(p),V.set(f),w.set(d),O.set(t),Y.set(n),G.set(a);const x=r.computeCentrality(e,v,R,B,U,s,i,o,_,m,L,g,C,H,F,T),[j,Z,J,W,$,q,K,Q,X,ee,te]=N();return u.set(j),l.set(Z),c.set(J),y.set(W),E.set($),p.set(q),f.set(K),d.set(Q),t.set(X),n.set(ee),a.set(te),x}finally{r._free(h)}}!function(e){function t(){return r.getMinIdealEdgeLength()}function n(e,t,n,a,s,i,o=p,u=f,l=d){return E(((t,n,a,s,i,c,y)=>r.applyForceDirectedLayout(e,t,n,a,s,i,c,y,o,u,l)),t,n,a,s,i)}e.getMinIdealEdgeLength=t,e.apply=n}(v||(v={})),function(e){function t(e,t,n,a,s,i,o=p,u=f,l=d){return E(((t,n,a,s,i,c,y)=>r.applyCommunityLayout(e,t,n,a,s,i,c,y,o,u,l)),t,n,a,s,i)}e.apply=t}(A||(A={})),function(e){function t(e,t,n,a,s,i){return E(((t,n,a,s,i,o,u)=>r.applySimpleLayout(e,t,n,a,s,i,o,u)),t,n,a,s,i)}e.apply=t}(b||(b={})),function(e){function t(e,t,n,a,s,i){return E(((t,n,a,s,i,o,u)=>r.applyHierarchicalLayout(e,t,n,a,s,i,o,u)),t,n,a,s,i)}e.apply=t}(P||(P={})),function(e){function t(e,t,n,a,s,i){return E(((t,n,a,s,i,o,u)=>r.applyRadialTreeLayout(e,t,n,a,s,i,o,u)),t,n,a,s,i)}e.apply=t}(_||(_={})),function(e){function t(e,t,n,a,s,i){return E(((t,n,a,s,i,o,u)=>r.applySmartTreeLayout(e,t,n,a,s,i,o,u)),t,n,a,s,i)}e.apply=t}(h||(h={})),function(e){function t(e,t,n,a,s,i,u,l,c,p,f,d){return E(((t,n,a,u,l,E,v)=>{if(s.length!==t)return{value:o.Error};if(i.length!==t)return{value:o.Error};if(c.length!==l)return{value:o.Error};if(p.length!==l)return{value:o.Error};const A=Float64Array.BYTES_PER_ELEMENT,b=16,P=r._malloc(b+t*A),_=r._malloc(b+t*A),h=r._malloc(b+l*A),m=r._malloc(b+l*A),L=P+b-P%b,g=_+b-_%b,C=h+b-h%b,H=m+b-m%b;try{return r.HEAPF64.subarray(L>>3,(L>>3)+t).set(s),r.HEAPF64.subarray(g>>3,(g>>3)+t).set(i),r.HEAPF64.subarray(C>>3,(C>>3)+l).set(c),r.HEAPF64.subarray(H>>3,(H>>3)+l).set(p),r.applyChronologicalLayout(e,t,n,a,u,L,g,l,E,v,C,H,f,y(d))}finally{r._free(P),r._free(_),r._free(h),r._free(m)}}),t,n,a,u,l)}e.apply=t}(m||(m={})),function(e){e[e.Undirected=0]="Undirected",e[e.Directed=1]="Directed",e[e.Reversed=2]="Reversed"}(L||(L={})),function(e){e[e.ByCC_Raw=0]="ByCC_Raw",e[e.ByCC_NormalizeGlobally=1]="ByCC_NormalizeGlobally",e[e.ByCC_NormalizeByCC=2]="ByCC_NormalizeByCC"}(g||(g={}));export{o as CallStatus,g as CentralityMode,l as Direction2D,m as LCChronologicalLayout,A as LCCommunityLayout,v as LCForceDirectedLayout,P as LCHierarchicalLayout,_ as LCRadialTreeLayout,b as LCSimpleLayout,h as LCSmartTreeLayout,u as LinkType,i as NodeFlag,L as RelationshipInterpretation,r as _lclib,C as computeCentrality,y as convertChronologicalLayoutSettingsToWasmSettings,p as defaultBudgetTheoreticalSeconds,f as defaultIdealEdgeLengthMultiplier,d as defaultRepulsionRadiusMultiplier,n as isLoaded,a as load};