Custom Gis Application with Arcgis Javascript API with modern layouting
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

46 lines
22 KiB

// All material copyright Esri, All Rights Reserved, unless otherwise specified.
// See https://js.arcgis.com/4.30/esri/copyright.txt for details.
//>>built
define("../chunks/tslib.es6 ../geometry ../core/Collection ../core/Error ../core/Logger ../core/MapUtils ../core/promiseUtils ../core/accessorSupport/decorators/property ../core/has ../core/RandomLCG ../core/accessorSupport/decorators/subclass ./Layer ./graphics/featureConversionUtils ./graphics/OptimizedGeometry ./knowledgeGraph/IdealEdgeLengthTypeOptions ./knowledgeGraph/KnowledgeGraphLayerDataManager ./knowledgeGraph/KnowledgeGraphSublayer ./knowledgeGraph/supportUtils ./mixins/BlendLayer ./mixins/ScaleRangeLayer ../libs/linkchartlayout/LinkChartLayout ../rest/knowledgeGraphService ../geometry/Extent ../geometry/Point ../geometry/Polyline".split(" "),
function(B,y,S,O,H,ea,fa,D,oa,pa,ha,ia,N,T,U,l,Q,ja,ka,la,w,ma,V,W,X){y=class extends ka.BlendLayer(la.ScaleRangeLayer(ia)){constructor(a){super(a);this.dataPreloadedInLocalCache=!1;this.defaultLinkChartConfig=null;this._currentLinkChartConfig={layoutMode:"RADIAL_TREE"};this._graphTypeLookup=new Map;this.knowledgeGraph=this.dataManager=null;this.layers=new S;this.entityLinkChartDiagramLookup=new Map;this.relationshipLinkChartDiagramLookup=new Map;this.linkChartExtent=new V({xmin:-1E-7,ymin:-1E-7,
xmax:1E-7,ymax:1E-7});this.memberRelationshipTypes=this.memberEntityTypes=null;this.sublayerIdsCache=new Map;this.tables=new S;this.type="link-chart";this._originalInclusionList=a.inclusionModeDefinition;if(a.dataPreloadedInLocalCache&&!a.inclusionModeDefinition)throw new O("knowledge-graph:linkchart-layer-constructor","If creating a link chart composite layer and configured that data is already loaded in the cache, you must specify an inclusion list so the Composite Layer knows what records belong to it");
}normalizeCtorArgs(a){return{url:a.url,title:a.title,dataPreloadedInLocalCache:a.dataPreloadedInLocalCache,defaultLinkChartConfig:a.defaultLinkChartConfig}}_initializeLayerProperties(a){if(!this.title&&this.url){var c=this.url.split("/");this.title=c[c.length-2]}const d=new Set;let b=[],g=[];if(a.inclusionModeDefinition&&(!a.inclusionModeDefinition.namedTypeDefinitions||1>a.inclusionModeDefinition.namedTypeDefinitions.size))throw new O("knowledge-graph:composite-layer-constructor","If an explicit inclusion definition is defined, at least one namedTypeDefinition must also be defined");
a.knowledgeGraph.dataModel.entityTypes?.forEach(e=>{e.name&&this._graphTypeLookup.set(e.name,e)});a.knowledgeGraph.dataModel.relationshipTypes?.forEach(e=>{e.name&&this._graphTypeLookup.set(e.name,e)});a.inclusionModeDefinition?.generateAllSublayers?(b=a.knowledgeGraph.dataModel.entityTypes??[],g=a.knowledgeGraph.dataModel.relationshipTypes??[]):a.inclusionModeDefinition?.namedTypeDefinitions&&0<a.inclusionModeDefinition?.namedTypeDefinitions.size?a.inclusionModeDefinition?.namedTypeDefinitions.forEach((e,
q)=>{(e=this._graphTypeLookup.get(q))?"relationship"===e.type?d.has(q)||(d.add(q),g.push(e)):"entity"===e.type?d.has(q)||(d.add(q),b.push(e)):(H.getLogger(this).warn(`A named type, ${q}, was in the inclusion list that wasn't properly modeled and will be removed`),a.inclusionModeDefinition?.namedTypeDefinitions.delete(q)):(H.getLogger(this).warn(`A named type, ${q}, was in the inclusion list that wasn't in the data model and will be removed`),a.inclusionModeDefinition?.namedTypeDefinitions.delete(q))}):
(b=a.knowledgeGraph.dataModel.entityTypes??[],g=a.knowledgeGraph.dataModel.relationshipTypes??[]);c=new l.KnowledgeGraphLayerDataManager({knowledgeGraph:a.knowledgeGraph,inclusionModeDefinition:a.inclusionModeDefinition});this.knowledgeGraph=a.knowledgeGraph;this.memberEntityTypes=b;this.memberRelationshipTypes=g;this.dataManager=c}load(a){this.addResolvingPromise(new Promise(c=>{ma.fetchKnowledgeGraph(this.url).then(d=>{this._initializeLayerProperties({knowledgeGraph:d,inclusionModeDefinition:this._originalInclusionList});
this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.size||(this.dataManager.inclusionModeDefinition={generateAllSublayers:!1,namedTypeDefinitions:new Map},this.dataManager.knowledgeGraph.dataModel.entityTypes?.forEach(b=>{b.name&&this.dataManager.inclusionModeDefinition?.namedTypeDefinitions.set(b.name,{useAllData:!0})}),this.dataManager.knowledgeGraph.dataModel.relationshipTypes?.forEach(b=>{b.name&&this.dataManager.inclusionModeDefinition?.namedTypeDefinitions.set(b.name,{useAllData:!0})}));
this.dataPreloadedInLocalCache?(this.loadLayerAssumingLocalCache(),this.dataManager.inclusionModeDefinition&&(this.dataManager.inclusionModeDefinition.generateAllSublayers=!1),this.dataManager.inclusionModeDefinition?.namedTypeDefinitions.forEach(b=>{b.useAllData=!1;b.members?.forEach(g=>{let e;(e=g.linkChartLocation instanceof T?g.linkChartLocation:g.linkChartLocation?N.convertFromGeometry(g.linkChartLocation):null)&&2===e.coords.length&&0===e.lengths.length?this.entityLinkChartDiagramLookup.set(g.id,
e):this.relationshipLinkChartDiagramLookup.set(g.id,e)});this.addResolvingPromise(this._initializeDiagram().then(async()=>{this.layers.forEach(async g=>{await g.refreshCachedQueryEngine()});this.tables.forEach(async g=>{await g.refreshCachedQueryEngine()})}))})):this.addResolvingPromise(this.dataManager.refreshCacheContent(void 0,!1,"GEOGRAPHIC"===this.defaultLinkChartConfig?.layoutMode,!0).then(async()=>{fa.throwIfAborted(a);const b=[],g=[];this.loadLayerAssumingLocalCache();this.dataManager.inclusionModeDefinition&&
(this.dataManager.inclusionModeDefinition.generateAllSublayers=!1,this.dataManager.inclusionModeDefinition.namedTypeDefinitions.forEach(e=>{e.useAllData=!1}));await this._initializeDiagram();this.layers.forEach(e=>{g.push(e.refreshCachedQueryEngine());b.push(new Promise(q=>{e.on("layerview-create",()=>{q(null)})}))});this.tables.forEach(e=>{g.push(e.refreshCachedQueryEngine())});await Promise.all(g)}));c(null)})}));return Promise.resolve(this)}async addRecords(a,c){let d=[];c?.cascadeAddRelationshipEndNodes&&
this.dataManager.knowledgeGraph.dataModel&&(d=await ja.getRelationshipEndNodeIds(a,this.dataManager.knowledgeGraph));a=a.concat(d).filter(b=>!this.sublayerIdsCache.get(b.typeName)?.has(b.id));await this._handleNewRecords(a)}async removeRecords(a,{cascadeRemoveRelationships:c=!0,recalculateLayout:d=!1}={cascadeRemoveRelationships:!0,recalculateLayout:!1}){let b=[];for(const e of a)!1===this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.get(e.typeName)?.useAllData&&this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.get(e.typeName)?.members?.has(e.id)&&
b.push(e);if(c){a=new Set;c=[];for(const e of b)if(this.dataManager.nodeConnectionsLookup.has(e.id))for(const q of this.dataManager.nodeConnectionsLookup.get(e.id))a.add(q);for(const e of a)if(this.dataManager.memberIdTypeLookup.has(e))for(const q of this.dataManager.memberIdTypeLookup.get(e))this.dataManager.relationshipTypeNames.has(q)&&c.push({id:e,typeName:q});b=b.concat(c)}this.dataManager.removeFromLayer(b);for(const e of b)this.sublayerIdsCache.get(e.typeName)?.delete(e.id),this.dataManager.relationshipTypeNames.has(e.typeName)?
this.relationshipLinkChartDiagramLookup.delete(e.id):this.entityLinkChartDiagramLookup.delete(e.id);d&&await this.calculateLinkChartLayout(this._currentLinkChartConfig.layoutMode,this._currentLinkChartConfig.layoutOptions);const g=[];this.layers.forEach(e=>{g.push(e.refreshCachedQueryEngine())});await Promise.all(g);this._refreshNamedTypes();return b}async expand(a,c){a=await this.dataManager.getConnectedRecordIds(a,c);c=a.filter(d=>!this.sublayerIdsCache.get(d.typeName)?.has(d.id));await this._handleNewRecords(a);
return{records:c}}loadLayerAssumingLocalCache(){this.memberRelationshipTypes.forEach(a=>{const c=new Q({objectType:a,parentCompositeLayer:this,graphType:"relationship",title:a.name});c.geometryType?this.layers.push(c):this.tables.push(c);this.dataManager.sublayerCaches.has(a.name)||this.dataManager.sublayerCaches.set(a.name,new Map)});this.memberEntityTypes.forEach(a=>{const c=new Q({objectType:a,parentCompositeLayer:this,graphType:"entity",title:a.name});c.geometryType?this.layers.push(c):this.tables.push(c);
this.dataManager.sublayerCaches.has(a.name)||this.dataManager.sublayerCaches.set(a.name,new Map)});this.dataManager.inclusionModeDefinition?.namedTypeDefinitions&&this.dataManager.inclusionModeDefinition?.namedTypeDefinitions.forEach((a,c)=>{const d=ea.getOrCreateMapValue(this.sublayerIdsCache,c,()=>new Set);a.members?.forEach(b=>{d.add(b.id);if(b.linkChartLocation)if(b.linkChartLocation instanceof T)this.dataManager.relationshipTypeNames.has(c)?this.relationshipLinkChartDiagramLookup.set(b.id,b.linkChartLocation):
this.entityLinkChartDiagramLookup.set(b.id,b.linkChartLocation);else{const g=N.convertFromGeometry(b.linkChartLocation);this.dataManager.relationshipTypeNames.has(c)?this.relationshipLinkChartDiagramLookup.set(b.id,b.linkChartLocation?g:null):this.entityLinkChartDiagramLookup.set(b.id,b.linkChartLocation?g:null)}})})}async calculateLinkChartLayout(a="RADIAL_TREE",c){const d=[],b=[],g=[];this.dataManager.sublayerCaches.forEach((t,h)=>{this.dataManager.entityTypeNames.has(h)?t.forEach(k=>{d.push({typeName:h,
feature:k})}):this.dataManager.relationshipTypeNames.has(h)&&t.forEach(k=>{b.push({typeName:h,feature:k})})});this.entityLinkChartDiagramLookup=new Map;this.relationshipLinkChartDiagramLookup=new Map;const e=new Map,q=new Map,K=new Map,I=new Map,z=new Uint8Array(d.length),p=new Float64Array(d.length),A=new Float64Array(d.length),Y=new Uint32Array(b.length),Z=new Uint32Array(b.length),r=[];var x=new V({xmin:-1E-7,ymin:-1E-7,xmax:1E-7,ymax:1E-7});let m=0,L=0;switch("GEOGRAPHIC"===a?"FORCE_DIRECTED":
a){case "FORCE_DIRECTED":var f=w.LCForceDirectedLayout.apply;break;case "COMMUNITY":f=w.LCCommunityLayout.apply;break;case "HIERARCHICAL":f=w.LCHierarchicalLayout.apply;break;case "RADIAL_TREE":f=w.LCRadialTreeLayout.apply;break;case "SMART_TREE":f=w.LCSmartTreeLayout.apply;break;default:f=w.LCSimpleLayout.apply}d.forEach(({typeName:t,feature:h})=>{if(c?.lockedNodeLocations?.has(h.attributes[l.mockOidFieldName])){"GEOGRAPHIC"===a&&this.dataManager.geographicLookup.has(t)?z[m]=w.NodeFlag.IsGeographic:
z[m]=w.NodeFlag.None;var k=c.lockedNodeLocations.get(h.attributes[l.mockOidFieldName]);p[m]=k.x;A[m]=k.y}else if("GEOGRAPHIC"===a&&this.dataManager.geographicLookup.has(t)){z[m]=w.NodeFlag.IsGeographic;k=null;k=h.attributes[this.dataManager.geographicLookup.get(t).name];switch(this.dataManager.geographicLookup.get(t)?.geometryType){case "esriGeometryPoint":p[m]=k?.x;A[m]=k?.y;break;case "esriGeometryPolygon":k=k?.centroid;null!=k?.x&&null!=k?.y?(p[m]=k.x,A[m]=k.y):z[m]=w.NodeFlag.IsMovable;break;
case "esriGeometryPolyline":k=k?.extent?.center;null!=k?.x&&null!=k?.y?(p[m]=k.x,A[m]=k.y):z[m]=w.NodeFlag.IsMovable;break;case "esriGeometryMultipoint":k=k?.extent?.center;null!=k?.x&&null!=k?.y?(p[m]=k.x,A[m]=k.y):z[m]=w.NodeFlag.IsMovable;break;default:z[m]=w.NodeFlag.IsMovable}if(null==p[m]||null==A[m]||Number.isNaN(p[m])||Number.isNaN(A[m]))z[m]=w.NodeFlag.IsMovable,p[m]=0,A[m]=0}else z[m]=w.NodeFlag.IsMovable,p[m]=0,A[m]=0;I.set(h.attributes[l.mockOidFieldName],m);r[m]={feature:h,typeName:t};
m++});let aa=!1;const R=new Map;b.forEach(t=>{var h=t.feature.attributes[l.mockOriginIdFieldName],k=t.feature.attributes[l.mockDestinationIdFieldName];const P=I.get(h),ba=I.get(k);void 0!==P&&void 0!==ba?(h=h+"-"+k,k=R.get(h),k?.has(t.typeName)||(Y[L]=P,Z[L]=ba,void 0===k?R.set(h,new Map([[t.typeName,L]])):k.set(t.typeName,L),L++),g.push(t)):(aa=!0,this.relationshipLinkChartDiagramLookup.set(h,null))});aa&&H.getLogger(this).warn("A relationship is a member of this layer that has either origin or destination entity nodes that are not members. The diagram geometry will be set to null");
const ca=this._validateLayoutSettings(a,c);var E=this._convertLayoutSettingsToCalculationSettings(ca);await w.load();const {success:na,links:G}=f(z,p,A,Y.subarray(0,L),Z.subarray(0,L),E.computationBudgetTime,E.idealEdgeLengthMultiplier,E.repulsionRadiusMultiplier);if(!na)throw new O("knowledge-graph:layout-failed","Attempting to arrange the records in the specified layout failed");for(f=0;f<r.length;f++)84.9999<A[f]?A[f]=84.9999:-84.9999>A[f]&&(A[f]=-84.9999),179.9999<p[f]?p[f]=179.9999:-179.9999>
p[f]&&(p[f]=-179.9999),r[f].feature.attributes[l.mockLayoutGeometryFieldName]=new W(p[f],A[f]),e.has(r[f].typeName)?e.get(r[f].typeName)?.set(r[f].feature.attributes[l.mockOidFieldName],r[f].feature):(E=new Map,E.set(r[f].feature.attributes[l.mockOidFieldName],r[f].feature),e.set(r[f].typeName,E)),K.set(r[f].feature.attributes[l.mockOidFieldName],r[f].feature),E=N.convertFromGeometry(r[f].feature.attributes[l.mockLayoutGeometryFieldName]),this.entityLinkChartDiagramLookup.set(r[f].feature.attributes[l.mockOidFieldName],
r[f].feature.attributes[l.mockLayoutGeometryFieldName]?E:null),r[f].feature.attributes[l.mockLayoutGeometryFieldName].x<x.xmin&&(x.xmin=r[f].feature.attributes[l.mockLayoutGeometryFieldName].x),r[f].feature.attributes[l.mockLayoutGeometryFieldName].x>x.xmax&&(x.xmax=r[f].feature.attributes[l.mockLayoutGeometryFieldName].x),r[f].feature.attributes[l.mockLayoutGeometryFieldName].y<x.ymin&&(x.ymin=r[f].feature.attributes[l.mockLayoutGeometryFieldName].y),r[f].feature.attributes[l.mockLayoutGeometryFieldName].y>
x.ymax&&(x.ymax=r[f].feature.attributes[l.mockLayoutGeometryFieldName].y);this.linkChartExtent.xmin=x.xmin;this.linkChartExtent.xmax=x.xmax;this.linkChartExtent.ymin=x.ymin;this.linkChartExtent.ymax=x.ymax;if(!G)throw new O("knowledge-graph:layout-failed","Attempting to retrieve link geometry from diagram engine failed");x=new Map;f=new Map;E=new Map;const da=new Set;for(let t=0;t<g.length;t++){var n=[];const h=g[t];var M=h.feature.attributes[l.mockOriginIdFieldName],u=h.feature.attributes[l.mockDestinationIdFieldName],
v=M+"-"+u,C=R.get(v).get(h.typeName),F=0===C?0:G?.vertexEndIndex[C-1];if(!da.has(C)){da.add(C);if(G.types[C]===w.LinkType.Recursive){C=[G.vertices[2*F],G.vertices[2*F+1]];F=[G.vertices[2*(F+1)],G.vertices[2*(F+1)+1]];var J=[.5*(C[0]+F[0]),.5*(C[1]+F[1])];const k=[J[0]-C[0],J[1]-C[1]],P=[J[0]+k[1],J[1]-k[0]];J=[J[0]-k[1],J[1]+k[0]];n.push(C);n.push(P);n.push(F);n.push(J);n.push(C)}else if(G.types[C]===w.LinkType.Regular)for(;F<G.vertexEndIndex[C];F++)n.push([G.vertices[2*F],G.vertices[2*F+1]]);else{H.getLogger(this).warn("A relationship generated an unsupported link geometry type. It will not be rendered");
continue}M=r[I.get(M)]?.feature.attributes[l.mockLayoutGeometryFieldName];u=r[I.get(u)]?.feature.attributes[l.mockLayoutGeometryFieldName];if(n[0][0]!==M.x||n[0][1]!==M.y)n[0]=[M.x,M.y];if(n[n.length-1][0]!==u.x||n[n.length-1][1]!==u.y)n[n.length-1]=[u.x,u.y];for(u=1;u<n.length-1;u++)85.5<n[u][1]?n[u][1]=85.5:-85.5>n[u][1]&&(n[u][1]=-85.5),179.9999<n[u][0]?n[u][0]=179.9999:-179.9999>n[u][0]&&(n[u][0]=-179.9999);x.has(v)?x.get(v).push(n):x.set(v,[n])}n=x.get(v);f.has(v)||(f.set(v,new Map),E.set(v,
new Map));u=f.get(v);v=E.get(v);u.has(h.typeName)||(u.set(h.typeName,n.shift()),v.set(h.typeName,0));n=u.get(h.typeName);v.set(h.typeName,v.get(h.typeName)+1);v=new X({paths:n});h.feature.attributes[l.mockLayoutGeometryFieldName]=v;q.has(h.typeName)?q.get(h.typeName)?.set(h.feature.attributes[l.mockOidFieldName],h.feature):(v=new Map,v.set(h.feature.attributes[l.mockOidFieldName],h.feature),q.set(h.typeName,v));K.set(h.feature.attributes[l.mockOidFieldName],h.feature);v=N.convertFromGeometry(h.feature.attributes[l.mockLayoutGeometryFieldName]);
this.relationshipLinkChartDiagramLookup.set(h.feature.attributes[l.mockOidFieldName],h.feature.attributes[l.mockLayoutGeometryFieldName]?v:null)}for(const t of g)t.feature.attributes[l.mockAggregationCountFieldName]=E.get(t.feature.attributes[l.mockOriginIdFieldName]+"-"+t.feature.attributes[l.mockDestinationIdFieldName])?.get(t.typeName)??null;this._currentLinkChartConfig={layoutMode:a,layoutOptions:ca};return{nodes:e,links:q,idMap:K}}async applyNewLinkChartLayout(a="RADIAL_TREE",c){const d=[];await this.calculateLinkChartLayout(a,
c);this.layers.forEach(b=>{d.push(b.refreshCachedQueryEngine())});await Promise.all(d);this._refreshNamedTypes()}getCurrentNodeLocations(){const a=new Map;this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.forEach(c=>{c?.members?.forEach(d=>{var b=d.linkChartLocation;const g=d.id;b&&("x"in b?(d=b.x,b=b.y):(d=b.coords[0],b=b.coords[1]),a.set(g,new W({x:d,y:b})))})});return a}async synchronizeInclusionListWithCache(){return new Promise(a=>{this.dataManager.inclusionModeDefinition?.namedTypeDefinitions.forEach((c,
d)=>{c.useAllData=!1;if(c.members&&0<c.members.size&&this.dataManager.sublayerCaches.get(d)){var b=new Set(Array.from(this.dataManager.sublayerCaches.get(d).keys()));Array.from(c.members.keys()).filter(g=>!b.has(g)).forEach(g=>{c.members?.delete(g)})}});a()})}async refreshLinkChartCache(a){await this.dataManager.refreshCacheContent(a);const c=[];this.layers.forEach(d=>{c.push(d.refreshCachedQueryEngine())});await Promise.all(c);this._refreshNamedTypes()}async connectEntities(a){let c=[];for(const d of this.dataManager.relationshipTypeNames){const b=
this.sublayerIdsCache.get(d);b&&(c=c.concat(Array.from(b.keys())))}a=await this.dataManager.getAttachedRelationships(a,c);await this._handleNewRecords(a);return{records:a}}async _handleNewRecords(a){var c=[];this.dataManager.addToLayer(a);for(var d of a)this.sublayerIdsCache.has(d.typeName)||(this.sublayerIdsCache.set(d.typeName,new Set),c.push(d.typeName)),this.sublayerIdsCache.get(d.typeName).add(d.id);for(const b of c)if(c=this._graphTypeLookup.get(b))d=new Q({objectType:c,parentCompositeLayer:this,
graphType:c.type,title:b}),"entity"===c.type?this.dataManager.entityTypeNames.add(b):this.dataManager.relationshipTypeNames.add(b),d.geometryType?this.layers.push(d):this.tables.push(d),this.dataManager.sublayerCaches.set(b,new Map);await this.dataManager.refreshCacheContent(a.map(b=>b.id));a=Object.assign({},this._currentLinkChartConfig.layoutOptions);a.lockedNodeLocations=this.getCurrentNodeLocations();await this.applyNewLinkChartLayout(this._currentLinkChartConfig.layoutMode,a)}async _initializeDiagram(){this.defaultLinkChartConfig?
this.defaultLinkChartConfig.doNotRecalculateLayout?(this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.forEach((a,c)=>{a?.members?.forEach(d=>{var b=d.linkChartLocation;d=d.id;if(b){b="x"in b?{x:b.x,y:b.y}:{x:b.coords[0],y:b.coords[1]};var g=N.convertFromGeometry(b);this.dataManager.relationshipTypeNames.has(c)?this.relationshipLinkChartDiagramLookup.set(d,g):this.entityLinkChartDiagramLookup.set(d,g);this.linkChartExtent.xmin>b.x&&(this.linkChartExtent.xmin=b.x);this.linkChartExtent.xmax<
b.x&&(this.linkChartExtent.xmax=b.x);this.linkChartExtent.ymin>b.y&&(this.linkChartExtent.ymin=b.y);this.linkChartExtent.ymax<b.y&&(this.linkChartExtent.ymax=b.y)}})}),this.memberRelationshipTypes.forEach(a=>{a.name&&this.dataManager.sublayerCaches.get(a.name)?.forEach(c=>{var d=this.relationshipLinkChartDiagramLookup.get(c.attributes[l.mockOriginIdFieldName]);const b=this.relationshipLinkChartDiagramLookup.get(c.attributes[l.mockDestinationIdFieldName]);d&&b?(d=N.convertFromGeometry(new X({paths:[[d.coords[0],
d.coords[1]],[b.coords[0],b.coords[1]]]})),this.relationshipLinkChartDiagramLookup.set(c.attributes[l.mockOidFieldName],d)):this.relationshipLinkChartDiagramLookup.set(c.attributes[l.mockOidFieldName],null)})})):await this.calculateLinkChartLayout(this.defaultLinkChartConfig.layoutMode,{lockedNodeLocations:this.getCurrentNodeLocations(),...(this.defaultLinkChartConfig.layoutOptions||{})}):await this.calculateLinkChartLayout("RADIAL_TREE",{lockedNodeLocations:this.getCurrentNodeLocations()})}_refreshNamedTypes(){for(const a of this.layers)a.emit("refresh",
{dataChanged:!0});for(const a of this.tables)a.emit("refresh",{dataChanged:!0})}_validateLayoutSettings(a,c){const d=p=>Object.values(U.IdealEdgeLengthTypeOptions).includes(p),b=p=>"number"===typeof p&&!isNaN(p)&&0<=p,g=new Set(["FORCE_DIRECTED","COMMUNITY","GEOGRAPHIC"]),e={};if(!g.has(a)||!c)return!g.has(a)&&c&&H.getLogger(this).warn("Layout mode options were given for a layout mode that does not utilize them, settings will be ignored"),e;const {computationBudgetTime:q,repulsionRadiusMultiplier:K,
idealEdgeLength:I,idealEdgeLengthType:z}=c;(p=>"number"===typeof p&&!isNaN(p)&&1<=p)(q)?e.computationBudgetTime=q:void 0!==q&&H.getLogger(this).warn("Invalid layout computationBudgetTime setting, will revert to default setting");(p=>"number"===typeof p&&!isNaN(p)&&1<=p)(K)?e.repulsionRadiusMultiplier=K:void 0!==K&&H.getLogger(this).warn("Invalid layout repulsionRadiusMultiplier setting, will revert to default setting");c=void 0!==I||void 0!==z;"GEOGRAPHIC"!==a&&c?H.getLogger(this).warn("Ideal edge length settings were specified for an incompatible layout mode, and will be ignored"):
"GEOGRAPHIC"===a&&c&&(d(z)?e.idealEdgeLengthType=z:void 0!==z&&H.getLogger(this).warn('Invalid layout idealEdgeLengthType setting, will revert to "multiplier" setting'),b(I)?e.idealEdgeLength=I:void 0!==I&&H.getLogger(this).warn("Invalid layout idealEdgeLength setting, will revert to default setting"));return e}_convertLayoutSettingsToCalculationSettings(a){let c=a.idealEdgeLength;a.idealEdgeLengthType===U.IdealEdgeLengthTypeOptions.ABSOLUTE&&(c=void 0===c?-1:-1*c);return{computationBudgetTime:a.computationBudgetTime,
repulsionRadiusMultiplier:a.repulsionRadiusMultiplier,idealEdgeLengthMultiplier:c}}};B.__decorate([D.property()],y.prototype,"dataPreloadedInLocalCache",void 0);B.__decorate([D.property()],y.prototype,"defaultLinkChartConfig",void 0);B.__decorate([D.property()],y.prototype,"dataManager",void 0);B.__decorate([D.property()],y.prototype,"knowledgeGraph",void 0);B.__decorate([D.property()],y.prototype,"layers",void 0);B.__decorate([D.property()],y.prototype,"entityLinkChartDiagramLookup",void 0);B.__decorate([D.property()],
y.prototype,"relationshipLinkChartDiagramLookup",void 0);B.__decorate([D.property()],y.prototype,"linkChartExtent",void 0);B.__decorate([D.property()],y.prototype,"memberEntityTypes",void 0);B.__decorate([D.property()],y.prototype,"memberRelationshipTypes",void 0);B.__decorate([D.property()],y.prototype,"sublayerIdsCache",void 0);B.__decorate([D.property()],y.prototype,"tables",void 0);B.__decorate([D.property({json:{read:!1}})],y.prototype,"type",void 0);return y=B.__decorate([ha.subclass("esri.layers.LinkChartLayer")],
y)});