graphdb-workbench 3.3.1-RC1 → 3.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/38644.4177d9bcdff1ad596ca1.bundle.js +2 -0
- package/dist/38644.4177d9bcdff1ad596ca1.bundle.js.map +1 -0
- package/dist/39518.323713e6d7824200b4aa.bundle.js +2 -0
- package/dist/{39518.d618e2761a7c63dbd8ee.bundle.js.map → 39518.323713e6d7824200b4aa.bundle.js.map} +1 -1
- package/dist/67888.72a3e3f1ca8ef6f166e5.bundle.js +2 -0
- package/dist/67888.72a3e3f1ca8ef6f166e5.bundle.js.map +1 -0
- package/dist/{82926.0628f0dcba28f5d0cd79.bundle.js → 82926.d6004d6f3c66ce06b0b8.bundle.js} +2 -2
- package/dist/{82926.0628f0dcba28f5d0cd79.bundle.js.map → 82926.d6004d6f3c66ce06b0b8.bundle.js.map} +1 -1
- package/dist/99448.54eab0c202c6b1df897d.bundle.js +2 -0
- package/dist/99448.54eab0c202c6b1df897d.bundle.js.map +1 -0
- package/dist/index.html +8 -8
- package/dist/js/angular/clustermanagement/templates/cluster-nodes-configuration.html +1 -1
- package/dist/js/angular/core/directives/autocomplete/templates/autocomplete.html +1 -1
- package/dist/js/angular/core/directives/dynamic-form/templates/dynamic-form.html +1 -1
- package/dist/js/angular/core/directives/operations-statuses-monitor/templates/operations-statuses-monitor.html +1 -1
- package/dist/js/angular/core/directives/rdfresourcesearch/templates/rdfResourceSearchTemplate.html +1 -1
- package/dist/js/angular/core/directives/shuttle-multiselect/templates/shuttle-multiselect.html +1 -1
- package/dist/js/angular/core/directives/yasgui-component/templates/yasgui-component.html +2 -2
- package/dist/js/angular/core/templates/cookie-policy/cookie-consent.html +1 -1
- package/dist/js/angular/core/templates/cookie-policy/cookie-policy.html +1 -1
- package/dist/js/angular/core/templates/editable-content/editable-content.html +1 -1
- package/dist/js/angular/core/templates/markdown-content/markdown-content.html +1 -1
- package/dist/js/angular/core/templates/search-resource-input.html +1 -1
- package/dist/js/angular/graphql/templates/create-graphql-endpoint.html +2 -2
- package/dist/js/angular/graphql/templates/graphql-endpoint-management.html +1 -1
- package/dist/js/angular/graphql/templates/graphql-playground.html +2 -2
- package/dist/js/angular/graphql/templates/modal/endpoint-configuration-modal.html +1 -1
- package/dist/js/angular/graphql/templates/modal/endpoint-generation-failure-result-modal.html +1 -1
- package/dist/js/angular/graphql/templates/modal/import-endpoint-definition-modal.html +1 -1
- package/dist/js/angular/security/templates/user.html +2 -2
- package/dist/js/angular/ttyg/templates/agent-list.html +1 -1
- package/dist/js/angular/ttyg/templates/agent-select-menu.html +1 -1
- package/dist/js/angular/ttyg/templates/chat-item-detail.html +1 -1
- package/dist/js/angular/ttyg/templates/chat-list.html +1 -1
- package/dist/js/angular/ttyg/templates/chat-panel.html +1 -1
- package/dist/js/angular/ttyg/templates/modal/agent-instructions-explain-modal.html +1 -1
- package/dist/js/angular/ttyg/templates/modal/agent-settings-modal.html +3 -3
- package/dist/js/angular/ttyg/templates/modal/external-integration-configuration-modal.html +1 -1
- package/dist/js/angular/ttyg/templates/no-agents-view.html +1 -1
- package/dist/js/angular/ttyg/templates/ttyg.html +1 -1
- package/dist/legacyWorkbench.1437717b1ec1164a1fcb.js +3 -0
- package/dist/{legacyWorkbench.f346ac6ed5ecf44b0a82.js.map → legacyWorkbench.1437717b1ec1164a1fcb.js.map} +1 -1
- package/dist/pages/aclmanagement.html +1 -1
- package/dist/pages/autocomplete.html +1 -1
- package/dist/pages/choose-repository-type.html +1 -1
- package/dist/pages/cluster-management/clusterInfo.html +3 -3
- package/dist/pages/create-index.html +1 -1
- package/dist/pages/dependencies.html +1 -1
- package/dist/pages/domainRangeInfo.html +2 -2
- package/dist/pages/edit.html +1 -1
- package/dist/pages/explore.html +1 -1
- package/dist/pages/export.html +1 -1
- package/dist/pages/find.html +1 -1
- package/dist/pages/graph-config/saveGraphConfig.html +8 -8
- package/dist/pages/graphs-visualizations.html +7 -7
- package/dist/pages/guides.html +1 -1
- package/dist/pages/home.html +1 -1
- package/dist/pages/import.html +2 -2
- package/dist/pages/jdbc-create.html +1 -1
- package/dist/pages/jdbc.html +1 -1
- package/dist/pages/monitor/backup-and-restore.html +1 -1
- package/dist/pages/monitor/queries.html +1 -1
- package/dist/pages/monitor/resources.html +1 -1
- package/dist/pages/namespaces.html +2 -2
- package/dist/pages/plugins.html +1 -1
- package/dist/pages/rdfClassHierarchyInfo.html +7 -7
- package/dist/pages/rdfrank.html +2 -2
- package/dist/pages/repositories.html +1 -1
- package/dist/pages/repository.html +1 -1
- package/dist/pages/similarity-indexes.html +1 -1
- package/dist/pages/sparql-editor.html +1 -1
- package/dist/pages/sparql-template-create.html +1 -1
- package/dist/pages/sparql-templates.html +1 -1
- package/dist/pages/ux-test1.html +2 -2
- package/dist/pages/webapi.html +2 -2
- package/dist/res/swagger5/index.html +11 -11
- package/package.json +1 -1
- package/dist/38644.beb1813607273fe31bae.bundle.js +0 -2
- package/dist/38644.beb1813607273fe31bae.bundle.js.map +0 -1
- package/dist/39518.d618e2761a7c63dbd8ee.bundle.js +0 -2
- package/dist/67888.76ac1f185b6c8ef1c96d.bundle.js +0 -2
- package/dist/67888.76ac1f185b6c8ef1c96d.bundle.js.map +0 -1
- package/dist/99448.afa5d1c877cd132c91ff.bundle.js +0 -2
- package/dist/99448.afa5d1c877cd132c91ff.bundle.js.map +0 -1
- package/dist/legacyWorkbench.f346ac6ed5ecf44b0a82.js +0 -3
- /package/dist/{legacyWorkbench.f346ac6ed5ecf44b0a82.js.LICENSE.txt → legacyWorkbench.1437717b1ec1164a1fcb.js.LICENSE.txt} +0 -0
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export const __webpack_esm_id__=38644;export const __webpack_esm_ids__=[38644];export const __webpack_esm_modules__={38644(t,e,r){var a=r(88141),n=r(19935),o=(r(32150),r(93462));function s(t,e,r,s,c,i,l,d,p,u,f,g,h){return{restrict:"AE",template:'<div id="domain-range"></div>',scope:{showPredicatesInfoPanel:"=",selectedPredicate:"=",collapseEdges:"="},link:function(u){const f=d(function(){!function(u){var f=1200,y=f/18,x=f/110,m=x/2,v=f/90,b=1.2,k=o.select("#domain-range").append("svg").attr("viewBox","0 0 1200 600").attr("preserveAspectRatio","xMidYMid meet").on("dblclick.zoom",null),w=o.forceSimulation(),E=o.drag().subject(function(t){return t}).on("start",function(t,e){w.stop(),e.fx=t.x,e.fy=t.y,o.select(this).classed("selected",!0)}).on("end",function(t,e){e.fx=null,e.fy=null,o.select(this).classed("selected",!1),C?(w.alpha(.2).restart(),C=!1):w.restart()}).on("drag",function(t,e){C=!0,w.alphaTarget(0).restart(),e.fx=t.x,e.fy=t.y}),N=k.append("defs");N.append("marker").attrs({id:"arrow",viewBox:"0 -5 10 10",refX:10,refY:0,markerUnits:"strokeWidth",markerWidth:5,markerHeight:5,orient:"auto",fill:g}).append("path").attrs({d:"M0,-5L10,0L0,5",class:"arrowHead"}),N.append("marker").attrs({id:"collapsed-arrow",viewBox:"0 -5 10 10",refX:9,refY:0,markerUnits:"strokeWidth",markerWidth:4,markerHeight:4,orient:"auto",fill:g}).append("path").attrs({d:"M0,-5L10,0L0,5",class:"arrowHead"}),N.append("marker").attrs({id:"arrow-loop",viewBox:"0 -5 10 10",refX:7,refY:0,markerUnits:"strokeWidth",markerWidth:5,markerHeight:5,orient:"auto",fill:g}).append("path").attrs({d:"M0,-5L10,0L0,5",class:"arrowHead"}),o.select("#download-svg").on("mouseover",function(){var t=a.A.Export.getCSSRules("css/domain-range-graph.css?v=3.3.1");$("defs").append('<style type="text/css"><![CDATA['+t+"]]></style>");var e=a.A.Export.generateBase64ImageSource("#domain-range svg");o.select(this).attrs({href:e,download:"domain-range-graph-"+r.getActiveRepository()+".svg"})}),function(){var t=f/7,e=205.7142857142857,r=o.select(".legend-container").append("svg").attr("viewBox","0 0 "+t+" "+e).attr("preserveAspectRatio","xMidYMid meet");r.append("rect").attrs({width:t,height:e}).style("fill","rgba(235, 235, 235, 0.9)");var a=16,n=42.66666666666667,s=n+f/90,i=v/1.1,l=(r.append("circle").attrs({class:"legend-class-node",cx:29.333333333333336,cy:30,r:y/4.5}),30+f/370);r.append("text").attrs({x:s,y:l}).style("font-size",i+"px").text("main class node"),r.append("circle").attrs({class:"legend-object-node",cx:29.333333333333336,cy:70,r:8.727272727272727});var d=l+40;r.append("text").attrs({x:s,y:d}).style("font-size",i+"px").text("class node");var p=70+f/45;r.append("circle").attrs({class:"legend-datatype-node",cx:29.333333333333336,cy:p,r:m});var u=d+f/45;r.append("text").attrs({x:s,y:u}).style("font-size",i+"px").text("datatype node");var g=123.33333333333334;r.append("line").attrs({class:"property-arrow",x1:a,y1:g,x2:n,y2:g}).style("stroke-width",b).attr("marker-end","url("+c.absUrl()+"#arrow)"),r.append("text").attrs({x:s,y:126.57657657657658}).style("font-size",i+"px").text("explicit property");var h=150;r.append("line").attrs({class:"implicit-property-arrow",x1:a,y1:h,x2:n,y2:h}).style("stroke-width",b).attr("marker-end","url("+c.absUrl()+"#arrow)"),r.append("text").attrs({x:s,y:153.24324324324326}).style("font-size",i+"px").text("implicit property");var x=176.66666666666666;r.append("line").attrs({class:"collapsed-property-arrow",x1:a,y1:x,x2:n,y2:x}).style("stroke-width",2).attr("marker-end","url("+c.absUrl()+"#collapsed-arrow)"),r.append("text").attrs({x:s,y:179.9099099099099}).style("font-size",i+"px").text("collapsed property")}();var A=c.search().uri,R=c.search().name;const L=c.search().collapsed;(function(t,e){s.getDomainRangeData(t,e).success(function(t,e,r){u.domainRangeGraphData=t}).error(function(t){p.error("Request for "+R+" failed!")})})(A,L),$(window).on("popstate",function(){i.set(l.DOMAIN_RANGE_WENT_BACK,!0)}),e.onpopstate=function(e){e.state&&t.$broadcast("changeCollapsedEdgesState",e.state.collapsed)},u.$watch("collapseEdges",function(){angular.isUndefined(u.collapseEdges)||(i.set(l.DOMAIN_RANGE_COLLAPSE_EDGES,u.collapseEdges),"true"!==i.get(l.DOMAIN_RANGE_WENT_BACK)&&function(e){t.$broadcast("switchEdgeMode",{uri:A,name:R,collapsed:e})}(u.collapseEdges),i.remove(l.DOMAIN_RANGE_WENT_BACK))}),u.$watch("domainRangeGraphData",function(){if(u.domainRangeGraphData){var r=_.cloneDeep(u.domainRangeGraphData);const S=r.nodes,I=r.links;w.nodes(S).force("x",o.forceX(600)).force("y",o.forceY(300)).force("charge",o.forceManyBody().strength(-800)).force("link",o.forceLink(I).distance(f/3.5));var a=k.selectAll(".link").data(I).enter().append("g");function B(t){t.style("stroke",g),t.style("stroke-width",2),t.attr("marker-end","url("+c.absUrl()+"#collapsed-arrow)")}var s,i,l=0;a.each(function(t){if(t.objectPropNodeClassUri!==A)s=a.append("line").attrs({class:"link","marker-end":"url("+c.absUrl()+"#arrow)"}).style("stroke-width",b).each(function(t){switch(t.propertyType){case"objectLeft":t.targetRadius=y;break;case"objectRight":t.targetRadius=x;break;case"datatype":t.targetRadius=m;break;default:t.targetRadius=0}var e=o.select(this);t.targetNodeEdgeCount>1?B(e):t.implicit&&e.style("stroke-dasharray","3, 3")});else{if(angular.isUndefined(i)){var e=y/2;i=o.select(this).append("path").attrs({d:"M 0 0 A "+e+" "+e+" 0 1 1 0 "+e,class:"loop-link",fill:"none","marker-end":"url("+c.absUrl()+"#arrow-loop)"}).style("stroke-width",b)}(l+=t.targetNodeEdgeCount)>1&&B(o.select(".loop-link"))}});var p={};function G(){$.isEmptyObject(p)||(p.text.style("fill","black"),p.background.style("fill","#f0f0f0"))}function W(t,e){G(),p.text=o.select(this),p.background=o.select(this.previousSibling),p.text.style("fill","white"),p.background.style("fill",g),d(function(){u.showPredicatesInfoPanel=!0,u.selectedPredicate=e}),t.stopPropagation()}$("document").ready(function(){$("#domain-range").bind("click",G)});var N=a.append("text").attr("class",function(t){return t.objectPropNodeClassUri===A?"loop-link-property-name":"property-name"}).attr("dx",function(t){return y/2*("objectLeft"===t.propertyType?1:-1)}).style("text-anchor",function(t){return"objectLeft"===t.propertyType?"end":"start"}).style("font-size",v).text(function(t){return t.targetNodeEdgeCount>1?t.targetNodeEdgeCount+" predicates":t.name});N.each(function(t){var r=o.select(this);/\d\spredicates/.test(r.text())?r.style("font-weight","bold").on("click",W):r.on("click",function(t,r){e.open("resource?uri="+encodeURIComponent(r.uri),"_blank")})});var L=a.append("rect").attr("class",function(t){return t.objectPropNodeClassUri!==A?"link-background":"loop-link-background"}).attr("width",function(t){return t.calculatedWidth=this.previousSibling.getBBox().width,t.calculatedWidth+4}).attr("height",function(t){return t.calculatedHeight=this.previousSibling.getBBox().height,t.calculatedHeight+2}).attr("transform",function(t){var e=2-y/2*("objectLeft"===t.propertyType?1:-1);return"objectLeft"===t.propertyType&&(e+=t.calculatedWidth),"translate(-"+e+",-"+(2+t.calculatedHeight/2)+")"}).on("click",function(t){t.stopPropagation()}),C=k.selectAll(".node").data(S).enter().append("g"),P=C.filter(function(t){return t.objectPropClassUri!==A}).append("circle").each(function(t){var e=o.select(this);"main"===t.classPosition?e.attrs({class:"class-node",r:y}).attr("marker-end","url("+c.absUrl()+"#loop-link)"):null===t.objectPropClassName?e.attrs({class:"datatype-node",r:m}):e.attrs({class:"object-prop-node",r:x})}).call(E);function z(e,r,a){u.$apply(function(){t.$broadcast("reloadDomainRangeGraphView",r,a)})}o.selectAll(".object-prop-node").on("dblclick",z),C.filter(function(t){return t.objectPropClassName&&t.objectPropClassUri!==A}).append("text").attr("class",function(t){return t.classPosition+"-class-label"}).style("font-size",v).text(function(t){return t.objectPropClassName}).on("click",function(t,r){e.open("resource?uri="+encodeURIComponent(r.objectPropClassUri),"_blank")});var U=C.select("text");k.select(".class-node").each(function(){o.select(this.parentNode).append("text").attr("class","rdf-class-label").style("font-size",function(t){return n.A.Text.calcFontSize(R,y)}).text(R).on("click",function(){e.open("resource?uri="+encodeURIComponent(A),"_blank")})});var j=k.select(".class-node + text"),T=o.select(".class-node"),M=o.selectAll(".loop-link-background"),O=o.selectAll(".loop-link-property-name");if(N=o.selectAll(".property-name"),!angular.isUndefined(i)){var D=[];M.each(function(t,e){o.select(this),D.push({idx:e,width:t.calculatedWidth,height:t.calculatedHeight})})}function F(t){var e=8*w.alpha();function r(t){var e=t.x+2*y,r=t.y-35.08771929824562;var a=[];M.each(function(n,s){a.push(n),s<h?function(a,n){var o=$.grep(D,function(t){return t.idx==n});n>0&&(e+=parseFloat(n*(o[0].height/(n/1.4)))),a.attrs({transform:"rotate(270, "+t.x+","+t.y+") translate("+e+","+r+")",width:o[0].height,height:o[0].width})}(o.select(this),s):o.select(this).remove()}),function(t){var e;o.select(".view-more-preds-label").style("font-weight","bold").each(function(r){r.target.allEdges=t,e=this.getComputedTextLength()}).on("click",W),o.select(".view-more-preds-rect").attr("height",e+4)}(a)}s.filter(function(t){return t.objectPropNodeClassUri!==A}).attr("x1",function(t){return t.source.x}).attr("y1",function(t){return t.source.y}).attr("x2",function(t){return t.targetX}).attr("y2",function(t){return t.targetY}).each(function(t){!function(t){"objectLeft"===t.propertyType?(t.source.x-=8*e,t.source.y-=e/9):(t.target.x+=8*e,t.target.y-=e/9)}(t);var r=Math.atan2(t.target.y-t.source.y,t.target.x-t.source.x);t.targetX=t.target.x-Math.cos(r)*t.targetRadius,t.targetY=t.target.y-Math.sin(r)*t.targetRadius}),P.each(function(t){"main"!==t.classPosition||angular.isUndefined(i)||(function(t){var e=t.x+64,r=t.y-y/5.7-5;i.attr("transform","rotate(270, "+t.x+","+t.y+") translate("+e+","+r+")")}(t),function(t){function e(e,r){var a=$.grep(D,function(t){return t.idx==r}),n=0;r>0&&(n=parseFloat(2*r*(a[0].height/1.4)));var o=t.x,s=t.y-2.1*y-n;e.attrs({x:o,y:s}).moveToFront()}O.each(function(t,r){var a=o.select(this),n=O.size()-h;n<0?e(a,r):(0==r&&!u.collapseEdges&&n>1&&(function(t,e,r){t.classed("view-more-preds-label",!0).text(r+" predicates more ..."),null!==this.nextSibling&&e.classed("view-more-preds-rect",!0)}(a,o.select(this.nextSibling),n),e(a,r)),r<h?e(a,r):a.remove())})}(t),r(t)),t.objectPropClassUri!==A&&o.select(this).attr("cx",function(t){return"main"===t.classPosition?function(t){!window.ActiveXObject&&"ActiveXObject"in window&&(Math.log10=function(t){return Math.log(t)/Math.LN10});var e=T.attr("cx")-600,r=.5*Math.log10(Math.abs(e));return t.x+=e>0?-r:r,t.x}(t):t.x}).attr("cy",function(t){return t.y})}),j.attr("x",function(t){return t.x}).attr("y",function(t){return t.y}).moveToFront(),L.filter(function(t){return t.objectPropNodeClassUri!==A}).attr("x",function(t){return t.target.x>t.source.x?t.source.x+(t.target.x-t.source.x)/2:t.target.x+(t.source.x-t.target.x)/2}).attr("y",function(t){return t.target.y>t.source.y?t.source.y+(t.target.y-t.source.y)/2:t.target.y+(t.source.y-t.target.y)/2}).moveToFront(),N.attr("x",function(t){return t.target.x>t.source.x?t.source.x+(t.target.x-t.source.x)/2:t.target.x+(t.source.x-t.target.x)/2}).attr("y",function(t){return t.target.y>t.source.y?t.source.y+(t.target.y-t.source.y)/2:t.target.y+(t.source.y-t.target.y)/2}).moveToFront(),U.attr("x",function(t){return"right"===t.classPosition?t.x+13.09090909090909:t.x-13.09090909090909}).attr("y",function(t){return t.y}).moveToFront()}w.on("tick",F)}});let C=!1}(u)},50);u.$on("$destroy",function(){d.cancel(f)})}}}angular.module("graphdb.framework.graphexplore.directives.domainrange",["graphdb.framework.graphexplore.controllers.domainrange","graphdb.framework.utils.localstorageadapter"]).constant("ONTO_RED","var(--gw-primary-base)").constant("ONTO_GREEN","var(--gw-tertiary-base)").constant("ONTO_BLUE","var(--gw-secondary-base)").constant("NON_COLLAPSED_REFLEXIVE_LINK_LIMIT",6).directive("domainRangeGraph",s),s.$inject=["$rootScope","$window","$repositories","GraphDataRestService","$location","LocalStorageAdapter","LSKeys","$timeout","toastr","ONTO_RED","ONTO_GREEN","ONTO_BLUE","NON_COLLAPSED_REFLEXIVE_LINK_LIMIT"]}};
|
|
2
|
+
//# sourceMappingURL=38644.4177d9bcdff1ad596ca1.bundle.js.map
|
|
@@ -0,0 +1 @@
|
|
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B,GACCO,KAAK,IAAK,SAAUK,GACjB,OAAOA,EAAEM,CACb,GACCkL,aACT,CAEA3L,EAAMD,GAAG,OAAQ2J,EAErB,CACJ,GAEA,IAAI9I,GAAY,CAiCpB,CAz5BQ+L,CAAuB5N,EAC3B,EAAG,IAEHA,EAAM6N,IAAI,WAAY,WAClBrO,EAASsO,OAAOzN,EACpB,EACJ,EAo5BJ,CAr7BAiG,QACKyH,OAAO,wDAAyD,CAC7D,yDACA,gDAEHC,SAAS,WAAY,0BACrBA,SAAS,aAAc,2BACvBA,SAAS,YAAa,4BACtBA,SAAS,qCAAsC,GAC/CC,UAAU,mBAAoBjP,GAEnCA,EAA0BkP,QAAU,CAAC,aAAc,UAAW,gBAAiB,uBAAwB,YAAa,sBAAuB,SAAU,WAAY,SAAU,WAAY,aAAc,YAAa,qC","sources":["webpack://root-config/./packages/legacy-workbench/src/js/angular/graphexplore/directives/domain-range-graph.directive.js"],"sourcesContent":["import SVG from 'lib/common/svg-export';\nimport D3 from 'lib/common/d3-utils';\nimport 'angular/utils/local-storage-adapter';\nimport * as d3 from 'd3';\n\nangular\n .module('graphdb.framework.graphexplore.directives.domainrange', [\n 'graphdb.framework.graphexplore.controllers.domainrange',\n 'graphdb.framework.utils.localstorageadapter'\n ])\n .constant('ONTO_RED', 'var(--gw-primary-base)')\n .constant('ONTO_GREEN', 'var(--gw-tertiary-base)')\n .constant('ONTO_BLUE', 'var(--gw-secondary-base)')\n .constant('NON_COLLAPSED_REFLEXIVE_LINK_LIMIT', 6)\n .directive('domainRangeGraph', domainRangeGraphDirective);\n\ndomainRangeGraphDirective.$inject = ['$rootScope', '$window', '$repositories', 'GraphDataRestService', '$location', 'LocalStorageAdapter', 'LSKeys', '$timeout', 'toastr', 'ONTO_RED', 'ONTO_GREEN', 'ONTO_BLUE', 'NON_COLLAPSED_REFLEXIVE_LINK_LIMIT'];\n\nfunction domainRangeGraphDirective($rootScope, $window, $repositories, GraphDataRestService, $location, LocalStorageAdapter, LSKeys, $timeout, toastr, ONTO_RED, ONTO_GREEN, ONTO_BLUE, NON_COLLAPSED_REFLEXIVE_LINK_LIMIT) {\n return {\n restrict: 'AE',\n template: '<div id=\"domain-range\"></div>',\n scope: {\n showPredicatesInfoPanel: '=',\n selectedPredicate: '=',\n collapseEdges: '='\n },\n link: linkFunc\n };\n\n function linkFunc(scope) {\n const timer = $timeout(function () {\n renderDomainRangeGraph(scope);\n }, 50);\n\n scope.$on(\"$destroy\", function () {\n $timeout.cancel(timer);\n });\n }\n\n function renderDomainRangeGraph(scope) {\n var width = 1200,\n height = 600;\n\n var mainClassSize = width / 18,\n otherClassSize = width / 110,\n datatypeSize = otherClassSize / 2,\n labelFontSize = width / 90,\n basicArrowStrokeWidth = width / 1000,\n collapsedArrowStrokeWidth = width / 600;\n\n var svg = d3.select(\"#domain-range\")\n .append(\"svg\")\n .attr(\"viewBox\", \"0 0 \" + width + \" \" + height)\n .attr(\"preserveAspectRatio\", \"xMidYMid meet\")\n .on(\"dblclick.zoom\", null);\n\n var force = d3.forceSimulation();\n\n var drag = d3.drag()\n .subject(function (d) {\n return d;\n })\n .on(\"start\", dragStart)\n .on(\"end\", dragEnd)\n .on(\"drag\", dragged);\n\n var defs = svg.append(\"defs\");\n generateMarkers(defs);\n\n function generateMarkers(defElement) {\n defs.append(\"marker\")\n .attrs({\n id: \"arrow\",\n viewBox: \"0 -5 10 10\",\n refX: 10,\n refY: 0,\n markerUnits: \"strokeWidth\",\n markerWidth: 5,\n markerHeight: 5,\n orient: \"auto\",\n fill: ONTO_BLUE\n })\n .append(\"path\")\n .attrs({\n d: \"M0,-5L10,0L0,5\",\n class: \"arrowHead\"\n });\n\n defs.append(\"marker\")\n .attrs({\n id: \"collapsed-arrow\",\n viewBox: \"0 -5 10 10\",\n refX: 9,\n refY: 0,\n markerUnits: \"strokeWidth\",\n markerWidth: 4,\n markerHeight: 4,\n orient: \"auto\",\n fill: ONTO_BLUE\n })\n .append(\"path\")\n .attrs({\n d: \"M0,-5L10,0L0,5\",\n class: \"arrowHead\"\n });\n\n defs.append(\"marker\")\n .attrs({\n id: \"arrow-loop\",\n viewBox: \"0 -5 10 10\",\n refX: 7,\n refY: 0,\n markerUnits: \"strokeWidth\",\n markerWidth: 5,\n markerHeight: 5,\n orient: \"auto\",\n fill: ONTO_BLUE\n })\n .append(\"path\")\n .attrs({\n d: \"M0,-5L10,0L0,5\",\n class: \"arrowHead\"\n });\n }\n\n /*\n * Prepares SVG document image export by adding xml namespaces and\n * additional style information\n */\n function prepareForSVGImageExport() {\n // get css rules for the diagram\n var cssRules = SVG.Export.getCSSRules(\"css/domain-range-graph.css?v=3.3.1\");\n\n // inline css rules in a defs tag\n $(\"defs\").append('<style type=\"text/css\"><![CDATA[' + cssRules + ']]></style>');\n\n // convert selected html to base64\n var imgSrc = SVG.Export.generateBase64ImageSource(\"#domain-range svg\");\n\n // set the binary image and a name for the downloadable file on the export button\n d3.select(this).attrs({\n href: imgSrc,\n download: \"domain-range-graph-\" + $repositories.getActiveRepository() + \".svg\"\n });\n }\n\n d3.select(\"#download-svg\")\n .on(\"mouseover\", prepareForSVGImageExport);\n\n generateLegend();\n\n function generateLegend() {\n // start of code for legend\n\n var legendBackgroundWidth = width / 7;\n var legendBackgroundHeight = legendBackgroundWidth * 1.2;\n\n var svgLegend = d3.select(\".legend-container\")\n .append(\"svg\")\n .attr(\"viewBox\", \"0 0 \" + legendBackgroundWidth + \" \" + legendBackgroundHeight)\n .attr(\"preserveAspectRatio\", \"xMidYMid meet\");\n\n var legendCellGroup = svgLegend;\n\n legendCellGroup.append(\"rect\")\n .attrs({\n width: legendBackgroundWidth,\n height: legendBackgroundHeight\n })\n .style(\"fill\", \"rgba(235, 235, 235, 0.9)\");\n\n var sourceX = width / 75;\n var sourceY = width / 40;\n var targetX = sourceX + mainClassSize / 2.5;\n var targetY = sourceY;\n\n var legendTextX = targetX + width / 90;\n var legendLabelFontSize = labelFontSize / 1.1;\n\n var classNodeY = sourceY;\n var legendClassNode = legendCellGroup\n .append(\"circle\")\n .attrs({\n class: \"legend-class-node\",\n cx: (sourceX + targetX) / 2,\n cy: classNodeY,\n r: mainClassSize / 4.5\n });\n\n var classNodeTextY = targetY + width / 370;\n legendCellGroup\n .append(\"text\")\n .attrs({\n x: legendTextX,\n y: classNodeTextY\n })\n .style('font-size', legendLabelFontSize + 'px')\n .text(\"main class node\");\n\n var objectNodeY = classNodeY + width / 30;\n legendCellGroup\n .append(\"circle\")\n .attrs({\n class: \"legend-object-node\",\n cx: (sourceX + targetX) / 2,\n cy: objectNodeY,\n r: otherClassSize / 1.25\n });\n\n var objectNodeTextY = classNodeTextY + width / 30;\n legendCellGroup\n .append(\"text\")\n .attrs({\n x: legendTextX,\n y: objectNodeTextY\n })\n .style('font-size', legendLabelFontSize + 'px')\n .text(\"class node\");\n\n var datatypeNodeY = objectNodeY + width / 45;\n legendCellGroup\n .append(\"circle\")\n .attrs({\n class: \"legend-datatype-node\",\n cx: (sourceX + targetX) / 2,\n cy: datatypeNodeY,\n r: datatypeSize\n });\n\n var datatypeNodeTextY = objectNodeTextY + width / 45;\n legendCellGroup\n .append(\"text\")\n .attrs({\n x: legendTextX,\n y: datatypeNodeTextY\n })\n .style('font-size', legendLabelFontSize + 'px')\n .text(\"datatype node\");\n\n var basicPropertyArrowY = datatypeNodeY + width / 45;\n legendCellGroup\n .append(\"line\")\n .attrs({\n class: \"property-arrow\",\n x1: sourceX,\n y1: basicPropertyArrowY,\n x2: targetX,\n y2: basicPropertyArrowY\n })\n .style(\"stroke-width\", basicArrowStrokeWidth)\n .attr(\"marker-end\", \"url(\" + $location.absUrl() + \"#arrow)\");\n\n legendCellGroup\n .append(\"text\")\n .attrs({\n x: legendTextX,\n y: basicPropertyArrowY + (width / 370)\n })\n .style('font-size', legendLabelFontSize + 'px')\n .text(\"explicit property\");\n\n var implicitPropArrowY = basicPropertyArrowY + width / 45;\n legendCellGroup\n .append(\"line\")\n .attrs({\n class: \"implicit-property-arrow\",\n x1: sourceX,\n y1: implicitPropArrowY,\n x2: targetX,\n y2: implicitPropArrowY\n })\n .style(\"stroke-width\", basicArrowStrokeWidth)\n .attr(\"marker-end\", \"url(\" + $location.absUrl() + \"#arrow)\");\n\n legendCellGroup\n .append(\"text\")\n .attrs({\n x: legendTextX,\n y: implicitPropArrowY + (width / 370)\n })\n .style('font-size', legendLabelFontSize + 'px')\n .text(\"implicit property\");\n\n var collapsedPropArrowY = implicitPropArrowY + width / 45;\n legendCellGroup\n .append(\"line\")\n .attrs({\n class: \"collapsed-property-arrow\",\n x1: sourceX,\n y1: collapsedPropArrowY,\n x2: targetX,\n y2: collapsedPropArrowY\n })\n .style(\"stroke-width\", collapsedArrowStrokeWidth)\n .attr(\"marker-end\", \"url(\" + $location.absUrl() + \"#collapsed-arrow)\");\n\n legendCellGroup\n .append(\"text\")\n .attrs({\n x: legendTextX,\n y: collapsedPropArrowY + (width / 370)\n })\n .style('font-size', legendLabelFontSize + 'px')\n .text(\"collapsed property\");\n // end of code for legend\n }\n\n var selectedRdfUri = $location.search().uri;\n var classNodeLabel = $location.search().name;\n const collapsed = $location.search().collapsed;\n\n getDomainRangeData(selectedRdfUri, collapsed);\n\n function getDomainRangeData(selectedRdfUri, collapsed) {\n GraphDataRestService.getDomainRangeData(selectedRdfUri, collapsed)\n .success(function (response, status, headers) {\n scope.domainRangeGraphData = response;\n }).error(function (response) {\n toastr.error(\"Request for \" + classNodeLabel + \" failed!\");\n });\n }\n\n function switchEdgeMode(collapsed) {\n $rootScope.$broadcast('switchEdgeMode', {\n uri: selectedRdfUri,\n name: classNodeLabel,\n collapsed: collapsed\n });\n }\n\n // intercept back button press and set action to local storage\n $(window).on('popstate', function () {\n LocalStorageAdapter.set(LSKeys.DOMAIN_RANGE_WENT_BACK, true);\n });\n\n $window.onpopstate = function (event) {\n if (event.state) {\n $rootScope.$broadcast(\"changeCollapsedEdgesState\", event.state.collapsed);\n }\n };\n\n scope.$watch('collapseEdges', function () {\n if (!angular.isUndefined(scope.collapseEdges)) {\n LocalStorageAdapter.set(LSKeys.DOMAIN_RANGE_COLLAPSE_EDGES, scope.collapseEdges);\n\n // if the back button has not been pressed, then switch to collapsed or non collapsed mode\n // otherwise skip, because back button will not function properly and will not pop the entire\n // history stack\n if (LocalStorageAdapter.get(LSKeys.DOMAIN_RANGE_WENT_BACK) !== \"true\") {\n switchEdgeMode(scope.collapseEdges);\n }\n\n // after back button status has been checked, remove the action from local storage in order\n // to be clean for next check\n LocalStorageAdapter.remove(LSKeys.DOMAIN_RANGE_WENT_BACK);\n }\n });\n\n scope.$watch('domainRangeGraphData', function () {\n if (scope.domainRangeGraphData) {\n var graph = _.cloneDeep(scope.domainRangeGraphData);\n\n const nodes = graph.nodes;\n const links = graph.links;\n\n force.nodes(nodes)\n .force('x', d3.forceX(width / 2))\n .force('y', d3.forceY(height / 2))\n .force(\"charge\", d3.forceManyBody().strength(-800))\n .force(\"link\", d3.forceLink(links).distance(width / 3.5))\n\n var linkGroup = svg.selectAll(\".link\")\n .data(links)\n .enter()\n .append(\"g\");\n\n function styleArrowsInCollapsedMode(sel) {\n sel.style(\"stroke\", ONTO_BLUE);\n sel.style(\"stroke-width\", collapsedArrowStrokeWidth);\n sel.attr(\"marker-end\", \"url(\" + $location.absUrl() + \"#collapsed-arrow)\");\n }\n\n var link,\n loopLink,\n loopLinkEdgeCount = 0;\n\n\n linkGroup\n .each(function (d) {\n if (d.objectPropNodeClassUri !== selectedRdfUri) {\n link = linkGroup\n .append(\"line\")\n .attrs({\n class: \"link\",\n // absolute url needed because angular inserts a <base> tag\n \"marker-end\": \"url(\" + $location.absUrl() + \"#arrow)\"\n })\n .style(\"stroke-width\", basicArrowStrokeWidth)\n .each(function (d) {\n switch (d.propertyType) {\n case \"objectLeft\":\n d.targetRadius = mainClassSize;\n break;\n case \"objectRight\":\n d.targetRadius = otherClassSize;\n break;\n case \"datatype\":\n d.targetRadius = datatypeSize;\n break;\n default:\n d.targetRadius = 0;\n }\n var sel = d3.select(this);\n if (d.targetNodeEdgeCount > 1) {\n styleArrowsInCollapsedMode(sel);\n } else if (d.implicit) {\n sel.style(\"stroke-dasharray\", \"3, 3\");\n }\n });\n } else {\n if (angular.isUndefined(loopLink)) {\n var loopLinkSize = mainClassSize / 2;\n loopLink = d3.select(this)\n .append(\"path\")\n .attrs({\n d: \"M 0 0 A \" + loopLinkSize + \" \" + loopLinkSize + \" 0 1 1 0 \" + loopLinkSize,\n class: \"loop-link\",\n fill: \"none\",\n \"marker-end\": \"url(\" + $location.absUrl() + \"#arrow-loop)\"\n })\n .style(\"stroke-width\", basicArrowStrokeWidth);\n }\n\n loopLinkEdgeCount += d.targetNodeEdgeCount;\n if (loopLinkEdgeCount > 1) {\n styleArrowsInCollapsedMode(d3.select(\".loop-link\"));\n }\n }\n });\n\n var previousPropertyNameSelection = {};\n\n function disableCollapsedPredicateLabelHightlighting() {\n if (!$.isEmptyObject(previousPropertyNameSelection)) {\n previousPropertyNameSelection.text.style(\"fill\", \"black\");\n previousPropertyNameSelection.background.style(\"fill\", \"#f0f0f0\");\n }\n }\n\n // when clicking anywhere else but the collapsed labels disable highlighting\n // of the currently selected one\n $(\"document\").ready(function () {\n $(\"#domain-range\").bind(\"click\", disableCollapsedPredicateLabelHightlighting);\n });\n\n function onCollapsedPropertyNameClick(event, d) {\n disableCollapsedPredicateLabelHightlighting();\n previousPropertyNameSelection.text = d3.select(this);\n\n previousPropertyNameSelection.background = d3.select(this.previousSibling);\n previousPropertyNameSelection.text.style(\"fill\", \"white\");\n\n previousPropertyNameSelection.background.style(\"fill\", ONTO_BLUE);\n $timeout(function () {\n scope.showPredicatesInfoPanel = true;\n scope.selectedPredicate = d;\n });\n event.stopPropagation();\n }\n\n\n var propertyNames = linkGroup\n .append(\"text\")\n .attr(\"class\", function (d) {\n return d.objectPropNodeClassUri === selectedRdfUri ? \"loop-link-property-name\" : \"property-name\";\n })\n .attr(\"dx\", function (d) {\n // offset text more towards the main class\n return mainClassSize / 2 * (d.propertyType === \"objectLeft\" ? 1 : -1);\n })\n .style(\"text-anchor\", function (d) {\n return d.propertyType === \"objectLeft\" ? \"end\" : \"start\";\n })\n .style(\"font-size\", labelFontSize)\n .text(function (d) {\n return d.targetNodeEdgeCount > 1 ? d.targetNodeEdgeCount + \" predicates\" : d.name;\n });\n\n\n propertyNames\n .each(function (d) {\n var sel = d3.select(this);\n var isCompoundEdge = /\\d\\spredicates/.test(sel.text());\n\n // handle collapsed predicates by making their font bold, make them highlight when clicked\n // and make them trigger the side panel to display the collapsed edges\n if (isCompoundEdge) {\n sel\n .style(\"font-weight\", \"bold\")\n .on(\"click\", onCollapsedPropertyNameClick);\n } else {\n // for regular predicate labels just attach a link to the \"Resources\" view\n // for more helpful information regarding them\n sel.on(\"click\", function (event, d) {\n $window.open(\"resource?uri=\" + encodeURIComponent(d.uri), \"_blank\");\n });\n }\n });\n var textPadding = width / 600;\n\n\n var linkRect = linkGroup\n .append(\"rect\")\n .attr(\"class\", function (d) {\n return d.objectPropNodeClassUri !== selectedRdfUri ? \"link-background\" : \"loop-link-background\"\n })\n .attr(\"width\", function (d) {\n d.calculatedWidth = this.previousSibling.getBBox().width;\n return d.calculatedWidth + textPadding * 2;\n })\n .attr(\"height\", function (d) {\n d.calculatedHeight = this.previousSibling.getBBox().height;\n return d.calculatedHeight + textPadding;\n })\n .attr(\"transform\", function (d) {\n // offset rect by the same amount as text (besides the padding)\n var translateX = textPadding - mainClassSize / 2 * (d.propertyType === \"objectLeft\" ? 1 : -1);\n if (d.propertyType === \"objectLeft\") {\n translateX += d.calculatedWidth;\n }\n return \"translate(-\" + translateX + \",-\" + (textPadding + d.calculatedHeight / 2) + \")\";\n })\n .on(\"click\", function (event) {\n event.stopPropagation();\n });\n\n\n var nodeGroup = svg.selectAll(\".node\")\n .data(nodes)\n .enter()\n .append(\"g\");\n\n var node = nodeGroup\n .filter(function (d) {\n return d.objectPropClassUri !== selectedRdfUri;\n })\n .append(\"circle\")\n .each(function (d) {\n var sel = d3.select(this);\n if (d.classPosition === \"main\") {\n sel.attrs({\n class: \"class-node\",\n r: mainClassSize\n })\n .attr(\"marker-end\", \"url(\" + $location.absUrl() + \"#loop-link)\");\n } else if (d.objectPropClassName === null) {\n sel.attrs({\n class: \"datatype-node\",\n r: datatypeSize\n });\n } else {\n sel.attrs({\n class: \"object-prop-node\",\n r: otherClassSize\n });\n }\n })\n .call(drag);\n\n\n function reloadDomainRangeGraphView(event, d, collapsed) {\n scope.$apply(function () {\n $rootScope.$broadcast('reloadDomainRangeGraphView', d, collapsed);\n });\n }\n\n d3.selectAll(\".object-prop-node\")\n .on(\"dblclick\", reloadDomainRangeGraphView);\n\n\n nodeGroup\n .filter(function (d) {\n return d.objectPropClassName && d.objectPropClassUri !== selectedRdfUri;\n })\n .append(\"text\")\n .attr(\"class\", function (d) {\n return d.classPosition + \"-class-label\";\n })\n .style(\"font-size\", labelFontSize)\n .text(function (d) {\n return d.objectPropClassName;\n })\n .on(\"click\", function (event, d) {\n $window.open(\"resource?uri=\" + encodeURIComponent(d.objectPropClassUri), \"_blank\");\n });\n\n var objectPropClassName = nodeGroup.select(\"text\");\n\n svg.select(\".class-node\")\n .each(function () {\n d3.select(this.parentNode)\n .append(\"text\")\n .attr(\"class\", \"rdf-class-label\")\n .style(\"font-size\", function (d) {\n return D3.Text.calcFontSize(classNodeLabel, mainClassSize)\n })\n .text(classNodeLabel)\n .on(\"click\", function () {\n $window.open(\"resource?uri=\" + encodeURIComponent(selectedRdfUri), \"_blank\");\n });\n });\n\n\n var rdfClassName = svg.select(\".class-node + text\"),\n classNode = d3.select(\".class-node\"),\n loopLinkBackgroundSel = d3.selectAll(\".loop-link-background\"),\n loopLinkPropertyName = d3.selectAll(\".loop-link-property-name\");\n\n propertyNames = d3.selectAll(\".property-name\");\n\n if (!angular.isUndefined(loopLink)) {\n var loopLinkBackgroundProps = [];\n\n loopLinkBackgroundSel.each(function (d, i) {\n var sel = d3.select(this);\n loopLinkBackgroundProps.push({\n idx: i,\n width: d.calculatedWidth,\n height: d.calculatedHeight\n });\n });\n }\n\n function tick(e) {\n var k = 8 * force.alpha();\n\n function pushEdgesToLeftAndRight(d) {\n if (d.propertyType === \"objectLeft\") {\n d.source.x -= 8 * k;\n d.source.y -= k / 9;\n } else {\n d.target.x += 8 * k;\n d.target.y -= k / 9;\n }\n }\n\n link\n .filter(function (d) {\n return d.objectPropNodeClassUri !== selectedRdfUri;\n })\n .attr(\"x1\", function (d) {\n return d.source.x;\n })\n .attr(\"y1\", function (d) {\n return d.source.y;\n })\n .attr(\"x2\", function (d) {\n return d.targetX;\n })\n .attr(\"y2\", function (d) {\n return d.targetY;\n })\n .each(function (d) {\n pushEdgesToLeftAndRight(d);\n\n // shortens the line to compensate for the circle at the target\n var angle = Math.atan2(d.target.y - d.source.y, d.target.x - d.source.x);\n d.targetX = d.target.x - Math.cos(angle) * d.targetRadius;\n d.targetY = d.target.y - Math.sin(angle) * d.targetRadius;\n });\n\n function positionLoopLink(d) {\n var loopTranslateX = d.x + mainClassSize * 0.96,\n loopTranslateY = d.y - mainClassSize / 5.7 - 5;\n loopLink.attr(\"transform\", \"rotate(270, \" + d.x + \",\" + d.y + \") translate(\" + loopTranslateX + \",\" + loopTranslateY + \")\");\n }\n\n function positionLoopLinkLabels(d) {\n function reposition(sel, i) {\n var foundLoopLinkBackgroundProps =\n $.grep(loopLinkBackgroundProps, function (obj) {\n return obj.idx == i;\n });\n var currentBackgroundHeight = 0;\n if (i > 0) {\n currentBackgroundHeight = parseFloat(2 * i * (foundLoopLinkBackgroundProps[0].height / 1.4));\n }\n\n var loopLinkLabelX = d.x,\n loopLinkLabelY = d.y - mainClassSize * 2.1 - currentBackgroundHeight;\n\n sel\n .attrs({\n x: loopLinkLabelX,\n y: loopLinkLabelY\n })\n .moveToFront();\n }\n\n /**\n * Create a \"View more\" label to depict that the are more reflexive link labels\n * left that could be seen in the side panel when clicking this label.\n *\n * @param labelSel\n * d3 selection of the text label\n * @param backgroundSel\n * d3 selection of the rectangle element background\n * @param predicatesLeft\n * number of predicates left that are collapsed\n */\n function createViewMorePredicatesLabel(labelSel, backgroundSel, predicatesLeft) {\n labelSel\n .classed(\"view-more-preds-label\", true)\n .text(predicatesLeft + \" predicates more ...\");\n if (this.nextSibling !== null) {\n backgroundSel\n .classed(\"view-more-preds-rect\", true);\n }\n }\n\n loopLinkPropertyName.each(function (dd, i) {\n var sel = d3.select(this);\n\n var predicatesLeft = loopLinkPropertyName.size() - NON_COLLAPSED_REFLEXIVE_LINK_LIMIT;\n if (predicatesLeft < 0) {\n reposition(sel, i);\n } else {\n if (i == 0 && !scope.collapseEdges && predicatesLeft > 1) {\n createViewMorePredicatesLabel(sel, d3.select(this.nextSibling), predicatesLeft);\n reposition(sel, i);\n }\n\n if (i < NON_COLLAPSED_REFLEXIVE_LINK_LIMIT) {\n reposition(sel, i);\n } else {\n sel.remove();\n }\n }\n });\n // loopLinkPropertyName.each(function (dd, i) {\n // var sel = d3.select(this);\n // if (i < NON_COLLAPSED_REFLEXIVE_LINK_LIMIT) {\n // reposition(sel, i);\n // } else if (i == NON_COLLAPSED_REFLEXIVE_LINK_LIMIT) {\n // createViewMorePredicatesLabel(sel, d3.select(this.nextSibling));\n // reposition(sel, i);\n // } else {\n // sel.remove();\n // }\n // });\n }\n\n function positionLoopLinkBackgrounds(d) {\n var loopLinkBackgroundY = d.x + mainClassSize * 2,\n loopLinkBackgroundX = d.y - mainClassSize / 1.9;\n\n function reposition(sel, i) {\n var foundLoopLinkBackgroundProps =\n $.grep(loopLinkBackgroundProps, function (obj) {\n return obj.idx == i;\n });\n if (i > 0) {\n loopLinkBackgroundY += parseFloat(i * (foundLoopLinkBackgroundProps[0].height / (i / 1.4)));\n }\n\n sel\n .attrs({\n transform: \"rotate(270, \" + d.x + \",\" + d.y + \") translate(\" + loopLinkBackgroundY + \",\" + loopLinkBackgroundX + \")\",\n width: foundLoopLinkBackgroundProps[0].height,\n height: foundLoopLinkBackgroundProps[0].width\n });\n }\n\n /**\n * Adjust new width of \"View more\" label background and add all reflexive link metadata the this\n * label in order to render them in the side panel.\n *\n * @param allLoopLinkEdges\n * all reflexive links to the current class\n */\n function adjustViewMorePredicatesLabel(allLoopLinkEdges) {\n var viewMoreTextWidth;\n d3.select(\".view-more-preds-label\")\n // make label bold to resemble a collapsed label\n .style(\"font-weight\", \"bold\")\n .each(function (d) {\n // attach all reflexive links to the \"view more\" collapsed predicate\n // because in non collapsed mode the backend does not provide them\n d.target.allEdges = allLoopLinkEdges;\n\n // calculate text width in pixels in order to adjust background width accordingly\n viewMoreTextWidth = this.getComputedTextLength();\n })\n .on(\"click\", onCollapsedPropertyNameClick);\n\n d3.select(\".view-more-preds-rect\")\n // we modify height property instead of width because they are reversed\n // when we repositioned loop link labels\n .attr(\"height\", viewMoreTextWidth + 2 * textPadding);\n }\n\n var allLoopLinkEdges = [];\n loopLinkBackgroundSel.each(function (dd, i) {\n allLoopLinkEdges.push(dd);\n if (i < NON_COLLAPSED_REFLEXIVE_LINK_LIMIT) {\n reposition(d3.select(this), i);\n } else {\n d3.select(this).remove();\n }\n });\n\n adjustViewMorePredicatesLabel(allLoopLinkEdges);\n }\n\n\n function centerClassNode(d) {\n if (!(window.ActiveXObject) && \"ActiveXObject\" in window) {\n Math.log10 = function (x) {\n return Math.log(x) / Math.LN10;\n };\n }\n var absDiff = classNode.attr(\"cx\") - width / 2,\n logOffset = Math.log10(Math.abs(absDiff)) * 0.5;\n d.x += absDiff > 0 ? -logOffset : logOffset;\n return d.x;\n }\n\n node\n .each(function (d) {\n if (d.classPosition === \"main\" && !angular.isUndefined(loopLink)) {\n positionLoopLink(d);\n positionLoopLinkLabels(d);\n positionLoopLinkBackgrounds(d);\n }\n\n if (d.objectPropClassUri !== selectedRdfUri) {\n d3.select(this)\n .attr(\"cx\", function (d) {\n // pushes the main class circle to the centre\n if (d.classPosition === \"main\") {\n return centerClassNode(d);\n }\n return d.x;\n })\n .attr(\"cy\", function (d) {\n return d.y;\n });\n }\n });\n\n\n rdfClassName\n .attr(\"x\", function (d) {\n return d.x;\n })\n .attr(\"y\", function (d) {\n return d.y;\n })\n .moveToFront();\n\n\n linkRect\n .filter(function (d) {\n return d.objectPropNodeClassUri !== selectedRdfUri;\n })\n .attr(\"x\", function (d) {\n if (d.target.x > d.source.x) {\n return (d.source.x + (d.target.x - d.source.x) / 2);\n } else {\n return (d.target.x + (d.source.x - d.target.x) / 2);\n }\n })\n .attr(\"y\", function (d) {\n if (d.target.y > d.source.y) {\n return (d.source.y + (d.target.y - d.source.y) / 2);\n } else {\n return (d.target.y + (d.source.y - d.target.y) / 2);\n }\n })\n .moveToFront();\n\n\n propertyNames\n .attr(\"x\", function (d) {\n if (d.target.x > d.source.x) {\n return (d.source.x + (d.target.x - d.source.x) / 2);\n } else {\n return (d.target.x + (d.source.x - d.target.x) / 2);\n }\n })\n .attr(\"y\", function (d) {\n if (d.target.y > d.source.y) {\n return (d.source.y + (d.target.y - d.source.y) / 2);\n } else {\n return (d.target.y + (d.source.y - d.target.y) / 2);\n }\n })\n .moveToFront();\n\n\n objectPropClassName\n .attr(\"x\", function (d) {\n if (d.classPosition === \"right\") {\n return d.x + otherClassSize * 1.2;\n } else {\n return d.x - otherClassSize * 1.2;\n }\n })\n .attr(\"y\", function (d) {\n return d.y;\n })\n .moveToFront();\n }\n\n force.on(\"tick\", tick)\n\n }\n });\n\n let isDragged = false;\n\n function dragStart(event, d) {\n force.stop();\n d.fx = event.x;\n d.fy = event.y;\n d3.select(this).classed(\"selected\", true);\n\n }\n\n // Update the subject (dragged node) position during drag.\n function dragged(event, d) {\n isDragged = true;\n\n force.alphaTarget(0).restart();\n d.fx = event.x;\n d.fy = event.y;\n }\n\n // Restore the target alpha so the simulation cools after dragging ends.\n // Unfix the subject position now that it’s no longer being dragged.\n function dragEnd(event, d) {\n d.fx = null;\n d.fy = null;\n d3.select(this).classed(\"selected\", false);\n if (isDragged) {\n force.alpha(0.2).restart();\n isDragged = false;\n } else {\n force.restart();\n }\n }\n\n }\n}\n"],"names":["domainRangeGraphDirective","$rootScope","$window","$repositories","GraphDataRestService","$location","LocalStorageAdapter","LSKeys","$timeout","toastr","ONTO_RED","ONTO_GREEN","ONTO_BLUE","NON_COLLAPSED_REFLEXIVE_LINK_LIMIT","restrict","template","scope","showPredicatesInfoPanel","selectedPredicate","collapseEdges","link","timer","width","mainClassSize","otherClassSize","datatypeSize","labelFontSize","basicArrowStrokeWidth","svg","d3","append","attr","on","force","drag","subject","d","event","stop","fx","x","fy","y","this","classed","isDragged","alpha","restart","alphaTarget","defs","attrs","id","viewBox","refX","refY","markerUnits","markerWidth","markerHeight","orient","fill","class","cssRules","SVG","Export","getCSSRules","$","imgSrc","generateBase64ImageSource","href","download","getActiveRepository","legendBackgroundWidth","legendBackgroundHeight","legendCellGroup","height","style","sourceX","targetX","legendTextX","legendLabelFontSize","classNodeTextY","cx","cy","r","text","classNodeY","objectNodeTextY","datatypeNodeY","datatypeNodeTextY","basicPropertyArrowY","x1","y1","x2","y2","absUrl","implicitPropArrowY","collapsedPropArrowY","generateLegend","selectedRdfUri","search","uri","classNodeLabel","name","collapsed","getDomainRangeData","success","response","status","headers","domainRangeGraphData","error","window","set","DOMAIN_RANGE_WENT_BACK","onpopstate","state","$broadcast","$watch","angular","isUndefined","DOMAIN_RANGE_COLLAPSE_EDGES","get","switchEdgeMode","remove","graph","_","cloneDeep","nodes","links","strength","distance","linkGroup","selectAll","data","enter","styleArrowsInCollapsedMode","sel","loopLink","loopLinkEdgeCount","each","objectPropNodeClassUri","propertyType","targetRadius","targetNodeEdgeCount","implicit","loopLinkSize","previousPropertyNameSelection","disableCollapsedPredicateLabelHightlighting","isEmptyObject","background","onCollapsedPropertyNameClick","previousSibling","stopPropagation","ready","bind","propertyNames","test","open","encodeURIComponent","linkRect","calculatedWidth","getBBox","textPadding","calculatedHeight","translateX","nodeGroup","node","filter","objectPropClassUri","classPosition","objectPropClassName","call","reloadDomainRangeGraphView","$apply","select","parentNode","D3","Text","calcFontSize","rdfClassName","classNode","loopLinkBackgroundSel","loopLinkPropertyName","loopLinkBackgroundProps","i","push","idx","tick","e","k","positionLoopLinkBackgrounds","loopLinkBackgroundY","loopLinkBackgroundX","allLoopLinkEdges","dd","foundLoopLinkBackgroundProps","grep","obj","parseFloat","transform","reposition","viewMoreTextWidth","target","allEdges","getComputedTextLength","adjustViewMorePredicatesLabel","source","targetY","pushEdgesToLeftAndRight","angle","Math","atan2","cos","sin","loopTranslateX","loopTranslateY","positionLoopLink","currentBackgroundHeight","loopLinkLabelX","loopLinkLabelY","moveToFront","predicatesLeft","size","labelSel","backgroundSel","nextSibling","createViewMorePredicatesLabel","positionLoopLinkLabels","ActiveXObject","log10","log","LN10","absDiff","logOffset","abs","centerClassNode","renderDomainRangeGraph","$on","cancel","module","constant","directive","$inject"],"ignoreList":[],"sourceRoot":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export const __webpack_esm_id__=39518;export const __webpack_esm_ids__=[14319,39518,49342,78618];export const __webpack_esm_modules__={14319(e,t,n){n.d(t,{Ds:()=>r,VH:()=>i,nj:()=>s,vH:()=>o});const r=[{id:"empty",name:"No inference"},{id:"rdfs-optimized",name:"RDFS (Optimized)"},{id:"rdfs",name:"RDFS"},{id:"rdfsplus-optimized",name:"RDFS-Plus (Optimized)"},{id:"owl-horst-optimized",name:"OWL-Horst (Optimized)"},{id:"owl-horst",name:"OWL-Horst"},{id:"owl2-ql-optimized",name:"OWL2-QL (Optimized)"},{id:"owl2-ql",name:"OWL2-QL"},{id:"owl-max-optimized",name:"OWL-Max (Optimized)"},{id:"owl-max",name:"OWL-Max"},{id:"owl2-rl-optimized",name:"OWL2-RL (Optimized)"},{id:"owl2-rl",name:"OWL2-RL"}],i={graphdbRepo:"graphdb",free:"free",eeWorker:"worker",eeMaster:"master",ontop:"ontop",se:"se",fedx:"fedx"},o=new RegExp("^[a-zA-Z0-9-_]+$"),s=new RegExp("^[0-9]+$")},19935(e,t,n){n.d(t,{A:()=>s}),n(62979);var r=n(93462);const i={dispatch:r.dispatch,pointer:r.pointer};var o=o||{};o.Text=function(){function e(e,t,n,r){n=n||10;var i=t/3;return"string"==typeof e?(i*=10/(e.substring(0,t/3).length+1.5),i+=1,e.match(/[\u0900-\u0DFF\u1100-\u11FF\u2E80-\u2EFF\u3000-\u9FFF]/)&&(i*=.6),i<n&&(i=n),Math.round(i)):(i<n&&(i=n),Math.round(i))}return{calcFontSizeRaw:e,calcFontSize:function(t,n,r,i){return e(t,n,r)+"px"},getTextWithElipsisIfNeeded:function(e,t){return"string"==typeof e&&e.length>t?e.substring(0,t-3)+"...":e}}}(),o.Transition={fadeIn:function(e,t){e.style("opacity",0).transition().duration(t).style("opacity",1)},fadeOut:function(e,t){e.style("opacity",1).transition().duration(t).style("opacity",0)}},o.Click=function(){function e(e,t,n){return function(){var r=n.apply(t,arguments);return r===t?e:r}}return{delayDblClick:function(){var t=i.dispatch("click","dblclick");return function(t,n){let r,i=1,o=arguments.length;for(;++i<o;)r=arguments[i],t[r]=e(t,n,n[r]);return t}(function(e){var n,r=null;e.on("mousedown",function(){n=i.pointer(document.body),new Date}),e.on("mouseup",function(e,o){var s,a,c;a=n,c=i.pointer(document.body),Math.sqrt(Math.pow(a[0]-c[0],2),Math.pow(a[1]-c[1],2))>5||(r?(window.clearTimeout(r),r=null,t.call("dblclick",e,e,o)):r=window.setTimeout((s=e,function(){t.call("click",s,s,o),r=null}),250))})},t,"on")}}}();const s=o},39518(e,t,n){n(82493),n(96e3),n(18148);var r=n(19935),i=n(75468),o=n(93462),s=(n(32150),n(14319)),a=n(78618),c=n(6418),l=n(72155),d=n(57154);function p(e,t,n,p,u,f,h,g,m,y,v,x,S,I,w,k,L,b,C,T,N,P){const A=(0,d.service)(d.SecurityContextService),M=(0,d.service)(d.RepositoryContextService);e.languageChanged=!1,e.propertiesObj={},e.propertiesObj.items=[],e.propertiesQueryObj={},e.propertiesQueryObj.query="",e.propertiesSearchPlaceholder=C.instant("visual.search.instance.placeholder"),e.propertiesNotFiltered=[],e.searchVisible=!1,e.nodeSelected=!1,e.queryResultsMode=!1,e.embedded=g.search().embedded,e.openedNodeInfoPanel=void 0,e.invalidLimit=!1,e.INVALID_LINKS_MSG=C.instant("sidepanel.invalid.limit.links.msg"),e.INVALID_LINKS_TOOLTIP=C.instant("sidepanel.invalid.limit.links.tooltip"),e.datasource=void 0,e.adapterContainer={adapter:{remain:!0}},e.hasInitedRepository=!1,e.defaultSettings={linksLimit:20,includeInferred:!0,sameAsState:!0,truncateNodeLabels:!0,languages:["en"],showLinksText:!0,preferredTypes:[],rejectedTypes:[],preferredPredicates:[],rejectedPredicates:["http://dbpedia.org/property/logo","http://dbpedia.org/property/hasPhotoCollection","http://dbpedia.org/property/website","http://dbpedia.org/property/homepage","http://dbpedia.org/ontology/thumbnail","http://xmlns.com/foaf/0.1/depiction","http://xmlns.com/foaf/0.1/homepage","http://xmlns.com/foaf/0.1/mbox","http://dbpedia.org/ontology/wikiPage*","http://dbpedia.org/property/wikiPage*","http://factforge.net/*"],preferredTypesOnly:!1,preferredPredicatesOnly:!1,includeSchema:!0},e.saveSettings=_.cloneDeep(e.defaultSettings),e.defaultGraphConfig={id:"default",name:"Easy graph",startMode:"search"},t.key="",e.onopen=e.onclose=()=>angular.noop(),e.goToHome=()=>{z();const{config:e,...t}=g.search();g.path("/graphs-visualizations").search(t)},e.shouldShowSettings=()=>e.configLoaded&&e.configLoaded.id===e.defaultGraphConfig.id,e.shouldDisableSameAs=()=>{const t=$("#sameAsCheck");return e.settings&&!e.settings.includeInferred&&t.prop("checked")&&(t.prop("checked",!1),e.settings.sameAsState=!1),e.settings&&!e.settings.includeInferred},e.propertiesFilterFunc=t=>t.key.toLowerCase().indexOf(e.propertiesQueryObj.query.toLowerCase())>=0,e.toggleMoreInfo=e=>{angular.element(e.currentTarget).parent().next().toggle(200),angular.element(e.currentTarget).children("span").toggleClass("ri-arrow-down-s-line").toggleClass("ri-arrow-up-s-line")},e.copyToClipboard=e=>{v.openCopyToClipboardModal(e)},e.resetSettings=()=>{e.settings=_.cloneDeep(e.defaultSettings),e.validateLinksLimit(),B()},e.changeLimit=t=>{let n=e.settings.linksLimit+t;n<1&&(n=1),n>1e3&&(n=1e3),e.settings.linksLimit=n},e.validateLinksLimit=()=>{e.invalidLimit=!s.nj.test(e.settings.linksLimit)},e.showSettings=()=>{e.showInfoPanel=!0,e.showFilter=!0,e.showNodeInfo=!1,e.showPredicates=!1,e.saveSettings?e.settings=_.cloneDeep(e.saveSettings):e.settings=_.cloneDeep(e.defaultSettings),B()},e.updateSettings=()=>{e.invalidLimit?p.error(e.INVALID_LINKS_TOOLTIP,e.INVALID_LINKS_MSG):(e.saveSettings=e.settings,e.saveSettings.languages=_.map(e.saveSettings.languagesMap,function(e){return e.text}),e.saveSettings.preferredTypes=_.map(e.saveSettings.preferredTypesMap,function(e){return e.text}),e.saveSettings.rejectedTypes=_.map(e.saveSettings.rejectedTypesMap,function(e){return e.text}),e.saveSettings.preferredPredicates=_.map(e.saveSettings.preferredPredicatesMap,function(e){return e.text}),e.saveSettings.rejectedPredicates=_.map(e.saveSettings.rejectedPredicatesMap,function(e){return e.text}),e.rootNodeIri?U(e.rootNodeIri):e.queryResultsMode&&g.search().query?q(g.search().query,g.search().sameAs,g.search().inference):"query"===e.configLoaded.startMode&&X(e.configLoaded),F(),e.showInfoPanel=!1,e.showFilter=!1,I.set(w.GRAPHS_VIZ,e.saveSettings))},e.getGraphConfigs=t=>{L.getGraphConfigs().success(function(n){e.graphConfigs=n,t&&t()}).error(function(e){p.error(getError(e),C.instant("graphexplore.error.graph.configs.short.msg"))})},e.findConfigById=function(t){return t===e.defaultGraphConfig.id?e.defaultGraphConfig:$.grep(e.graphConfigs,function(e){return e.id===t})[0]},e.easyGraphSearch=t=>{e.configLoaded=e.defaultGraphConfig,e.openUri(t)},e.deleteConfig=t=>{v.openSimpleModal({title:C.instant("common.confirm"),message:C.instant("graphexplore.delete.graph",{configName:t.name}),warning:!0}).result.then(function(){L.deleteGraphConfig(t).success(function(){e.getGraphConfigs(),e.refreshSavedGraphs()}).error(function(e){p.error(getError(e),C.instant("graphexplore.error.cannot.delete.config"))})})},e.goToGraphConfig=e=>{const t={config:e.id,[d.REPOSITORY_ID_PARAM]:M.getSelectedRepository().id};j(t,{config:e}),z(),X(e)},e.replaceIRIWithPrefix=t=>{const n=e.namespaces,r=_.findLast(n,function(e){return 0===t.indexOf(e.uri)});return r?r.prefix+":"+t.substring(r.uri.length):t};const R=[];R.push(t.$on("$translateChangeSuccess",function(){e.INVALID_LINKS_MSG=C.instant("sidepanel.invalid.limit.links.msg"),e.INVALID_LINKS_TOOLTIP=C.instant("sidepanel.invalid.limit.links.tooltip"),e.propertiesSearchPlaceholder=C.instant("visual.search.instance.placeholder")})),R.push(N.onAutocompleteEnabledUpdated(t=>{e.isAutocompleteEnabled=t})),R.push(M.onSelectedRepositoryChanged(t=>{t?P.getNamespaces(t.id).then(t=>{e.repositoryNamespaces=t,e.namespaces=t.namespaces}).catch(e=>{const t=getError(e);p.error(t,C.instant("error.getting.namespaces.for.repo"))}):e.repositoryNamespaces=new c.u})),R.push(e.$on("repositoryIsSet",function(t,n){const r=n||{newRepo:!1};r.newRepo&&(e.hasInitedRepository=!1),me(!!r.newRepo),r.newRepo&&(z(),$(".graph-visualization svg").empty(),g.search().query&&(e.goToHome(),W()))})),R.push(t.$watch(()=>t.key,()=>{te=0,_.each(e.propertiesObj.items,function(e){t.key>e&&te++}),ne++})),R.push(e.$watch("propertiesObj.items",()=>{angular.isDefined(e.propertiesObj.items)&&e.propertiesObj.items.length>0&&u(function(){e.adapterContainer.adapter.reload()},500)}));let O=!1,E=0;function G(e){O&&e.stopPropagation()}document.addEventListener("keydown",G,!0),e.$on("$destroy",()=>{R.forEach(e=>e()),document.removeEventListener("keydown",G,!0),window.onpopstate=null});const j=(t,n)=>{e.embedded&&(t.embedded=!0),g.search(t),n.skipOnPopState=!0,g.state(n)},z=()=>{e.searchVisible=!1,e.nodeSelected=!1,e.configLoaded=null,e.queryResultsMode=!1,e.lastSavedGraphName=null,e.lastSavedGraphId=null,e.shared=!1,e.numberOfPinnedNodes=0,re={},ie=0},D=()=>T.isActive()?e.defaultSettings:e.saveSettings,F=()=>{D().showLinksText?o.selectAll("svg .link-wrapper text").style("display","block"):o.selectAll("svg .link-wrapper text").style("display","none")},B=()=>{e.settings.languagesMap=_.map(e.settings.languages,function(e){return{text:e}}),e.settings.preferredTypesMap=_.map(e.settings.preferredTypes,function(e){return{text:e}}),e.settings.rejectedTypesMap=_.map(e.settings.rejectedTypes,function(e){return{text:e}}),e.settings.preferredPredicatesMap=_.map(e.settings.preferredPredicates,function(e){return{text:e}}),e.settings.rejectedPredicatesMap=_.map(e.settings.rejectedPredicates,function(e){return{text:e}})},U=()=>{e.rootNodeIri&&e.$broadcast("onRootNodeChange",e.rootNodeIri)},W=()=>{g.search().query?(e.searchVisible=!1,e.queryResultsMode=!0,q(g.search().query,g.search().sameAs,g.search().inference)):e.$on("onRootNodeChange",function(t,n){e.loading=!0;const r=D();angular.isDefined(n)&&(e.rootNodeIri=n,b.getInstanceNode({iri:n,config:e.configLoaded?e.configLoaded.id:e.defaultGraphConfig.id,languages:e.shouldShowSettings()?r.languages:[],includeInferred:r.includeInferred,sameAsState:r.sameAsState}).then(function(t){e.nodeSelected=!0,e.searchVisible=!1,null===t.data.types&&(t.data.types="greyColor"),ge=new he;const n=ge.addNode(t.data,de/2,pe/2);le=ce,Ee(n,!0)}).catch(function(t){e.loading=!1,p.error(getError(t),C.instant("graphexplore.error.could.not.load.graph"))}))}),g.search().uri&&e.openUri(g.search().uri,!0),g.search().saved&&k.getSavedGraph(g.search().saved).success(function(t){e.loadSavedGraph(t)}).error(function(e){const t=getError(e);p.error(t,C.instant("graphexplore.error.could.not.open"))})},q=(t,n,r)=>{const i=D(),o=void 0===n?i.sameAsState:!0===n,s=void 0===r?i.includeInferred:!0===r;e.loading=!0,b.updateGraph({query:t,linksLimit:i.linksLimit,languages:e.shouldShowSettings()?i.languages:[],includeInferred:s,sameAsState:o}).then(function(e){Re(e)},function(t){e.loading=!1,p.error(getError(t.data),C.instant("graphexplore.error.cannot.load.graph"))})},K=(e,t)=>{const n=e.split(" ");return t?[n[0],n[1],n[2]].join(">"):[n[0],n[2]].join(">")},V=e=>[e.source.iri,e.target.iri].join(">"),H=e=>{if(e.isTriple){const t=document.getElementById((0,a.hK)(K(e.iri)));if(t&&void 0!==t.__data__.x)return t.__data__.x}return e.x},Z=e=>{if(e.isTriple){const t=document.getElementById((0,a.hK)(K(e.iri)));if(t&&void 0!==t.__data__.y)return t.__data__.y}return e.y},Q=e=>{const t=e.trim().split(" ");return`<<<${t[0]}> <${t[1]}> <${t[2]}>>>`},J=e=>{const t=e.source.isTriple?K(e.source.iri,!0):e.source.iri,n=e.target.isTriple?K(e.target.iri,!0):e.target.iri;return(0,a.hK)(`${t}>${n}>marker`)},Y=(e,t)=>{const n=t.map(t=>t[e]);return t.filter((t,r)=>n.indexOf(t[e])===r)},X=t=>{e.configLoaded=t,"search"===t.startMode?e.searchVisible=!0:"node"===t.startMode&&t.startIRI?u(function(){e.openUri(t.startIRI,!0)},0):"query"===t.startMode&&t.startGraphQuery&&(e.loading=!0,L.loadGraphForConfig(t,t.startQueryIncludeInferred,D().linksLimit,t.startQuerySameAs).then(function(e){Re(e)},function(t){e.loading=!1,p.error(getError(t),C.instant("graphexplore.error.graph.load"))}))},ee=function(){var t,n;g.search().config?(t=g.search().config,n=W,t===e.defaultGraphConfig.id?X(e.defaultGraphConfig):L.getConfig(t).then(e=>{X(e),n()}).catch(e=>{p.error(getError(e),C.instant("graphexplore.error.could.not.load.config",{configId:t}))})):g.search().query||g.search().uri?(X(e.defaultGraphConfig),W()):W()};S.onpopstate=function(t){t.state&&t.state.skipOnPopState||(z(),t.state&&(t.state.config?(X(t.state.config),t.state.uri&&e.openUri(t.state.uri,!0)):t.state.savedGraph&&e.loadSavedGraph(t.state.savedGraph,!0)))},e.embedded&&(g.search().query||g.search().uri||g.search().config||g.search().saved)&&(e.noGoHome=!0);let te=0,ne=0,re={},ie=0;const oe=16,se=o.zoom().scaleExtent([.1,10]);let ae;const ce=o.zoomIdentity.translate(0,-70).scale(1);se.on("zoom",function(e){T.isActive()||(le=e.transform,ae.attr("transform",le))});let le=ce;const de=1e3,pe=1e3;let ue,fe;function he(){this.nodes=[],this.links=[],this.tripleNodes=new Map,this.tripleLinksCopy=new Map,this.addNode=function(e,t,n){return e.x=t,e.y=n,this.nodes.push(e),e},this.computeConnectedness=function(){const e={},t={};_.each(this.links,function(n){const r=n.source.iri,i=n.target.iri,o=_.min([r,i])+"|"+_.max([r,i]);t[o]||(t[o]=1,e[r]=(e[r]||0)+1,e[i]=(e[i]||0)+1)}),_.each(this.links,function(t){e[t.source.iri]>1&&e[t.target.iri]>1?t.connectedness=Math.min(5,Math.max(e[t.source.iri],e[t.target.iri])-1):t.connectedness=0})},this.addAndMatchLinks=function(e){const t=this.nodes;Array.prototype.push.apply(this.links,function(e,t){return _.map(e,function(e){let n,r;n=e.isTripleSource?Fe(e.source):_.find(t,function(t){return t.iri===e.source}),r=e.isTripleTarget?Fe(e.target):_.find(t,function(t){return t.iri===e.target});const i={source:n,target:r,predicates:e.predicates};if(e.isTripleSource||e.isTripleTarget){const e=`${i.source.isTriple?K(i.source.iri):i.source.iri}>${i.target.isTriple?K(i.target.iri):i.target.iri}`;if(ge.tripleLinksCopy.has(e)){const t=ge.tripleLinksCopy.get(e);return t[0].predicates.push(...i.predicates),t.push(i),ge.tripleLinksCopy.set(e,t),null}ge.tripleLinksCopy.set(e,[i])}return i})}(e,t));for(const e of ge.tripleLinksCopy.keys())1===ge.tripleLinksCopy.get(e).length&&ge.tripleLinksCopy.delete(e);this.links=this.links.filter(e=>null!==e),this.computeConnectedness()};const t=function(e,t){return n(e,t).length};function n(e,t){return _.filter(t,function(t){return t.source.iri===e.iri||t.target.iri===e.iri})}this.countLinks=t,this.linksTypes=function(e,t){const r=n(e,t),i=_.map(r,function(t){return t.source.iri===e.iri?t.target.types:t.source.types});return _.uniq(_.flatten(i))},this.linksPredicates=function(e,t){const r=n(e,t),i=_.map(r,function(e){return e.predicates});return _.uniq(_.flatten(i))},this.removeTriples=function(e){const t=[];this.tripleNodes.size>0&&e.forEach(e=>{this.tripleNodes.has(e)&&(this.tripleNodes.delete(e),this.links=_.reject(this.links,function(n){const r=e.split(">"),i=K(n.source.iri),o=K(n.target.iri);if(i===e&&ge.tripleNodes.delete(o)){const e=o.split(">");t.push({source:e[0],target:e[1]})}const s=i===e||o===e||n.source.iri===r[0]&&n.target.iri===r[1];return s&&(ge.tripleLinksCopy.delete(`${i}>${o}`),ge.tripleLinksCopy.delete(`${o}>${i}`)),s}))}),t.forEach(e=>{this.links=_.reject(this.links,function(t){return t.source.iri===e.source&&t.target.iri===e.target})})},this.removeNode=function(n){const r=[];this.links=_.reject(this.links,function(e){const t=e.source.iri===n.iri||e.target.iri===n.iri;return t&&(e.target.isTriple&&r.push(K(e.target.iri)),e.source.isTriple||e.target.isTriple||r.push([e.source.iri,e.target.iri].join(">"))),t}),this.removeTriples(r);const i=this.links;this.nodes=_.reject(this.nodes,function(e){return 0===t(e,i)}),0===this.nodes.length&&(e.nodeSelected=!1),this.computeConnectedness()},this.removeNodeLeafLinks=function(e){const r=[];let i=this.links;this.links=_.reject(this.links,function(o){let s=o.source.iri===e.iri&&1===t(o.target,i)&&!o.target.isTriple||o.target.iri===e.iri&&1===t(o.source,i)&&!o.source.isTriple;if(!s){let r;if(o.source.iri!==e.iri||2!==t(o.target,i)||o.target.isTriple?o.target.iri!==e.iri||2!==t(o.source,i)||o.source.isTriple||(r=n(o.source,i)):r=n(o.target,i),!r)return!1;s=(r[0].source.iri===e.iri||r[0].target.iri)&&(r[1].source.iri===e.iri||r[1].target.iri)}return s&&(o.target.isTriple&&r.push(K(o.target.iri)),o.source.isTriple||o.target.isTriple||r.push([o.source.iri,o.target.iri].join(">"))),s}),this.removeTriples(r),i=this.links,this.nodes=_.reject(this.nodes,function(n){return 0===t(n,i)&&n.iri!==e.iri}),this.computeConnectedness()},this.addTriple=function(e,t,n){e.x=t,e.y=n,e.weight=0;const r=K(e.iri);if(this.tripleNodes.has(r)){const t=this.tripleNodes.get(r);t.push(e),this.tripleNodes.set(r,t)}else e.weight=10,this.tripleNodes.set(r,[e])},this.copyState=function(){const e=_.map(this.nodes,function(e){return{iri:e.iri,isTriple:e.isTriple,size:e.size,labels:_.cloneDeep(e.labels),types:_.cloneDeep(e.types),rdfRank:e.rdfRank,x:e.x,y:e.y,fixed:e.fixed}}),t=JSON.stringify(Array.from(this.tripleNodes.entries())),n=JSON.stringify(Array.from(this.tripleLinksCopy.entries()));return{nodes:e,links:_.map(this.links,function(e){return{source:e.source.iri,isTripleSource:e.source.isTriple,target:e.target.iri,isTripleTarget:e.target.isTriple,predicates:e.predicates}}),tripleNodes:t,tripleLinksCopy:n,colorIndex:ie,type2color:re,transform:le}},this.restoreState=function(t){e.nodeSelected=!0,e.searchVisible=!1,this.nodes=_.cloneDeep(t.nodes),this.tripleNodes=t.tripleNodes?new Map(JSON.parse(t.tripleNodes)):new Map,this.links=[],this.addAndMatchLinks(t.links),this.tripleLinksCopy=t.tripleLinksCopy?new Map(JSON.parse(t.tripleLinksCopy)):new Map,_.each(this.nodes,function(t){t.fixed&&e.numberOfPinnedNodes++}),angular.isDefined(t.colorIndex)&&angular.isDefined(t.type2color)&&(ie=t.colorIndex,re=_.cloneDeep(t.type2color)),angular.isDefined(t.transform)&&(le=o.zoomIdentity.translate(t.transform.x,t.transform.y).scale(t.transform.k)),Te()}}e.datasource={get:function(t,n,r){return y.initLazyList(t,n,r,te,e.propertiesObj.items)},revision:function(){return ne}},e.showInfoPanel=!1;let ge=new he;function me(t){!n.getActiveRepository()||e.hasInitedRepository&&!t||(e.hasInitedRepository=!0,t||e.getGraphConfigs(ee))}e.addedTag=function(t){return t.text.indexOf(":")<0?(p.warning(C.instant("graphexplore.absolute.prefixed.iri")),null):(t.text=function(e,t){if(!/^<?(http|urn).*>?/.test(e)){const n=e.split(":"),r=n[0],i=n[1];if(!angular.isUndefined(i)){const e=f.getNamespaceUriForPrefix(t,r);if(e)return e+i}}return e}(t.text,e.namespaces),e.pageslideExpanded=!0,t)},e.validateTag=function(e,t,n){if(e.text.indexOf(":")<0)return n?p.warning(C.instant("graphexplore.absolute.prefixed.iri.option"),t):p.warning(C.instant("graphexplore.absolute.prefixed.iri"),t),!1;const r=e.text.indexOf("*");if(r>=0){if(!n)return p.warning(C.instant("graphexplore.wildcards.not.allowed"),t),!1;if(r<e.text.length-1)return p.warning(C.instant("graphexplore.wildcards.last.char"),t),!1}return!0},e.getTagClass=function(e){return e.endsWith("*")?"tag-item-wildcard":null},e.getActiveRepository=function(){return n.getActiveRepository()},e.isLicenseValid=function(){return(0,d.service)(d.LicenseContextService).getLicenseSnapshot().valid};const ye=500,ve=1.75,xe=o.scaleLinear().domain([0,9]).range(["hsl(0, 100%, 75%)","hsl(360, 90%, 82%)"]).interpolate(o.interpolateHslLong),Se=o.scaleLinear().domain([0,9]).range(["hsl(180, 50%, 75%)","hsl(540, 40%, 82%)"]).interpolate(o.interpolateHslLong);e.getColor=function(e){angular.isUndefined(re[e])&&(re[e]=ie,ie++);const t=re[e];return t>39?"#c2c2c2":t%2==0?xe(t/2):Se(t/2)};const Ie=o.forceX(de/2).strength(.005),we=o.forceY(pe/2).strength(.005),ke=o.forceSimulation().force("x",Ie).force("y",we),Le=o.select(".main-container .graph-visualization").append("svg").attr("viewBox","0 0 "+de+" "+pe).attr("preserveAspectRatio","xMidYMid meet");let be=0,Ce=0;const _e=new function(){this.state=!1,this.setLoadingState=function(e){this.state=e},this.getLoadingState=function(){return this.state},this.init=function(e,t){o.select(t).append("circle").attr("cx",function(){return e.x}).attr("cy",function(){return e.y}).attr("class","loader-container").attr("r",function(){return e.size}).style("fill","fff").style("opacity","0.7"),o.select(t).append("image").attr("xlink:href","js/angular/templates/loader/ot-loader.svg?v=3.3.1").attr("x",function(){return e.x-e.size+5}).attr("y",function(){return e.y-e.size}).attr("width",function(){return 2*e.size}).attr("height",function(){return 2*e.size}).attr("class","node-loader")}};function Te(t){o.selectAll("svg g").remove(),o.selectAll(".d3-tip").remove(),o.selectAll(".menu-events").remove(),ae=Le.append("g").attr("class","nodes-container").attr("transform",function(){return angular.isDefined(le)&&!t?le:""});const n=(0,i.A)().attr("class","d3-tip").customPosition(function(){const e=ue.getBoundingClientRect();return{top:e.bottom+10+"px",left:e.left-30+"px"}}).html(function(t){let n="";return t.fixed&&(n+='<i class="ri-pushpin-line"></i> '),t.types.length>0?n+=t.types.map(t=>`<div> · ${e.replaceIRIWithPrefix(t)}</div>`).join(""):n+=`<i>${C.instant("visual.node.tooltip.no_types")}</i>`,n}),s=function(e){let t="";return t+=_.join(_.map(e.predicates,function(t,n){if(0===n)return Ue(t);if(n<10)return" · "+Ue(t);if(10===n){const t=function(e){return e.predicates.length-10}(e),n=t>1?t+" predicates":t+" predicate";return" · "+C.instant("graphexplore.tip.text",{textToShow:n})}}),""),t};let c,d;const f=(0,i.A)().attr("class","d3-tip").customPosition(function(e){const t=c.getBoundingClientRect(),n=function(e){const t=s(e),n=document.createElement("canvas").getContext("2d");return n.font="13px Arial",e.predicates.length<10?n.measureText(t).width:n.measureText(t).width/2}(e);return{top:t.top-30+"px",left:t.left-30+"px",width:n+"px"}}).html(function(e){return s(e)});let h;const g=function(){u.cancel(h),u.cancel(be),ue=null,n.hide(),Ce=u(function(){Ge()},500)};Le.call(n),Le.call(f);let m=Le.selectAll(".link"),y=Le.selectAll(".node");const v=o.forceCollide(e=>e.size+5).strength(.5),x=o.forceManyBody().strength(-300),S=o.forceCenter(de/2,pe/2);ke.nodes(ge.nodes).force("charge",x).force("collide",v).force("center",S).force("link",o.forceLink(ge.links).distance(function(e){return e.source.isTriple||e.target.isTriple?0:function(e){const t=$("<span></span>"),n=e.predicates[0].split("/"),r=n[n.length-1];t.addClass("predicate-text").text(r),$("body").append(t);const i=t.width()+2*e.source.size+2*e.target.size+50;return t.remove(),.75*i}(e)+30*e.connectedness})),ae.append("defs").selectAll("marker").data(ge.links).enter().append("marker").attr("class","arrow-marker").attr("id",function(e){return J(e)}).attr("viewBox","0 -5 10 10").attr("refX",function(e){return e.target.isTriple?11:e.target.size+11}).attr("refY",0).attr("markerWidth",10).attr("markerHeight",10).attr("orient","auto").append("path").attr("d","M0,-5L10,0L0,5 L10,0 L0, -5"),m=ae.selectAll(".link").data(ge.links).enter().append("g").attr("class","link-wrapper").attr("id",function(e){return(0,a.hK)(V(e))}).append("line").attr("class","link").style("stroke-width",1).style("fill","transparent").style("marker-end",function(e){return`url(#${J(e)})`});const I=ae.selectAll(".link-wrapper").append("text").text(function(e){return Be(e)}).attr("class",function(e){return e.predicates.length>1||ge.tripleNodes.has(V(e))?"predicates":"predicate"}).attr("dy","-0.5em").style("text-anchor","middle").style("display",D().showLinksText?"":"none").on("mouseover",function(e,t){e.stopPropagation(),function(e,t){u.cancel(d);const n=c=e.target;u(function(){c===n&&t.predicates.length>1&&f.show(t,c)},300)}(e,t)}).on("mouseout",function(){u.cancel(d),c=null,f.hide()}).on("click",function(t,n){t.stopPropagation(),function(t,n){$e();const r=V(n);if(1===n.predicates.length&&ge.tripleNodes.has(r)){fe=null;const e=ge.tripleNodes.get(r)[0];if(Ae(e,t.currentTarget,t.button)){const t={};t.iri=e.iri,t.pred=Ue(e.iri.split(" ")[1]),ze(t)}return}!function(t){if(e.showNodeInfo=!1,e.showPredicates=t.predicates.length>1,e.showFilter=!1,e.showInfoPanel=!1,fe===t)return e.showNodeInfo=!1,e.showInfoPanel=!1,void(fe=null);fe=t,e.showPredicates&&(e.predicates=_.map(t.predicates,function(e){const n=function(e,t){const n=V(t);return ge.tripleNodes.has(n)?ge.tripleNodes.get(n).findIndex(t=>t.iri.indexOf(e)>=0):-1}(e,t),r=n>-1;return{value:Ue(e),partOfTriple:r,linkId:r?V(t):"",nodeIndex:n}}),e.showInfoPanel=!0)}(n)}(t,n)});let w,k=0,L=null,b=null;const N=function(t,n,r){const i=Array.isArray(r)?r[n]:r;ge.countLinks(t,ge.links)<=D().linksLimit?Ee(t,!1,i):p.info(C.instant("graphexplore.increase.limit"),C.instant("graphexplore.node.at.max")),e.closeInfoPanel()};function P(e,t){let n,r,i,o,s=!0;if("down"===t)n=2*e.size,r=e.size/3,i=.8,o=.3;else if("down-fixed"===t)n=2*e.size,r=e.size,i=.8,o=.66;else if("up"===t)n=e.size/3,r=2*e.size,i=.3,o=.8;else{if("fixed"!==t)return;n=e.size,i=.66,s=!1}let a=ae.selectAll(".node-wrapper").filter(function(t){return t===e}).append("text").text("").classed("icon-any pinned",!0).style("font-size",n+"px").attr("x",function(e){return e.x}).attr("y",function(e){return e.y}).attr("opacity",i);"fixed"!==t&&"down-fixed"!==t||(e.pin=a),s&&(a=a.transition().duration(1e3).style("font-size",function(){return r+"px"}).attr("opacity",o),"down-fixed"!==t&&a.remove())}const A=o.drag().subject(function(e){return e}).on("start",function(e,t){T.isActive()||0===e.sourceEvent.button&&(t.fixedBeforeDrag=t.fixed,t.isBeingDragged=!0,t.beginDragging=!0,Ge(),o.select(e.currentTarget).classed("dragging",!0),ke.alphaTarget(.3).restart())}).on("drag",function(t,n){n.isBeingDragged&&(n.fx=t.x,n.fy=t.y,n.fixed?n.beginDragging&&P(n,"fixed"):(e.numberOfPinnedNodes++,n.fixed=!0,P(n,"down-fixed")),n.pinWasFixed=!0,n.beginDragging=null)}).on("end",function(e,t){t.isBeingDragged&&(t.pinWasFixed&&(t.pinWasFixed=null,o.select(".pinned").remove()),t.isBeingDragged=!1,o.select(e.currentTarget).classed("dragging",!1)),ke.alphaTarget(0)});y=ae.selectAll(".node").data(ge.nodes).enter().append("g").attr("class","node-wrapper").attr("id",function(e){return e.iri}).append("circle").attr("class","node").attr("r",function(e){return e.size}).style("fill",function(t){return"greyColor"===t.types?"c2c2c2":e.getColor(t.types[0])}).on("mouseover",function(t,r){if(!r.isBeingDragged){u.cancel(Ce);const i=t.currentTarget;be=u(()=>{(function(t,n){return!e.showInfoPanel&&((Pe.closeIcon||Pe.expandIcon||Pe.focusIcon||Pe.copyURIIcon)&&Pe.removeIcons(),ke.alpha()<.1&&(Pe.initIcons(t,n.parentNode),ke.stop(),Ne(),!0))})(r,i)&&function(e,t){u.cancel(h);const r=ue=t.target;u(function(){ue===r&&n.show(e,ue)},300)}(r,t)},400)}}).on("mouseout",g).on("click",function(t,n){if(t.button&&0!==t.button)return;const r=t.currentTarget;if(L&&b===r)return u.cancel(L),L=null,void N(n,0,r.parentNode);b=r,g(),e.showPredicates=!1,T.isActive()||(u.cancel(L),L=u(function(){Ae(n,0,t),L=null},40+ye))}).on("touchstart",(e,t)=>function(e){k=0,w=u(function(){k<5&&Me(e),w=null},1e3)}(t)).on("touchmove",function(){k++}).on("touchend",function(){u.cancel(w),w=null}).on("contextmenu",function(t,r){t.shiftKey||(t.preventDefault(),Ge(),e.closeInfoPanel(),r.fixed?(e.numberOfPinnedNodes--,r.fixed=!1,r.fx=null,r.fy=null,P(r,"up"),ke.alpha(1).restart()):(e.numberOfPinnedNodes++,r.fixed=!0,P(r,"down")),function(e){ue&&n.show(e,ue)}(r))}).on("gdb-expand-node",(e,t)=>N(t,0,e.srcElement.parentNode)).on("gdb-show-node-info",(e,t)=>je(t)).call(A);const M=e.saveSettings.truncateNodeLabels?"hidden":"visible",R=ae.selectAll(".node-wrapper").append("foreignObject").style("pointer-events","none").style("overflow",M).attr("width",function(e){return 2*e.size*ve});ae.insert("g").attr("class","menu-events"),(t=>{t.each(function(e){e.fontSize=r.A.Text.calcFontSizeRaw(e.labels[0].label,e.size,oe,!0)}).attr("height",function(e){return 4.2*e.fontSize}).append("xhtml:div").attr("class","node-label-body").classed("truncated-label",e.saveSettings.truncateNodeLabels).style("font-size",function(e){return e.fontSize+"px"}).html(function(e){return l.U.getText(e.labels[0].label).replaceAll("\n","<br>")})})(R),ke.on("tick",function(){m.attr("x1",function(e){return H(e.source)}).attr("y1",function(e){return Z(e.source)}).attr("x2",function(e){return H(e.target)}).attr("y2",function(e){return Z(e.target)}),I.attr("x",function(e){const t=H(e.source),n=H(e.target);return e.x=.5*(t+n)}).attr("y",function(e){const t=Z(e.source),n=Z(e.target);return e.y=.5*(t+n)}).attr("transform",function(e){return"rotate("+function(e,t){const n=H(e.source),r=Z(e.source),i=H(e.target),o=Z(e.target);if(t)return 180*Math.atan2(o-r,i-n)/Math.PI;{const e=180*Math.atan2(o-r,i-n)/Math.PI;return e<=90&&e>=-90?e:(e>0?-1:1)*(180-Math.abs(e))}}(e,e.direction)+", "+e.x+", "+e.y+")"}),y.attr("cx",function(e){return e.x}).attr("cy",function(e){return e.y}),ae.select(".node-loader").attr("x",function(e){return e.x-e.size+3}).attr("y",function(e){return e.y-e.size}),ae.select(".loader-container").attr("cx",function(e){return e.x}).attr("cy",function(e){return e.y}),R.attr("x",function(e){return e.x-e.size*ve}).attr("y",function(e){return e.y-4.2*e.fontSize/2}),o.select(".pinned").attr("x",function(e){return e.x}).attr("y",function(e){return e.y}),Ne()}),angular.isDefined(_e)&&_e.setLoadingState(!1),e.loading&&(e.loading=!1),o.selectAll(".link-wrapper").each(function(){const e=$(this).attr("id").split(">")[0],t=$(this).attr("id").split(">")[1];o.selectAll(".link").each(function(n){const r=(0,a.hK)(n.source.iri),i=(0,a.hK)(n.target.iri);if(r===t&&i===e){let e=r;e+=">",e+=i;const t=document.createTextNode(" ⟶");document.getElementById(e).lastChild.appendChild(t),n.direction="double"}})}),o.selectAll(".d3-actions-tip").remove(),ke.alpha(.3).restart()}function Ne(){t.d3alpha=ke.alpha()}const Pe=new function(){function n(e,t){return"translate("+(t.x-14+(t.size+15)*Math.cos(e*Math.PI/180-Math.PI/2))+","+(t.y-14+(t.size+15)*Math.sin(e*Math.PI/180-Math.PI/2))+")"}this.closeIcon=void 0,this.expandIcon=void 0,this.collapseIcon=void 0,this.focusIcon=void 0,this.copyURIIcon=void 0,this.actionsTip=void 0,this.removeIcons=function(){this.closeIcon.remove("g"),this.expandIcon&&this.expandIcon.remove("g"),this.collapseIcon&&this.collapseIcon.remove("g"),this.focusIcon.remove("g"),this.copyURIIcon.remove("g"),this.closeIcon=void 0,this.expandIcon=void 0,this.collapseIcon=void 0,this.focusIcon=void 0,this.copyURIIcon=void 0,this.expandedState=!1},this.expandedState=!1,this.initIcons=function(r,s){const a=(0,i.A)().attr("class","d3-tip d3-actions-tip").customPosition(function(e,t){const n=t.target.getBoundingClientRect();return{top:n.top-20+"px",left:n.right+10+"px"}}).html(function(e){return e});Le.call(a),r.isExpanded?(this.collapseIcon=o.select(".menu-events").append("g").attr("class","collapse-icon").attr("name","collapse").attr("transform",function(){return n(20,r)}),this.collapseIcon.append("circle").attr("cx",14).attr("cy",14).attr("r",13).style("fill","#eee"),this.collapseIcon.append("path").attr("d","M22.67,12a.59.59,0,0,1-.53.65l-6.88.72H15.2a.59.59,0,0,1-.59-.65l.72-6.88A.58.58,0,0,1,16,5.33a.59.59,0,0,1,.53.65L16,11.11,21.3,5.79a.64.64,0,0,1,.91.91L16.89,12,22,11.49A.59.59,0,0,1,22.67,12ZM12.59,14.75l-6.75.85a.59.59,0,0,0-.51.66.58.58,0,0,0,.66.51l4.95-.62-5.2,5.2a.64.64,0,1,0,.91.91l5.2-5.2L11.23,22a.59.59,0,0,0,.51.66h.07a.59.59,0,0,0,.59-.52l.85-6.75a.59.59,0,0,0-.17-.49A.58.58,0,0,0,12.59,14.75Z").style("fill","var(--gw-primary-base)"),this.collapseIcon.on("click",function(){var e;(e=r).isExpanded=!1,ge.removeNodeLeafLinks(e),Te()}).on("mouseover",function(e){a.show(e.currentTarget.getAttribute("name"),e),u.cancel(be),u.cancel(Ce)}).on("mouseout",function(){a.hide(),Ce=u(function(){Ge()},500)})):(this.expandIcon=o.select(".menu-events").append("g").attr("class","expand-icon").attr("name","expand").attr("transform",function(){return n(20,r)}),this.expandIcon.append("circle").attr("cx",14).attr("cy",14).attr("r",13).style("fill","#eee"),this.expandIcon.append("path").attr("d","M22.37,6.28l-.72,6.88a.59.59,0,0,1-.59.53H21a.59.59,0,0,1-.53-.65L21,7.9l-5.32,5.32a.64.64,0,0,1-.91-.91L20.1,7,15,7.53a.59.59,0,0,1-.12-1.18l6.88-.72a.59.59,0,0,1,.65.65ZM12.89,20.34,7.95,21l5.2-5.2a.64.64,0,0,0-.91-.91L7,20.05l.62-4.95A.59.59,0,0,0,6.48,15l-.85,6.75a.59.59,0,0,0,.59.67h.07L13,21.52a.59.59,0,1,0-.15-1.18Z").style("fill","var(--gw-primary-base)"),this.expandIcon.on("click",function(){Ee(r,!1,s)}).on("mouseover",function(e){a.show(e.currentTarget.getAttribute("name"),e),u.cancel(Ce),u.cancel(be)}).on("mouseout",function(){a.hide(),Ce=u(function(){Ge()},500)})),this.focusIcon=o.select(".menu-events").append("g").attr("class","focus-icon").attr("name","focus").attr("transform",function(){return n(20,r)}),this.focusIcon.append("circle").attr("cx",14).attr("cy",14).attr("r",13).style("fill","#eee"),this.focusIcon.append("path").attr("d","M14.2,23.81a9.8,9.8,0,1,1,6.93-2.87h0A9.74,9.74,0,0,1,14.2,23.81Zm0-18.17a8.37,8.37,0,1,0,5.92,14.29h0A8.37,8.37,0,0,0,14.2,5.64Zm1.42,6.95a2,2,0,1,0,0,2.85A2,2,0,0,0,15.62,12.59Z").style("fill","var(--gw-primary-base)"),this.focusIcon.on("click",function(){t.$broadcast("onRootNodeChange",r.iri)}).on("mouseover",function(e){a.show(e.currentTarget.getAttribute("name"),e),u.cancel(Ce),u.cancel(be)}).on("mouseout",function(){a.hide(),Ce=u(function(){Ge()},500)}),this.copyURIIcon=o.select(".menu-events").append("g").attr("class","ri-links-line").attr("name","link").attr("transform",function(){return n(20,r)}),this.copyURIIcon.append("circle").attr("cx",14).attr("cy",14).attr("r",13).style("fill","#eee"),this.copyURIIcon.append("path").attr("d","M 13.457031 10.164062 C 13.648438 10.164062 13.820312 10.242188 13.941406 10.363281 L 15.492188 11.859375 C 15.984375 12.332031 16.292969 12.992188 16.292969 13.714844 C 16.292969 14.441406 15.984375 15.097656 15.492188 15.574219 L 10.394531 20.496094 C 9.902344 20.972656 9.222656 21.265625 8.472656 21.265625 C 7.71875 21.265625 7.039062 20.972656 6.546875 20.496094 L 4.996094 19 C 4.507812 18.523438 4.203125 17.867188 4.203125 17.144531 C 4.203125 16.421875 4.507812 15.765625 4.996094 15.289062 L 7.542969 12.824219 C 7.667969 12.707031 7.84375 12.628906 8.035156 12.628906 C 8.417969 12.628906 8.726562 12.929688 8.726562 13.300781 C 8.726562 13.484375 8.648438 13.652344 8.523438 13.773438 L 5.976562 16.234375 C 5.738281 16.46875 5.589844 16.792969 5.589844 17.148438 C 5.589844 17.503906 5.738281 17.824219 5.976562 18.058594 L 7.527344 19.566406 C 7.773438 19.792969 8.105469 19.929688 8.472656 19.929688 C 8.835938 19.929688 9.167969 19.792969 9.414062 19.566406 L 14.511719 14.644531 C 14.753906 14.410156 14.90625 14.089844 14.90625 13.730469 C 14.90625 13.375 14.753906 13.054688 14.511719 12.820312 L 12.964844 11.324219 C 12.839844 11.203125 12.761719 11.039062 12.761719 10.855469 C 12.761719 10.488281 13.070312 10.1875 13.449219 10.1875 Z M 17.082031 3.976562 C 17.082031 3.976562 17.085938 3.976562 17.085938 3.976562 C 17.824219 3.976562 18.492188 4.261719 18.980469 4.722656 L 20.535156 6.203125 C 21.042969 6.679688 21.355469 7.34375 21.355469 8.082031 C 21.355469 8.792969 21.058594 9.441406 20.582031 9.914062 L 18.0625 12.402344 C 17.9375 12.527344 17.761719 12.605469 17.566406 12.605469 C 17.183594 12.605469 16.875 12.304688 16.875 11.9375 C 16.875 11.753906 16.949219 11.589844 17.070312 11.46875 L 19.605469 8.984375 C 19.847656 8.75 19.996094 8.429688 19.996094 8.070312 C 19.996094 7.714844 19.847656 7.394531 19.605469 7.160156 L 18.019531 5.667969 C 17.773438 5.445312 17.4375 5.304688 17.070312 5.300781 C 16.703125 5.304688 16.367188 5.453125 16.128906 5.691406 L 11.085938 10.667969 C 10.84375 10.898438 10.695312 11.222656 10.695312 11.578125 C 10.695312 11.933594 10.84375 12.257812 11.085938 12.488281 L 12.675781 13.980469 C 12.804688 14.101562 12.882812 14.273438 12.882812 14.457031 C 12.882812 14.828125 12.574219 15.128906 12.191406 15.128906 C 12.003906 15.128906 11.832031 15.054688 11.707031 14.9375 L 10.140625 13.457031 C 9.636719 12.980469 9.324219 12.316406 9.324219 11.582031 C 9.324219 10.863281 9.621094 10.214844 10.101562 9.742188 L 15.140625 4.765625 C 15.625 4.285156 16.304688 3.980469 17.054688 3.976562 Z M 17.082031 3.976562").style("fill","var(--gw-primary-base)"),this.copyURIIcon.on("click",function(){e.copyToClipboard(r.iri),Ge(),a.hide()}).on("mouseover",function(e){a.show("<div style='text-align: center;'><b>Copy to ClipBoard</b><br>"+r.iri+"</div>",e),u.cancel(Ce),u.cancel(be)}).on("mouseout",function(){a.hide(),Ce=u(function(){Ge()},500)}),this.closeIcon=o.select(".menu-events").append("g").attr("class","close-icon").attr("name","remove").attr("transform",function(){return n(20,r)}),this.closeIcon.append("circle").attr("cx",14).attr("cy",14).attr("r",13).style("fill","#eee"),this.closeIcon.append("path").attr("d","M14.94,14l5.87-5.87a.66.66,0,1,0-.94-.94L14,13.06,8.13,7.19a.66.66,0,0,0-.94.94L13.06,14,7.19,19.87a.66.66,0,1,0,.94.94L14,14.94l5.87,5.87a.66.66,0,1,0,.94-.94Z").style("fill","var(--gw-primary-base)"),this.closeIcon.on("click",function(){Me(r)}).on("mouseover",function(e){a.show(e.currentTarget.getAttribute("name"),e),u.cancel(Ce),u.cancel(be)}).on("mouseout",function(){a.hide(),Ce=u(function(){Ge()},500)}),this.animateMenu(r)},this.animateMenu=function(e){const t=100,r=o.easeSin;let i=0,s=20;this.expandIcon&&this.expandIcon.transition().duration(t).style("opacity",1).ease(r).attr("transform",function(){return n(s,e)}).delay(i+=35),this.collapseIcon&&this.collapseIcon.transition().duration(t).style("opacity",1).ease(r).attr("transform",function(){return n(s,e)}).delay(i+=35),this.copyURIIcon.transition().duration(t).style("opacity",1).ease(r).attr("transform",function(){return s+=30,n(s,e)}).delay(i+=35),this.focusIcon.transition().duration(t).style("opacity",1).ease(r).attr("transform",function(){return s+=30,n(s,e)}).delay(i+=35),this.closeIcon.transition().duration(t).style("opacity",1).ease(r).attr("transform",function(){return s+=30,n(s,e)}).delay(i+=35),this.expandedState=!0}};function Ae(n,r,i){return e.showInfoPanel=!1,e.showPredicates=!1,e.showNodeInfo=!1,i.shiftKey&&(i.ctrlKey||i.metaKey)?(t.$broadcast("onRootNodeChange",n.iri),!1):i.ctrlKey||i.metaKey?(Me(n),!1):void 0!==e.openedNodeInfoPanel&&e.openedNodeInfoPanel===n?(e.pageslideExpanded=!1,e.openedNodeInfoPanel=void 0,!1):(je(n),!0)}function Me(e){ge.removeNode(e),Te()}function Re(t){!function(t){e.nodeSelected=!0,null===t.data.types&&(t.data.types="greyColor"),ge=new he,le=ce}(t),Oe(t)}function Oe(t,n,r){let i=t.data;i=_.filter(i,function(e){return-1===_.findIndex(ge.links,function(t){return e.source===t.source.iri&&e.target===t.target.iri})});const o=[],s=ge.tripleLinksCopy.values();for(let e=0;e<ge.tripleLinksCopy.size;e++)s.next().value.forEach(e=>{o.push(e)});i=_.filter(i,function(e){return-1===_.findIndex(o,function(t){return e.source===t.source.iri&&e.target===t.target.iri})}),i=_.filter(i,function(e){return e.source!==e.target});const a=Y("iri",_.union(_.flatten(_.map(t.data,function(e){return[{iri:e.source,isTriple:e.isTripleSource},{iri:e.target,isTriple:e.isTripleTarget}]})))),c=_.map(ge.nodes,function(e){return{iri:e.iri,isTriple:Boolean(e.isTriple)}}),l=ge.tripleNodes.values();for(let e=0;e<ge.tripleNodes.size;e++)l.next().value.forEach(e=>{c.push({iri:e.iri,isTriple:e.isTriple})});const d=_.reject(a,function(e){return _.some(c,e)});if(0===d.length){const e=a.length>0?a.length-1:0;(r||0===i.length)&&p.info(C.instant("graphexplore.error.node.connections",{count:e})),ge.addAndMatchLinks(i),Te()}else{const t=[],r=[],o=D();_.forEach(d,function(n,i){t.push(b.getInstanceNode({iri:n.isTriple?Q(n.iri):n.iri,config:e.configLoaded.id,languages:e.shouldShowSettings()?o.languages:[],includeInferred:o.includeInferred,sameAsState:o.sameAsState}).then(function(e){r[i]=e.data}))}),h.all(t).then(function(){_.forEach(r,function(e,t){const i=2*Math.PI*t/r.length,o=(n?n.x:0)+Math.cos(i)*pe/3,s=(n?n.y:0)+Math.sin(i)*pe/3;e.isTriple?ge.addTriple(e,o,s):ge.addNode(e,o,s)}),ge.addAndMatchLinks(i),n&&(n.isExpanded=!0),Te()})}}function Ee(t,n,r){if(_e.getLoadingState())return;_e.init(t,r);const i=D(),o=t.iri;b.getInstanceNodeLinks({iri:o,linksLimit:i.linksLimit,includeInferred:i.includeInferred,config:e.configLoaded.id,preferredTypes:e.shouldShowSettings()?i.preferredTypes:[],rejectedTypes:e.shouldShowSettings()?i.rejectedTypes:[],preferredPredicates:e.shouldShowSettings()?i.preferredPredicates:[],rejectedPredicates:e.shouldShowSettings()?i.rejectedPredicates:[],preferredTypesOnly:e.shouldShowSettings()?i.preferredTypesOnly:[],preferredPredicatesOnly:e.shouldShowSettings()?i.preferredPredicatesOnly:[],languages:e.shouldShowSettings()?i.languages:[],sameAsState:i.sameAsState,includeSchema:i.includeSchema}).then(function(e){Oe(e,t,n)},function(t){const n=getError(t.data);p.error(n,C.instant("graphexplore.error.exploring.node")),e.loading=!1,_e.setLoadingState(!1)})}function Ge(){angular.isDefined(Pe)&&Pe.expandedState&&Pe.removeIcons()}function je(t){ke.stop(),e.openedNodeInfoPanel=t,e.showNodeInfo=!0,e.showFilter=!1,e.showPredicates=!1,e.nodeLabels=t.labels,e.nodeTypes=t.types,e.rdfRank=t.rdfRank,e.nodeIri=t.iri,e.resourceType=t.isTriple?"triple":"uri",e.encodedIri=t.isTriple?encodeURIComponent(Q(t.iri)):encodeURIComponent(t.iri),e.showInfoPanel=!0,e.rdfsLabel=t.labels[0].label,e.rdfsComment=t.comment,e.expanded=!1,e.propertiesQueryObj.query="",e.dataNodeKeysQuery="";const n=D();b.getProperties({iri:t.isTriple?Q(t.iri):t.iri,config:e.configLoaded.id,languages:e.shouldShowSettings()?n.languages:[],includeInferred:n.includeInferred,sameAsState:n.sameAsState,rejectedPredicates:e.shouldShowSettings()?n.rejectedPredicates:[]}).then(function(t){e.data=_.mapKeys(t.data,function(t,n){return e.replaceIRIWithPrefix(n)}),e.propertiesObj.items=[],_.forEach(e.data,function(t,n){e.propertiesObj.items.push({key:n,value:t})}),e.nodeImage=void 0,e.propertiesNotFiltered=e.propertiesObj.items;const n=_.find(e.propertiesObj.items,function(e){return"image"===e.key});n&&(e.nodeImage=n.value[0].v),e.propertiesObj.items=_.reject(e.propertiesObj.items,function(e){return"image"===e.key}),e.propertiesNotFiltered=e.propertiesObj.items},function(e){p.warning(getError(e.data),"Error")})}function ze(e){De("predicate","var(--gw-primary-dark)",e),De("predicates","var(--gw-primary-dark)",e);const t=document.getElementsByClassName("link");t&&_.each(t,function(t){const n=t.__data__;(n.source.iri.indexOf(e.iri)>=0||n.target.iri.indexOf(e.iri)>=0)&&(t.style.stroke="var(--gw-primary-dark)",t.style.strokeWidth=4)});const n=document.getElementsByClassName("arrow-marker");n&&_.each(n,function(t){const n=t.__data__;(n.source.iri.indexOf(e.iri)>=0||n.target.iri.indexOf(e.iri)>=0)&&(t.style.stroke="var(--gw-primary-dark)",t.__data__.target.isTriple||t.setAttribute("refX","23"))})}function De(e,t,n){const r=document.getElementsByClassName(e);r&&_.each(r,function(e){const r=e.__data__;n?((r.source.iri.indexOf(n.iri)>=0||r.target.iri.indexOf(n.iri)>=0)&&(e.style.fill=t),K(n.iri)===V(r)&&(e.textContent=n.pred,e.style.fill=t),n.oppLinkIRI&&n.oppLinkIRI===V(r)&&(e.textContent=n.oppTriplePred,e.style.fill=t)):(e.style.fill=t,e.textContent=Be(r))})}function $e(){_.each(e.predicates,function(e){const t=document.getElementById(e.linkId+e.nodeIndex);t&&(t.style.fontWeight="normal")});const t=document.getElementsByClassName("link");t&&_.each(t,function(e){e.style.stroke="#999",e.style.strokeWidth=1}),De("predicate",""),De("predicates","");const n=document.getElementsByClassName("arrow-marker");n&&_.each(n,function(e){e.style.stroke="#999",e.__data__.target.isTriple||e.setAttribute("refX","59")})}function Fe(e){const t=K(e);if(ge.tripleNodes.has(t))return ge.tripleNodes.get(t).find(t=>t.iri===e)}function Be(e){return e.predicates.length>1?e.predicates.length+" predicates":Ue(e.predicates[0])}function Ue(t){const n=e.replaceIRIWithPrefix(t);return n.length===t.length?t.split("/")[t.split("/").length-1]:n}e.toggleSidePanel=function(){e.pageslideExpanded=!e.pageslideExpanded},e.closeInfoPanel=function(){e.pageslideExpanded=!1,e.openedNodeInfoPanel=void 0,e.predicates=[],fe=null,u(function(){e.showInfoPanel=!1})},e.clickLink=function(t){if(ge.tripleNodes.has(t.linkId)){$e();const n=ge.tripleNodes.get(t.linkId)[t.nodeIndex];je(n),e.showPredicates=!0;const r=document.getElementById(t.linkId+t.nodeIndex);r&&(r.style.fontWeight="bold");const i={},o=ge.tripleLinksCopy.values();for(let e=0;e<ge.tripleLinksCopy.size;e++){const e=o.next().value;e.length>1&&e.every(t=>t.source.iri===n.iri?(i.iri=e[0].source.iri,t.target.isTriple&&(i.oppLinkIRI=K(t.target.iri),i.oppTriplePred=Ue(t.target.iri.split(" ")[1])),i.pred=Ue(n.iri.split(" ")[1]),1===t.predicates.length&&(i.linkPred=t.predicates[0]),!1):t.target.iri!==n.iri||(i.iri=e[0].target.iri,t.source.isTriple&&(i.oppLinkIRI=K(t.source.iri),i.oppTriplePred=Ue(t.source.iri.split(" ")[1])),i.pred=Ue(n.iri.split(" ")[1]),1===t.predicates.length&&(i.linkPred=t.predicates[0]),!1))}i.iri||(i.iri=n.iri,i.pred=Ue(n.iri.split(" ")[1])),ze(i)}},e.splitPredicate=function(e){return e.split("/")[e.split("/").length-1]},e.getActiveRepository=function(){return n.getActiveRepository()},e.isLoadingLocation=function(){return n.isLoadingLocation()},e.hasActiveLocation=function(){return n.hasActiveLocation()},e.rotate=function(e){Ge();const t=10*(e?1:-1)*Math.PI/180,n=Math.cos(t),r=Math.sin(t),i=de/2,s=pe/2;o.selectAll(".node-wrapper").each(function(e){e.x=i+(n*(e.x-i)+r*(e.y-s)),e.y=s+(-r*(e.x-i)+n*(e.y-s)),e.fixed&&(e.fx=e.x,e.fy=e.y)}),ke.alpha(1).restart()},e.openUri=function(t,n){if(!n){const n={};e.configLoaded.id!==e.defaultGraphConfig.id&&(n.config=e.configLoaded.id),n.uri=t,n[d.REPOSITORY_ID_PARAM]=M.getSelectedRepository().id,j(n,{uri:t,config:e.configLoaded})}e.$broadcast("onRootNodeChange",t)},e.saveOrUpdateGraph=function(){const t=JSON.stringify(ge.copyState()),n={id:e.lastSavedGraphId,name:e.lastSavedGraphName,data:t,shared:e.shared,repositoryId:M.getSelectedRepository().id};n.id?e.saveGraphModal("update",n):e.saveGraphModal("new",n)},e.renameSavedGraph=function(t){e.saveGraphModal("rename",{id:t.id,name:t.name,config:t.config,shared:t.shared})};e.saveGraphModal=function(t,n,r){const i=x.open({templateUrl:"js/angular/graphexplore/templates/modal/save-graph.html",controller:"SaveGraphModalCtrl",resolve:{data:function(){return{mode:t,graph:n,graphExists:r,shared:n.shared}}}});E++,O=!0,i.result.then(function(t){if(t.restart)e.saveGraphModal(t.mode,t.graph,!1);else switch(t.mode){case"new":!function(t){e.configLoaded&&(t.config=e.configLoaded.id),k.addNewSavedGraph(t).success(function(n,r,i){e.lastSavedGraphName=t.name,e.lastSavedGraphId=i()["x-saved-graph-id"],e.shared=t.shared,e.refreshSavedGraphs(),p.success(C.instant("graphexplore.saved.graph",{name:t.name}))}).error(function(n,r){if(422===r)e.saveGraphModal("new",t,!0);else{const e=getError(n);p.error(e,C.instant("graphexplore.error.cannot.create.graph"))}})}(t.graph);break;case"update":case"rename":n=t.graph,k.editSavedGraph(n).success(function(){e.lastSavedGraphName=n.name,e.shared=n.shared,e.refreshSavedGraphs(),p.success(C.instant("graphexplore.saved.graph.was.edited",{name:n.name}))}).error(function(e){const t=getError(e);p.error(t,C.instant("graphexplore.error.cannot.edit"))})}var n}).finally(()=>{E--,E<=0&&(O=!1,E=0)})},e.refreshSavedGraphs=function(){k.getSavedGraphs().success(function(t){e.savedGraphs=t}).error(function(e){const t=getError(e);p.error(t,C.instant("graphexplore.error.getting.saved.graphs"))})},e.loadSavedGraph=function(t,n){t.owner?(e.lastSavedGraphName=t.name,e.lastSavedGraphId=t.id,e.shared=t.shared,e.configLoaded=e.findConfigById(t.config)):(e.lastSavedGraphName=null,e.lastSavedGraphId=null,e.shared=t.shared),e.configLoaded||(e.configLoaded=e.defaultGraphConfig);const r={...g.search(),saved:t.id,[d.REPOSITORY_ID_PARAM]:M.getSelectedRepository().id};ge.restoreState(JSON.parse(t.data)),n||j(r,{savedGraph:t})},e.copyToClipboardSavedGraph=function(t){const n=new URL(window.location.href);n.searchParams.set("saved",t.id),n.searchParams.set(d.REPOSITORY_ID_PARAM,M.getSelectedRepository().id),e.copyToClipboard(n.toString())},e.deleteSavedGraph=function(t){v.openSimpleModal({title:C.instant("common.confirm"),message:C.instant("graphexplore.confirm.delete.graph",{graphName:t.name}),warning:!0}).result.then(function(){!function(t){k.deleteSavedGraph(t).success(function(){e.refreshSavedGraphs(),p.success(C.instant("graphexplore.saved.graph.was.deleted",{name:t.name}))}).error(function(e){const t=getError(e);p.error(t,C.instant("graphexplore.error.cannot.delete"))})}(t)})},e.openIRI=function(t,n){return n.shiftKey?e.$broadcast("onRootNodeChange",t):window.open(t,"_blank"),!1},e.togglePinAllNodes=function(){Ge();const t=angular.isUndefined(e.numberOfPinnedNodes)||e.numberOfPinnedNodes<=0;e.numberOfPinnedNodes=0,o.selectAll(".node").each(function(n){n.fixed=t,t?(e.numberOfPinnedNodes++,n.fx=n.x,n.fy=n.y):(n.fx=null,n.fy=null)}),ke.alpha(1).restart()},$("body").on("keydown",function(t){!T.isActive()&&"input"!==t.target.nodeName&&e.nodeSelected&&(37===t.keyCode?e.rotate(!0):39===t.keyCode&&e.rotate(!1))}),e.getLiteralFromPropValue=function(e){return e.substring(e.indexOf(":")+1)};let We=!1;We||(Le.append("rect").attr("width",10*de).attr("height",10*pe).attr("x",-(10*de-de)/2).attr("y",-(10*pe-pe)/2).style("fill","none").style("pointer-events","all").call(se).on("click",function(e){e.stopPropagation(),Ge(),ke.stop()}),We=!0),(t=>{const n=t.appSettings;e.defaultSettings.includeInferred=n.DEFAULT_INFERENCE,e.defaultSettings.sameAsState=n.DEFAULT_INFERENCE&&n.DEFAULT_SAMEAS,e.defaultSettings.includeSchema=n.DEFAULT_VIS_GRAPH_SCHEMA;const r=I.get(w.GRAPHS_VIZ);if(r&&"object"==typeof r)try{e.saveSettings=r,void 0===e.saveSettings.includeSchema&&(e.saveSettings.includeSchema=e.defaultSettings.includeSchema,e.saveSettings.rejectedPredicates=[...e.saveSettings.rejectedPredicates,...e.defaultSettings.rejectedPredicates].unique())}catch{e.saveSettings=_.cloneDeep(e.defaultSettings),I.set(w.GRAPHS_VIZ,e.saveSettings)}else e.saveSettings=_.cloneDeep(e.defaultSettings)})(A.getAuthenticatedUser()),me()}function u(e,t,n,r){switch(e.mode=n.mode,e.graph=_.cloneDeep(n.graph),e.graphExists=n.graphExists,e.mode){case"new":e.title=r.instant("graphexplore.create.new.graph"),e.okButtonText=r.instant("common.create.btn");break;case"update":e.title=r.instant("graphexplore.update"),e.okButtonText=r.instant("common.save.btn");break;case"rename":e.title=r.instant("graphexplore.rename"),e.okButtonText=r.instant("common.save.btn")}e.ok=function(){e.form.$valid&&(e.graph.name=i(e.graph.name),t.close({graph:e.graph,mode:e.mode}))},e.saveNew=function(){e.graph.name=i(e.graph.name)+" (new)",t.close({graph:e.graph,mode:"new",restart:!0})},e.cancel=function(){t.dismiss("cancel")};const i=e=>e.replace(/\s+/g," ").trim()}angular.module("graphdb.framework.graphexplore.controllers.graphviz",["ui.scroll.jqlite","ui.scroll","toastr","ui.bootstrap","ngTagsInput","graphdb.framework.utils.localstorageadapter","graphdb.core.services.workbench-context","graphdb.framework.core.services.rdf4j.repositories"]).controller("GraphsVisualizationsCtrl",p).controller("SaveGraphModalCtrl",u).config(["$uibTooltipProvider",function(e){e.options({appendToBody:!0})}]),p.$inject=["$scope","$rootScope","$repositories","toastr","$timeout","ClassInstanceDetailsService","$q","$location","$jwtAuth","UiScrollService","ModalService","$uibModal","$window","LocalStorageAdapter","LSKeys","SavedGraphsRestService","GraphConfigRestService","GraphDataRestService","$translate","GuidesService","WorkbenchContextService","RDF4JRepositoriesService"],u.$inject=["$scope","$uibModalInstance","data","$translate"]},62979(e,t,n){var r,i;r=[n(93462)],i=function(e){function t(e,t){return e.each(function(){var e=t.apply(this,arguments),n=select(this);for(var r in e)n.attr(r,e[r])})}function r(e,t){for(var n in t)e.attr(n,t[n]);return e}return void 0===e&&(e=n(93462)),e.selection.prototype.attrs=function(e){return("function"==typeof e?t:r)(this,e)},e.selection.prototype.moveToFront=function(){return this.each(function(){e.select(this.parentNode.appendChild(this))})},e.selection.prototype.moveToBack=function(){return this.each(function(){const e=this.parentNode.firstChild;e&&this.parentNode.insertBefore(this,e)})},e}.apply(t,r),void 0===i||(e.exports=i)},75468(e,t,n){n.d(t,{A:()=>o});var r=n(93462);const i={select:r.select,selection:r.selection},o=function(){var e=function(){return"n"},t=function(){return[0,0]},n=function(){return" "},r=u(),o=null,s=null,a=null,c=null;function l(e){var t;o="svg"===(t=(t=e).node()).tagName.toLowerCase()?t:t.ownerSVGElement,s=o.createSVGPoint(),document.body.appendChild(r)}l.show=function(){var r=Array.prototype.slice.call(arguments);r[r.length-1]instanceof SVGElement&&(a=r.pop());var i,o=n.apply(this,r),s=t.apply(this,r),u=e.apply(this,r),h=f(),g=p.length,m=document.documentElement.scrollTop||document.body.scrollTop,y=document.documentElement.scrollLeft||document.body.scrollLeft,v=c.apply(this,r);for(h.html(o).style("opacity",1).style("pointer-events","all");g--;)h.classed(p[g],!1);const x=r.filter(e=>e instanceof Event);return i=d.get(u).apply(this,x),v?Object.keys(v).forEach(function(e){h.style(e,v[e])}):h.classed(u,!0).style("top",i.top+s[0]+m+"px").style("left",i.left+s[1]+y+"px"),l},l.hide=function(){return f().style("opacity",0).style("pointer-events","none"),l},l.attr=function(e,t){if(arguments.length<2&&"string"==typeof e)return f().attr(e);var n=Array.prototype.slice.call(arguments);return i.selection.prototype.attr.apply(f(),n),l},l.style=function(e,t){if(arguments.length<2&&"string"==typeof e)return f().style(e);var n=Array.prototype.slice.call(arguments);return i.selection.prototype.style.apply(f(),n),l},l.direction=function(t){return arguments.length?(e=null==t?t:g(t),l):e},l.offset=function(e){return arguments.length?(t=null==e?e:g(e),l):t},l.html=function(e){return arguments.length?(n=null==e?e:g(e),l):n},l.customPosition=function(e){return arguments.length?(c=null==e?e:g(e),l):c},l.destroy=function(){return r&&(f().remove(),r=null),l};var d=new Map(Object.entries({n:function(e){var t=h(e);return{top:t.n.y-r.offsetHeight,left:t.n.x-r.offsetWidth/2}},s:function(e){var t=h(e);return{top:t.s.y,left:t.s.x-r.offsetWidth/2}},e:function(e){var t=h(e);return{top:t.e.y-r.offsetHeight/2,left:t.e.x}},w:function(e){var t=h(e);return{top:t.w.y-r.offsetHeight/2,left:t.w.x-r.offsetWidth}},nw:function(e){var t=h(e);return{top:t.nw.y-r.offsetHeight,left:t.nw.x-r.offsetWidth}},ne:function(e){var t=h(e);return{top:t.ne.y-r.offsetHeight,left:t.ne.x}},sw:function(e){var t=h(e);return{top:t.sw.y,left:t.sw.x-r.offsetWidth}},se:function(e){var t=h(e);return{top:t.se.y,left:t.e.x}}})),p=d.keys();function u(){var e=i.select(document.createElement("div"));return e.style("position","absolute").style("top",0).style("opacity",0).style("pointer-events","none").style("box-sizing","border-box"),e.node()}function f(){return null===r&&(r=u(),document.body.appendChild(r)),i.select(r)}function h(e){for(var t=a||e.target;void 0===t.getScreenCTM&&"undefined"===t.parentNode;)t=t.parentNode;var n={},r=t.getScreenCTM(),i=t.getBBox(),o=i.width,c=i.height,l=i.x,d=i.y;return s.x=l,s.y=d,n.nw=s.matrixTransform(r),s.x+=o,n.ne=s.matrixTransform(r),s.y+=c,n.se=s.matrixTransform(r),s.x-=o,n.sw=s.matrixTransform(r),s.y-=c/2,n.w=s.matrixTransform(r),s.x+=o,n.e=s.matrixTransform(r),s.x-=o/2,s.y-=c/2,n.n=s.matrixTransform(r),s.y+=c,n.s=s.matrixTransform(r),n}function g(e){return"function"==typeof e?e:function(){return e}}return l}},78618(e,t,n){n.d(t,{G4:()=>o,Sn:()=>s,hK:()=>i});var r=n(98980);const i=e=>e.replace(/[()']/g,""),o=e=>"string"==typeof e?"true"===e:Boolean(e),s=e=>e?(0,r.upperFirst)(e.toLowerCase()):e}};
|
|
2
|
+
//# sourceMappingURL=39518.323713e6d7824200b4aa.bundle.js.map
|