graphdb-workbench 3.4.0-TR3 → 3.4.0-TR5

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.
Files changed (152) hide show
  1. package/dist/19057.a52dd7b0e356e884a792.bundle.js +3 -0
  2. package/dist/19057.a52dd7b0e356e884a792.bundle.js.map +1 -0
  3. package/dist/23236.1490d29a6e40f437885b.bundle.js +2 -0
  4. package/dist/23236.1490d29a6e40f437885b.bundle.js.map +1 -0
  5. package/dist/24125.0fd6b7797f2630fe59c6.bundle.js +2 -0
  6. package/dist/24125.0fd6b7797f2630fe59c6.bundle.js.map +1 -0
  7. package/dist/24690.79fd696f08f3ebbb1c6f.bundle.js +2 -0
  8. package/dist/24690.79fd696f08f3ebbb1c6f.bundle.js.map +1 -0
  9. package/dist/{3395.8452312923e6a77d2ffd.bundle.js → 3395.8dfba5922c8aad6d860c.bundle.js} +2 -2
  10. package/dist/3395.8dfba5922c8aad6d860c.bundle.js.map +1 -0
  11. package/dist/34985.8ef74b317fc8bff7e8e1.bundle.js +2 -0
  12. package/dist/34985.8ef74b317fc8bff7e8e1.bundle.js.map +1 -0
  13. package/dist/50244.69475a004173b61902a8.bundle.js +2 -0
  14. package/dist/50244.69475a004173b61902a8.bundle.js.map +1 -0
  15. package/dist/60447.4fd8b4ce9b95b98deade.bundle.js +2 -0
  16. package/dist/60447.4fd8b4ce9b95b98deade.bundle.js.map +1 -0
  17. package/dist/63842.68a1c5451a236b8ede97.bundle.js +2 -0
  18. package/dist/63842.68a1c5451a236b8ede97.bundle.js.map +1 -0
  19. package/dist/{64709.9f6594f730a4b54d6fc9.bundle.js → 64709.93e616541b4b18e88892.bundle.js} +2 -2
  20. package/dist/{64709.9f6594f730a4b54d6fc9.bundle.js.map → 64709.93e616541b4b18e88892.bundle.js.map} +1 -1
  21. package/dist/{65677.038185dcd07233e07f52.bundle.js → 65677.77bf484a0da0eec48f0b.bundle.js} +2 -2
  22. package/dist/{65677.038185dcd07233e07f52.bundle.js.map → 65677.77bf484a0da0eec48f0b.bundle.js.map} +1 -1
  23. package/dist/66574.cae68c94f87ba873b322.bundle.js +2 -0
  24. package/dist/66574.cae68c94f87ba873b322.bundle.js.map +1 -0
  25. package/dist/{80933.ef5e85af9b19067ee89b.bundle.js → 80933.ddbcb2688f7d93009c04.bundle.js} +2 -2
  26. package/dist/{80933.ef5e85af9b19067ee89b.bundle.js.map → 80933.ddbcb2688f7d93009c04.bundle.js.map} +1 -1
  27. package/dist/{82917.e537e5e649be4a5a0e20.bundle.js → 82917.e234e043395ff0b7d48f.bundle.js} +2 -2
  28. package/dist/82917.e234e043395ff0b7d48f.bundle.js.map +1 -0
  29. package/dist/{86099.acb890d2b6e1d841c4c3.bundle.js → 86099.0abe4f96d87490fe332e.bundle.js} +2 -2
  30. package/dist/{86099.acb890d2b6e1d841c4c3.bundle.js.map → 86099.0abe4f96d87490fe332e.bundle.js.map} +1 -1
  31. package/dist/{90418.0a737513ff59bfee423a.bundle.js → 90418.ee1af575862a64c12457.bundle.js} +2 -2
  32. package/dist/90418.ee1af575862a64c12457.bundle.js.map +1 -0
  33. package/dist/{96972.896f91c5874df70d14bb.bundle.js → 96972.fc25a13bb1bc69ad785c.bundle.js} +2 -2
  34. package/dist/96972.fc25a13bb1bc69ad785c.bundle.js.map +1 -0
  35. package/dist/9923.74654347e1812dd0f90a.bundle.js +3 -0
  36. package/dist/9923.74654347e1812dd0f90a.bundle.js.map +1 -0
  37. package/dist/api/models/application-settings/application-settings.d.ts +8 -1
  38. package/dist/api/models/application-settings/test/application-settings.spec.d.ts +1 -0
  39. package/dist/api/ontotext-workbench-api.js +1 -1
  40. package/dist/api/ontotext-workbench-api.js.map +1 -1
  41. package/dist/api/services/application-settings/application-settings-storage.service.d.ts +6 -0
  42. package/dist/api/services/runtime-configuration/runtime-configuration-context.service.d.ts +20 -0
  43. package/dist/api/services/theme/theme.service.d.ts +14 -3
  44. package/dist/css/explore.css +1 -1
  45. package/dist/css/lib/ontotext-yasgui-web-component.css +1 -1
  46. package/dist/css/user.css +1 -1
  47. package/dist/i18n/locale-en.json +4 -1
  48. package/dist/i18n/locale-fr.json +6 -3
  49. package/dist/index.html +9 -9
  50. package/dist/js/angular/clustermanagement/templates/cluster-nodes-configuration.html +1 -1
  51. package/dist/js/angular/core/directives/autocomplete/templates/autocomplete.html +1 -1
  52. package/dist/js/angular/core/directives/dynamic-form/templates/dynamic-form.html +1 -1
  53. package/dist/js/angular/core/directives/operations-statuses-monitor/templates/operations-statuses-monitor.html +1 -1
  54. package/dist/js/angular/core/directives/rdfresourcesearch/templates/rdfResourceSearchTemplate.html +1 -1
  55. package/dist/js/angular/core/directives/shuttle-multiselect/templates/shuttle-multiselect.html +1 -1
  56. package/dist/js/angular/core/directives/yasgui-component/templates/yasgui-component.html +2 -2
  57. package/dist/js/angular/core/templates/cookie-policy/cookie-consent.html +1 -1
  58. package/dist/js/angular/core/templates/cookie-policy/cookie-policy.html +1 -1
  59. package/dist/js/angular/core/templates/editable-content/editable-content.html +1 -1
  60. package/dist/js/angular/core/templates/markdown-content/markdown-content.html +1 -1
  61. package/dist/js/angular/core/templates/search-resource-input.html +1 -1
  62. package/dist/js/angular/graphql/templates/create-graphql-endpoint.html +2 -2
  63. package/dist/js/angular/graphql/templates/graphql-endpoint-management.html +1 -1
  64. package/dist/js/angular/graphql/templates/graphql-playground.html +2 -2
  65. package/dist/js/angular/graphql/templates/modal/endpoint-configuration-modal.html +1 -1
  66. package/dist/js/angular/graphql/templates/modal/endpoint-generation-failure-result-modal.html +1 -1
  67. package/dist/js/angular/graphql/templates/modal/import-endpoint-definition-modal.html +1 -1
  68. package/dist/js/angular/security/templates/user.html +13 -16
  69. package/dist/js/angular/ttyg/templates/agent-list.html +1 -1
  70. package/dist/js/angular/ttyg/templates/agent-select-menu.html +1 -1
  71. package/dist/js/angular/ttyg/templates/chat-item-detail.html +1 -1
  72. package/dist/js/angular/ttyg/templates/chat-list.html +1 -1
  73. package/dist/js/angular/ttyg/templates/chat-panel.html +1 -1
  74. package/dist/js/angular/ttyg/templates/modal/agent-instructions-explain-modal.html +1 -1
  75. package/dist/js/angular/ttyg/templates/modal/agent-settings-modal.html +3 -3
  76. package/dist/js/angular/ttyg/templates/modal/external-integration-configuration-modal.html +1 -1
  77. package/dist/js/angular/ttyg/templates/no-agents-view.html +1 -1
  78. package/dist/js/angular/ttyg/templates/ttyg.html +1 -1
  79. package/dist/{legacyWorkbench.77dd92ce99a75c4ee674.js → legacyWorkbench.cb08fa647eed6afe60e8.js} +3 -3
  80. package/dist/{legacyWorkbench.77dd92ce99a75c4ee674.js.map → legacyWorkbench.cb08fa647eed6afe60e8.js.map} +1 -1
  81. package/dist/{main.6db145d35852092cde59.js → main.1198f08d1cc597b94cbc.js} +3 -3
  82. package/dist/main.1198f08d1cc597b94cbc.js.map +1 -0
  83. package/dist/pages/aclmanagement.html +1 -1
  84. package/dist/pages/autocomplete.html +1 -1
  85. package/dist/pages/choose-repository-type.html +1 -1
  86. package/dist/pages/cluster-management/clusterInfo.html +3 -3
  87. package/dist/pages/create-index.html +5 -3
  88. package/dist/pages/dependencies.html +3 -3
  89. package/dist/pages/domainRangeInfo.html +2 -2
  90. package/dist/pages/edit.html +1 -1
  91. package/dist/pages/explore.html +72 -75
  92. package/dist/pages/export.html +1 -1
  93. package/dist/pages/find.html +1 -1
  94. package/dist/pages/graph-config/saveGraphConfig.html +8 -8
  95. package/dist/pages/graphs-visualizations.html +7 -7
  96. package/dist/pages/guides.html +1 -1
  97. package/dist/pages/home.html +1 -1
  98. package/dist/pages/import.html +2 -2
  99. package/dist/pages/jdbc-create.html +1 -1
  100. package/dist/pages/jdbc.html +1 -1
  101. package/dist/pages/monitor/backup-and-restore.html +1 -1
  102. package/dist/pages/monitor/queries.html +1 -1
  103. package/dist/pages/monitor/resources.html +1 -1
  104. package/dist/pages/namespaces.html +2 -2
  105. package/dist/pages/plugins.html +1 -1
  106. package/dist/pages/rdfClassHierarchyInfo.html +7 -7
  107. package/dist/pages/rdfrank.html +2 -2
  108. package/dist/pages/repositories.html +1 -1
  109. package/dist/pages/repository.html +1 -1
  110. package/dist/pages/similarity-indexes.html +1 -1
  111. package/dist/pages/sparql-editor.html +1 -1
  112. package/dist/pages/sparql-template-create.html +1 -1
  113. package/dist/pages/sparql-templates.html +1 -1
  114. package/dist/pages/ux-test1.html +2 -2
  115. package/dist/pages/webapi.html +2 -2
  116. package/dist/res/swagger5/index.html +11 -11
  117. package/dist/shared-components/cjs/onto-graph-explore-split-button.cjs.entry.js +1 -1
  118. package/dist/shared-components/collection/components/onto-graph-explore-split-button/onto-graph-explore-split-button.js +1 -1
  119. package/dist/shared-components/esm/onto-graph-explore-split-button.entry.js +1 -1
  120. package/dist/shared-components/shared-components/p-cd5cc683.entry.js +1 -0
  121. package/dist/shared-components/shared-components/shared-components.esm.js +1 -1
  122. package/package.json +1 -1
  123. package/dist/19057.c644732712725c1a6d3d.bundle.js +0 -3
  124. package/dist/19057.c644732712725c1a6d3d.bundle.js.map +0 -1
  125. package/dist/23236.36dabf6a87d61107178d.bundle.js +0 -2
  126. package/dist/23236.36dabf6a87d61107178d.bundle.js.map +0 -1
  127. package/dist/24125.fc41760fdae44b0480c8.bundle.js +0 -2
  128. package/dist/24125.fc41760fdae44b0480c8.bundle.js.map +0 -1
  129. package/dist/24690.d4ed1c24eded4eb0da85.bundle.js +0 -2
  130. package/dist/24690.d4ed1c24eded4eb0da85.bundle.js.map +0 -1
  131. package/dist/3395.8452312923e6a77d2ffd.bundle.js.map +0 -1
  132. package/dist/34985.a6b52e4b364c7efd3046.bundle.js +0 -2
  133. package/dist/34985.a6b52e4b364c7efd3046.bundle.js.map +0 -1
  134. package/dist/50244.35b37c35412261341adb.bundle.js +0 -2
  135. package/dist/50244.35b37c35412261341adb.bundle.js.map +0 -1
  136. package/dist/60447.fd8b44d92859a3481ad7.bundle.js +0 -2
  137. package/dist/60447.fd8b44d92859a3481ad7.bundle.js.map +0 -1
  138. package/dist/63842.e62b43ae192a642531c6.bundle.js +0 -2
  139. package/dist/63842.e62b43ae192a642531c6.bundle.js.map +0 -1
  140. package/dist/66574.8591bdbb6983d8d07c04.bundle.js +0 -2
  141. package/dist/66574.8591bdbb6983d8d07c04.bundle.js.map +0 -1
  142. package/dist/82917.e537e5e649be4a5a0e20.bundle.js.map +0 -1
  143. package/dist/90418.0a737513ff59bfee423a.bundle.js.map +0 -1
  144. package/dist/96972.896f91c5874df70d14bb.bundle.js.map +0 -1
  145. package/dist/9923.6963c46c47330a6ba2d0.bundle.js +0 -3
  146. package/dist/9923.6963c46c47330a6ba2d0.bundle.js.map +0 -1
  147. package/dist/main.6db145d35852092cde59.js.map +0 -1
  148. package/dist/shared-components/shared-components/p-1b143527.entry.js +0 -1
  149. /package/dist/{19057.c644732712725c1a6d3d.bundle.js.LICENSE.txt → 19057.a52dd7b0e356e884a792.bundle.js.LICENSE.txt} +0 -0
  150. /package/dist/{9923.6963c46c47330a6ba2d0.bundle.js.LICENSE.txt → 9923.74654347e1812dd0f90a.bundle.js.LICENSE.txt} +0 -0
  151. /package/dist/{legacyWorkbench.77dd92ce99a75c4ee674.js.LICENSE.txt → legacyWorkbench.cb08fa647eed6afe60e8.js.LICENSE.txt} +0 -0
  152. /package/dist/{main.6db145d35852092cde59.js.LICENSE.txt → main.1198f08d1cc597b94cbc.js.LICENSE.txt} +0 -0
@@ -1,2 +1,2 @@
1
- export const __webpack_esm_id__=86099;export const __webpack_esm_ids__=[86099];export const __webpack_esm_modules__={86099(e,t,n){var a=n(82667),r=n(89687),i=n(9508),s=n(44482),c=n(66886),o=(n(38473),n(57154));function l(e,t,n,l,d,h,u,f,p,g,x,m){return{restrict:"AE",template:'<div id="classChart"></div>',scope:{classHierarchyData:"=",flattenedClassNames:"=",selectedClass:"=",currentSliderValue:"=",showClassInfoPanel:"=",showExternalElements:"=",hidePrefixes:"=",currentBrowserLimit:"="},link:function(y,A,v){!function(y){let A=!1;let v,S;const C=s.pack().size([780,780]),R=s.scaleLinear().domain([0,4]).range(["hsl(19, 70%, 90%)","hsl(19, 70%, 50%)"]).interpolate(s.interpolateHcl),E=s.select("#classChart").insert("svg:svg","h2").attr("viewBox","0 0 800 800").attr("preserveAspectRatio","xMidYMid meet").on("dblclick.zoom",null);function P(){return E.append("svg:g").attrs({id:"main-group",transform:"translate(400,400)"})}function w(){return"true"===g.get(x.CLASS_HIERARCHY_HIDE_PREFIXES)}function H(){const e=c.A.Export.getCSSRules("css/rdf-class-hierarchy-labels.css?v=3.4.0-TR3");s.selectAll("#main-group").append("defs"),$("defs").append('<style type="text/css"><![CDATA['+e+"]]></style>"),s.selectAll("g").style("opacity",1);const t=c.A.Export.generateBase64ImageSource("#classChart svg");s.select(this).attrs({href:t,download:"class-hierarchy-"+h.getActiveRepository()+".svg"})}y.hidePrefixes=w();let I=P();const T=!!y.classHierarchyData?.classCount,L=h.getActiveRepository()&&!h.isSystemRepository();let D,k,N,b,F;(0,o.service)(o.LicenseContextService).onLicenseChanged(t=>{t?.valid&&!T&&L&&function(){e.loader=!0,e.hierarchyError=!1;const t=g.get(`classHierarchy-selectedGraph-${h.getActiveRepository()}`);n.getClassHierarchyData(null!==t?t.contextID.uri:"").success(function(t,n){e.loader=!1,207===n&&u.warning(m.instant("graphexplore.update.diagram"),m.instant("graphexplore.repository.data.changed")),y.classHierarchyData=t,s.select("#download-svg").on("mouseover",H)}).error(function(t){e.loader=!1,e.hierarchyError=getError(t),u.error(m.instant("graphexplore.error.request.failed",{name:p,error:getError(t)}))})}()});const z={};function O(n,c,o,h){b&&b(),F&&F(),s.selectAll("#main-group").remove(),I=P(),r.A.SingleChild.addPlaceholders(n,!0),S=s.hierarchy(n),S.sum(function(e){return e.size}),N=o||S,C(S);const u=S.descendants();let g;N.isInFocusTransitive=!0,r.A.SingleChild.removePlaceholders(u),r.A.SingleChild.centerNodes(u),r.A.SingleChild.makePositionsRelativeToZero(u),v||(v=(0,a.A)().attr("class","d3-tip").customPosition(function(e,t){return{top:"inherit",bottom:l.innerHeight-t.clientY+"px",right:l.innerWidth-t.clientX+"px"}}).html(function(e){return e.data.name}),E.call(v));const x=I.selectAll("circle").data(u).enter().append("g");c.doFade&&x.each(function(e){i.A.Transition.fadeIn(s.select(this),550)});let m=[];const w=x.append("circle").attr("class",function(e){return e.data.role}).attr("data-test",function(e){return"class-"+e.data.name}).attr("guide-selector",function(e){return"class-"+e.data.name}).style("fill",function(e){return e.children?R(e.depth):"#E0D0D0"}).each(function(e){if(e.circle=s.select(this),e.data.name!==p){const t=e.data.name;m.push({name:t}),z[[t]]=e,e.circle.classed("rdf-class",!0),e.circle.on("mouseover",function(t){c.noPrefixes||e.textHidden?v.show(e,t):v.hide(e)}),e.circle.on("mouseout",v.hide)}}).on("gdb-focus",(e,t)=>k(t)).on("gdb-zoom",(e,t)=>Z(t));let H;function T(e){s.selectAll(".selected").classed("selected",e.selected=!1),e.circle.classed("selected",e.selected=!0),H=e}function L(){y.showClassInfoPanel=!1}m&&(m=_.uniqBy(m,"name"),y.flattenedClassNames=m);const $=i.A.Click.delayDblClick();s.selectAll(".parent, .topLevelParent, .child, .root").call($),k=function(e){Z(e),e.data.name===p?(L(),s.selectAll(".selected").classed("selected",!1)):(T(e),A||(y.selectedClass=H,y.showClassInfoPanel=!0),y.$on("sidePanelClosed",function(t){s.selectAll(".selected").classed("selected",e.selected=!1)}))},$.on("click",function(e,t){t.data.id&&l.history.pushState({id:t.data.id},"classHierarchyPage"+t.data.id,"hierarchy#"+t.data.id),v.hide(),k(t)}),$.on("dblclick",function(t,a){a!==n&&(v.hide(),T(a),e.$broadcast("goToDomainRangeGraphView",H,N),t.stopPropagation())});let O=0;E.on("wheel",function(e){v.hide(),e.preventDefault(),e.stopPropagation();const t=Date.now();if(!(t-O>100))return;O=t;let n="";e.deltaY<=-1?n="in":e.deltaY>=1&&(n="out");let a=e.target.__data__;if(a||(a=N),"in"===n){if(a!==N){for(;a.parent&&!a.parent.isInFocusTransitive;)a=a.parent;a.depth<N.depth&&(a=N)}if(a===N&&a.children){let e=a.children[0];for(let t=1;t<a.children.length;t++)a.children[t].sortingRank>e.sortingRank&&(e=a.children[t]);e.children&&(a=e)}else a.children||(a=a.parent);Z(a,!0)}else"out"===n&&(a=N.parent,a&&Z(a,!0));N.data.name===p&&l.history.replaceState({id:1},"classHierarchyPage1","hierarchy#1"),U()});const Y=I.selectAll("text").data(u).enter().append("text").attr("class",function(e){return e.children&&e.children.length?"label":"label child-label"}).each(function(e){e.textSel=s.select(this)});c.noPrefixes?(Y.each(function(e){const t=e.data.name.indexOf(":");e.data.name.indexOf("http://")>-1?e.noPrefixName=e.data.name:t>-1&&(e.noPrefixName=e.data.name.substring(t+1))}),Y.style("font-size",function(e){return i.A.Text.calcFontSize(e.noPrefixName,e.r)}).text(function(e){return i.A.Text.getTextWithElipsisIfNeeded(e.noPrefixName,e.r/3)})):Y.style("font-size",function(e){return i.A.Text.calcFontSize(e.data.name,e.r)}).text(function(e){return i.A.Text.getTextWithElipsisIfNeeded(e.data.name,e.r/3)}),Y.style("display",function(e){return e.parent&&e.parent.data===N.data?(e.textHidden=this.textContent.indexOf("...")+3===this.textContent.length,null):(e.textHidden=!0,"none")}),c.doFade&&!c.keepPrevState&&Y.each(function(e){i.A.Transition.fadeIn(s.select(this),550)}),D=function(){function e(e){e&&w.each(function(t){+e===t.data.id&&k(t)})}const n=t.hash();l.onpopstate=function(t){t.state&&e(t.state.id)},e(n)};const B=I.selectAll("circle, text");function V(e,t){const n=800/e[2];g=e,B.attr("transform",function(t){return"translate("+(t.x-e[0])*n+","+(t.y-e[1])*n+")"}),w.attr("r",function(e){return e.r*n}),t&&Y.each(function(e){e.data.fullName!==N.data.topLevelParentUri&&N.data.topLevelParentUri!==p||(e.textSel.style("display","none"),N.children&&N.children.length?_.each(N.children,function(e){e.textSel.style("display","inline")}):N.textSel.style("display","inline"),N.parent&&_.each(N.parent.children,function(e){e.data.name!==N.data.name&&e.textSel.style("display","inline")}))}),Y.style("font-size",function(e){return c.noPrefixes?i.A.Text.calcFontSize(e.noPrefixName,e.r*n):i.A.Text.calcFontSize(e.data.name,e.r*n)}).text(function(e){return c.noPrefixes?i.A.Text.getTextWithElipsisIfNeeded(e.noPrefixName,e.r*n/3):i.A.Text.getTextWithElipsisIfNeeded(e.data.name,e.r*n/3)})}function M(e){let t=2*e+20;return 2*e/t<.3&&(t=2*e+2),t}function W(e){!e.isInFocusTransitive&&e.parent&&e.parent.isInFocusTransitive?(e.textHidden=this.textContent.indexOf("...")+3===this.textContent.length,this.style.display=""):(e.textHidden=!0,this.style.display="none")}function Z(e,t){if(d(function(){y.showExternalElements=e.data.name===p}),N===e)return;if(e.data.id&&l.history.replaceState({id:e.data.id},"classHierarchyPage"+e.data.id,"hierarchy#"+e.data.id),!e.children&&(e=e.parent,N===e))return;if(t&&(L(),s.selectAll(".selected").classed("selected",!1)),N.parent){let e=N;for(;e;)e.isInFocusTransitive=!1,e=e.parent}let n=e;for(;n;)n.isInFocusTransitive=!!n.children,n=n.parent;N=e,2*N.r/(2*N.r+20)<.3||y.currentSliderValue>y.currentBrowserLimit?(V([N.x,N.y,M(N.r)]),Y.each(function(e){W.call(this,e)})):s.transition().duration(f).tween("zoom",function(e){const t=s.interpolateZoom(g,[N.x,N.y,M(N.r)]);return function(e){V(t(e))}}).selectAll("text").each(W)}V([N.x,N.y,M(N.r)],h),b=y.$on("rootFocus",function(){l.history.pushState({id:1},"classHierarchyPage1","hierarchy#1"),k(S)}),F=y.$on("classSearch",function(e){k(e)})}function U(){const t=y.classHierarchyData.classCount;let n=g.get(x.CLASS_HIERARCHY_CURRENT_SLIDER_VALUE);(!n||n>t)&&(n=t,g.set(x.CLASS_HIERARCHY_CURRENT_SLIDER_VALUE,n)),e.$broadcast("classCount",t,n)}let Y,B,V,M;window.addEventListener("resize",U),window.addEventListener("beforeunload",function e(){window.removeEventListener("resize",U),window.removeEventListener("beforeunload",e)}),y.$watch("classHierarchyData",function(){Y&&Y(),B&&B(),V&&V(),M&&M();let e=w();if(y.classHierarchyData.classCount){U();const t=structuredClone(y.classHierarchyData);const n=s.hierarchy(t).descendants().sort(function(e,t){return e.data.sortingRank>t.data.sortingRank?-1:e.data.sortingRank<t.data.sortingRank||e.data.depth>t.data.depth?1:e.data.depth<t.data.depth?-1:0});let a,r;function i(e,t){const n={keepPrevState:!0,noPrefixes:w()};r=n.noPrefixes,O(a||e,n,N,!0),d(()=>{g.set(x.CLASS_HIERARCHY_SWITCH_PREFIXES,t),D(),A=!1},70)}function c(e,n,s){if(!e)return;g.set(x.CLASS_HIERARCHY_CURRENT_SLIDER_VALUE,e),a={name:p,children:[]};const c=new Set;for(let t=1;t<=e;t++)c.add(n[t].data.id),n[t].parent===n[0]&&a.children.push(n[t].data);(function e(t){if(!t.children)return;const n=[];for(const e of t.children)c.has(e.id)&&n.push($.extend({},e));t.children=n;for(const n of t.children)e(n)})(a),s?(r=angular.isUndefined(r)?w():r,O(a,{noPrefixes:r})):i(t)}const o=g.get(x.CLASS_HIERARCHY_CURRENT_SLIDER_VALUE);if(o)c(o,n);else{const h={doFade:!0,keepPrevState:!0,noPrefixes:w()};O(t,h),D()}let l;Y=y.$watch("hidePrefixes",function(n){angular.isUndefined(n)||e?e=void 0:d(function(){A=!0,function(e){angular.isUndefined(e)||g.set(x.CLASS_HIERARCHY_HIDE_PREFIXES,e)}(n),i(t,!0)},50)},!0),B=y.$watch("currentSliderValue",function(e){c(e,n,!0)},!0),M=y.$on("onEnterKeypressSearchAction",function(e){l&&k(l)}),V=y.$on("searchedClass",function(e,t){l=z[t.name],l&&k(l)})}},!0)}(y)}}}angular.module("graphdb.framework.graphexplore.directives.class",["graphdb.framework.graphexplore.controllers.class","graphdb.framework.utils.localstorageadapter"]).constant("ZOOM_DURATION",500).constant("ROOT_OBJ_NAME","RDF Class Hierarchy").directive("rdfClassHierarchy",l),l.$inject=["$rootScope","$location","GraphDataRestService","$window","$timeout","$repositories","toastr","ZOOM_DURATION","ROOT_OBJ_NAME","LocalStorageAdapter","LSKeys","$translate"]},89687(e,t,n){n.d(t,{A:()=>r});var a=a||{};a.SingleChild={addPlaceholders:function e(t,n){if(t.children){for(var a=0;a<t.children.length;a++)e(t.children[a]);if(1===t.children.length){var r=1.2*t.size;n&&(r=.1*t.children[0].size),t.children.push({name:"placeholder",size:r})}}},removePlaceholders:function e(t){for(var n=t.length-1;n>=0;n--){var a=t[n];"placeholder"===a.data.name?t.splice(n,1):a.children&&e(a.children)}},centerNodes:function(e){for(var t=0;t<e.length;t++){var n=e[t];if(n.children&&1===n.children.length){var a=n.x-n.children[0].x;n.children[0].x+=a,r(n.children[0],a)}}function r(e,t){if(e.children)for(var n=0;n<e.children.length;n++)e.children[n].x+=t,r(e.children[n],t)}},makePositionsRelativeToZero:function(e){for(var t=e[0].x,n=e[0].y,a=0;a<e.length;a++){var r=e[a];r.x-=t,r.y-=n}}};const r=a},66886(e,t,n){n.d(t,{A:()=>i}),n(11014);const a={selectAll:n(44482).selectAll};var r=r||{};r.Export={getCSSRules:function(e){const t=$('link[href="'+e+'"]')[0].sheet.rules;let n="";return _.each(t,function(e){n+=e.cssText}),n},generateBase64ImageSource:function(e){e||(e="svg");const t=a.selectAll(e).attr("version","1.1").attr("xmlns","http://www.w3.org/2000/svg").node().parentNode.innerHTML;return"data:image/svg+xml;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(t)))}};const i=r}};
2
- //# sourceMappingURL=86099.acb890d2b6e1d841c4c3.bundle.js.map
1
+ export const __webpack_esm_id__=86099;export const __webpack_esm_ids__=[86099];export const __webpack_esm_modules__={86099(e,t,n){var a=n(82667),r=n(89687),i=n(9508),s=n(44482),c=n(66886),o=(n(38473),n(57154));function l(e,t,n,l,d,h,u,f,p,g,x,m){return{restrict:"AE",template:'<div id="classChart"></div>',scope:{classHierarchyData:"=",flattenedClassNames:"=",selectedClass:"=",currentSliderValue:"=",showClassInfoPanel:"=",showExternalElements:"=",hidePrefixes:"=",currentBrowserLimit:"="},link:function(y,A,v){!function(y){let A=!1;let v,S;const C=s.pack().size([780,780]),R=s.scaleLinear().domain([0,4]).range(["hsl(19, 70%, 90%)","hsl(19, 70%, 50%)"]).interpolate(s.interpolateHcl),E=s.select("#classChart").insert("svg:svg","h2").attr("viewBox","0 0 800 800").attr("preserveAspectRatio","xMidYMid meet").on("dblclick.zoom",null);function P(){return E.append("svg:g").attrs({id:"main-group",transform:"translate(400,400)"})}function w(){return"true"===g.get(x.CLASS_HIERARCHY_HIDE_PREFIXES)}function H(){const e=c.A.Export.getCSSRules("css/rdf-class-hierarchy-labels.css?v=3.4.0-TR5");s.selectAll("#main-group").append("defs"),$("defs").append('<style type="text/css"><![CDATA['+e+"]]></style>"),s.selectAll("g").style("opacity",1);const t=c.A.Export.generateBase64ImageSource("#classChart svg");s.select(this).attrs({href:t,download:"class-hierarchy-"+h.getActiveRepository()+".svg"})}y.hidePrefixes=w();let I=P();const T=!!y.classHierarchyData?.classCount,L=h.getActiveRepository()&&!h.isSystemRepository();let D,k,N,b,F;(0,o.service)(o.LicenseContextService).onLicenseChanged(t=>{t?.valid&&!T&&L&&function(){e.loader=!0,e.hierarchyError=!1;const t=g.get(`classHierarchy-selectedGraph-${h.getActiveRepository()}`);n.getClassHierarchyData(null!==t?t.contextID.uri:"").success(function(t,n){e.loader=!1,207===n&&u.warning(m.instant("graphexplore.update.diagram"),m.instant("graphexplore.repository.data.changed")),y.classHierarchyData=t,s.select("#download-svg").on("mouseover",H)}).error(function(t){e.loader=!1,e.hierarchyError=getError(t),u.error(m.instant("graphexplore.error.request.failed",{name:p,error:getError(t)}))})}()});const z={};function O(n,c,o,h){b&&b(),F&&F(),s.selectAll("#main-group").remove(),I=P(),r.A.SingleChild.addPlaceholders(n,!0),S=s.hierarchy(n),S.sum(function(e){return e.size}),N=o||S,C(S);const u=S.descendants();let g;N.isInFocusTransitive=!0,r.A.SingleChild.removePlaceholders(u),r.A.SingleChild.centerNodes(u),r.A.SingleChild.makePositionsRelativeToZero(u),v||(v=(0,a.A)().attr("class","d3-tip").customPosition(function(e,t){return{top:"inherit",bottom:l.innerHeight-t.clientY+"px",right:l.innerWidth-t.clientX+"px"}}).html(function(e){return e.data.name}),E.call(v));const x=I.selectAll("circle").data(u).enter().append("g");c.doFade&&x.each(function(e){i.A.Transition.fadeIn(s.select(this),550)});let m=[];const w=x.append("circle").attr("class",function(e){return e.data.role}).attr("data-test",function(e){return"class-"+e.data.name}).attr("guide-selector",function(e){return"class-"+e.data.name}).style("fill",function(e){return e.children?R(e.depth):"#E0D0D0"}).each(function(e){if(e.circle=s.select(this),e.data.name!==p){const t=e.data.name;m.push({name:t}),z[[t]]=e,e.circle.classed("rdf-class",!0),e.circle.on("mouseover",function(t){c.noPrefixes||e.textHidden?v.show(e,t):v.hide(e)}),e.circle.on("mouseout",v.hide)}}).on("gdb-focus",(e,t)=>k(t)).on("gdb-zoom",(e,t)=>Z(t));let H;function T(e){s.selectAll(".selected").classed("selected",e.selected=!1),e.circle.classed("selected",e.selected=!0),H=e}function L(){y.showClassInfoPanel=!1}m&&(m=_.uniqBy(m,"name"),y.flattenedClassNames=m);const $=i.A.Click.delayDblClick();s.selectAll(".parent, .topLevelParent, .child, .root").call($),k=function(e){Z(e),e.data.name===p?(L(),s.selectAll(".selected").classed("selected",!1)):(T(e),A||(y.selectedClass=H,y.showClassInfoPanel=!0),y.$on("sidePanelClosed",function(t){s.selectAll(".selected").classed("selected",e.selected=!1)}))},$.on("click",function(e,t){t.data.id&&l.history.pushState({id:t.data.id},"classHierarchyPage"+t.data.id,"hierarchy#"+t.data.id),v.hide(),k(t)}),$.on("dblclick",function(t,a){a!==n&&(v.hide(),T(a),e.$broadcast("goToDomainRangeGraphView",H,N),t.stopPropagation())});let O=0;E.on("wheel",function(e){v.hide(),e.preventDefault(),e.stopPropagation();const t=Date.now();if(!(t-O>100))return;O=t;let n="";e.deltaY<=-1?n="in":e.deltaY>=1&&(n="out");let a=e.target.__data__;if(a||(a=N),"in"===n){if(a!==N){for(;a.parent&&!a.parent.isInFocusTransitive;)a=a.parent;a.depth<N.depth&&(a=N)}if(a===N&&a.children){let e=a.children[0];for(let t=1;t<a.children.length;t++)a.children[t].sortingRank>e.sortingRank&&(e=a.children[t]);e.children&&(a=e)}else a.children||(a=a.parent);Z(a,!0)}else"out"===n&&(a=N.parent,a&&Z(a,!0));N.data.name===p&&l.history.replaceState({id:1},"classHierarchyPage1","hierarchy#1"),U()});const Y=I.selectAll("text").data(u).enter().append("text").attr("class",function(e){return e.children&&e.children.length?"label":"label child-label"}).each(function(e){e.textSel=s.select(this)});c.noPrefixes?(Y.each(function(e){const t=e.data.name.indexOf(":");e.data.name.indexOf("http://")>-1?e.noPrefixName=e.data.name:t>-1&&(e.noPrefixName=e.data.name.substring(t+1))}),Y.style("font-size",function(e){return i.A.Text.calcFontSize(e.noPrefixName,e.r)}).text(function(e){return i.A.Text.getTextWithElipsisIfNeeded(e.noPrefixName,e.r/3)})):Y.style("font-size",function(e){return i.A.Text.calcFontSize(e.data.name,e.r)}).text(function(e){return i.A.Text.getTextWithElipsisIfNeeded(e.data.name,e.r/3)}),Y.style("display",function(e){return e.parent&&e.parent.data===N.data?(e.textHidden=this.textContent.indexOf("...")+3===this.textContent.length,null):(e.textHidden=!0,"none")}),c.doFade&&!c.keepPrevState&&Y.each(function(e){i.A.Transition.fadeIn(s.select(this),550)}),D=function(){function e(e){e&&w.each(function(t){+e===t.data.id&&k(t)})}const n=t.hash();l.onpopstate=function(t){t.state&&e(t.state.id)},e(n)};const B=I.selectAll("circle, text");function V(e,t){const n=800/e[2];g=e,B.attr("transform",function(t){return"translate("+(t.x-e[0])*n+","+(t.y-e[1])*n+")"}),w.attr("r",function(e){return e.r*n}),t&&Y.each(function(e){e.data.fullName!==N.data.topLevelParentUri&&N.data.topLevelParentUri!==p||(e.textSel.style("display","none"),N.children&&N.children.length?_.each(N.children,function(e){e.textSel.style("display","inline")}):N.textSel.style("display","inline"),N.parent&&_.each(N.parent.children,function(e){e.data.name!==N.data.name&&e.textSel.style("display","inline")}))}),Y.style("font-size",function(e){return c.noPrefixes?i.A.Text.calcFontSize(e.noPrefixName,e.r*n):i.A.Text.calcFontSize(e.data.name,e.r*n)}).text(function(e){return c.noPrefixes?i.A.Text.getTextWithElipsisIfNeeded(e.noPrefixName,e.r*n/3):i.A.Text.getTextWithElipsisIfNeeded(e.data.name,e.r*n/3)})}function M(e){let t=2*e+20;return 2*e/t<.3&&(t=2*e+2),t}function W(e){!e.isInFocusTransitive&&e.parent&&e.parent.isInFocusTransitive?(e.textHidden=this.textContent.indexOf("...")+3===this.textContent.length,this.style.display=""):(e.textHidden=!0,this.style.display="none")}function Z(e,t){if(d(function(){y.showExternalElements=e.data.name===p}),N===e)return;if(e.data.id&&l.history.replaceState({id:e.data.id},"classHierarchyPage"+e.data.id,"hierarchy#"+e.data.id),!e.children&&(e=e.parent,N===e))return;if(t&&(L(),s.selectAll(".selected").classed("selected",!1)),N.parent){let e=N;for(;e;)e.isInFocusTransitive=!1,e=e.parent}let n=e;for(;n;)n.isInFocusTransitive=!!n.children,n=n.parent;N=e,2*N.r/(2*N.r+20)<.3||y.currentSliderValue>y.currentBrowserLimit?(V([N.x,N.y,M(N.r)]),Y.each(function(e){W.call(this,e)})):s.transition().duration(f).tween("zoom",function(e){const t=s.interpolateZoom(g,[N.x,N.y,M(N.r)]);return function(e){V(t(e))}}).selectAll("text").each(W)}V([N.x,N.y,M(N.r)],h),b=y.$on("rootFocus",function(){l.history.pushState({id:1},"classHierarchyPage1","hierarchy#1"),k(S)}),F=y.$on("classSearch",function(e){k(e)})}function U(){const t=y.classHierarchyData.classCount;let n=g.get(x.CLASS_HIERARCHY_CURRENT_SLIDER_VALUE);(!n||n>t)&&(n=t,g.set(x.CLASS_HIERARCHY_CURRENT_SLIDER_VALUE,n)),e.$broadcast("classCount",t,n)}let Y,B,V,M;window.addEventListener("resize",U),window.addEventListener("beforeunload",function e(){window.removeEventListener("resize",U),window.removeEventListener("beforeunload",e)}),y.$watch("classHierarchyData",function(){Y&&Y(),B&&B(),V&&V(),M&&M();let e=w();if(y.classHierarchyData.classCount){U();const t=structuredClone(y.classHierarchyData);const n=s.hierarchy(t).descendants().sort(function(e,t){return e.data.sortingRank>t.data.sortingRank?-1:e.data.sortingRank<t.data.sortingRank||e.data.depth>t.data.depth?1:e.data.depth<t.data.depth?-1:0});let a,r;function i(e,t){const n={keepPrevState:!0,noPrefixes:w()};r=n.noPrefixes,O(a||e,n,N,!0),d(()=>{g.set(x.CLASS_HIERARCHY_SWITCH_PREFIXES,t),D(),A=!1},70)}function c(e,n,s){if(!e)return;g.set(x.CLASS_HIERARCHY_CURRENT_SLIDER_VALUE,e),a={name:p,children:[]};const c=new Set;for(let t=1;t<=e;t++)c.add(n[t].data.id),n[t].parent===n[0]&&a.children.push(n[t].data);(function e(t){if(!t.children)return;const n=[];for(const e of t.children)c.has(e.id)&&n.push($.extend({},e));t.children=n;for(const n of t.children)e(n)})(a),s?(r=angular.isUndefined(r)?w():r,O(a,{noPrefixes:r})):i(t)}const o=g.get(x.CLASS_HIERARCHY_CURRENT_SLIDER_VALUE);if(o)c(o,n);else{const h={doFade:!0,keepPrevState:!0,noPrefixes:w()};O(t,h),D()}let l;Y=y.$watch("hidePrefixes",function(n){angular.isUndefined(n)||e?e=void 0:d(function(){A=!0,function(e){angular.isUndefined(e)||g.set(x.CLASS_HIERARCHY_HIDE_PREFIXES,e)}(n),i(t,!0)},50)},!0),B=y.$watch("currentSliderValue",function(e){c(e,n,!0)},!0),M=y.$on("onEnterKeypressSearchAction",function(e){l&&k(l)}),V=y.$on("searchedClass",function(e,t){l=z[t.name],l&&k(l)})}},!0)}(y)}}}angular.module("graphdb.framework.graphexplore.directives.class",["graphdb.framework.graphexplore.controllers.class","graphdb.framework.utils.localstorageadapter"]).constant("ZOOM_DURATION",500).constant("ROOT_OBJ_NAME","RDF Class Hierarchy").directive("rdfClassHierarchy",l),l.$inject=["$rootScope","$location","GraphDataRestService","$window","$timeout","$repositories","toastr","ZOOM_DURATION","ROOT_OBJ_NAME","LocalStorageAdapter","LSKeys","$translate"]},89687(e,t,n){n.d(t,{A:()=>r});var a=a||{};a.SingleChild={addPlaceholders:function e(t,n){if(t.children){for(var a=0;a<t.children.length;a++)e(t.children[a]);if(1===t.children.length){var r=1.2*t.size;n&&(r=.1*t.children[0].size),t.children.push({name:"placeholder",size:r})}}},removePlaceholders:function e(t){for(var n=t.length-1;n>=0;n--){var a=t[n];"placeholder"===a.data.name?t.splice(n,1):a.children&&e(a.children)}},centerNodes:function(e){for(var t=0;t<e.length;t++){var n=e[t];if(n.children&&1===n.children.length){var a=n.x-n.children[0].x;n.children[0].x+=a,r(n.children[0],a)}}function r(e,t){if(e.children)for(var n=0;n<e.children.length;n++)e.children[n].x+=t,r(e.children[n],t)}},makePositionsRelativeToZero:function(e){for(var t=e[0].x,n=e[0].y,a=0;a<e.length;a++){var r=e[a];r.x-=t,r.y-=n}}};const r=a},66886(e,t,n){n.d(t,{A:()=>i}),n(11014);const a={selectAll:n(44482).selectAll};var r=r||{};r.Export={getCSSRules:function(e){const t=$('link[href="'+e+'"]')[0].sheet.rules;let n="";return _.each(t,function(e){n+=e.cssText}),n},generateBase64ImageSource:function(e){e||(e="svg");const t=a.selectAll(e).attr("version","1.1").attr("xmlns","http://www.w3.org/2000/svg").node().parentNode.innerHTML;return"data:image/svg+xml;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(t)))}};const i=r}};
2
+ //# sourceMappingURL=86099.0abe4f96d87490fe332e.bundle.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"86099.acb890d2b6e1d841c4c3.bundle.js","mappings":"kNAoBA,SAASA,EAAwBC,EAAYC,EAAWC,EAAsBC,EAASC,EAAUC,EAAeC,EAAQC,EAAeC,EAAeC,EAAqBC,EAAQC,GAC/K,MAAO,CACHC,SAAU,KACVC,SAAU,8BACVC,MAAO,CACHC,mBAAoB,IACpBC,oBAAqB,IACrBC,cAAe,IACfC,mBAAoB,IACpBC,mBAAoB,IACpBC,qBAAsB,IACtBC,aAAc,IACdC,oBAAq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IsB,EAAOtF,EAAMgE,GAEjBsB,EAAKI,GAAKmE,EACVvE,EAAKK,GAAKmE,CACd,CACJ,GAUJ,S,yCCnFA,MAAMvO,EAAK,CAAC8F,U,SAASA,WACrB,IAAI1E,EAAMA,GAAO,CAAC,EAElBA,EAAIC,OAwBO,CACHC,YAxBJ,SAAqBkN,GACjB,MAAMrN,EAAWI,EAAE,cAAgBiN,EAAoB,MAAM,GAAGC,MAAMC,MACtE,IAAIC,EAAS,GAIb,OAHAtH,EAAEpB,KAAK9E,EAAU,SAAUyN,GACvBD,GAAUC,EAAMC,OACpB,GACOF,CACX,EAkBIjN,0BAhBJ,SAAmCoN,GAC1BA,IACDA,EAAmB,OAGvB,MAAMC,EAAY/O,EAAG8F,UAAUgJ,GAC1BrO,KAAK,UAAW,OAChBA,KAAK,QAAS,8BACdsJ,OAAOiF,WAAWC,UAGvB,MAAO,2CAA6CC,KAAKC,SAASC,mBAAmBL,IACzF,GAQJ,S","sources":["webpack://root-config/./packages/legacy-workbench/src/js/angular/graphexplore/directives/rdf-class-hierarchy.directive.js","webpack://root-config/./packages/legacy-workbench/src/js/lib/common/circle-packing.js","webpack://root-config/./packages/legacy-workbench/src/js/lib/common/svg-export.js"],"sourcesContent":["/* eslint-disable no-invalid-this */\nimport d3tip from 'lib/d3-tip/d3-tip-patch';\nimport CirclePacking from 'lib/common/circle-packing';\nimport D3 from 'lib/common/d3-utils';\nimport * as d3 from 'd3';\nimport SVG from 'lib/common/svg-export';\nimport 'angular/utils/local-storage-adapter';\nimport {service, LicenseContextService} from '@ontotext/workbench-api';\n\nangular\n .module('graphdb.framework.graphexplore.directives.class', [\n 'graphdb.framework.graphexplore.controllers.class',\n 'graphdb.framework.utils.localstorageadapter',\n ])\n .constant(\"ZOOM_DURATION\", 500)\n .constant(\"ROOT_OBJ_NAME\", \"RDF Class Hierarchy\")\n .directive('rdfClassHierarchy', classHierarchyDirective);\n\nclassHierarchyDirective.$inject = ['$rootScope', '$location', 'GraphDataRestService', '$window', '$timeout', '$repositories', 'toastr', 'ZOOM_DURATION', 'ROOT_OBJ_NAME', 'LocalStorageAdapter', 'LSKeys', '$translate'];\n\nfunction classHierarchyDirective($rootScope, $location, GraphDataRestService, $window, $timeout, $repositories, toastr, ZOOM_DURATION, ROOT_OBJ_NAME, LocalStorageAdapter, LSKeys, $translate) {\n return {\n restrict: 'AE',\n template: '<div id=\"classChart\"></div>',\n scope: {\n classHierarchyData: '=',\n flattenedClassNames: '=',\n selectedClass: '=',\n currentSliderValue: '=',\n showClassInfoPanel: '=',\n showExternalElements: '=',\n hidePrefixes: '=',\n currentBrowserLimit: '=',\n },\n link: linkFunc,\n };\n\n function linkFunc(scope, element, attrs) {\n renderCirclePacking(scope, element);\n }\n\n function renderCirclePacking(scope, element) {\n /**\n * A boolean flag that determines whether the opening of the side info panel\n * should be suppressed when focusing on the chart while a class is selected.\n */\n let suppressPanelOpen = false;\n\n const width = 800;\n const height = 800;\n const diameter = height;\n const margin = 20;\n let tip;\n let rootHierarchy;\n\n const packLayout = d3.pack()\n .size([diameter - margin, diameter - margin]);\n\n const color = d3.scaleLinear()\n .domain([0, 4])\n .range([\"hsl(19, 70%, 90%)\", \"hsl(19, 70%, 50%)\"])\n .interpolate(d3.interpolateHcl);\n\n const svg = d3.select(\"#classChart\")\n .insert(\"svg:svg\", \"h2\")\n .attr(\"viewBox\", \"0 0 \" + width + \" \" + height)\n .attr(\"preserveAspectRatio\", \"xMidYMid meet\")\n .on(\"dblclick.zoom\", null);\n\n function appendMainGroup() {\n return svg.append(\"svg:g\")\n .attrs({\n id: \"main-group\",\n transform: \"translate(\" + width / 2 + \",\" + height / 2 + \")\",\n });\n }\n\n function savePrefixesState(hidePrefixes) {\n if (!angular.isUndefined(hidePrefixes)) {\n LocalStorageAdapter.set(LSKeys.CLASS_HIERARCHY_HIDE_PREFIXES, hidePrefixes);\n }\n }\n\n function getPrefixesState() {\n return LocalStorageAdapter.get(LSKeys.CLASS_HIERARCHY_HIDE_PREFIXES) === \"true\";\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 const cssRules = SVG.Export.getCSSRules(\"css/rdf-class-hierarchy-labels.css?v=3.4.0-TR3\");\n // inline css rules in a defs tag\n d3.selectAll(\"#main-group\")\n .append(\"defs\");\n $(\"defs\").append('<style type=\"text/css\"><![CDATA[' + cssRules + ']]></style>');\n\n // switch opacity to visible\n d3.selectAll(\"g\")\n .style(\"opacity\", 1);\n\n // convert selected html to base64\n const imgSrc = SVG.Export.generateBase64ImageSource(\"#classChart 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: \"class-hierarchy-\" + $repositories.getActiveRepository() + \".svg\",\n });\n }\n\n scope.hidePrefixes = getPrefixesState();\n\n let g = appendMainGroup();\n\n function fetchClassHierarchy() {\n $rootScope.loader = true;\n $rootScope.hierarchyError = false;\n const selGraphFromCache = LocalStorageAdapter.get(`classHierarchy-selectedGraph-${$repositories.getActiveRepository()}`);\n GraphDataRestService.getClassHierarchyData(selGraphFromCache !== null ? selGraphFromCache.contextID.uri : \"\")\n .success(function(response, status) {\n $rootScope.loader = false;\n if (status === 207) {\n toastr.warning(\n $translate.instant('graphexplore.update.diagram'),\n $translate.instant('graphexplore.repository.data.changed'),\n );\n }\n scope.classHierarchyData = response;\n d3.select(\"#download-svg\").on(\"mouseover\", prepareForSVGImageExport);\n })\n .error(function(response) {\n $rootScope.loader = false;\n $rootScope.hierarchyError = getError(response);\n toastr.error(\n $translate.instant('graphexplore.error.request.failed', {\n name: ROOT_OBJ_NAME,\n error: getError(response),\n }),\n );\n });\n }\n\n const hasData = !!scope.classHierarchyData?.classCount;\n const canUseRepo = $repositories.getActiveRepository() && !$repositories.isSystemRepository();\n\n service(LicenseContextService).onLicenseChanged((license) => {\n if (license?.valid && !hasData && canUseRepo) {\n fetchClassHierarchy();\n }\n });\n\n let autoZoomToPreviousState;\n let doFocus;\n\n let focus;\n let rootFocusEvent;\n let classSearchEvent;\n const flattenedClassData = {};\n\n function drawDiagram(root, config, newFocus, switchPrefixes) {\n if (rootFocusEvent) rootFocusEvent();\n if (classSearchEvent) classSearchEvent();\n // remove old group tag containing the diagram\n d3.selectAll(\"#main-group\").remove();\n\n // append new empty group tag in order to rerender new diagram\n g = appendMainGroup();\n\n // fix for single child classes\n CirclePacking.SingleChild.addPlaceholders(root, true);\n\n rootHierarchy = d3.hierarchy(root);\n rootHierarchy.sum(function(d) {\n return d.size;\n });\n focus = newFocus ? newFocus : rootHierarchy;\n\n packLayout(rootHierarchy);\n\n const nodes = rootHierarchy.descendants();\n let view;\n\n focus.isInFocusTransitive = true;\n\n // fixes for single child classes\n CirclePacking.SingleChild.removePlaceholders(nodes);\n CirclePacking.SingleChild.centerNodes(nodes);\n CirclePacking.SingleChild.makePositionsRelativeToZero(nodes);\n\n if (!tip) {\n tip = d3tip()\n .attr('class', 'd3-tip')\n .customPosition(function(d, event) {\n return {\n top: 'inherit',\n bottom: ($window.innerHeight - event.clientY) + 'px',\n right: ($window.innerWidth - event.clientX) + 'px',\n };\n })\n .html(function(d) {\n return d.data.name;\n });\n svg.call(tip);\n }\n\n const circleGroup = g.selectAll(\"circle\")\n .data(nodes)\n .enter().append(\"g\");\n\n if (config.doFade) {\n circleGroup.each(function(d) {\n D3.Transition.fadeIn(d3.select(this), 550);\n });\n }\n\n let flattenedClassNames = [];\n\n const circle = circleGroup\n .append(\"circle\")\n .attr(\"class\", function(d) {\n return d.data.role;\n })\n .attr(\"data-test\", function(d) {\n return \"class-\" + d.data.name;\n })\n .attr(\"guide-selector\", function(d) {\n return \"class-\" + d.data.name;\n })\n .style(\"fill\", function(d) {\n //return colors[d.depth % 6];\n return d.children ? color(d.depth) : \"#E0D0D0\";\n })\n .each(function(d) {\n d.circle = d3.select(this);\n if (d.data.name !== ROOT_OBJ_NAME) {\n const key = d.data.name;\n flattenedClassNames.push({name: key});\n flattenedClassData[[key]] = d;\n\n d.circle.classed(\"rdf-class\", true);\n d.circle.on('mouseover', function(event) {\n if (config.noPrefixes) {\n tip.show(d, event);\n } else if (!d.textHidden) {\n tip.hide(d);\n } else {\n tip.show(d, event);\n }\n });\n d.circle.on('mouseout', tip.hide);\n }\n })\n // custom event used when user is following a guide\n .on(\"gdb-focus\", (event, d) => doFocus(d))\n .on(\"gdb-zoom\", (event, d) => zoom(d));\n\n\n if (flattenedClassNames) {\n flattenedClassNames = _.uniqBy(flattenedClassNames, 'name');\n scope.flattenedClassNames = flattenedClassNames;\n }\n\n let selectedClass;\n\n function getCurrentClassDataAndMarkSelected(obj) {\n d3.selectAll(\".selected\").classed(\"selected\", obj.selected = false);\n obj.circle.classed(\"selected\", obj.selected = true);\n selectedClass = obj;\n }\n\n function showClassInfoPanel() {\n scope.selectedClass = selectedClass;\n scope.showClassInfoPanel = true;\n }\n\n function closeClassInfoPanel() {\n scope.showClassInfoPanel = false;\n }\n\n function goToDomainRangeGraphView() {\n $rootScope.$broadcast('goToDomainRangeGraphView', selectedClass, focus);\n }\n\n const clickCancel = D3.Click.delayDblClick();\n d3.selectAll(\".parent, .topLevelParent, .child, .root\")\n .call(clickCancel);\n\n doFocus = function(obj) {\n zoom(obj);\n\n if (obj.data.name === ROOT_OBJ_NAME) {\n closeClassInfoPanel();\n d3.selectAll(\".selected\").classed(\"selected\", false);\n } else {\n getCurrentClassDataAndMarkSelected(obj);\n if (!suppressPanelOpen) {\n showClassInfoPanel();\n }\n\n // FIXME: is it ok to bind this event handler every time and not just once?\n scope.$on('sidePanelClosed', function(event) {\n d3.selectAll(\".selected\").classed(\"selected\", obj.selected = false);\n });\n }\n\n\n //do not stop event propagation here\n };\n\n clickCancel.on(\"click\", function(event, obj) {\n // add clicked class to browser history\n if (obj.data.id) {\n $window.history.pushState({id: obj.data.id}, \"classHierarchyPage\" + obj.data.id, \"hierarchy#\" + obj.data.id);\n }\n\n //hide current d3-tip tooltip\n tip.hide();\n\n doFocus(obj);\n });\n\n clickCancel.on(\"dblclick\", function(event, obj) {\n if (obj === root) {\n return;\n }\n // hide current d3-tip tooltip in order not to appear in the next view\n tip.hide();\n getCurrentClassDataAndMarkSelected(obj);\n goToDomainRangeGraphView();\n\n event.stopPropagation();\n });\n\n let lastTimeWheel = 0;\n svg.on('wheel', function(event) {\n // hide current d3-tip tooltip\n tip.hide();\n\n event.preventDefault();\n event.stopPropagation();\n\n // at least 100ms must have passed since last time we updated\n const now = Date.now();\n if (now - lastTimeWheel > 100) {\n lastTimeWheel = now;\n } else {\n return;\n }\n\n let direction = '';\n if (event.deltaY <= -1) {\n direction = 'in';\n } else if (event.deltaY >= 1) {\n direction = 'out';\n }\n\n let obj = event.target.__data__;\n\n if (!obj) {\n // scroll outside the big circle\n obj = focus;\n }\n\n if (direction === 'in') {\n // determine object to zoom to\n\n if (obj !== focus) {\n // consider the object on which the scroll event occurred\n // and find the furthest parent that has no focused children\n while (obj.parent && !obj.parent.isInFocusTransitive) {\n obj = obj.parent;\n }\n if (obj.depth < focus.depth) {\n // however if that parent is of lower depth than the focus we ignore it\n obj = focus;\n }\n }\n\n if (obj === focus && obj.children) {\n // if object is in focus and it has children we zoom to its biggest child\n // TODO: sort children on backend\n let newobj = obj.children[0];\n for (let i = 1; i < obj.children.length; i++) {\n if (obj.children[i].sortingRank > newobj.sortingRank) {\n newobj = obj.children[i];\n }\n }\n if (newobj.children) {\n // Use the child only if it has children\n obj = newobj;\n }\n } else if (!obj.children) {\n // If node has no children use its parent instead\n obj = obj.parent;\n }\n\n zoom(obj, true);\n } else if (direction === 'out') {\n // zooming out simply goes one parent up\n obj = focus.parent;\n if (obj) {\n zoom(obj, true);\n }\n }\n\n if (focus.data.name === ROOT_OBJ_NAME) {\n $window.history.replaceState({id: 1}, \"classHierarchyPage1\", \"hierarchy#1\");\n }\n\n // redraw slider on zoom out\n sendSliderData();\n });\n\n const text = g.selectAll(\"text\")\n .data(nodes)\n .enter().append(\"text\")\n .attr(\"class\", function(d) {\n return d.children && d.children.length ? \"label\" : \"label child-label\";\n })\n .each(function(d) {\n d.textSel = d3.select(this);\n });\n\n function trimPrefixes(d) {\n const idx = d.data.name.indexOf(\":\");\n const absUriIdx = d.data.name.indexOf(\"http://\");\n if (absUriIdx > -1) {\n // if we have no prefix available ignore\n d.noPrefixName = d.data.name;\n } else if (idx > -1) {\n d.noPrefixName = d.data.name.substring(idx + 1);\n }\n }\n\n if (config.noPrefixes) {\n text.each(trimPrefixes);\n text\n .style(\"font-size\", function(d) {\n return D3.Text.calcFontSize(d.noPrefixName, d.r);\n })\n .text(function(d) {\n return D3.Text.getTextWithElipsisIfNeeded(d.noPrefixName, d.r / 3);\n });\n } else {\n text\n .style(\"font-size\", function(d) {\n return D3.Text.calcFontSize(d.data.name, d.r);\n })\n .text(function(d) {\n return D3.Text.getTextWithElipsisIfNeeded(d.data.name, d.r / 3);\n });\n }\n\n // TODO: make this use the full version (same as zoom)\n text.style(\"display\", function(d) {\n if (d.parent && d.parent.data === focus.data) {\n d.textHidden = this.textContent.indexOf(\"...\") + 3 === this.textContent.length;\n return null;\n } else {\n d.textHidden = true;\n return \"none\";\n }\n });\n\n if (config.doFade && !config.keepPrevState) {\n text.each(function(d) {\n D3.Transition.fadeIn(d3.select(this), 550);\n });\n }\n\n autoZoomToPreviousState = function() {\n function focusOnCurrentClass(focusHistoryId) {\n if (focusHistoryId) {\n circle.each(function(d) {\n if (+focusHistoryId === d.data.id) {\n doFocus(d);\n }\n });\n }\n }\n\n const focusHistoryId = $location.hash();\n\n $window.onpopstate = function(event) {\n if (event.state) {\n const focusHistoryId = event.state.id;\n focusOnCurrentClass(focusHistoryId);\n }\n };\n\n focusOnCurrentClass(focusHistoryId);\n };\n\n const node = g.selectAll(\"circle, text\");\n\n function zoomTo(v, switchPrefixes) {\n const k = diameter / v[2];\n view = v;\n\n node.attr(\"transform\", function(d) {\n return \"translate(\" + (d.x - v[0]) * k + \",\" + (d.y - v[1]) * k + \")\";\n });\n\n circle.attr(\"r\", function(d) {\n return d.r * k;\n });\n\n function switchPrefixesInPlace(d) {\n // if uris match with the topLevelParentUri of the focused element\n // or your focus is a top level parent hide its label and if it is not\n // a child element show all of its child labels. If it is a child element\n // only show its label.\n if (d.data.fullName === focus.data.topLevelParentUri || focus.data.topLevelParentUri === ROOT_OBJ_NAME) {\n d.textSel.style(\"display\", \"none\");\n if (focus.children && focus.children.length) {\n _.each(focus.children, function(c) {\n c.textSel.style(\"display\", \"inline\");\n });\n } else {\n focus.textSel.style(\"display\", \"inline\");\n }\n\n // in order to show prefixes of siblings check if the focused\n // element has a parent and show all of its children except\n // for the name of the focused element because you need to see\n // its children\n if (focus.parent) {\n _.each(focus.parent.children, function(c) {\n if (c.data.name !== focus.data.name) {\n c.textSel.style(\"display\", \"inline\");\n }\n });\n }\n }\n }\n\n if (switchPrefixes) {\n text.each(switchPrefixesInPlace);\n }\n\n text\n .style(\"font-size\", function(d) {\n if (config.noPrefixes) {\n return D3.Text.calcFontSize(d.noPrefixName, d.r * k);\n }\n return D3.Text.calcFontSize(d.data.name, d.r * k);\n })\n .text(function(d) {\n if (config.noPrefixes) {\n return D3.Text.getTextWithElipsisIfNeeded(d.noPrefixName, d.r * k / 3);\n }\n return D3.Text.getTextWithElipsisIfNeeded(d.data.name, d.r * k / 3);\n });\n }\n\n\n function adjustRadius(r) {\n let newr = r * 2 + margin;\n if (r * 2 / newr < 0.3) {\n // for very small circles we need to adjust\n newr = r * 2 + 2;\n }\n return newr;\n }\n\n zoomTo([focus.x, focus.y, adjustRadius(focus.r)], switchPrefixes);\n\n function textUpdate(d) {\n if (d.isInFocusTransitive || !(d.parent && d.parent.isInFocusTransitive)) {\n // hide labels of classes that are in focus (including children) OR whose parents aren't in focus\n d.textHidden = true;\n this.style.display = \"none\";\n } else {\n // show all other labels\n d.textHidden = this.textContent.indexOf(\"...\") + 3 === this.textContent.length;\n this.style.display = \"\";\n }\n }\n\n function zoom(d, shouldClosePanel) {\n // use empty timeout to force the following code to be executed on the next $digest cycle\n // in order to avoid '$digest in progress' error\n $timeout(function() {\n scope.showExternalElements = (d.data.name === ROOT_OBJ_NAME);\n });\n\n if (focus === d) {\n // Node is already zoomed to\n // Important to return before we modify the history, otherwise we choke the browser\n return;\n }\n\n if (d.data.id) {\n $window.history.replaceState({id: d.data.id}, \"classHierarchyPage\" + d.data.id, \"hierarchy#\" + d.data.id);\n }\n\n if (!d.children) {\n // No children - zoom to parent instead\n d = d.parent;\n if (focus === d) {\n // Parent is already zoomed to\n return;\n }\n }\n\n if (shouldClosePanel) {\n closeClassInfoPanel();\n d3.selectAll(\".selected\").classed(\"selected\", false);\n }\n\n if (focus.parent) {\n let p = focus;\n while (p) {\n p.isInFocusTransitive = false;\n p = p.parent;\n }\n }\n\n let p = d;\n while (p) {\n p.isInFocusTransitive = !!p.children;\n p = p.parent;\n }\n\n focus = d;\n\n const isVerySmallCircle = focus.r * 2 / (focus.r * 2 + margin) < 0.3;\n\n if (isVerySmallCircle || scope.currentSliderValue > scope.currentBrowserLimit) {\n // no fancy animation for slower browsers if above the limit or if zooming to a very small circle\n zoomTo([focus.x, focus.y, adjustRadius(focus.r)]);\n\n text.each(function(d) {\n textUpdate.call(this, d);\n });\n } else {\n // the fancy version for faster browsers\n const transition = d3.transition()\n .duration(ZOOM_DURATION)\n .tween(\"zoom\", function(d) {\n const i = d3.interpolateZoom(view, [focus.x, focus.y, adjustRadius(focus.r)]);\n return function(t) {\n zoomTo(i(t));\n };\n });\n\n transition.selectAll(\"text\")\n // Experimental: hide texts to be hidden on \"start\", show texts to be shown on \"end\"\n .each(textUpdate);\n }\n }\n\n rootFocusEvent = scope.$on('rootFocus', function() {\n $window.history.pushState({id: 1}, \"classHierarchyPage1\", \"hierarchy#1\");\n doFocus(rootHierarchy);\n });\n\n classSearchEvent = scope.$on('classSearch', function(selectedClass) {\n doFocus(selectedClass);\n });\n }\n\n function sendSliderData() {\n const currentClassCount = scope.classHierarchyData.classCount;\n let currentSliderValue = LocalStorageAdapter.get(LSKeys.CLASS_HIERARCHY_CURRENT_SLIDER_VALUE);\n\n if (!currentSliderValue || currentSliderValue > currentClassCount) {\n currentSliderValue = currentClassCount;\n LocalStorageAdapter.set(LSKeys.CLASS_HIERARCHY_CURRENT_SLIDER_VALUE, currentSliderValue);\n }\n\n $rootScope.$broadcast(\"classCount\", currentClassCount, currentSliderValue);\n }\n\n window.addEventListener('resize', sendSliderData);\n\n window.addEventListener('beforeunload', removeResizeListener);\n\n function removeResizeListener() {\n window.removeEventListener('resize', sendSliderData);\n window.removeEventListener('beforeunload', removeResizeListener);\n }\n\n let prefixesWatch;\n let currentClassCountWatch;\n let searchedClassBroadcast;\n let onEnterClassSearchBroadcast;\n\n scope.$watch('classHierarchyData', function() {\n // when data changes unregister watchers by calling them\n if (prefixesWatch) prefixesWatch();\n if (currentClassCountWatch) currentClassCountWatch();\n if (searchedClassBroadcast) searchedClassBroadcast();\n if (onEnterClassSearchBroadcast) onEnterClassSearchBroadcast();\n\n // get initial state of prefixes (hidden or not) when changing repositories\n // in order to avoid triggering an unwanted prefixes watch\n let initialPrefixesState = getPrefixesState();\n\n if (scope.classHierarchyData.classCount) {\n sendSliderData();\n\n const rootData = structuredClone(scope.classHierarchyData);\n\n const root = d3.hierarchy(rootData);\n\n function sortRoot(root) {\n // add all classes to a flat array, add parent information\n // and sort according to instancesCount DESC, depth ASC\n\n return root.descendants()\n .sort(function(a, b) {\n if (a.data.sortingRank > b.data.sortingRank) {\n return -1;\n } else if (a.data.sortingRank < b.data.sortingRank) {\n return 1;\n } else if (a.data.depth > b.data.depth) {\n return 1;\n } else if (a.data.depth < b.data.depth) {\n return -1;\n } else {\n return 0;\n }\n });\n }\n\n const sortedChildren = sortRoot(root);\n\n // we start with an empty new rootData\n let filteredRootData;\n let noPrefixesGlobal;\n\n\n function restoreDiagramState(currentRootData, switchPrefixes) {\n const prefixesConfig = {\n keepPrevState: true,\n noPrefixes: getPrefixesState(),\n };\n\n // get noPrefixes flag from drawDiagram configuration params\n noPrefixesGlobal = prefixesConfig.noPrefixes;\n\n if (filteredRootData) {\n drawDiagram(filteredRootData, prefixesConfig, focus, true);\n } else {\n drawDiagram(currentRootData, prefixesConfig, focus, true);\n }\n\n $timeout(() => {\n LocalStorageAdapter.set(LSKeys.CLASS_HIERARCHY_SWITCH_PREFIXES, switchPrefixes);\n autoZoomToPreviousState();\n // Need to set this to false to enable the info panel to work when selecting a class.\n // The panel opening will be suppressed only when the prefixes are toggled.\n suppressPanelOpen = false;\n }, 70);\n }\n\n function redrawFilteredDiagram(currentSliderValue, sortedChildrenArray, useSlider) {\n if (!currentSliderValue) {\n return;\n }\n\n LocalStorageAdapter.set(LSKeys.CLASS_HIERARCHY_CURRENT_SLIDER_VALUE, currentSliderValue);\n\n filteredRootData = {\n name: ROOT_OBJ_NAME,\n children: [],\n };\n\n // walk through the given count of (sortedChildrenArray) classes\n // - record the id of each class we've seen\n // - add the rootData level classes to the new rootData\n const addedIds = new Set();\n for (let k = 1; k <= currentSliderValue; k++) {\n addedIds.add(sortedChildrenArray[k].data.id);\n if (sortedChildrenArray[k].parent === sortedChildrenArray[0]) { // i.e. the parent is the \"class hierarchy\"\n filteredRootData.children.push(sortedChildrenArray[k].data);\n }\n }\n\n // walk through all the classes in the new rootData and only keep those that have an \"added id\"\n // we create separate copies of the arrays in order not to contaminate the original data\n // we also copy each class's object ($.extend ...) for the same reason\n function fixChildren(node) {\n if (!node.children) {\n return;\n }\n const newChildren = [];\n for (const child of node.children) {\n if (addedIds.has(child.id)) {\n newChildren.push($.extend({}, child));\n }\n }\n node.children = newChildren;\n for (const child of node.children) {\n fixChildren(child);\n }\n }\n\n fixChildren(filteredRootData);\n\n if (useSlider) {\n // redraw diagram when slider value changes and persist current state\n // in local storage\n noPrefixesGlobal = angular.isUndefined(noPrefixesGlobal) ? getPrefixesState() : noPrefixesGlobal;\n const redrawConfig = {\n noPrefixes: noPrefixesGlobal,\n };\n drawDiagram(filteredRootData, redrawConfig);\n } else {\n // if the user returns to the diagram with back browser button\n // read the saved state (show/hide prefixes, current slider value)\n // from local storage and render the diagram according to the saved metrics\n restoreDiagramState(rootData);\n }\n }\n\n const currentSliderValue = LocalStorageAdapter.get(LSKeys.CLASS_HIERARCHY_CURRENT_SLIDER_VALUE);\n if (currentSliderValue) {\n redrawFilteredDiagram(currentSliderValue, sortedChildren);\n } else {\n const basicConfig = {\n doFade: true,\n keepPrevState: true,\n noPrefixes: getPrefixesState(),\n };\n drawDiagram(rootData, basicConfig);\n autoZoomToPreviousState();\n }\n\n prefixesWatch = scope.$watch('hidePrefixes', function(hidePrefixes) {\n if (angular.isUndefined(hidePrefixes) || initialPrefixesState) {\n initialPrefixesState = undefined;\n return;\n }\n // if digest overflows a possible fix might be wrapping this in $timeout\n $timeout(function() {\n suppressPanelOpen = true;\n savePrefixesState(hidePrefixes);\n restoreDiagramState(rootData, true);\n }, 50);\n }, true);\n\n currentClassCountWatch = scope.$watch('currentSliderValue', function(currentSliderValue) {\n redrawFilteredDiagram(currentSliderValue, sortedChildren, true);\n }, true);\n\n // we handle this event for the cases where we already have searched for a given class and\n // hit enter again on the already selected class in order again react and zoom to it again\n // if we are not at the moment\n let currentSearchedClass;\n onEnterClassSearchBroadcast = scope.$on('onEnterKeypressSearchAction', function(event) {\n if (currentSearchedClass) {\n doFocus(currentSearchedClass);\n }\n });\n\n searchedClassBroadcast = scope.$on('searchedClass', function(event, searchedClass) {\n currentSearchedClass = flattenedClassData[searchedClass.name];\n if (currentSearchedClass) {\n doFocus(currentSearchedClass);\n }\n });\n }\n }, true);\n }\n}\n","var CirclePacking = CirclePacking || {};\n\nCirclePacking.SingleChild = function () {\n /*\n Functions that enable single child circles to display properly, see\n http://stackoverflow.com/questions/22307486/d3-js-packed-circle-layout-how-to-adjust-child-radius\n */\n function addPlaceholders(node, first) {\n if (node.children) {\n for (var i = 0; i < node.children.length; i++) {\n var child = node.children[i];\n addPlaceholders(child);\n }\n\n if (node.children.length === 1) {\n var placeholderSize = node.size * 1.2;\n if (first) {\n placeholderSize = node.children[0].size * 0.1;\n }\n node.children.push({\n name: 'placeholder', size: placeholderSize,\n // children: []\n });\n }\n }\n }\n\n function removePlaceholders(nodes) {\n for (var i = nodes.length - 1; i >= 0; i--) {\n var node = nodes[i];\n\n if (node.data.name === 'placeholder') {\n nodes.splice(i, 1);\n } else {\n if (node.children) {\n removePlaceholders(node.children);\n }\n }\n }\n }\n\n function centerNodes(nodes) {\n for (var i = 0; i < nodes.length; i++) {\n var node = nodes[i];\n\n if (node.children) {\n if (node.children.length === 1) {\n var offset = node.x - node.children[0].x;\n node.children[0].x += offset;\n reposition(node.children[0], offset);\n }\n }\n }\n\n function reposition(node, offset) {\n if (node.children) {\n for (var i = 0; i < node.children.length; i++) {\n node.children[i].x += offset;\n reposition(node.children[i], offset);\n }\n }\n }\n }\n\n function makePositionsRelativeToZero(nodes) {\n //use this to have vis centered at 0,0,0 (easier for positioning)\n var offsetX = nodes[0].x;\n var offsetY = nodes[0].y;\n\n for (var i = 0; i < nodes.length; i++) {\n\n var node = nodes[i];\n\n node.x -= offsetX;\n node.y -= offsetY;\n }\n }\n\n return {\n addPlaceholders: addPlaceholders,\n removePlaceholders: removePlaceholders,\n centerNodes: centerNodes,\n makePositionsRelativeToZero: makePositionsRelativeToZero\n }\n}();\n\nexport default CirclePacking;\n","import 'lib/d3.patch.js'\nimport {selectAll} from 'd3';\n\nconst d3 = {selectAll};\nvar SVG = SVG || {};\n\nSVG.Export = function () {\n function getCSSRules(cssSourceFilePath) {\n const cssRules = $('link[href=\"' + cssSourceFilePath + '\"]')[0].sheet.rules;\n let cssStr = \"\";\n _.each(cssRules, function (value) {\n cssStr += value.cssText;\n });\n return cssStr;\n }\n\n function generateBase64ImageSource(svgSelectorClass) {\n if (!svgSelectorClass) {\n svgSelectorClass = \"svg\";\n }\n // add needed xml namespace\n const exportSvg = d3.selectAll(svgSelectorClass)\n .attr(\"version\", \"1.1\")\n .attr(\"xmlns\", \"http://www.w3.org/2000/svg\")\n .node().parentNode.innerHTML;\n\n // convert selected html to base64\n return \"data:image/svg+xml;charset=utf-8;base64,\" + btoa(unescape(encodeURIComponent(exportSvg)));\n }\n\n return {\n getCSSRules: getCSSRules,\n generateBase64ImageSource: generateBase64ImageSource\n };\n}();\n\nexport default SVG;\n"],"names":["classHierarchyDirective","$rootScope","$location","GraphDataRestService","$window","$timeout","$repositories","toastr","ZOOM_DURATION","ROOT_OBJ_NAME","LocalStorageAdapter","LSKeys","$translate","restrict","template","scope","classHierarchyData","flattenedClassNames","selectedClass","currentSliderValue","showClassInfoPanel","showExternalElements","hidePrefixes","currentBrowserLimit","link","element","attrs","suppressPanelOpen","tip","rootHierarchy","packLayout","d3","size","diameter","color","domain","range","interpolate","svg","insert","attr","on","appendMainGroup","append","id","transform","getPrefixesState","get","CLASS_HIERARCHY_HIDE_PREFIXES","prepareForSVGImageExport","cssRules","SVG","Export","getCSSRules","$","style","imgSrc","generateBase64ImageSource","this","href","download","getActiveRepository","g","hasData","classCount","canUseRepo","isSystemRepository","autoZoomToPreviousState","doFocus","focus","rootFocusEvent","classSearchEvent","service","LicenseContextService","onLicenseChanged","license","valid","loader","hierarchyError","selGraphFromCache","getClassHierarchyData","contextID","uri","success","response","status","warning","instant","error","getError","name","fetchClassHierarchy","flattenedClassData","drawDiagram","root","config","newFocus","switchPrefixes","remove","CirclePacking","SingleChild","addPlaceholders","sum","d","nodes","descendants","view","isInFocusTransitive","removePlaceholders","centerNodes","makePositionsRelativeToZero","d3tip","customPosition","event","top","bottom","innerHeight","clientY","right","innerWidth","clientX","html","data","call","circleGroup","selectAll","enter","doFade","each","D3","Transition","fadeIn","circle","role","children","depth","key","push","classed","noPrefixes","textHidden","show","hide","zoom","getCurrentClassDataAndMarkSelected","obj","selected","closeClassInfoPanel","_","uniqBy","clickCancel","Click","delayDblClick","$on","history","pushState","$broadcast","stopPropagation","lastTimeWheel","preventDefault","now","Date","direction","deltaY","target","__data__","parent","newobj","i","length","sortingRank","replaceState","sendSliderData","text","textSel","idx","indexOf","noPrefixName","substring","Text","calcFontSize","r","getTextWithElipsisIfNeeded","textContent","keepPrevState","focusOnCurrentClass","focusHistoryId","hash","onpopstate","state","node","zoomTo","v","k","x","y","fullName","topLevelParentUri","c","adjustRadius","newr","textUpdate","display","shouldClosePanel","p","duration","tween","t","currentClassCount","CLASS_HIERARCHY_CURRENT_SLIDER_VALUE","set","prefixesWatch","currentClassCountWatch","searchedClassBroadcast","onEnterClassSearchBroadcast","window","addEventListener","removeResizeListener","removeEventListener","$watch","initialPrefixesState","rootData","structuredClone","sortedChildren","sort","a","b","filteredRootData","noPrefixesGlobal","restoreDiagramState","currentRootData","prefixesConfig","CLASS_HIERARCHY_SWITCH_PREFIXES","redrawFilteredDiagram","sortedChildrenArray","useSlider","addedIds","Set","add","fixChildren","newChildren","child","has","extend","angular","isUndefined","basicConfig","currentSearchedClass","undefined","savePrefixesState","searchedClass","renderCirclePacking","module","constant","directive","$inject","first","placeholderSize","splice","offset","reposition","offsetX","offsetY","cssSourceFilePath","sheet","rules","cssStr","value","cssText","svgSelectorClass","exportSvg","parentNode","innerHTML","btoa","unescape","encodeURIComponent"],"sourceRoot":""}
1
+ {"version":3,"file":"86099.0abe4f96d87490fe332e.bundle.js","mappings":"kNAoBA,SAASA,EAAwBC,EAAYC,EAAWC,EAAsBC,EAASC,EAAUC,EAAeC,EAAQC,EAAeC,EAAeC,EAAqBC,EAAQC,GAC/K,MAAO,CACHC,SAAU,KACVC,SAAU,8BACVC,MAAO,CACHC,mBAAoB,IACpBC,oBAAqB,IACrBC,cAAe,IACfC,mBAAoB,IACpBC,mBAAoB,IACpBC,qBAAsB,IACtBC,aAAc,IACdC,oBAAqB,KAEzBC,KAGJ,SAAkBT,EAAOU,EAASC,IAIlC,SAA6BX,GAKzB,IAAIY,GAAoB,EAMxB,IAAIC,EACAC,EAEJ,MAAMC,EAAaC,EAAAA,OACdC,KAAK,CAACC,IAAmBA,MAExBC,EAAQH,EAAAA,cACTI,OAAO,CAAC,EAAG,IACXC,MAAM,CAAC,o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AMrN,EAAWI,EAAE,cAAgBiN,EAAoB,MAAM,GAAGC,MAAMC,MACtE,IAAIC,EAAS,GAIb,OAHAtH,EAAEpB,KAAK9E,EAAU,SAAUyN,GACvBD,GAAUC,EAAMC,OACpB,GACOF,CACX,EAkBIjN,0BAhBJ,SAAmCoN,GAC1BA,IACDA,EAAmB,OAGvB,MAAMC,EAAY/O,EAAG8F,UAAUgJ,GAC1BrO,KAAK,UAAW,OAChBA,KAAK,QAAS,8BACdsJ,OAAOiF,WAAWC,UAGvB,MAAO,2CAA6CC,KAAKC,SAASC,mBAAmBL,IACzF,GAQJ,S","sources":["webpack://root-config/./packages/legacy-workbench/src/js/angular/graphexplore/directives/rdf-class-hierarchy.directive.js","webpack://root-config/./packages/legacy-workbench/src/js/lib/common/circle-packing.js","webpack://root-config/./packages/legacy-workbench/src/js/lib/common/svg-export.js"],"sourcesContent":["/* eslint-disable no-invalid-this */\nimport d3tip from 'lib/d3-tip/d3-tip-patch';\nimport CirclePacking from 'lib/common/circle-packing';\nimport D3 from 'lib/common/d3-utils';\nimport * as d3 from 'd3';\nimport SVG from 'lib/common/svg-export';\nimport 'angular/utils/local-storage-adapter';\nimport {service, LicenseContextService} from '@ontotext/workbench-api';\n\nangular\n .module('graphdb.framework.graphexplore.directives.class', [\n 'graphdb.framework.graphexplore.controllers.class',\n 'graphdb.framework.utils.localstorageadapter',\n ])\n .constant(\"ZOOM_DURATION\", 500)\n .constant(\"ROOT_OBJ_NAME\", \"RDF Class Hierarchy\")\n .directive('rdfClassHierarchy', classHierarchyDirective);\n\nclassHierarchyDirective.$inject = ['$rootScope', '$location', 'GraphDataRestService', '$window', '$timeout', '$repositories', 'toastr', 'ZOOM_DURATION', 'ROOT_OBJ_NAME', 'LocalStorageAdapter', 'LSKeys', '$translate'];\n\nfunction classHierarchyDirective($rootScope, $location, GraphDataRestService, $window, $timeout, $repositories, toastr, ZOOM_DURATION, ROOT_OBJ_NAME, LocalStorageAdapter, LSKeys, $translate) {\n return {\n restrict: 'AE',\n template: '<div id=\"classChart\"></div>',\n scope: {\n classHierarchyData: '=',\n flattenedClassNames: '=',\n selectedClass: '=',\n currentSliderValue: '=',\n showClassInfoPanel: '=',\n showExternalElements: '=',\n hidePrefixes: '=',\n currentBrowserLimit: '=',\n },\n link: linkFunc,\n };\n\n function linkFunc(scope, element, attrs) {\n renderCirclePacking(scope, element);\n }\n\n function renderCirclePacking(scope, element) {\n /**\n * A boolean flag that determines whether the opening of the side info panel\n * should be suppressed when focusing on the chart while a class is selected.\n */\n let suppressPanelOpen = false;\n\n const width = 800;\n const height = 800;\n const diameter = height;\n const margin = 20;\n let tip;\n let rootHierarchy;\n\n const packLayout = d3.pack()\n .size([diameter - margin, diameter - margin]);\n\n const color = d3.scaleLinear()\n .domain([0, 4])\n .range([\"hsl(19, 70%, 90%)\", \"hsl(19, 70%, 50%)\"])\n .interpolate(d3.interpolateHcl);\n\n const svg = d3.select(\"#classChart\")\n .insert(\"svg:svg\", \"h2\")\n .attr(\"viewBox\", \"0 0 \" + width + \" \" + height)\n .attr(\"preserveAspectRatio\", \"xMidYMid meet\")\n .on(\"dblclick.zoom\", null);\n\n function appendMainGroup() {\n return svg.append(\"svg:g\")\n .attrs({\n id: \"main-group\",\n transform: \"translate(\" + width / 2 + \",\" + height / 2 + \")\",\n });\n }\n\n function savePrefixesState(hidePrefixes) {\n if (!angular.isUndefined(hidePrefixes)) {\n LocalStorageAdapter.set(LSKeys.CLASS_HIERARCHY_HIDE_PREFIXES, hidePrefixes);\n }\n }\n\n function getPrefixesState() {\n return LocalStorageAdapter.get(LSKeys.CLASS_HIERARCHY_HIDE_PREFIXES) === \"true\";\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 const cssRules = SVG.Export.getCSSRules(\"css/rdf-class-hierarchy-labels.css?v=3.4.0-TR5\");\n // inline css rules in a defs tag\n d3.selectAll(\"#main-group\")\n .append(\"defs\");\n $(\"defs\").append('<style type=\"text/css\"><![CDATA[' + cssRules + ']]></style>');\n\n // switch opacity to visible\n d3.selectAll(\"g\")\n .style(\"opacity\", 1);\n\n // convert selected html to base64\n const imgSrc = SVG.Export.generateBase64ImageSource(\"#classChart 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: \"class-hierarchy-\" + $repositories.getActiveRepository() + \".svg\",\n });\n }\n\n scope.hidePrefixes = getPrefixesState();\n\n let g = appendMainGroup();\n\n function fetchClassHierarchy() {\n $rootScope.loader = true;\n $rootScope.hierarchyError = false;\n const selGraphFromCache = LocalStorageAdapter.get(`classHierarchy-selectedGraph-${$repositories.getActiveRepository()}`);\n GraphDataRestService.getClassHierarchyData(selGraphFromCache !== null ? selGraphFromCache.contextID.uri : \"\")\n .success(function(response, status) {\n $rootScope.loader = false;\n if (status === 207) {\n toastr.warning(\n $translate.instant('graphexplore.update.diagram'),\n $translate.instant('graphexplore.repository.data.changed'),\n );\n }\n scope.classHierarchyData = response;\n d3.select(\"#download-svg\").on(\"mouseover\", prepareForSVGImageExport);\n })\n .error(function(response) {\n $rootScope.loader = false;\n $rootScope.hierarchyError = getError(response);\n toastr.error(\n $translate.instant('graphexplore.error.request.failed', {\n name: ROOT_OBJ_NAME,\n error: getError(response),\n }),\n );\n });\n }\n\n const hasData = !!scope.classHierarchyData?.classCount;\n const canUseRepo = $repositories.getActiveRepository() && !$repositories.isSystemRepository();\n\n service(LicenseContextService).onLicenseChanged((license) => {\n if (license?.valid && !hasData && canUseRepo) {\n fetchClassHierarchy();\n }\n });\n\n let autoZoomToPreviousState;\n let doFocus;\n\n let focus;\n let rootFocusEvent;\n let classSearchEvent;\n const flattenedClassData = {};\n\n function drawDiagram(root, config, newFocus, switchPrefixes) {\n if (rootFocusEvent) rootFocusEvent();\n if (classSearchEvent) classSearchEvent();\n // remove old group tag containing the diagram\n d3.selectAll(\"#main-group\").remove();\n\n // append new empty group tag in order to rerender new diagram\n g = appendMainGroup();\n\n // fix for single child classes\n CirclePacking.SingleChild.addPlaceholders(root, true);\n\n rootHierarchy = d3.hierarchy(root);\n rootHierarchy.sum(function(d) {\n return d.size;\n });\n focus = newFocus ? newFocus : rootHierarchy;\n\n packLayout(rootHierarchy);\n\n const nodes = rootHierarchy.descendants();\n let view;\n\n focus.isInFocusTransitive = true;\n\n // fixes for single child classes\n CirclePacking.SingleChild.removePlaceholders(nodes);\n CirclePacking.SingleChild.centerNodes(nodes);\n CirclePacking.SingleChild.makePositionsRelativeToZero(nodes);\n\n if (!tip) {\n tip = d3tip()\n .attr('class', 'd3-tip')\n .customPosition(function(d, event) {\n return {\n top: 'inherit',\n bottom: ($window.innerHeight - event.clientY) + 'px',\n right: ($window.innerWidth - event.clientX) + 'px',\n };\n })\n .html(function(d) {\n return d.data.name;\n });\n svg.call(tip);\n }\n\n const circleGroup = g.selectAll(\"circle\")\n .data(nodes)\n .enter().append(\"g\");\n\n if (config.doFade) {\n circleGroup.each(function(d) {\n D3.Transition.fadeIn(d3.select(this), 550);\n });\n }\n\n let flattenedClassNames = [];\n\n const circle = circleGroup\n .append(\"circle\")\n .attr(\"class\", function(d) {\n return d.data.role;\n })\n .attr(\"data-test\", function(d) {\n return \"class-\" + d.data.name;\n })\n .attr(\"guide-selector\", function(d) {\n return \"class-\" + d.data.name;\n })\n .style(\"fill\", function(d) {\n //return colors[d.depth % 6];\n return d.children ? color(d.depth) : \"#E0D0D0\";\n })\n .each(function(d) {\n d.circle = d3.select(this);\n if (d.data.name !== ROOT_OBJ_NAME) {\n const key = d.data.name;\n flattenedClassNames.push({name: key});\n flattenedClassData[[key]] = d;\n\n d.circle.classed(\"rdf-class\", true);\n d.circle.on('mouseover', function(event) {\n if (config.noPrefixes) {\n tip.show(d, event);\n } else if (!d.textHidden) {\n tip.hide(d);\n } else {\n tip.show(d, event);\n }\n });\n d.circle.on('mouseout', tip.hide);\n }\n })\n // custom event used when user is following a guide\n .on(\"gdb-focus\", (event, d) => doFocus(d))\n .on(\"gdb-zoom\", (event, d) => zoom(d));\n\n\n if (flattenedClassNames) {\n flattenedClassNames = _.uniqBy(flattenedClassNames, 'name');\n scope.flattenedClassNames = flattenedClassNames;\n }\n\n let selectedClass;\n\n function getCurrentClassDataAndMarkSelected(obj) {\n d3.selectAll(\".selected\").classed(\"selected\", obj.selected = false);\n obj.circle.classed(\"selected\", obj.selected = true);\n selectedClass = obj;\n }\n\n function showClassInfoPanel() {\n scope.selectedClass = selectedClass;\n scope.showClassInfoPanel = true;\n }\n\n function closeClassInfoPanel() {\n scope.showClassInfoPanel = false;\n }\n\n function goToDomainRangeGraphView() {\n $rootScope.$broadcast('goToDomainRangeGraphView', selectedClass, focus);\n }\n\n const clickCancel = D3.Click.delayDblClick();\n d3.selectAll(\".parent, .topLevelParent, .child, .root\")\n .call(clickCancel);\n\n doFocus = function(obj) {\n zoom(obj);\n\n if (obj.data.name === ROOT_OBJ_NAME) {\n closeClassInfoPanel();\n d3.selectAll(\".selected\").classed(\"selected\", false);\n } else {\n getCurrentClassDataAndMarkSelected(obj);\n if (!suppressPanelOpen) {\n showClassInfoPanel();\n }\n\n // FIXME: is it ok to bind this event handler every time and not just once?\n scope.$on('sidePanelClosed', function(event) {\n d3.selectAll(\".selected\").classed(\"selected\", obj.selected = false);\n });\n }\n\n\n //do not stop event propagation here\n };\n\n clickCancel.on(\"click\", function(event, obj) {\n // add clicked class to browser history\n if (obj.data.id) {\n $window.history.pushState({id: obj.data.id}, \"classHierarchyPage\" + obj.data.id, \"hierarchy#\" + obj.data.id);\n }\n\n //hide current d3-tip tooltip\n tip.hide();\n\n doFocus(obj);\n });\n\n clickCancel.on(\"dblclick\", function(event, obj) {\n if (obj === root) {\n return;\n }\n // hide current d3-tip tooltip in order not to appear in the next view\n tip.hide();\n getCurrentClassDataAndMarkSelected(obj);\n goToDomainRangeGraphView();\n\n event.stopPropagation();\n });\n\n let lastTimeWheel = 0;\n svg.on('wheel', function(event) {\n // hide current d3-tip tooltip\n tip.hide();\n\n event.preventDefault();\n event.stopPropagation();\n\n // at least 100ms must have passed since last time we updated\n const now = Date.now();\n if (now - lastTimeWheel > 100) {\n lastTimeWheel = now;\n } else {\n return;\n }\n\n let direction = '';\n if (event.deltaY <= -1) {\n direction = 'in';\n } else if (event.deltaY >= 1) {\n direction = 'out';\n }\n\n let obj = event.target.__data__;\n\n if (!obj) {\n // scroll outside the big circle\n obj = focus;\n }\n\n if (direction === 'in') {\n // determine object to zoom to\n\n if (obj !== focus) {\n // consider the object on which the scroll event occurred\n // and find the furthest parent that has no focused children\n while (obj.parent && !obj.parent.isInFocusTransitive) {\n obj = obj.parent;\n }\n if (obj.depth < focus.depth) {\n // however if that parent is of lower depth than the focus we ignore it\n obj = focus;\n }\n }\n\n if (obj === focus && obj.children) {\n // if object is in focus and it has children we zoom to its biggest child\n // TODO: sort children on backend\n let newobj = obj.children[0];\n for (let i = 1; i < obj.children.length; i++) {\n if (obj.children[i].sortingRank > newobj.sortingRank) {\n newobj = obj.children[i];\n }\n }\n if (newobj.children) {\n // Use the child only if it has children\n obj = newobj;\n }\n } else if (!obj.children) {\n // If node has no children use its parent instead\n obj = obj.parent;\n }\n\n zoom(obj, true);\n } else if (direction === 'out') {\n // zooming out simply goes one parent up\n obj = focus.parent;\n if (obj) {\n zoom(obj, true);\n }\n }\n\n if (focus.data.name === ROOT_OBJ_NAME) {\n $window.history.replaceState({id: 1}, \"classHierarchyPage1\", \"hierarchy#1\");\n }\n\n // redraw slider on zoom out\n sendSliderData();\n });\n\n const text = g.selectAll(\"text\")\n .data(nodes)\n .enter().append(\"text\")\n .attr(\"class\", function(d) {\n return d.children && d.children.length ? \"label\" : \"label child-label\";\n })\n .each(function(d) {\n d.textSel = d3.select(this);\n });\n\n function trimPrefixes(d) {\n const idx = d.data.name.indexOf(\":\");\n const absUriIdx = d.data.name.indexOf(\"http://\");\n if (absUriIdx > -1) {\n // if we have no prefix available ignore\n d.noPrefixName = d.data.name;\n } else if (idx > -1) {\n d.noPrefixName = d.data.name.substring(idx + 1);\n }\n }\n\n if (config.noPrefixes) {\n text.each(trimPrefixes);\n text\n .style(\"font-size\", function(d) {\n return D3.Text.calcFontSize(d.noPrefixName, d.r);\n })\n .text(function(d) {\n return D3.Text.getTextWithElipsisIfNeeded(d.noPrefixName, d.r / 3);\n });\n } else {\n text\n .style(\"font-size\", function(d) {\n return D3.Text.calcFontSize(d.data.name, d.r);\n })\n .text(function(d) {\n return D3.Text.getTextWithElipsisIfNeeded(d.data.name, d.r / 3);\n });\n }\n\n // TODO: make this use the full version (same as zoom)\n text.style(\"display\", function(d) {\n if (d.parent && d.parent.data === focus.data) {\n d.textHidden = this.textContent.indexOf(\"...\") + 3 === this.textContent.length;\n return null;\n } else {\n d.textHidden = true;\n return \"none\";\n }\n });\n\n if (config.doFade && !config.keepPrevState) {\n text.each(function(d) {\n D3.Transition.fadeIn(d3.select(this), 550);\n });\n }\n\n autoZoomToPreviousState = function() {\n function focusOnCurrentClass(focusHistoryId) {\n if (focusHistoryId) {\n circle.each(function(d) {\n if (+focusHistoryId === d.data.id) {\n doFocus(d);\n }\n });\n }\n }\n\n const focusHistoryId = $location.hash();\n\n $window.onpopstate = function(event) {\n if (event.state) {\n const focusHistoryId = event.state.id;\n focusOnCurrentClass(focusHistoryId);\n }\n };\n\n focusOnCurrentClass(focusHistoryId);\n };\n\n const node = g.selectAll(\"circle, text\");\n\n function zoomTo(v, switchPrefixes) {\n const k = diameter / v[2];\n view = v;\n\n node.attr(\"transform\", function(d) {\n return \"translate(\" + (d.x - v[0]) * k + \",\" + (d.y - v[1]) * k + \")\";\n });\n\n circle.attr(\"r\", function(d) {\n return d.r * k;\n });\n\n function switchPrefixesInPlace(d) {\n // if uris match with the topLevelParentUri of the focused element\n // or your focus is a top level parent hide its label and if it is not\n // a child element show all of its child labels. If it is a child element\n // only show its label.\n if (d.data.fullName === focus.data.topLevelParentUri || focus.data.topLevelParentUri === ROOT_OBJ_NAME) {\n d.textSel.style(\"display\", \"none\");\n if (focus.children && focus.children.length) {\n _.each(focus.children, function(c) {\n c.textSel.style(\"display\", \"inline\");\n });\n } else {\n focus.textSel.style(\"display\", \"inline\");\n }\n\n // in order to show prefixes of siblings check if the focused\n // element has a parent and show all of its children except\n // for the name of the focused element because you need to see\n // its children\n if (focus.parent) {\n _.each(focus.parent.children, function(c) {\n if (c.data.name !== focus.data.name) {\n c.textSel.style(\"display\", \"inline\");\n }\n });\n }\n }\n }\n\n if (switchPrefixes) {\n text.each(switchPrefixesInPlace);\n }\n\n text\n .style(\"font-size\", function(d) {\n if (config.noPrefixes) {\n return D3.Text.calcFontSize(d.noPrefixName, d.r * k);\n }\n return D3.Text.calcFontSize(d.data.name, d.r * k);\n })\n .text(function(d) {\n if (config.noPrefixes) {\n return D3.Text.getTextWithElipsisIfNeeded(d.noPrefixName, d.r * k / 3);\n }\n return D3.Text.getTextWithElipsisIfNeeded(d.data.name, d.r * k / 3);\n });\n }\n\n\n function adjustRadius(r) {\n let newr = r * 2 + margin;\n if (r * 2 / newr < 0.3) {\n // for very small circles we need to adjust\n newr = r * 2 + 2;\n }\n return newr;\n }\n\n zoomTo([focus.x, focus.y, adjustRadius(focus.r)], switchPrefixes);\n\n function textUpdate(d) {\n if (d.isInFocusTransitive || !(d.parent && d.parent.isInFocusTransitive)) {\n // hide labels of classes that are in focus (including children) OR whose parents aren't in focus\n d.textHidden = true;\n this.style.display = \"none\";\n } else {\n // show all other labels\n d.textHidden = this.textContent.indexOf(\"...\") + 3 === this.textContent.length;\n this.style.display = \"\";\n }\n }\n\n function zoom(d, shouldClosePanel) {\n // use empty timeout to force the following code to be executed on the next $digest cycle\n // in order to avoid '$digest in progress' error\n $timeout(function() {\n scope.showExternalElements = (d.data.name === ROOT_OBJ_NAME);\n });\n\n if (focus === d) {\n // Node is already zoomed to\n // Important to return before we modify the history, otherwise we choke the browser\n return;\n }\n\n if (d.data.id) {\n $window.history.replaceState({id: d.data.id}, \"classHierarchyPage\" + d.data.id, \"hierarchy#\" + d.data.id);\n }\n\n if (!d.children) {\n // No children - zoom to parent instead\n d = d.parent;\n if (focus === d) {\n // Parent is already zoomed to\n return;\n }\n }\n\n if (shouldClosePanel) {\n closeClassInfoPanel();\n d3.selectAll(\".selected\").classed(\"selected\", false);\n }\n\n if (focus.parent) {\n let p = focus;\n while (p) {\n p.isInFocusTransitive = false;\n p = p.parent;\n }\n }\n\n let p = d;\n while (p) {\n p.isInFocusTransitive = !!p.children;\n p = p.parent;\n }\n\n focus = d;\n\n const isVerySmallCircle = focus.r * 2 / (focus.r * 2 + margin) < 0.3;\n\n if (isVerySmallCircle || scope.currentSliderValue > scope.currentBrowserLimit) {\n // no fancy animation for slower browsers if above the limit or if zooming to a very small circle\n zoomTo([focus.x, focus.y, adjustRadius(focus.r)]);\n\n text.each(function(d) {\n textUpdate.call(this, d);\n });\n } else {\n // the fancy version for faster browsers\n const transition = d3.transition()\n .duration(ZOOM_DURATION)\n .tween(\"zoom\", function(d) {\n const i = d3.interpolateZoom(view, [focus.x, focus.y, adjustRadius(focus.r)]);\n return function(t) {\n zoomTo(i(t));\n };\n });\n\n transition.selectAll(\"text\")\n // Experimental: hide texts to be hidden on \"start\", show texts to be shown on \"end\"\n .each(textUpdate);\n }\n }\n\n rootFocusEvent = scope.$on('rootFocus', function() {\n $window.history.pushState({id: 1}, \"classHierarchyPage1\", \"hierarchy#1\");\n doFocus(rootHierarchy);\n });\n\n classSearchEvent = scope.$on('classSearch', function(selectedClass) {\n doFocus(selectedClass);\n });\n }\n\n function sendSliderData() {\n const currentClassCount = scope.classHierarchyData.classCount;\n let currentSliderValue = LocalStorageAdapter.get(LSKeys.CLASS_HIERARCHY_CURRENT_SLIDER_VALUE);\n\n if (!currentSliderValue || currentSliderValue > currentClassCount) {\n currentSliderValue = currentClassCount;\n LocalStorageAdapter.set(LSKeys.CLASS_HIERARCHY_CURRENT_SLIDER_VALUE, currentSliderValue);\n }\n\n $rootScope.$broadcast(\"classCount\", currentClassCount, currentSliderValue);\n }\n\n window.addEventListener('resize', sendSliderData);\n\n window.addEventListener('beforeunload', removeResizeListener);\n\n function removeResizeListener() {\n window.removeEventListener('resize', sendSliderData);\n window.removeEventListener('beforeunload', removeResizeListener);\n }\n\n let prefixesWatch;\n let currentClassCountWatch;\n let searchedClassBroadcast;\n let onEnterClassSearchBroadcast;\n\n scope.$watch('classHierarchyData', function() {\n // when data changes unregister watchers by calling them\n if (prefixesWatch) prefixesWatch();\n if (currentClassCountWatch) currentClassCountWatch();\n if (searchedClassBroadcast) searchedClassBroadcast();\n if (onEnterClassSearchBroadcast) onEnterClassSearchBroadcast();\n\n // get initial state of prefixes (hidden or not) when changing repositories\n // in order to avoid triggering an unwanted prefixes watch\n let initialPrefixesState = getPrefixesState();\n\n if (scope.classHierarchyData.classCount) {\n sendSliderData();\n\n const rootData = structuredClone(scope.classHierarchyData);\n\n const root = d3.hierarchy(rootData);\n\n function sortRoot(root) {\n // add all classes to a flat array, add parent information\n // and sort according to instancesCount DESC, depth ASC\n\n return root.descendants()\n .sort(function(a, b) {\n if (a.data.sortingRank > b.data.sortingRank) {\n return -1;\n } else if (a.data.sortingRank < b.data.sortingRank) {\n return 1;\n } else if (a.data.depth > b.data.depth) {\n return 1;\n } else if (a.data.depth < b.data.depth) {\n return -1;\n } else {\n return 0;\n }\n });\n }\n\n const sortedChildren = sortRoot(root);\n\n // we start with an empty new rootData\n let filteredRootData;\n let noPrefixesGlobal;\n\n\n function restoreDiagramState(currentRootData, switchPrefixes) {\n const prefixesConfig = {\n keepPrevState: true,\n noPrefixes: getPrefixesState(),\n };\n\n // get noPrefixes flag from drawDiagram configuration params\n noPrefixesGlobal = prefixesConfig.noPrefixes;\n\n if (filteredRootData) {\n drawDiagram(filteredRootData, prefixesConfig, focus, true);\n } else {\n drawDiagram(currentRootData, prefixesConfig, focus, true);\n }\n\n $timeout(() => {\n LocalStorageAdapter.set(LSKeys.CLASS_HIERARCHY_SWITCH_PREFIXES, switchPrefixes);\n autoZoomToPreviousState();\n // Need to set this to false to enable the info panel to work when selecting a class.\n // The panel opening will be suppressed only when the prefixes are toggled.\n suppressPanelOpen = false;\n }, 70);\n }\n\n function redrawFilteredDiagram(currentSliderValue, sortedChildrenArray, useSlider) {\n if (!currentSliderValue) {\n return;\n }\n\n LocalStorageAdapter.set(LSKeys.CLASS_HIERARCHY_CURRENT_SLIDER_VALUE, currentSliderValue);\n\n filteredRootData = {\n name: ROOT_OBJ_NAME,\n children: [],\n };\n\n // walk through the given count of (sortedChildrenArray) classes\n // - record the id of each class we've seen\n // - add the rootData level classes to the new rootData\n const addedIds = new Set();\n for (let k = 1; k <= currentSliderValue; k++) {\n addedIds.add(sortedChildrenArray[k].data.id);\n if (sortedChildrenArray[k].parent === sortedChildrenArray[0]) { // i.e. the parent is the \"class hierarchy\"\n filteredRootData.children.push(sortedChildrenArray[k].data);\n }\n }\n\n // walk through all the classes in the new rootData and only keep those that have an \"added id\"\n // we create separate copies of the arrays in order not to contaminate the original data\n // we also copy each class's object ($.extend ...) for the same reason\n function fixChildren(node) {\n if (!node.children) {\n return;\n }\n const newChildren = [];\n for (const child of node.children) {\n if (addedIds.has(child.id)) {\n newChildren.push($.extend({}, child));\n }\n }\n node.children = newChildren;\n for (const child of node.children) {\n fixChildren(child);\n }\n }\n\n fixChildren(filteredRootData);\n\n if (useSlider) {\n // redraw diagram when slider value changes and persist current state\n // in local storage\n noPrefixesGlobal = angular.isUndefined(noPrefixesGlobal) ? getPrefixesState() : noPrefixesGlobal;\n const redrawConfig = {\n noPrefixes: noPrefixesGlobal,\n };\n drawDiagram(filteredRootData, redrawConfig);\n } else {\n // if the user returns to the diagram with back browser button\n // read the saved state (show/hide prefixes, current slider value)\n // from local storage and render the diagram according to the saved metrics\n restoreDiagramState(rootData);\n }\n }\n\n const currentSliderValue = LocalStorageAdapter.get(LSKeys.CLASS_HIERARCHY_CURRENT_SLIDER_VALUE);\n if (currentSliderValue) {\n redrawFilteredDiagram(currentSliderValue, sortedChildren);\n } else {\n const basicConfig = {\n doFade: true,\n keepPrevState: true,\n noPrefixes: getPrefixesState(),\n };\n drawDiagram(rootData, basicConfig);\n autoZoomToPreviousState();\n }\n\n prefixesWatch = scope.$watch('hidePrefixes', function(hidePrefixes) {\n if (angular.isUndefined(hidePrefixes) || initialPrefixesState) {\n initialPrefixesState = undefined;\n return;\n }\n // if digest overflows a possible fix might be wrapping this in $timeout\n $timeout(function() {\n suppressPanelOpen = true;\n savePrefixesState(hidePrefixes);\n restoreDiagramState(rootData, true);\n }, 50);\n }, true);\n\n currentClassCountWatch = scope.$watch('currentSliderValue', function(currentSliderValue) {\n redrawFilteredDiagram(currentSliderValue, sortedChildren, true);\n }, true);\n\n // we handle this event for the cases where we already have searched for a given class and\n // hit enter again on the already selected class in order again react and zoom to it again\n // if we are not at the moment\n let currentSearchedClass;\n onEnterClassSearchBroadcast = scope.$on('onEnterKeypressSearchAction', function(event) {\n if (currentSearchedClass) {\n doFocus(currentSearchedClass);\n }\n });\n\n searchedClassBroadcast = scope.$on('searchedClass', function(event, searchedClass) {\n currentSearchedClass = flattenedClassData[searchedClass.name];\n if (currentSearchedClass) {\n doFocus(currentSearchedClass);\n }\n });\n }\n }, true);\n }\n}\n","var CirclePacking = CirclePacking || {};\n\nCirclePacking.SingleChild = function () {\n /*\n Functions that enable single child circles to display properly, see\n http://stackoverflow.com/questions/22307486/d3-js-packed-circle-layout-how-to-adjust-child-radius\n */\n function addPlaceholders(node, first) {\n if (node.children) {\n for (var i = 0; i < node.children.length; i++) {\n var child = node.children[i];\n addPlaceholders(child);\n }\n\n if (node.children.length === 1) {\n var placeholderSize = node.size * 1.2;\n if (first) {\n placeholderSize = node.children[0].size * 0.1;\n }\n node.children.push({\n name: 'placeholder', size: placeholderSize,\n // children: []\n });\n }\n }\n }\n\n function removePlaceholders(nodes) {\n for (var i = nodes.length - 1; i >= 0; i--) {\n var node = nodes[i];\n\n if (node.data.name === 'placeholder') {\n nodes.splice(i, 1);\n } else {\n if (node.children) {\n removePlaceholders(node.children);\n }\n }\n }\n }\n\n function centerNodes(nodes) {\n for (var i = 0; i < nodes.length; i++) {\n var node = nodes[i];\n\n if (node.children) {\n if (node.children.length === 1) {\n var offset = node.x - node.children[0].x;\n node.children[0].x += offset;\n reposition(node.children[0], offset);\n }\n }\n }\n\n function reposition(node, offset) {\n if (node.children) {\n for (var i = 0; i < node.children.length; i++) {\n node.children[i].x += offset;\n reposition(node.children[i], offset);\n }\n }\n }\n }\n\n function makePositionsRelativeToZero(nodes) {\n //use this to have vis centered at 0,0,0 (easier for positioning)\n var offsetX = nodes[0].x;\n var offsetY = nodes[0].y;\n\n for (var i = 0; i < nodes.length; i++) {\n\n var node = nodes[i];\n\n node.x -= offsetX;\n node.y -= offsetY;\n }\n }\n\n return {\n addPlaceholders: addPlaceholders,\n removePlaceholders: removePlaceholders,\n centerNodes: centerNodes,\n makePositionsRelativeToZero: makePositionsRelativeToZero\n }\n}();\n\nexport default CirclePacking;\n","import 'lib/d3.patch.js'\nimport {selectAll} from 'd3';\n\nconst d3 = {selectAll};\nvar SVG = SVG || {};\n\nSVG.Export = function () {\n function getCSSRules(cssSourceFilePath) {\n const cssRules = $('link[href=\"' + cssSourceFilePath + '\"]')[0].sheet.rules;\n let cssStr = \"\";\n _.each(cssRules, function (value) {\n cssStr += value.cssText;\n });\n return cssStr;\n }\n\n function generateBase64ImageSource(svgSelectorClass) {\n if (!svgSelectorClass) {\n svgSelectorClass = \"svg\";\n }\n // add needed xml namespace\n const exportSvg = d3.selectAll(svgSelectorClass)\n .attr(\"version\", \"1.1\")\n .attr(\"xmlns\", \"http://www.w3.org/2000/svg\")\n .node().parentNode.innerHTML;\n\n // convert selected html to base64\n return \"data:image/svg+xml;charset=utf-8;base64,\" + btoa(unescape(encodeURIComponent(exportSvg)));\n }\n\n return {\n getCSSRules: getCSSRules,\n generateBase64ImageSource: generateBase64ImageSource\n };\n}();\n\nexport default SVG;\n"],"names":["classHierarchyDirective","$rootScope","$location","GraphDataRestService","$window","$timeout","$repositories","toastr","ZOOM_DURATION","ROOT_OBJ_NAME","LocalStorageAdapter","LSKeys","$translate","restrict","template","scope","classHierarchyData","flattenedClassNames","selectedClass","currentSliderValue","showClassInfoPanel","showExternalElements","hidePrefixes","currentBrowserLimit","link","element","attrs","suppressPanelOpen","tip","rootHierarchy","packLayout","d3","size","diameter","color","domain","range","interpolate","svg","insert","attr","on","appendMainGroup","append","id","transform","getPrefixesState","get","CLASS_HIERARCHY_HIDE_PREFIXES","prepareForSVGImageExport","cssRules","SVG","Export","getCSSRules","$","style","imgSrc","generateBase64ImageSource","this","href","download","getActiveRepository","g","hasData","classCount","canUseRepo","isSystemRepository","autoZoomToPreviousState","doFocus","focus","rootFocusEvent","classSearchEvent","service","LicenseContextService","onLicenseChanged","license","valid","loader","hierarchyError","selGraphFromCache","getClassHierarchyData","contextID","uri","success","response","status","warning","instant","error","getError","name","fetchClassHierarchy","flattenedClassData","drawDiagram","root","config","newFocus","switchPrefixes","remove","CirclePacking","SingleChild","addPlaceholders","sum","d","nodes","descendants","view","isInFocusTransitive","removePlaceholders","centerNodes","makePositionsRelativeToZero","d3tip","customPosition","event","top","bottom","innerHeight","clientY","right","innerWidth","clientX","html","data","call","circleGroup","selectAll","enter","doFade","each","D3","Transition","fadeIn","circle","role","children","depth","key","push","classed","noPrefixes","textHidden","show","hide","zoom","getCurrentClassDataAndMarkSelected","obj","selected","closeClassInfoPanel","_","uniqBy","clickCancel","Click","delayDblClick","$on","history","pushState","$broadcast","stopPropagation","lastTimeWheel","preventDefault","now","Date","direction","deltaY","target","__data__","parent","newobj","i","length","sortingRank","replaceState","sendSliderData","text","textSel","idx","indexOf","noPrefixName","substring","Text","calcFontSize","r","getTextWithElipsisIfNeeded","textContent","keepPrevState","focusOnCurrentClass","focusHistoryId","hash","onpopstate","state","node","zoomTo","v","k","x","y","fullName","topLevelParentUri","c","adjustRadius","newr","textUpdate","display","shouldClosePanel","p","duration","tween","t","currentClassCount","CLASS_HIERARCHY_CURRENT_SLIDER_VALUE","set","prefixesWatch","currentClassCountWatch","searchedClassBroadcast","onEnterClassSearchBroadcast","window","addEventListener","removeResizeListener","removeEventListener","$watch","initialPrefixesState","rootData","structuredClone","sortedChildren","sort","a","b","filteredRootData","noPrefixesGlobal","restoreDiagramState","currentRootData","prefixesConfig","CLASS_HIERARCHY_SWITCH_PREFIXES","redrawFilteredDiagram","sortedChildrenArray","useSlider","addedIds","Set","add","fixChildren","newChildren","child","has","extend","angular","isUndefined","basicConfig","currentSearchedClass","undefined","savePrefixesState","searchedClass","renderCirclePacking","module","constant","directive","$inject","first","placeholderSize","splice","offset","reposition","offsetX","offsetY","cssSourceFilePath","sheet","rules","cssStr","value","cssText","svgSelectorClass","exportSvg","parentNode","innerHTML","btoa","unescape","encodeURIComponent"],"sourceRoot":""}
@@ -1,2 +1,2 @@
1
- export const __webpack_esm_id__=90418;export const __webpack_esm_ids__=[90418];export const __webpack_esm_modules__={90418(){function e(){return{restrict:"E",require:"ngModel",scope:{ngModel:"=",ngDisabled:"=",placeholder:"@"},templateUrl:"js/angular/core/templates/editable-content/editable-content.html",link:function(e,t,n,o){const a=t.find("div"),l=()=>{e.ngDisabled||e.$apply(()=>{a.html().length&&!a.text().trim().length&&a.empty(),o.$setViewValue(a[0].innerText)})};o.$render=()=>{a.html(o.$viewValue||"")};const r=e=>{e.preventDefault();const t=(e.originalEvent||e).clipboardData.getData("text/plain"),n=window.getSelection();if(!n.rangeCount)return;n.deleteFromDocument();const o=n.getRangeAt(0),a=document.createDocumentFragment(),l=t.split("\n");l.forEach((e,t)=>{a.appendChild(document.createTextNode(e)),t<l.length-1&&a.appendChild(document.createElement("br"))}),o.insertNode(a),n.collapseToEnd()};e.$on("$destroy",()=>{a.off("blur keyup change input",l),a.off("paste",r)}),a.on("blur keyup change input",l),a.on("paste",r)}}}angular.module("graphdb.framework.core.directives.editable-content",[]).directive("editableContent",e),e.$inject=[]}};
2
- //# sourceMappingURL=90418.0a737513ff59bfee423a.bundle.js.map
1
+ export const __webpack_esm_id__=90418;export const __webpack_esm_ids__=[90418];export const __webpack_esm_modules__={90418(){function e(){return{restrict:"E",require:"ngModel",scope:{ngModel:"=",ngDisabled:"=",placeholder:"@"},templateUrl:"js/angular/core/templates/editable-content/editable-content.html",link:function(e,t,n,o){const a=t.find("div"),l=()=>{e.ngDisabled||e.$apply(()=>{a.html().length&&!a.text().trim().length&&a.empty(),o.$setViewValue(a[0].innerText)})};o.$render=()=>{a.html(o.$viewValue||"")};const r=e=>{e.preventDefault();const t=(e.originalEvent||e).clipboardData.getData("text/plain"),n=window.getSelection();if(!n.rangeCount)return;n.deleteFromDocument();const o=n.getRangeAt(0),a=document.createDocumentFragment(),r=t.split("\n");r.forEach((e,t)=>{a.appendChild(document.createTextNode(e)),t<r.length-1&&a.appendChild(document.createElement("br"))}),o.insertNode(a),n.collapseToEnd(),l()};e.$on("$destroy",()=>{a.off("blur keyup change input",l),a.off("paste",r)}),a.on("blur keyup change input",l),a.on("paste",r)}}}angular.module("graphdb.framework.core.directives.editable-content",[]).directive("editableContent",e),e.$inject=[]}};
2
+ //# sourceMappingURL=90418.ee1af575862a64c12457.bundle.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"90418.ee1af575862a64c12457.bundle.js","mappings":"6HAoBA,SAASA,IACL,MAAO,CACHC,SAAU,IACVC,QAAS,UACTC,MAAO,CACHC,QAAS,IACTC,WAAY,IACZC,YAAa,KAEjBC,YAAa,mEACbC,KAAM,SAASL,EAAOM,EAASC,EAAOC,GAKlC,MAAMC,EAAcH,EAAQI,KAAK,OAU3BC,EAAmBA,KAChBX,EAAME,YACPF,EAAMY,OAAO,KACLH,EAAYI,OAAOC,SAAWL,EAAYM,OAAOC,OAAOF,QAExDL,EAAYQ,QAEhBT,EAAYU,cAAcT,EAAY,GAAGU,cAQrDX,EAAYY,QAAU,KAClBX,EAAYI,KAAKL,EAAYa,YAAc,KAU/C,MAAMC,EAAgBC,IAClBA,EAAMC,iBAEN,MAAMT,GAAQQ,EAAME,eAAiBF,GAAOG,cAAcC,QAAQ,cAC5DC,EAAYC,OAAOC,eAEzB,IAAKF,EAAUG,WAAY,OAE3BH,EAAUI,qBACV,MAAMC,EAAQL,EAAUM,WAAW,GAC7BC,EAAWC,SAASC,yBACpBC,EAAQvB,EAAKwB,MAAM,MAEzBD,EAAME,QAAQ,CAACC,EAAMC,KACjBP,EAASQ,YAAYP,SAASQ,eAAeH,IACzCC,EAAQJ,EAAMxB,OAAS,GACvBqB,EAASQ,YAAYP,SAASS,cAAc,SAIpDZ,EAAMa,WAAWX,GACjBP,EAAUmB,gBACVpC,KAeJX,EAAMgD,IAAI,WALmBC,KACzBxC,EAAYyC,IAAI,0BAA2BvC,GAC3CF,EAAYyC,IAAI,QAAS5B,KAI7Bb,EAAY0C,GAAG,0BAA2BxC,GAC1CF,EAAY0C,GAAG,QAAS7B,EAC5B,EAER,CAnGA8B,QACKC,OAAO,qDAHI,IAIXC,UAAU,kBAAmBzD,GAElCA,EAAgB0D,QAAU,E","sources":["webpack://root-config/./packages/legacy-workbench/src/js/angular/core/directives/editable-content/editable-content.js"],"sourcesContent":["/**\n * @ngdoc directive\n * @name editableContent\n * @module graphdb.framework.core.directives.editable-content\n * @restrict E\n * @description\n * A reusable contenteditable directive bound to an ngModel. It allows editable plain-text input and supports disabling and placeholder text.\n *\n * @param {string} ngModel - The model to bind contenteditable input to.\n * @param {boolean=} ngDisabled - Disables the contenteditable field when true.\n * @param {string=} placeholder - Placeholder text to show when input is empty.\n */\nconst modules = [];\n\nangular\n .module('graphdb.framework.core.directives.editable-content', modules)\n .directive('editableContent', editableContent);\n\neditableContent.$inject = [];\n\nfunction editableContent() {\n return {\n restrict: 'E',\n require: 'ngModel',\n scope: {\n ngModel: '=',\n ngDisabled: '=',\n placeholder: '@',\n },\n templateUrl: 'js/angular/core/templates/editable-content/editable-content.html',\n link: function(scope, element, attrs, ngModelCtrl) {\n // =========================\n // Private variables\n // =========================\n\n const editableDiv = element.find('div');\n\n // =========================\n // Private functions\n // =========================\n\n /**\n * Updates the bound ngModel with the current contenteditable value.\n * Also clears invalid HTML when only whitespace remains.\n */\n const updateModelValue = () => {\n if (!scope.ngDisabled) {\n scope.$apply(() => {\n if (editableDiv.html().length && !editableDiv.text().trim().length) {\n // Fixes a problem with the placeholder when type some word and delete it.\n editableDiv.empty();\n }\n ngModelCtrl.$setViewValue(editableDiv[0].innerText);\n });\n }\n };\n\n /**\n * Renders the model value into the contenteditable element.\n */\n ngModelCtrl.$render = () => {\n editableDiv.html(ngModelCtrl.$viewValue || '');\n };\n\n /**\n * Handles paste events in the contenteditable element by inserting plain text only.\n * Prevents the default paste behavior and manually inserts the clipboard text as plain text,\n * preserving line breaks by converting them to <br> elements.\n *\n * @param {Event} event - The paste event object containing clipboard data.\n */\n const pasteHandler = (event) => {\n event.preventDefault();\n\n const text = (event.originalEvent || event).clipboardData.getData('text/plain');\n const selection = window.getSelection();\n\n if (!selection.rangeCount) return;\n\n selection.deleteFromDocument();\n const range = selection.getRangeAt(0);\n const fragment = document.createDocumentFragment();\n const lines = text.split('\\n');\n\n lines.forEach((line, index) => {\n fragment.appendChild(document.createTextNode(line));\n if (index < lines.length - 1) {\n fragment.appendChild(document.createElement('br'));\n }\n });\n\n range.insertNode(fragment);\n selection.collapseToEnd();\n updateModelValue();\n };\n\n // =========================\n // Subscriptions\n // =========================\n\n /**\n * Unsubscribes from all watchers and event listeners to prevent memory leaks.\n */\n const removeAllSubscribers = () => {\n editableDiv.off('blur keyup change input', updateModelValue);\n editableDiv.off('paste', pasteHandler);\n };\n\n scope.$on('$destroy', removeAllSubscribers);\n editableDiv.on('blur keyup change input', updateModelValue);\n editableDiv.on('paste', pasteHandler);\n },\n };\n}\n"],"names":["editableContent","restrict","require","scope","ngModel","ngDisabled","placeholder","templateUrl","link","element","attrs","ngModelCtrl","editableDiv","find","updateModelValue","$apply","html","length","text","trim","empty","$setViewValue","innerText","$render","$viewValue","pasteHandler","event","preventDefault","originalEvent","clipboardData","getData","selection","window","getSelection","rangeCount","deleteFromDocument","range","getRangeAt","fragment","document","createDocumentFragment","lines","split","forEach","line","index","appendChild","createTextNode","createElement","insertNode","collapseToEnd","$on","removeAllSubscribers","off","on","angular","module","directive","$inject"],"sourceRoot":""}
@@ -1,2 +1,2 @@
1
- export const __webpack_esm_id__=96972;export const __webpack_esm_ids__=[14267,96972];export const __webpack_esm_modules__={96972(e,t,n){n(38473),n(23236);var o=n(24125),s=n(22723),r=n(14267),a=n(44482),c=n(57154);const i={select:a.select};let l=240;const d={no_cluster_configured:"",create_cluster_btn:"",legend_node_state:"",legend_link_state:"",node_state_leader:"Leader",node_state_follower:"Follower",node_state_candidate:"Candidate",node_state_no_cluster:"No cluster",node_state_out_of_sync:"Out of sync",node_state_no_connection:"No connection",node_state_read_only:"Read only",node_state_restricted:"Restricted",link_state_in_sync:"In sync",link_state_syncing:"Syncing",link_state_out_of_sync:"Out of sync",recovery_state:{searching_for_node:"Searching for node",waiting_for_snapshot:"Waiting for snapshot from node",receiving_snapshot:"Receiving a snapshot from node",applying_snapshot:"Applying a snapshot",building_snapshot:"Building a snapshot for node",sending_snapshot:"Sending a snapshot to node",recovery_operation_failure_warning:"Node unable to recover. Action required"}},u={node_state:"legend_node_state",link_state:"legend_link_state"};angular.module("graphdb.framework.clustermanagement.directives.cluster-graphical-view",["graphdb.framework.utils.localstorageadapter","graphdb.framework.clustermanagement.directives.cluster-legend"]).directive("clusterGraphicalView",["$window","LocalStorageAdapter","LSKeys","UriUtils","$translate","$jwtAuth","$rootScope","ClusterViewContextService",function(e,t,n,a,_,p,g,f){return{restrict:"E",scope:{clusterModel:"="},link:function(p,h){const m=(0,c.service)(c.AuthorizationService),y=angular.element(e),w=[];let v,k,S,b,C,M=L(),x=j(),A=Math.min(M,x)/2-100,D=M/2,E=x/2;function N(){const e=f.getClusterViewD3Container();M=L(),x=j(),e.attr("width",M),e.attr("height",x),z()}function V(e,t=""){Object.keys(e).forEach(n=>{let o="";t&&(o+=t),o+=`.${n}`;const s=e[n];"string"==typeof s?e[n]=_.instant(`cluster_management.cluster_graphical_view${o}`):"object"==typeof s&&V(s,o)})}function L(){const o="collapsedMenu"===t.get(n.MENU_STATE);return l=o?70:240,Math.max(Math.floor(.95*(e.innerWidth-l)),600)}function j(){return Math.max(.95*(e.innerHeight-250),675)}function I(e){p.$emit(r.DP,e.target)}function z(){A=Math.min(M,x)/2-100,D=M/2,E=x/2,o.cZ(S,D,E),S.select(".cluster-zone").attr("r",A),k!==p.clusterModel.hasCluster&&(k=!!p.clusterModel.hasCluster,function(e){o.Xl(e,S,d,v),!e&&v&&S.on("mouseup",()=>{p.$emit(r.Yn)})}(k));const e=function(){const e=(0,s.cloneDeep)(p.clusterModel.nodes)||[];return e.forEach(e=>{if(e.hostname=a.shortenIri(e.endpoint),!(0,s.isEmpty)(e.recoveryStatus)){let t=`cluster_management.cluster_graphical_view.recovery_state.${e.recoveryStatus.state.toLowerCase()}`;e.recoveryStatus.affectedNodes&&e.recoveryStatus.affectedNodes.length>0&&(t+="_with_affected_node"),e.recoveryStatus.message=_.instant(t,{node:e.recoveryStatus.affectedNodes.join(", ")})}}),e}();!function(e){const t=b.selectAll("#node-group").data(e,e=>e.address),n=o.kI(t,45);n.on("click",(e,t)=>{p.$emit(r.vu,t);const n=i.select(".nodetooltip"),o=$(window).width();e.pageX<o/2?(n.style("left",e.pageX+"px"),n.style("right","")):(n.style("left",""),n.style("right",o-e.pageX+"px")),n.style("top",e.pageY-28+"px")}),o.HF(n),o.ss(n,D,E,A)}(e),function(e,t){const n=C.selectAll(".link").data(e,e=>e.id);o.cy(n),o.$$(n,t)}((0,s.cloneDeep)(p.clusterModel.links)||[],e)}p.width=function(){return M},p.height=function(){return x},p.$on("$destroy",function(){y.unbind("resize",N),y.unbind("mousedown",I),o.Wg(),w.forEach(e=>e())}),v=m.isAdmin(),y.bind("resize",N),y.bind("mousedown",I),w.push(g.$on("$translateChangeSuccess",function(){V(d),o.r_(k,S,d),Object.keys(u).forEach(e=>{i.select(`#${e}`).text(function(e){return d[u[e]]}(e))})})),w.push(p.$on(r.aV,function(){z()})),V(d),function(e){const t=o.J5(h[0]).attr("width",M).attr("height",x);S=o.dB(t,e),C=t.append("g").attr("id","links-group"),b=t.append("g").attr("id","nodes-group"),o.D6(t,o.ZC.BIG),o.D6(t,o.ZC.SMALL),f.updateClusterViewD3Container(t)}(!(!p.clusterModel.nodes||!p.clusterModel.nodes.length)),z()}}}])},14267(e,t,n){n.d(t,{DP:()=>r,Yn:()=>c,aV:()=>i,fe:()=>s,pw:()=>o,vu:()=>a});const o="updateCluster",s="deleteCluster",r="clickInView",a="nodeSelected",c="createCluster",i="modelUpdated"}};
2
- //# sourceMappingURL=96972.896f91c5874df70d14bb.bundle.js.map
1
+ export const __webpack_esm_id__=96972;export const __webpack_esm_ids__=[14267,96972];export const __webpack_esm_modules__={96972(e,t,n){n(38473),n(23236);var o=n(24125),s=n(22723),r=n(14267),a=n(44482),c=n(57154);const i={select:a.select};let l=240;const d={no_cluster_configured:"",create_cluster_btn:"",legend_node_state:"",legend_link_state:"",node_state_leader:"Leader",node_state_follower:"Follower",node_state_candidate:"Candidate",node_state_no_cluster:"No cluster",node_state_out_of_sync:"Out of sync",node_state_no_connection:"No connection",node_state_read_only:"Read only",node_state_restricted:"Restricted",link_state_in_sync:"In sync",link_state_syncing:"Syncing",link_state_out_of_sync:"Out of sync",recovery_state:{searching_for_node:"Searching for node",waiting_for_snapshot:"Waiting for snapshot from node",receiving_snapshot:"Receiving a snapshot from node",applying_snapshot:"Applying a snapshot",building_snapshot:"Building a snapshot for node",sending_snapshot:"Sending a snapshot to node",recovery_operation_failure_warning:"Node unable to recover. Action required"}},u={node_state:"legend_node_state",link_state:"legend_link_state"};angular.module("graphdb.framework.clustermanagement.directives.cluster-graphical-view",["graphdb.framework.utils.localstorageadapter","graphdb.framework.clustermanagement.directives.cluster-legend"]).directive("clusterGraphicalView",["$window","LocalStorageAdapter","LSKeys","UriUtils","$translate","$jwtAuth","$rootScope","ClusterViewContextService",function(e,t,n,a,_,p,g,f){return{restrict:"E",scope:{clusterModel:"="},link:function(p,h){const m=(0,c.service)(c.AuthorizationService),y=angular.element(e),w=[];let v,k,S,b,C,M=L(),x=j(),A=Math.min(M,x)/2-100,D=M/2,E=x/2;function N(){const e=f.getClusterViewD3Container();M=L(),x=j(),e.attr("width",M),e.attr("height",x),z()}function V(e,t=""){Object.keys(e).forEach(n=>{let o="";t&&(o+=t),o+=`.${n}`;const s=e[n];"string"==typeof s?e[n]=_.instant(`cluster_management.cluster_graphical_view${o}`):"object"==typeof s&&V(s,o)})}function L(){const o="collapsedMenu"===t.get(n.MENU_STATE);return l=o?70:240,Math.max(Math.floor(.95*(e.innerWidth-l)),600)}function j(){return Math.max(.95*(e.innerHeight-250),675)}function I(e){p.$emit(r.DP,e.target)}function z(){A=Math.min(M,x)/2-100,D=M/2,E=x/2,o.cZ(S,D,E),S.select(".cluster-zone").attr("r",A),k!==p.clusterModel.hasCluster&&(k=!!p.clusterModel.hasCluster,function(e){o.Xl(e,S,d,v),!e&&v&&S.on("mouseup",()=>{p.$emit(r.Yn)})}(k));const e=function(){const e=(0,s.cloneDeep)(p.clusterModel.nodes)||[];return e.forEach(e=>{if(e.hostname=a.shortenIri(e.endpoint),!(0,s.isEmpty)(e.recoveryStatus)){let t=`cluster_management.cluster_graphical_view.recovery_state.${e.recoveryStatus.state.toLowerCase()}`;e.recoveryStatus.affectedNodes&&e.recoveryStatus.affectedNodes.length>0&&(t+="_with_affected_node"),e.recoveryStatus.message=_.instant(t,{node:e.recoveryStatus.affectedNodes.join(", ")})}}),e}();!function(e){const t=b.selectAll("#node-group").data(e,e=>e.address),n=o.kI(t,45);n.on("click",(e,t)=>{p.$emit(r.vu,t);const n=i.select(".nodetooltip"),o=$(window).width();e.pageX<o/2?(n.style("left",e.pageX+"px"),n.style("right","")):(n.style("left",""),n.style("right",o-e.pageX+"px")),n.style("top",e.pageY-28+"px")}),o.HF(n),o.ss(n,D,E,A)}(e),function(e,t){const n=C.selectAll(".link").data(e,e=>e.id);o.cy(n),o.$$(n,t),o.Tk(C,e,t)}((0,s.cloneDeep)(p.clusterModel.links)||[],e)}p.width=function(){return M},p.height=function(){return x},p.$on("$destroy",function(){y.unbind("resize",N),y.unbind("mousedown",I),o.Wg(),w.forEach(e=>e())}),v=m.isAdmin(),y.bind("resize",N),y.bind("mousedown",I),w.push(g.$on("$translateChangeSuccess",function(){V(d),o.r_(k,S,d),Object.keys(u).forEach(e=>{i.select(`#${e}`).text(function(e){return d[u[e]]}(e))})})),w.push(p.$on(r.aV,function(){z()})),V(d),function(e){const t=o.J5(h[0]).attr("width",M).attr("height",x);S=o.dB(t,e),C=t.append("g").attr("id","links-group"),b=t.append("g").attr("id","nodes-group"),o.D6(t,o.ZC.BIG),o.D6(t,o.ZC.SMALL),f.updateClusterViewD3Container(t)}(!(!p.clusterModel.nodes||!p.clusterModel.nodes.length)),z()}}}])},14267(e,t,n){n.d(t,{DP:()=>r,Yn:()=>c,aV:()=>i,fe:()=>s,pw:()=>o,vu:()=>a});const o="updateCluster",s="deleteCluster",r="clickInView",a="nodeSelected",c="createCluster",i="modelUpdated"}};
2
+ //# sourceMappingURL=96972.fc25a13bb1bc69ad785c.bundle.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"96972.fc25a13bb1bc69ad785c.bundle.js","mappings":"qNAYA,MAAMA,EAAK,CAACC,OAAMA,EAAAA,QAGlB,IAAIC,EAF2B,IAG/B,MAGMC,EAAkB,CACpBC,sBAAuB,GACvBC,mBAAoB,GACpBC,kBAAmB,GACnBC,kBAAmB,GACnBC,kBAAmB,SACnBC,oBAAqB,WACrBC,qBAAsB,YACtBC,sBAAuB,aACvBC,uBAAwB,cACxBC,yBAA0B,gBAC1BC,qBAAsB,YACtBC,sBAAuB,aACvBC,mBAAoB,UACpBC,mBAAoB,UACpBC,uBAAwB,cACxBC,eAAgB,CACZC,mBAAoB,qBACpBC,qBAAsB,iCACtBC,mBAAoB,iCACpBC,kBAAmB,sBACnBC,kBA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F,KA0HhD,IAEAvF,EAAcsF,KAAK9F,EAAMyF,IAAIS,EAAAA,GAAe,WACxCvE,GACJ,IAqBAC,EAAmBnE,GA1IvB,SAA2BiD,GACvB,MAAMc,EAAM0B,EAAAA,GAA4B/C,EAAQ,IAC3CuB,KAAK,QAASZ,GACdY,KAAK,SAAUV,GAEpBL,EAAcuC,EAAAA,GAAsB1B,EAAKd,GAEzCG,EAAaW,EAAI2E,OAAO,KAAKzE,KAAK,KAAM,eACxCd,EAAaY,EAAI2E,OAAO,KAAKzE,KAAK,KAAM,eAExCwB,EAAAA,GAAiB1B,EAAK4E,EAAAA,GAAaC,KACnCnD,EAAAA,GAAiB1B,EAAK4E,EAAAA,GAAaE,OAEnCxG,EAA0ByG,6BAA6B/E,EAC3D,CA8HIgF,IADsBxG,EAAMC,aAAaqD,QAAStD,EAAMC,aAAaqD,MAAMY,SAE3EvC,GAGR,EAER,G,8EC5SG,MAAM8E,EAAiB,gBACjBC,EAAiB,gBAOjB1D,EAAgB,cAOhB4B,EAAgB,eAMhBxB,EAAiB,gBAOjB8C,EAAgB,c","sources":["webpack://root-config/./packages/legacy-workbench/src/js/angular/clustermanagement/directives/cluster-graphical-view.directive.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/clustermanagement/events.js"],"sourcesContent":["import 'angular/utils/local-storage-adapter';\nimport 'angular/clustermanagement/directives/cluster-legend.directive';\nimport * as CDS from \"../services/cluster-drawing.service\";\nimport {ARROW_CONFIG} from \"../services/cluster-drawing.service\";\nimport {cloneDeep, isEmpty} from \"lodash\";\nimport {CLICK_IN_VIEW, CREATE_CLUSTER, MODEL_UPDATED, NODE_SELECTED} from \"../events\";\nimport {select} from 'd3';\nimport {\n AuthorizationService,\n service,\n} from '@ontotext/workbench-api';\n\nconst d3 = {select};\nconst navigationBarWidthFull = 240;\nconst navigationBarWidthCollapsed = 70;\nlet navigationBarWidth = navigationBarWidthFull;\nconst nodeRadius = 45;\n\n// Labels in translation map is dynamically translated and reassigned. It contains defaults\nconst translationsMap = {\n no_cluster_configured: '',\n create_cluster_btn: '',\n legend_node_state: '',\n legend_link_state: '',\n node_state_leader: \"Leader\",\n node_state_follower: \"Follower\",\n node_state_candidate: \"Candidate\",\n node_state_no_cluster: \"No cluster\",\n node_state_out_of_sync: \"Out of sync\",\n node_state_no_connection: \"No connection\",\n node_state_read_only: \"Read only\",\n node_state_restricted: \"Restricted\",\n link_state_in_sync: \"In sync\",\n link_state_syncing: \"Syncing\",\n link_state_out_of_sync: \"Out of sync\",\n recovery_state: {\n searching_for_node: \"Searching for node\",\n waiting_for_snapshot: \"Waiting for snapshot from node\",\n receiving_snapshot: \"Receiving a snapshot from node\",\n applying_snapshot: \"Applying a snapshot\",\n building_snapshot: \"Building a snapshot for node\",\n sending_snapshot: \"Sending a snapshot to node\",\n recovery_operation_failure_warning: \"Node unable to recover. Action required\",\n },\n};\n\nconst idTranslationKeyMap = {\n node_state: 'legend_node_state',\n link_state: 'legend_link_state',\n};\n\nconst clusterManagementDirectives = angular.module('graphdb.framework.clustermanagement.directives.cluster-graphical-view', [\n 'graphdb.framework.utils.localstorageadapter',\n 'graphdb.framework.clustermanagement.directives.cluster-legend',\n]);\n\nclusterManagementDirectives.directive('clusterGraphicalView', ['$window', 'LocalStorageAdapter', 'LSKeys', 'UriUtils', '$translate', '$jwtAuth', '$rootScope', 'ClusterViewContextService',\n function($window, LocalStorageAdapter, LSKeys, UriUtils, $translate, $jwtAuth, $rootScope, ClusterViewContextService) {\n return {\n restrict: 'E',\n scope: {\n clusterModel: '=',\n },\n link: function(scope, element) {\n // =========================\n // Private variables\n // =========================\n const authorizationService = service(AuthorizationService);\n\n const w = angular.element($window);\n const subscriptions = [];\n let hasAccess;\n let width = getWindowWidth();\n let height = getWindowHeight();\n let clusterZoneRadius = Math.min(width, height) / 2 - 100;\n let clusterZoneX = width / 2;\n let clusterZoneY = height / 2;\n let hasCluster;\n\n // SVG components\n let clusterZone;\n let nodesGroup;\n let linksGroup;\n\n // =========================\n // Public variables\n // =========================\n\n // =========================\n // Public functions\n // =========================\n\n scope.width = function() {\n return width;\n };\n\n scope.height = function() {\n return height;\n };\n\n // =========================\n // Private functions\n // =========================\n\n function resize() {\n const svg = ClusterViewContextService.getClusterViewD3Container();\n // recalculates with new screen width\n width = getWindowWidth();\n height = getWindowHeight();\n svg.attr(\"width\", width);\n svg.attr(\"height\", height);\n plot();\n }\n\n function updateTranslations(translationMapObject, translationAppend = '') {\n Object.keys(translationMapObject).forEach((key) => {\n let compoundKey = '';\n if (translationAppend) {\n compoundKey += translationAppend;\n }\n compoundKey += `.${key}`;\n const value = translationMapObject[key];\n if (typeof value === 'string') {\n translationMapObject[key] = $translate.instant(`cluster_management.cluster_graphical_view${compoundKey}`);\n } else if (typeof value === 'object') {\n updateTranslations(value, compoundKey);\n }\n });\n }\n\n function getWindowWidth() {\n const collapsed = LocalStorageAdapter.get(LSKeys.MENU_STATE) === 'collapsedMenu';\n navigationBarWidth = collapsed ? navigationBarWidthCollapsed : navigationBarWidthFull;\n // 95% avoids horizontal scrollbars and adds some margin\n return Math.max(Math.floor(($window.innerWidth - navigationBarWidth) * 0.95), 600);\n }\n\n function getWindowHeight() {\n // 95% avoids horizontal scrollbars and adds some margin\n return Math.max((($window.innerHeight - 250) * 0.95), 675);\n }\n\n function updateLabels() {\n CDS.updateClusterZoneLabels(hasCluster, clusterZone, translationsMap);\n Object.keys(idTranslationKeyMap).forEach((elementId) => {\n d3.select(`#${elementId}`).text(getLabelFor(elementId));\n });\n }\n\n function getLabelFor(elementId) {\n const labelKey = idTranslationKeyMap[elementId];\n return translationsMap[labelKey];\n }\n\n function createClusterZone(hasCluster) {\n const svg = CDS.createClusterSvgElement(element[0])\n .attr('width', width)\n .attr('height', height);\n\n clusterZone = CDS.createClusterZone(svg, hasCluster);\n\n linksGroup = svg.append('g').attr('id', 'links-group');\n nodesGroup = svg.append('g').attr('id', 'nodes-group');\n\n CDS.addArrowHead(svg, ARROW_CONFIG.BIG);\n CDS.addArrowHead(svg, ARROW_CONFIG.SMALL);\n\n ClusterViewContextService.updateClusterViewD3Container(svg);\n }\n\n function createNodes(nodes) {\n const nodeData = nodesGroup.selectAll('#node-group').data(nodes, (node) => node.address);\n const nodesElements = CDS.createNodes(nodeData, nodeRadius);\n nodesElements\n .on('click', (event, d) => {\n scope.$emit(NODE_SELECTED, d);\n // position the tooltip according to the node!\n const tooltip = d3.select('.nodetooltip');\n const windowWidth = $(window).width();\n if (event.pageX < windowWidth / 2) {\n // left\n tooltip.style(\"left\", event.pageX + \"px\");\n tooltip.style(\"right\", \"\");\n } else {\n // right\n tooltip.style(\"left\", \"\");\n tooltip.style(\"right\", (windowWidth - event.pageX) + \"px\");\n }\n tooltip.style(\"top\", (event.pageY - 28) + \"px\");\n });\n CDS.updateNodes(nodesElements);\n CDS.positionNodesOnClusterZone(nodesElements, clusterZoneX, clusterZoneY, clusterZoneRadius);\n }\n\n function drawLinks(links, nodes) {\n const linksData = linksGroup.selectAll('.link').data(links, (link) => link.id);\n CDS.createLinks(linksData);\n CDS.updateLinks(linksData, nodes);\n CDS.updateLinkIcons(linksGroup, links, nodes);\n }\n\n function resizeClusterComponent() {\n calculateClusterZoneProperties();\n CDS.moveElement(clusterZone, clusterZoneX, clusterZoneY);\n clusterZone\n .select('.cluster-zone')\n .attr('r', clusterZoneRadius);\n }\n\n function calculateClusterZoneProperties() {\n clusterZoneRadius = Math.min(width, height) / 2 - 100;\n clusterZoneX = width / 2;\n clusterZoneY = height / 2;\n }\n\n function setClusterZoneType(hasCluster) {\n CDS.setCreateClusterZone(hasCluster, clusterZone, translationsMap, hasAccess);\n if (!hasCluster && hasAccess) {\n clusterZone.on('mouseup', () => {\n scope.$emit(CREATE_CLUSTER);\n });\n }\n }\n\n function getNodesModel() {\n const nodes = cloneDeep(scope.clusterModel.nodes) || [];\n nodes.forEach((node) => {\n node.hostname = UriUtils.shortenIri(node.endpoint);\n if (!isEmpty(node.recoveryStatus)) {\n let messageLabelKey = `cluster_management.cluster_graphical_view.recovery_state.${node.recoveryStatus.state.toLowerCase()}`;\n const hasAffectedNodes = node.recoveryStatus.affectedNodes && node.recoveryStatus.affectedNodes.length > 0;\n if (hasAffectedNodes) {\n messageLabelKey += '_with_affected_node';\n }\n node.recoveryStatus.message = $translate.instant(messageLabelKey, {node: node.recoveryStatus.affectedNodes.join(', ')});\n }\n });\n return nodes;\n }\n\n function mousedownHandler(event) {\n scope.$emit(CLICK_IN_VIEW, event.target);\n }\n\n function plot() {\n resizeClusterComponent();\n if (hasCluster !== scope.clusterModel.hasCluster) {\n hasCluster = !!scope.clusterModel.hasCluster;\n setClusterZoneType(hasCluster);\n }\n const nodes = getNodesModel();\n createNodes(nodes);\n const links = cloneDeep(scope.clusterModel.links) || [];\n drawLinks(links, nodes);\n }\n\n // =========================\n // Events and watchers\n // =========================\n\n const subscribeHandlers = () => {\n w.bind('resize', resize);\n w.bind('mousedown', mousedownHandler);\n\n subscriptions.push($rootScope.$on('$translateChangeSuccess', function() {\n updateTranslations(translationsMap);\n updateLabels();\n }));\n\n subscriptions.push(scope.$on(MODEL_UPDATED, function() {\n plot();\n }));\n };\n\n const removeAllListeners = () => {\n subscriptions.forEach((subscription) => subscription());\n };\n\n scope.$on(\"$destroy\", function() {\n w.unbind('resize', resize);\n w.unbind('mousedown', mousedownHandler);\n CDS.removeEventListeners();\n removeAllListeners();\n });\n\n // =========================\n // Initialization\n // =========================\n\n function initialize() {\n hasAccess = authorizationService.isAdmin();\n subscribeHandlers();\n updateTranslations(translationsMap);\n const hasCluster = !!(scope.clusterModel.nodes && scope.clusterModel.nodes.length);\n createClusterZone(hasCluster);\n plot();\n }\n initialize();\n },\n };\n },\n]);\n","export const UPDATE_CLUSTER = 'updateCluster';\nexport const DELETE_CLUSTER = 'deleteCluster';\n\n/**\n * Event fired from the cluster-graphical-view component up to its parent when user clicks somewhere in the view.\n * The payload is the event target HTMLElement.\n * @type {string}\n */\nexport const CLICK_IN_VIEW = 'clickInView';\n\n/**\n * Event fired from the cluster-graphical-view component up to its parent when user selects a node from the visualization.\n * The payload is the selected node.\n * @type {string}\n */\nexport const NODE_SELECTED = 'nodeSelected';\n\n/**\n * Event fired when the cluster zone visualization is clicked while there is no cluster yet.\n * @type {string}\n */\nexport const CREATE_CLUSTER = 'createCluster';\n\n/**\n * Event fired from the cluster management view component down to the child visualization informing it that the model\n * was updated.\n * @type {string}\n */\nexport const MODEL_UPDATED = 'modelUpdated';\n"],"names":["d3","select","navigationBarWidth","translationsMap","no_cluster_configured","create_cluster_btn","legend_node_state","legend_link_state","node_state_leader","node_state_follower","node_state_candidate","node_state_no_cluster","node_state_out_of_sync","node_state_no_connection","node_state_read_only","node_state_restricted","link_state_in_sync","link_state_syncing","link_state_out_of_sync","recovery_state","searching_for_node","waiting_for_snapshot","receiving_snapshot","applying_snapshot","building_snapshot","sending_snapshot","recovery_operation_failure_warning","idTranslationKeyMap","node_state","link_state","angular","module","directive","$window","LocalStorageAdapter","LSKeys","UriUtils","$translate","$jwtAuth","$rootScope","ClusterViewContextService","restrict","scope","clusterModel","link","element","authorizationService","service","AuthorizationService","w","subscriptions","hasAccess","hasCluster","clusterZone","nodesGroup","linksGroup","width","getWindowWidth","height","getWindowHeight","clusterZoneRadius","Math","min","clusterZoneX","clusterZoneY","resize","svg","getClusterViewD3Container","attr","plot","updateTranslations","translationMapObject","translationAppend","Object","keys","forEach","key","compoundKey","value","instant","collapsed","get","MENU_STATE","max","floor","innerWidth","innerHeight","mousedownHandler","event","$emit","CLICK_IN_VIEW","target","CDS","on","CREATE_CLUSTER","setClusterZoneType","nodes","cloneDeep","node","hostname","shortenIri","endpoint","isEmpty","recoveryStatus","messageLabelKey","state","toLowerCase","affectedNodes","length","message","join","getNodesModel","nodeData","selectAll","data","address","nodesElements","d","NODE_SELECTED","tooltip","windowWidth","$","window","pageX","style","pageY","createNodes","links","linksData","id","drawLinks","$on","unbind","subscription","isAdmin","bind","push","elementId","text","getLabelFor","MODEL_UPDATED","append","ARROW_CONFIG","BIG","SMALL","updateClusterViewD3Container","createClusterZone","UPDATE_CLUSTER","DELETE_CLUSTER"],"sourceRoot":""}
@@ -0,0 +1,3 @@
1
+ /*! For license information please see 9923.74654347e1812dd0f90a.bundle.js.LICENSE.txt */
2
+ export const __webpack_esm_id__=9923;export const __webpack_esm_ids__=[3816,8822,9923,10767,13233,35026,45961,49741,49771,51609,63842];export const __webpack_esm_modules__={9923(e,t,r){r(22742),r(80601),r(33136),r(75752),r(23931),r(58469),r(11014),r(82667),r(75890),r(31478),r(61454),r(53294),r(9508),r(89687),r(66886),r(51609),r(3816),r(35026),r(49741),r(52915),r(24727),r(49771),r(63842),r(82917),r(90672),r(86099),r(65677),r(45961),r(8822),r(79710),r(13233),r(10767),r(23517),angular.module("graphdb.framework.graphexplore",["graphdb.framework.core.controllers","graphdb.framework.core.directives","graphdb.framework.rest.graphexplore.data.service","graphdb.framework.graphexplore.services.uiscroll","graphdb.framework.graphexplore.services.rdfsdetails","graphdb.framework.rest.graphexplore.savedgraphs.service","graphdb.framework.rest.graphconfig.service","graphdb.framework.graphexplore.controllers.class","graphdb.framework.graphexplore.controllers.domainrange","graphdb.framework.graphexplore.controllers.dependencies","graphdb.framework.graphexplore.controllers.graphviz","graphdb.framework.graphexplore.controllers.graphviz.config","graphdb.framework.graphexplore.directives.sysrepo","graphdb.framework.graphexplore.directives.rdfsdetails","graphdb.framework.graphexplore.directives.searchfilter","graphdb.framework.graphexplore.directives.class","graphdb.framework.graphexplore.directives.domainrange","graphdb.framework.graphexplore.directives.dependencies","graphdb.framework.graphexplore.directives.searchcontrols","graphdb.framework.core.directives.yasgui-component"])},63842(e,t,r){var n=r(22835),a=r(57154);const s={select:r(44482).select},o="WAIT",i="NO_REPO",l="READY",c="IN_PROGRESS",d="ERROR",u={contextID:{type:"all",value:"all.graphs.label",uri:""}};function p(e){if(e<1e3)return e;const t=Math.floor(Math.log(e)/Math.log(1e3));let r=e/Math.pow(1e3,t);return r=r%1>1/Math.pow(1e3,t-1)?r.toFixed(2):r.toFixed(0),r+["K","M","G","T","P","H"][t-1]}function g(e,t,r,p,g,h,f,m,v,C,x,y){const b=(0,a.service)(a.RepositoryContextService);let S=null;e.hasMoreGraphs=!1,e.status=b.getSelectedRepository()?.id?o:i,e.graphsDropdownToggled=t=>{e.hasMoreGraphs&&t&&p.warning(y.instant("dependencies.graphs.too.many.warning",{graphsLimit:n.Z.formatNumberToLocaleString(1e3,y.use())}))};let w=u;const R=function(){x.resolveGraphs(b.getSelectedRepository()?.id,1001).success(function(t){e.graphsInRepo=t.results.bindings,e.hasMoreGraphs=e.graphsInRepo.length>1002,$(),e.isSystemRepository()?"READY"!==e.status&&k():(e.status="WAIT",k(!0))}).error(function(t){e.repositoryError=getError(t),p.error(getError(t),y.instant("graphexplore.error.getting.graph"))})},$=function(){const t=C.get(`dependencies-selectedGraph-${b.getSelectedRepository()?.id}`);null!==t&&e.graphsInRepo.some(e=>e.contextID.uri===t.contextID.uri)?w=t:C.set(`dependencies-selectedGraph-${b.getSelectedRepository()?.id}`,w)},I=function(t){s.select("#dependencies-chord").html(""),e.status=o,f.getRelationshipsData(t,e.direction,w.contextID.uri).success(function(t){e.dependenciesData={matrix:t.right,nodes:t.left,hasLinks:_.sum(_.map(t.right,function(e){return _.sum(e)}))>0,direction:e.direction},e.status=l}).error(function(t){e.status=l,p.error(getError(t),y.instant("graphexplore.error.dependencies.count"))})},k=function(t){(e.status!==l||t)&&(e.status=o,f.getRelationshipsStatus(w.contextID.uri).success(function(t){if(e.status=t,e.status===c){if(null!==S)return;S=h(()=>k(),2e3)}e.status===l&&(null!==S&&(h.cancel(S),S=null),f.getRelationshipsClasses(e.direction,w.contextID.uri).success(function(t,r){e.allClasses.items=_.filter(t,E),e.allNotFilteredClasses=t,e.selectedClasses=void 0,angular.isUndefined(e.selectedClasses)&&(e.selectedClasses=t.slice(0,10)),I(e.selectedClasses),207===r&&p.warning(y.instant("graphexplore.update.diagram"),y.instant("graphexplore.repository.data.changed"))})),0===e.status.indexOf("ERROR;")&&(e.status=d,null!==S&&(h.cancel(S),S=null),p.error(y.instant("graphexplore.error.dependencies.calc",{error:e.status.substring(6)})))}).error(function(t){e.status=d,p.error(getError(t),y.instant("graphexplore.error.dependencies.count.status"))}))};e.allClasses={},e.allClasses.items=[],e.allNotFilteredClasses=[],e.direction="all";const O={};let j=0,D=0;function E(t){return-1!==t.name.toLowerCase().indexOf(e.classQuery.query.toLowerCase())}t.key="",O.get=function(t,r,n){m.initLazyList(t,r,n,j,e.allClasses.items)},t.$watch(function(){return t.key},function(){j=0,_.each(e.allClasses.items,function(e){t.key>e&&j++}),D++}),O.revision=function(){return D},e.datasource=O,e.adapterContainer={adapter:{remain:!0}},e.classQuery={},e.classQuery.query="",e.classFilterFunc=E,e.$watch("allClasses.items",function(){e.allClasses.items.length>0&&g(function(){e.adapterContainer.adapter.reload()},30)}),e.$watch("direction",function(){const t=b.getSelectedRepository();!t||e.isSystemRepository()||t.isFedx()||R()}),e.$on("$destroy",function(){h.cancel(S),U()}),e.isLoading=function(){return e.status===c||e.status===o},e.confirmCalculateDependencies=function(){v.openSimpleModal({title:y.instant("confirm.operation"),message:y.instant("graphexplore.calculating.relationships"),warning:!0}).result.then(function(){e.calculateDependencies()})},e.calculateDependencies=function(){e.status=o,e.selectedClasses=void 0,f.calculateRelationships(w.contextID.uri).success(function(t){0===t.indexOf("ERROR;")?p.error(y.instant("graphexplore.error.dependencies.calc",{error:e.status.substring(6)})):k()}).error(function(e){p.error(y.instant("graphexplore.error.could.not.force.count",{error:getError(e)}))})},e.addClass=function(t){e.selectedClasses.push(t),I(e.selectedClasses)},e.removeClass=function(t){_.remove(e.selectedClasses,function(e){return e.name===t.name}),I(e.selectedClasses)},e.showClass=function(t){e.classToShow=t},e.isClassByNameShown=function(t){return void 0!==_.find(e.selectedClasses,{name:t})},e.addClassByName=function(t){e.selectedClasses.push(_.find(e.allClasses.items,{name:t})),I(e.selectedClasses)},e.removeClassByName=function(t){_.remove(e.selectedClasses,function(e){return e.name===t}),I(e.selectedClasses)},e.removeAllClasses=function(){e.selectedClasses=[],I(e.selectedClasses)},e.isSystemRepository=function(){return"SYSTEM"===b.getSelectedRepository()?.id};const U=b.onSelectedRepositoryChanged(()=>function(){e.classQuery={},e.classQuery.query="",e.repositoryError=null,w=u;const t=b.getSelectedRepository();t&&!t.isFedx()?R():e.status=i}());e.selectGraph=function(e){w=e,k(!0),C.set(`dependencies-selectedGraph-${b.getSelectedRepository()?.id}`,w)},e.getSelectedGraphValue=function(){return w.contextID.value},e.isAllGraphsSelected=function(){return"all.graphs.label"===e.getSelectedGraphValue()}}Object.defineProperty(r.g,"allGraphs",{get:()=>u}),angular.module("graphdb.framework.graphexplore.controllers.dependencies",["ui.scroll.jqlite","ui.scroll","toastr","ui.bootstrap","graphdb.framework.core.services.repositories","graphdb.framework.utils.localstorageadapter"]).controller("DependenciesChordCtrl",g).config(["$uibTooltipProvider",function(e){e.options({appendToBody:!0})}]).filter("humanize",function(){return p}),g.$inject=["$scope","$rootScope","$repositories","toastr","$timeout","$interval","GraphDataRestService","UiScrollService","ModalService","LocalStorageAdapter","RDF4JRepositoriesRestService","$translate"]},49771(e,t,r){function n(e,t,r,n,a,s,o,i,l,c,d,u,p){e.predicatesObj={},e.predicatesQueryObj={},e.predicatesObj.items=[],e.predicatesQueryObj.query="",e.predicatesListNotFiltered=[],e.predicatesSearchPlaceholder="Search predicates",e.onopen=e.onclose=()=>angular.noop();const g={};let h=0,f=0;r.key="",g.get=function(t,r,n){return c.initLazyList(t,r,n,h,e.predicatesObj.items)},r.$watch(function(){return r.key},function(){h=0,_.each(e.predicatesObj.items,function(e){r.key>e&&h++}),f++}),g.revision=function(){return f},e.adapterContainer={adapter:{remain:!0}};const m=o.get(i.DOMAIN_RANGE_COLLAPSE_EDGES);function v(){const e=o.get(i.CLASS_HIERARCHY_LAST_SELECTED_CLASS);t.search("").hash(e).path("hierarchy")}e.collapseEdges=null===m||"true"===m,e.datasource=g,e.$on("reloadDomainRangeGraphView",function(e,r){const n=r.objectPropClassUri,a=r.objectPropClassName;t.path("domain-range-graph").search("uri",n).search("name",a)}),e.$on("switchEdgeMode",function(e,r){t.path("domain-range-graph").search("uri",r.uri).search("name",r.name).search("collapsed",r.collapsed)}),e.$on("repositoryIsSet",function(){C!==a.getActiveRepository()&&(C=a.getActiveRepository(),v())}),e.$on("changeCollapsedEdgesState",function(t,r){e.collapseEdges=!r,o.set(i.DOMAIN_RANGE_COLLAPSE_EDGES,e.collapseEdges)}),e.goToClassHierarchyView=v,e.copyToClipboard=function(e){d.openCopyToClipboardModal(e)},e.toggleCollapseEdgesState=function(){e.collapseEdges=!e.collapseEdges,s.history.pushState({collapsed:e.collapseEdges},"domainRangePage",null)},e.predicatesListFilterFunc=function(t){return t.resolvedUri.toLowerCase().indexOf(e.predicatesQueryObj.query.toLowerCase())>=0},e.$watch("predicatesObj.items",function(){e.predicatesObj.items>0&&n(function(){e.adapterContainer.adapter.reload()},30)}),e.$watch("selectedPredicate",function(){e.showPredicatesInfoPanel&&function(t){const r=t.target,n=t.source;e.encodedUri=encodeURIComponent(t.uri),e.sourceTargetObjectNodeUri=r.objectPropClassUri?r.objectPropClassUri:n.objectPropClassUri,e.encodedSourceTargetObjectNodeUri=encodeURIComponent(e.sourceTargetObjectNodeUri),e.sourceTargetObjectNodeName=r.objectPropClassName?r.objectPropClassName:n.objectPropClassName?n.objectPropClassName:"<i>Literal</i>",-1===e.sourceTargetObjectNodeName.indexOf("Literal")?l.getRdfsLabelAndComment(e.sourceTargetObjectNodeUri).success(function(t){e.rdfsLabel=t.label,e.rdfsComment=t.comment}).error(function(){u.error(p.instant("domain.range.error.get.label.comment"))}):(e.rdfsComment=void 0,e.rdfsLabel=void 0),e.predicatesObj.items=[],e.predicatesQueryObj.query="";const a=r.allEdges?r.allEdges:n.allEdges;_.each(a,function(t){const r={};r.absUri=encodeURIComponent(t.uri),r.absUriNonEncoded=t.uri,r.resolvedUri=t.name,r.isImplicit=t.implicit,e.predicatesObj.items.push(r)}),e.predicatesListNotFiltered=e.predicatesObj.items}(e.selectedPredicate)}),$(document).ready(function(){$(".compact-mode-toggle").click(function(){$(".tooltip").hide()})});let C=a.getActiveRepository()}r(38473),angular.module("graphdb.framework.graphexplore.controllers.domainrange",["ui.scroll.jqlite","ui.scroll","ngSanitize","graphdb.framework.utils.localstorageadapter"]).controller("DomainRangeGraphCtlr",n),n.$inject=["$scope","$location","$rootScope","$timeout","$repositories","$window","LocalStorageAdapter","LSKeys","GraphDataRestService","UiScrollService","ModalService","toastr","$translate"]},79710(e,t,r){var n=r(66886),a=(r(51609),r(44482));function s(e,t){return{restrict:"A",template:'<div id="dependencies-chord"></div>',scope:{dependenciesData:"="},link:function(r){r.$watch("dependenciesData",function(){if(r.dependenciesData){const s=r.dependenciesData;!function(s,o){if(function(e){for(const t of e)if(t.some(e=>0!==e))return!1;return!0}(s))return;const i=a.scaleOrdinal(a.schemeCategory10),l=a.select("body").append("div").attr("class","tooltip").style("opacity",0);a.select("body").on("click",function(){l.style("opacity",0)});const c=Math.min(800,800)/2.8,d=c-24,u=a.arc().innerRadius(d).outerRadius(c),p=a.chord().padAngle(.04).sortSubgroups(a.descending).sortChords(a.ascending),g=a.ribbon().radius(d);a.select("#dependencies-chord").select("svg").remove();const h=a.select("#dependencies-chord").append("svg").attr("viewBox","0 0 800 800").attr("preserveAspectRatio","xMidYMid meet").style("font","10px sans-serif").append("g").attr("id","circle").attr("transform","translate(400,400)");h.append("circle").attr("r",c).style("fill","none");const f=p(s),m=h.selectAll(".group").data(f.groups).enter().append("g").attr("class","group").on("mouseover",function(){const e=m.nodes().indexOf(this);v.classed("fade",function(t){return t.source.index!==e&&t.target.index!==e})});m.append("title").text(function(e,t){return o[t]}),m.append("path").attr("id",function(e,t){return"group"+t}).attr("d",u).style("fill",function(e,t){return i(t)}),m.append("text").each(function(e){e.angle=(e.startAngle+e.endAngle)/2}).attr("class","dependencies-chord-label").attr("dy",".35em").attr("transform",function(e){return"rotate("+(180*e.angle/Math.PI-90)+")translate("+(d+26)+")"+(e.angle>Math.PI?"rotate(180)":"")}).style("text-anchor",function(e){return e.angle>Math.PI?"end":null}).text(function(e){return o[e.index]});const v=h.selectAll(".chord").data(f).enter().append("path").attr("class","chord").style("fill",function(e){return i(e.target.index)}).style("fill-opacity",".67").style("stroke","#000").style("stroke-width",".25px").style("cursor","pointer").attr("d",g);v.on("mouseover",function(){a.select(this).style("fill-opacity","1")}),v.on("mouseout",function(){a.select(this).style("fill-opacity",".67")}),v.on("click",function(e,n){const a=o[n.source.index],s=o[n.target.index],i=e.pageX,c=e.pageY;t.getPredicates(a,s,r.selectedGraph&&r.selectedGraph.contextID.uri).success(function(e){let t="<div class='dependencies-tooltip'><div class='row'>"+a+" <i class='ri-arrow-left-right-line'></i> "+s+"</div>"+_.map(e.slice(0,10),function(e){const t=" <i class='ri-arrow-"+("out"===e.direction?"right":"left")+"-long-line'></i>";return"<div class='row'>"+e.predicate+" : "+e.weight+t+" </div>"}).join("");e.length>10?t=t+"<div class='pull-right'>And "+(e.length-10).toString()+" more...</div></div>":t+="</div>",l.html(t).style("left",i+"px").style("top",c+"px")}),l.transition().duration(200).style("opacity",1)}),a.select("#circle").on("mouseleave",function(){h.selectAll(".chord").classed("fade",!1)}),a.select("#download-svg").on("mouseover",function(){const t=n.A.Export.generateBase64ImageSource(".dependencies-chord svg");a.select(this).attrs({href:t,download:"dependencies-"+e.getActiveRepository()+".svg"})})}(s.matrix,s.nodes,s.direction)}})}}}angular.module("graphdb.framework.graphexplore.directives.dependencies",["graphdb.framework.graphexplore.controllers.dependencies","graphdb.framework.rest.graphexplore.data.service"]).directive("dependenciesChord",s),s.$inject=["$repositories","GraphDataRestService"]},13233(){function e(){return{restrict:"AE",scope:{filterQueryObj:"=",filterFunction:"&",listItemsObj:"=",listItemsNotFiltered:"=",searchPlaceholder:"@"},templateUrl:"js/angular/graphexplore/templates/listItemsSearchFilterTemplate.html",link:function(e){e.filterFunction=e.filterFunction(),e.$watch("filterQueryObj.query",function(){var t,r,n,a;e.listItemsObj.items=(t=e.filterQueryObj.query,r=e.listItemsObj.items,n=e.listItemsNotFiltered,a=e.filterFunction,t.length>0?_.filter(n,a):r.length!==n.length?n:r)})}}}angular.module("graphdb.framework.graphexplore.directives.searchfilter",[]).directive("listItemsSearchFilter",e),e.$inject=[]},8822(){function e(e){return{restrict:"AE",scope:{rdfsLabel:"=",rdfsComment:"=",expanded:"=",alwaysExpanded:"="},templateUrl:"js/angular/graphexplore/templates/rdfsCommentLabelTemplate.html",link:function(t,r){t.stringLimit=e,t.scrollToTop=function(){r[0].getElementsByClassName("rdfs-comment")[0].scrollTop=0},t.checkCommentLength=function(){return r[0].getElementsByClassName("rdfs-comment-text")[0].innerText.length<e},t.equalHeights=function(){const e=r[0].getElementsByClassName("rdfs-comment-text")[0].innerHeight;e<250&&t.expanded&&(r[0].getElementsByClassName("rdfs-comment")[0].innerHeight=e)},t.toggleFullComment=function(){t.expanded=!t.expanded},t.$watch("expanded || alwaysExpanded",function(r){t.stringLimit=r?t.rdfsComment.length:e})}}}angular.module("graphdb.framework.graphexplore.directives.rdfsdetails",[]).directive("rdfsCommentLabel",e).constant("SHORT_COMMENT_LENGTH",100),e.$inject=["SHORT_COMMENT_LENGTH"]},10767(){function e(e,t){return{restrict:"AE",scope:{searchData:"=",searchFields:"@",titleField:"@",searchPlaceholder:"@",initialValue:"=",searchedObjCallback:"&"},templateUrl:"js/angular/graphexplore/templates/searchIconInputTemplate.html",link:function(r,n){r.searchedObjCallback=r.searchedObjCallback(),r.performSearchActionOnEnter=function(){e.$broadcast("onEnterKeypressSearchAction")},r.showInput=function(){$("#selectGraphDropdown").hide(),n.find("#search_input #search_input_value")[0].value="",n.find(".search-icon").addClass("animated bounceOut").css("z-index","-1"),n.find("#search_input .angucomplete-holder").css("display","block"),t(function(){n.find("#search_input .angucomplete-holder").css("width","250px").css("left","-215px"),t(function(){n.find(".close-icon").css("display","block").addClass("animated bounceIn").css("z-index","3"),n.find("#search_input #search_input_value").focus()},200)},1)},r.hideInput=function(){n.find("#search_input #search_input_value")[0].value="",n.find("#search_input .angucomplete-holder").css("width","0px").css("left","35px"),t(function(){n.find("#search_input .angucomplete-holder").css("display","none"),$("#selectGraphDropdown").show()},250),n.find(".close-icon").addClass("animated bounceOut").removeClass("bounceOut").css("z-index","-1").css("display","none").click(function(){$(".tooltip").hide()}),t(function(){n.find(".search-icon").css("display","inline-block").removeClass("bounceOut").addClass("bounceIn").css("z-index","3")},200)}}}}angular.module("graphdb.framework.graphexplore.directives.searchcontrols",[]).directive("searchIconInput",e),e.$inject=["$rootScope","$timeout"]},45961(){function e(e,t){return{restrict:"A",scope:{},templateUrl:"js/angular/graphexplore/templates/systemRepoWarningTemplate.html",link:function(r){r.isSystemRepository=function(){return"SYSTEM"===e.getActiveRepository()},r.hasPermission=function(){return t.hasPermission()}}}}angular.module("graphdb.framework.graphexplore.directives.sysrepo",["graphdb.framework.graphexplore.controllers.class"]).directive("systemRepoWarning",e),e.$inject=["$repositories","$rootScope"]},35026(){angular.module("graphdb.framework.graphexplore.services.rdfsdetails",[]).factory("RdfsLabelCommentService",function(){return{processAndFilterLabelAndComment:function(e){function t(e){const t={};for(let r in e)if(e.hasOwnProperty(r)){let n=r;r.indexOf(":")>-1&&(n=r,r=r.split(":")[1].toLowerCase()),t[r]=e[n]}return t}const r=e.results.bindings,n=[],a=[];_.each(r,function(e){let r;angular.isUndefined(e.label)||(r=t(e.label),n.push(r)),angular.isUndefined(e.comment)||(r=t(e.comment),a.push(r))});const s=function(e){return"en"===e.lang||"de"===e.lang},o=$.grep(n,s)[0],i=$.grep(a,s)[0];return{rdfsLabel:angular.isUndefined(o)?n.length>0?n[0].value:void 0:o.value,rdfsComment:angular.isUndefined(i)?a.length>0?a[0].value:void 0:i.value}}}})},3816(){function e(e){return{initLazyList:function(t,r,n,a,s){return e(function(){const e=t+a-1,o=Math.max(0-a,e),i=Math.min(e+r-1,s.length);o>i?n([]):$.isArray(s)&&n(s.slice(o,i+1))},100,!0)}}}angular.module("graphdb.framework.graphexplore.services.uiscroll",[]).factory("UiScrollService",e),e.$inject=["$timeout"]},52915(e,t,r){var n=r(25782);angular.module("graphdb.framework.rest.graphconfig.service",[]).factory("GraphConfigRestService",o);const a="rest/explore-graph",s=`${a}/config`;function o(e){return{getGraphConfigs:function(){return e.get(s)},getGraphConfigSamples:function(){return e.get(`${a}/samples`)},loadGraphForConfig:function(t,r,n,a){return e.get(`${s}/graph/${encodeURIComponent(t.id)}?includeInferred=${r}&linksLimit=${n}&sameAsState=${a}`)},getConfig:function(t){return e.get(`${s}/${encodeURIComponent(t)}`).then(e=>(0,n.ls)(e.data))},createGraphConfig:function(t){return e.post(s,t)},updateGraphConfig:function(t){return e.put(`${s}/${encodeURIComponent(t.id)}`,t)},deleteGraphConfig:function(t){return e.delete(`${s}/${encodeURIComponent(t.id)}`)},validateQuery:function(t,r,n,s,o){return e({method:"POST",url:`${a}/validate`,data:{query:t,queryType:r,params:n,all:s,oneOf:o}})}}}o.$inject=["$http"]},51609(){angular.module("graphdb.framework.rest.graphexplore.data.service",[]).factory("GraphDataRestService",a),a.$inject=["$http"];const e="rest/class-hierarchy",t="rest/domain-range",r="rest/dependencies",n="rest/explore-graph";function a(a){return{getClassHierarchyData:function(t){return a.get(e,{params:{graphURI:t}})},reloadClassHierarchy:function(t){return a.get(e,{params:{doReload:!0,graphURI:t}})},getClassInstances:function(t){return a.get(`${e}/class-instances`,{params:{targetUri:t}})},getDomainRangeData:function(e,r){return a.get(t,{params:{targetUri:e,collapsed:r}})},checkDomainRangeData:function(e){return a.head(t,{params:{targetUri:e}})},getRelationshipsData:function(e,t,n){return a.get(`${r}/matrix`,{params:{mode:t,classes:_.map(e,function(e){return e.name}),graphURI:n}})},getRelationshipsClasses:function(e,t){return a.get(`${r}/classes`,{params:{mode:e,graphURI:t}})},getRelationshipsStatus:function(e){return a.get(`${r}/status`,{params:{graphURI:e}})},calculateRelationships:function(e){return a.get(`${r}/update`,{params:{graphURI:e}})},getPredicates:function(e,t,n){return a.get(`${r}/predicates`,{params:{from:e,to:t,mode:"all",graphURI:n}})},getInstanceNode:function(e){return a.get(`${n}/node`,{params:e})},getInstanceNodeLinks:function(e){return a.get(`${n}/links`,{params:e})},getProperties:function(e){return a.get(`${n}/properties`,{params:e})},updateGraph:function(e){let t={headers:{"Content-Type":"application/json"}};return t=Object.assign(t,e),a.post(`${n}/graph`,t)},getRdfsLabelAndComment:function(e,t,r){const n=r||{};return a({url:"rest/explore/details",method:"GET",params:_.extend(n,{uri:e,languages:t}),headers:{Accept:"application/json"}})}}}},49741(){angular.module("graphdb.framework.rest.graphexplore.savedgraphs.service",[]).factory("SavedGraphsRestService",t),t.$inject=["$http"];const e="rest/explore-graph/saved";function t(t){return{getSavedGraphs:function(){return t.get(e)},getSavedGraph:function(r){return t.get(`${e}/${encodeURIComponent(r)}`)},editSavedGraph:function(r){return t.put(`${e}/${encodeURIComponent(r.id)}`,r)},deleteSavedGraph:function(r){return t.delete(`${e}/${encodeURIComponent(r.id)}`)},addNewSavedGraph:function(r){return t.post(e,r)}}}},61454(){window.angular.module("angucomplete-alt",[]).directive("angucompleteAlt",["$q","$parse","$http","$sce","$timeout","$templateCache","$interpolate",function(e,t,r,n,a,s,o){var i="/angucomplete-alt/index.html";function l(t,s,o,i){var l,c,d,u,p,g,h=s.find("input"),f=3,m=null,v="autocomplete-required",C=null,x=null,y=s[0].querySelector(".angucomplete-dropdown"),b=!1,S=null;function w(e,r){e&&("object"==typeof e?(t.searchStr=k(e),I({originalObject:e})):"string"==typeof e&&e.length>0?t.searchStr=e:console&&console.error&&console.error("Tried to set "+(r?"initial":"")+" value of angucomplete to",e,"which is an invalid value"),D(!0))}function R(e){S=null,t.hideResults(e),document.body.removeEventListener("click",R)}function $(e){return e.which?e.which:e.keyCode}function I(e){"function"==typeof t.selectedObject?t.selectedObject(e,t.selectedObjectData):t.selectedObject=e,D(!!e)}function k(e){return t.titleField.split(",").map(function(t){return O(e,t)}).join(" ")}function O(e,t){var r,n;if(t){r=t.split("."),n=e;for(var a=0;a<r.length;a++)n=n[r[a]]}else n=e;return n}function j(e,r){var a,s,o;if(o=new RegExp(r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"i"),e)return e.match&&e.replace||(e=e.toString()),a=(s=e.match(o))?e.replace(o,'<span class="'+t.matchClass+'">'+s[0]+"</span>"):e,n.trustAsHtml(a)}function D(e){t.notEmpty=e,C=t.searchStr,t.fieldRequired&&i&&t.inputName&&i[t.inputName].$setValidity(v,e)}function E(e){!t.overrideSuggestions||t.selectedObject&&t.selectedObject.originalObject===t.searchStr||(e&&e.preventDefault(),a.cancel(m),F(),I({originalObject:t.searchStr}),t.clearSelected&&(t.searchStr=null),P())}function _(){return s[0].querySelectorAll(".angucomplete-row")[t.currentIndex]}function U(e){y.scrollTop=y.scrollTop+e}function A(){var e=t.results[t.currentIndex];t.matchClass?h.val(k(e.originalObject)):h.val(e.title)}function L(e){return function(r,n,a,s){n||a||s||!r.data||(r=r.data),t.searching=!1,H(O(c(r),t.remoteUrlDataField),e)}}function N(e,r,n,a){t.searching=!1,0!==r&&-1!==r&&(r||n||a||(r=e.status),t.remoteUrlErrorCallback?t.remoteUrlErrorCallback(e,r,n,a):console&&console.error&&console.error("http error"))}function F(){x&&x.resolve()}function T(n){var a={},s=t.remoteUrl+encodeURIComponent(n);t.remoteUrlRequestFormatter&&(a={params:t.remoteUrlRequestFormatter(n)},s=t.remoteUrl),t.remoteUrlRequestWithCredentials&&(a.withCredentials=!0),F(),x=e.defer(),a.timeout=x.promise,r.get(s,a).success(L(n)).error(N)}function G(r){F(),x=e.defer(),t.remoteApiHandler(r,x.promise).then(L(r)).catch(N)}function P(){t.showDropdown=!1,t.results=[],y&&(y.scrollTop=0)}function M(){t.showDropdown=u,t.currentIndex=t.focusFirst?0:-1,t.results=[]}function q(e){!e||e.length<f||(t.localData?t.$apply(function(){var r;r=void 0!==t.localSearch()?t.localSearch()(e,t.localData):function(e){var r,n,a,s,o=t.searchFields.split(","),i=[];for(void 0!==t.parseInput()&&(e=t.parseInput()(e)),r=0;r<t.localData.length;r++){for(n=!1,a=0;a<o.length;a++)s=O(t.localData[r],o[a])||"",n=n||s.toString().toLowerCase().indexOf(e.toString().toLowerCase())>=0;n&&(i[i.length]=t.localData[r])}return i}(e),t.searching=!1,H(r,e)}):t.remoteApiHandler?G(e):T(e))}function H(e,r){var n,a,s,o,i,l;if(e&&e.length>0)for(t.results=[],n=0;n<e.length;n++)t.titleField&&""!==t.titleField&&(o=i=k(e[n])),a="",t.descriptionField&&(a=l=O(e[n],t.descriptionField)),s="",t.imageField&&(s=O(e[n],t.imageField)),t.matchClass&&(i=j(o,r),l=j(a,r)),t.results[t.results.length]={title:i,description:l,image:s,originalObject:e[n]};else t.results=[];t.autoMatch&&1===t.results.length&&function(e,r,n){if(!n)return!1;for(var a in r)if(r[a].toLowerCase()===n.toLowerCase())return t.selectResult(e),!0;return!1}(t.results[0],{title:o,desc:a||""},t.searchStr)?t.showDropdown=!1:0!==t.results.length||p?t.showDropdown=!0:t.showDropdown=!1}function B(){t.localData?H(t.localData,""):t.remoteApiHandler?G(""):T("")}s.on("mousedown",function(e){e.target.id?(S=e.target.id)===t.id+"_dropdown"&&document.body.addEventListener("click",R):S=e.target.className}),t.currentIndex=t.focusFirst?0:null,t.searching=!1,d=t.$watch("initialValue",function(e){e&&(d(),w(e,!0))}),t.$watch("fieldRequired",function(e,r){e!==r&&(e?C&&-1!==t.currentIndex?D(!0):D(!1):i[t.inputName].$setValidity(v,!0))}),t.$on("angucomplete-alt:clearInput",function(e,r){r&&r!==t.id||(t.searchStr=null,I(),D(!1),P())}),t.$on("angucomplete-alt:changeInput",function(e,r,n){r&&r===t.id&&w(n)}),t.onFocusHandler=function(){t.focusIn&&t.focusIn(),0!==f||t.searchStr&&0!==t.searchStr.length||(t.currentIndex=t.focusFirst?0:t.currentIndex,t.showDropdown=!0,B())},t.hideResults=function(){S&&(S===t.id+"_dropdown"||S.indexOf("angucomplete")>=0)?S=null:(l=a(function(){P(),t.$apply(function(){t.searchStr&&t.searchStr.length>0&&h.val(t.searchStr)})},200),F(),t.focusOut&&t.focusOut(),t.overrideSuggestions&&t.searchStr&&t.searchStr.length>0&&-1===t.currentIndex&&E())},t.resetHideResults=function(){l&&a.cancel(l)},t.hoverRow=function(e){t.currentIndex=e},t.selectResult=function(e){t.matchClass&&(e.title=k(e.originalObject),e.description=O(e.originalObject,t.descriptionField)),t.clearSelected?t.searchStr=null:t.searchStr=e.title,I(e),P()},t.inputChangeHandler=function(e){return e.length<f?(F(),P()):0===e.length&&0===f&&(t.searching=!1,B()),t.inputChanged&&(e=t.inputChanged(e)),e},t.fieldRequiredClass&&""!==t.fieldRequiredClass&&(v=t.fieldRequiredClass),t.minlength&&""!==t.minlength&&(f=parseInt(t.minlength,10)),t.pause||(t.pause=500),t.clearSelected||(t.clearSelected=!1),t.overrideSuggestions||(t.overrideSuggestions=!1),t.fieldRequired&&i&&(t.initialValue?D(!0):D(!1)),t.inputType=o.type?o.type:"text",t.textSearching=o.textSearching?o.textSearching:"Searching...",t.textNoResults=o.textNoResults?o.textNoResults:"No results found",u="false"!==t.textSearching,p="false"!==t.textNoResults,t.maxlength=o.maxlength?o.maxlength:524288,h.on("keydown",function(e){var r=$(e),n=null,a=null;13===r&&t.results?(t.currentIndex>=0&&t.currentIndex<t.results.length?(e.preventDefault(),t.selectResult(t.results[t.currentIndex])):(E(e),P()),t.$apply()):40===r&&t.results?(e.preventDefault(),t.currentIndex+1<t.results.length&&t.showDropdown&&(t.$apply(function(){t.currentIndex++,A()}),b&&(n=_(),y.getBoundingClientRect().top+parseInt(getComputedStyle(y).maxHeight,10)<n.getBoundingClientRect().bottom&&U(function(e){var t=getComputedStyle(e);return e.offsetHeight+parseInt(t.marginTop,10)+parseInt(t.marginBottom,10)}(n))))):38===r&&t.results?(e.preventDefault(),t.currentIndex>=1?(t.$apply(function(){t.currentIndex--,A()}),b&&(a=_().getBoundingClientRect().top-(y.getBoundingClientRect().top+parseInt(getComputedStyle(y).paddingTop,10)))<0&&U(a-1)):0===t.currentIndex&&t.$apply(function(){t.currentIndex=-1,h.val(t.searchStr)})):9===r?t.results&&t.results.length>0&&t.showDropdown?-1===t.currentIndex&&t.overrideSuggestions?E():(-1===t.currentIndex&&(t.currentIndex=0),t.selectResult(t.results[t.currentIndex]),t.$digest()):t.searchStr&&t.searchStr.length>0&&E():27===r&&e.preventDefault()}),h.on("keyup",function(e){var r=$(e);if(37!==r&&39!==r)if(38===r||13===r)e.preventDefault();else if(40===r)e.preventDefault(),!t.showDropdown&&t.searchStr&&t.searchStr.length>=f&&(M(),t.searching=!0,q(t.searchStr));else if(27===r)P(),t.$apply(function(){h.val(t.searchStr)});else{if(0===f&&!t.searchStr)return;t.searchStr&&""!==t.searchStr?t.searchStr.length>=f&&(M(),m&&a.cancel(m),t.searching=!0,m=a(function(){q(t.searchStr)},t.pause)):t.showDropdown=!1,C&&C!==t.searchStr&&!t.clearSelected&&t.$apply(function(){I()})}}),g="remoteUrlResponseFormatter",c=function(e){return t[g]?t[g](e):e},a(function(){var e=getComputedStyle(y);b=e.maxHeight&&"auto"===e.overflowY})}return s.put(i,'<div class="angucomplete-holder" ng-class="{\'angucomplete-dropdown-visible\': showDropdown}"> <input id="{{id}}_value" name="{{inputName}}" tabindex="{{fieldTabindex}}" ng-class="{\'angucomplete-input-not-empty\': notEmpty}" ng-model="searchStr" ng-disabled="disableInput" type="{{inputType}}" placeholder="{{placeholder}}" maxlength="{{maxlength}}" ng-focus="onFocusHandler()" class="{{inputClass}}" ng-focus="resetHideResults()" ng-blur="hideResults($event)" autocapitalize="off" autocorrect="off" autocomplete="off" ng-change="inputChangeHandler(searchStr)"/> <div id="{{id}}_dropdown" class="angucomplete-dropdown" ng-show="showDropdown"> <div class="angucomplete-searching" ng-show="searching" ng-bind="textSearching"></div> <div class="angucomplete-searching" ng-show="!searching && (!results || results.length == 0)" ng-bind="textNoResults"></div> <div class="angucomplete-row" ng-repeat="result in results" ng-click="selectResult(result)" ng-mouseenter="hoverRow($index)" ng-class="{\'angucomplete-selected-row\': $index == currentIndex}"> <div ng-if="imageField" class="angucomplete-image-holder"> <img ng-if="result.image && result.image != \'\'" ng-src="{{result.image}}" class="angucomplete-image"/> <div ng-if="!result.image && result.image != \'\'" class="angucomplete-image-default"></div> </div> <div class="angucomplete-title" ng-if="matchClass" ng-bind-html="result.title"></div> <div class="angucomplete-title" ng-if="!matchClass">{{ result.title }}</div> <div ng-if="matchClass && result.description && result.description != \'\'" class="angucomplete-description" ng-bind-html="result.description"></div> <div ng-if="!matchClass && result.description && result.description != \'\'" class="angucomplete-description">{{result.description}}</div> </div> </div></div>'),{restrict:"EA",require:"^?form",scope:{selectedObject:"=",selectedObjectData:"=",disableInput:"=",initialValue:"=",localData:"=",localSearch:"&",remoteUrlRequestFormatter:"=",remoteUrlRequestWithCredentials:"@",remoteUrlResponseFormatter:"=",remoteUrlErrorCallback:"=",remoteApiHandler:"=",id:"@",type:"@",placeholder:"@",textSearching:"@",textNoResults:"@",remoteUrl:"@",remoteUrlDataField:"@",titleField:"@",descriptionField:"@",imageField:"@",inputClass:"@",pause:"@",searchFields:"@",minlength:"@",matchClass:"@",clearSelected:"@",overrideSuggestions:"@",fieldRequired:"=",fieldRequiredClass:"@",inputChanged:"=",autoMatch:"@",focusOut:"&",focusIn:"&",fieldTabindex:"@",inputName:"@",focusFirst:"@",parseInput:"&"},templateUrl:function(e,t){return t.templateUrl||i},compile:function(e){var t=o.startSymbol(),r=o.endSymbol();if("{{"!==t||"}}"!==r){var n=e.html().replace(/\{\{/g,t).replace(/\}\}/g,r);e.html(n)}return l}}}])}};
3
+ //# sourceMappingURL=9923.74654347e1812dd0f90a.bundle.js.map