graphdb-workbench 2.2.1 → 2.2.2-TR2

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 (118) hide show
  1. package/dist/{108.19b6e7d30df333e42876.bundle.js → 108.3c3f9c242e6a3e18fff5.bundle.js} +2 -2
  2. package/dist/108.3c3f9c242e6a3e18fff5.bundle.js.map +1 -0
  3. package/dist/11.f4c5533cd200c8568ff6.bundle.js +1 -1
  4. package/dist/11.f4c5533cd200c8568ff6.bundle.js.map +1 -1
  5. package/dist/111.a12fdfab1d11ab373ecf.bundle.js +2 -0
  6. package/dist/111.a12fdfab1d11ab373ecf.bundle.js.map +1 -0
  7. package/dist/112.8cd13d27736494201244.bundle.js +2 -0
  8. package/dist/112.8cd13d27736494201244.bundle.js.map +1 -0
  9. package/dist/{12.d9d71e44fdefd12ffbd9.bundle.js → 12.f348b65d06b0213c492e.bundle.js} +2 -2
  10. package/dist/12.f348b65d06b0213c492e.bundle.js.map +1 -0
  11. package/dist/{13.c983d32d3e92f49cd670.bundle.js → 13.fc8afecbe1a39b84c1db.bundle.js} +2 -2
  12. package/dist/13.fc8afecbe1a39b84c1db.bundle.js.map +1 -0
  13. package/dist/{14.8661d578dfadafbcdf84.bundle.js → 14.457cf038826e0d9e033e.bundle.js} +2 -2
  14. package/dist/14.457cf038826e0d9e033e.bundle.js.map +1 -0
  15. package/dist/148.dd250d3cc5aafade33c6.bundle.js +1 -1
  16. package/dist/148.dd250d3cc5aafade33c6.bundle.js.map +1 -1
  17. package/dist/{15.6eada6724367dcd05007.bundle.js → 15.874aa7b7f7972283a629.bundle.js} +2 -2
  18. package/dist/15.874aa7b7f7972283a629.bundle.js.map +1 -0
  19. package/dist/20.fbcb31706f03a07e8827.bundle.js +1 -1
  20. package/dist/20.fbcb31706f03a07e8827.bundle.js.map +1 -1
  21. package/dist/{21.7f0a59ea2ad9340dcb2f.bundle.js → 21.ea150df1291050bc1c4a.bundle.js} +2 -2
  22. package/dist/21.ea150df1291050bc1c4a.bundle.js.map +1 -0
  23. package/dist/27.83b24ef9ec0fd6964d92.bundle.js +1 -1
  24. package/dist/27.83b24ef9ec0fd6964d92.bundle.js.map +1 -1
  25. package/dist/33.4d23fa109c9184727386.bundle.js +1 -1
  26. package/dist/33.4d23fa109c9184727386.bundle.js.map +1 -1
  27. package/dist/34.f019d485e103b291488a.bundle.js +2 -0
  28. package/dist/34.f019d485e103b291488a.bundle.js.map +1 -0
  29. package/dist/40.50b40301c8cc69a70457.bundle.js +1 -1
  30. package/dist/40.50b40301c8cc69a70457.bundle.js.map +1 -1
  31. package/dist/44.568afd25b8a568b1c18d.bundle.js +2 -0
  32. package/dist/44.568afd25b8a568b1c18d.bundle.js.map +1 -0
  33. package/dist/45.ff1425adb8765ead76fa.bundle.js +2 -0
  34. package/dist/45.ff1425adb8765ead76fa.bundle.js.map +1 -0
  35. package/dist/46.e92017f79bee05197e4a.bundle.js +2 -0
  36. package/dist/46.e92017f79bee05197e4a.bundle.js.map +1 -0
  37. package/dist/47.099bba66b99e58961fd9.bundle.js +2 -0
  38. package/dist/47.099bba66b99e58961fd9.bundle.js.map +1 -0
  39. package/dist/48.5a84d14ed4cb41f91fca.bundle.js +2 -0
  40. package/dist/48.5a84d14ed4cb41f91fca.bundle.js.map +1 -0
  41. package/dist/49.ad3b75a5d0c8679165b9.bundle.js +2 -0
  42. package/dist/49.ad3b75a5d0c8679165b9.bundle.js.map +1 -0
  43. package/dist/50.5114c92299726180a264.bundle.js +2 -0
  44. package/dist/50.5114c92299726180a264.bundle.js.map +1 -0
  45. package/dist/51.f884748db1436a79a134.bundle.js +2 -0
  46. package/dist/51.f884748db1436a79a134.bundle.js.map +1 -0
  47. package/dist/52.351e9098a43e13a6f2da.bundle.js +2 -0
  48. package/dist/52.351e9098a43e13a6f2da.bundle.js.map +1 -0
  49. package/dist/94.38349f52df66313fbcc0.bundle.js +1 -1
  50. package/dist/94.38349f52df66313fbcc0.bundle.js.map +1 -1
  51. package/dist/{bundle.119af3621ec41f8cbf04.bundle.js → bundle.f540ee201846422b1cb9.bundle.js} +3 -3
  52. package/dist/bundle.f540ee201846422b1cb9.bundle.js.map +1 -0
  53. package/dist/css/jmx.css +11 -1
  54. package/dist/i18n/locale-en.json +22 -6
  55. package/dist/i18n/locale-fr.json +61 -15
  56. package/dist/index.html +3 -3
  57. package/dist/js/angular/core/directives/rdfresourcesearch/templates/rdfResourceSearchTemplate.html +1 -1
  58. package/dist/pages/autocomplete.html +1 -1
  59. package/dist/pages/choose-repository-type.html +1 -1
  60. package/dist/pages/cluster-management/clusterInfo.html +3 -3
  61. package/dist/pages/create-index.html +4 -4
  62. package/dist/pages/dependencies.html +1 -1
  63. package/dist/pages/domainRangeInfo.html +2 -2
  64. package/dist/pages/edit.html +1 -1
  65. package/dist/pages/explore.html +1 -1
  66. package/dist/pages/export.html +1 -1
  67. package/dist/pages/find.html +1 -1
  68. package/dist/pages/graph-config/saveGraphConfig.html +11 -11
  69. package/dist/pages/graphs-visualizations.html +7 -7
  70. package/dist/pages/guides.html +1 -1
  71. package/dist/pages/import.html +1 -1
  72. package/dist/pages/jdbc-create.html +5 -5
  73. package/dist/pages/monitor/queries.html +1 -1
  74. package/dist/pages/monitor/resources.html +121 -31
  75. package/dist/pages/namespaces.html +2 -2
  76. package/dist/pages/plugins.html +1 -1
  77. package/dist/pages/rdfClassHierarchyInfo.html +7 -7
  78. package/dist/pages/rdfrank.html +2 -2
  79. package/dist/pages/repositories.html +2 -2
  80. package/dist/pages/repository.html +2 -2
  81. package/dist/pages/similarity-indexes.html +1 -1
  82. package/dist/pages/sparql-template-create.html +5 -5
  83. package/dist/pages/sparql.html +3 -3
  84. package/dist/pages/webapi.html +2 -2
  85. package/dist/plugins.js +4 -3
  86. package/dist/res/swagger/index.html +27 -27
  87. package/package.json +1 -1
  88. package/dist/108.19b6e7d30df333e42876.bundle.js.map +0 -1
  89. package/dist/111.4845cf402b3a4c3c006c.bundle.js +0 -2
  90. package/dist/111.4845cf402b3a4c3c006c.bundle.js.map +0 -1
  91. package/dist/112.99c50f08e6724346dc3a.bundle.js +0 -2
  92. package/dist/112.99c50f08e6724346dc3a.bundle.js.map +0 -1
  93. package/dist/12.d9d71e44fdefd12ffbd9.bundle.js.map +0 -1
  94. package/dist/13.c983d32d3e92f49cd670.bundle.js.map +0 -1
  95. package/dist/14.8661d578dfadafbcdf84.bundle.js.map +0 -1
  96. package/dist/15.6eada6724367dcd05007.bundle.js.map +0 -1
  97. package/dist/21.7f0a59ea2ad9340dcb2f.bundle.js.map +0 -1
  98. package/dist/34.01b159cdf635ac9d0dd7.bundle.js +0 -2
  99. package/dist/34.01b159cdf635ac9d0dd7.bundle.js.map +0 -1
  100. package/dist/44.4d7cb09cdd1413d5f879.bundle.js +0 -2
  101. package/dist/44.4d7cb09cdd1413d5f879.bundle.js.map +0 -1
  102. package/dist/45.8c6f6eba4736e953c2bc.bundle.js +0 -2
  103. package/dist/45.8c6f6eba4736e953c2bc.bundle.js.map +0 -1
  104. package/dist/46.3a0da10162409588560c.bundle.js +0 -2
  105. package/dist/46.3a0da10162409588560c.bundle.js.map +0 -1
  106. package/dist/47.049aedaa6cfccef06f69.bundle.js +0 -2
  107. package/dist/47.049aedaa6cfccef06f69.bundle.js.map +0 -1
  108. package/dist/48.d7b02a85dfa52084b1c4.bundle.js +0 -2
  109. package/dist/48.d7b02a85dfa52084b1c4.bundle.js.map +0 -1
  110. package/dist/49.2e7858348448fdde1332.bundle.js +0 -2
  111. package/dist/49.2e7858348448fdde1332.bundle.js.map +0 -1
  112. package/dist/50.1650ec02515a7dce98a5.bundle.js +0 -2
  113. package/dist/50.1650ec02515a7dce98a5.bundle.js.map +0 -1
  114. package/dist/51.c597233d286f68e37481.bundle.js +0 -2
  115. package/dist/51.c597233d286f68e37481.bundle.js.map +0 -1
  116. package/dist/52.0ea1cd862aeb2461a9c4.bundle.js +0 -2
  117. package/dist/52.0ea1cd862aeb2461a9c4.bundle.js.map +0 -1
  118. package/dist/bundle.119af3621ec41f8cbf04.bundle.js.map +0 -1
@@ -1,2 +1,2 @@
1
- (window.webpackJsonp=window.webpackJsonp||[]).push([[20],{253:function(e,t,n){var r,i,a;i=[],void 0===(a="function"==typeof(r=function(){return function(){var e=function(){return"n"},t=function(){return[0,0]},n=function(){return" "},r=u(),i=null,a=null,o=null,s=null;function l(e){var t;i="svg"===(t=(t=e).node()).tagName.toLowerCase()?t:t.ownerSVGElement,a=i.createSVGPoint(),document.body.appendChild(r)}l.show=function(){var r=Array.prototype.slice.call(arguments);r[r.length-1]instanceof SVGElement&&(o=r.pop());var i,a=n.apply(this,r),u=t.apply(this,r),h=e.apply(this,r),p=f(),v=d.length,y=document.documentElement.scrollTop||document.body.scrollTop,g=document.documentElement.scrollLeft||document.body.scrollLeft,m=s.apply(this,r);for(p.html(a).style({opacity:1,"pointer-events":"all"});v--;)p.classed(d[v],!1);return i=c.get(h).apply(this),m?p.style(m):p.classed(h,!0).style({top:i.top+u[0]+y+"px",left:i.left+u[1]+g+"px"}),l},l.hide=function(){return f().style({opacity:0,"pointer-events":"none"}),l},l.attr=function(e,t){if(arguments.length<2&&"string"==typeof e)return f().attr(e);var n=Array.prototype.slice.call(arguments);return d3.selection.prototype.attr.apply(f(),n),l},l.style=function(e,t){if(arguments.length<2&&"string"==typeof e)return f().style(e);var n=Array.prototype.slice.call(arguments);return d3.selection.prototype.style.apply(f(),n),l},l.direction=function(t){return arguments.length?(e=null==t?t:d3.functor(t),l):e},l.offset=function(e){return arguments.length?(t=null==e?e:d3.functor(e),l):t},l.html=function(e){return arguments.length?(n=null==e?e:d3.functor(e),l):n},l.customPosition=function(e){return arguments.length?(s=null==e?e:d3.functor(e),l):s},l.destroy=function(){return r&&(f().remove(),r=null),l};var c=d3.map({n:function(){var e=h();return{top:e.n.y-r.offsetHeight,left:e.n.x-r.offsetWidth/2}},s:function(){var e=h();return{top:e.s.y,left:e.s.x-r.offsetWidth/2}},e:function(){var e=h();return{top:e.e.y-r.offsetHeight/2,left:e.e.x}},w:function(){var e=h();return{top:e.w.y-r.offsetHeight/2,left:e.w.x-r.offsetWidth}},nw:function(){var e=h();return{top:e.nw.y-r.offsetHeight,left:e.nw.x-r.offsetWidth}},ne:function(){var e=h();return{top:e.ne.y-r.offsetHeight,left:e.ne.x}},sw:function(){var e=h();return{top:e.sw.y,left:e.sw.x-r.offsetWidth}},se:function(){var e=h();return{top:e.se.y,left:e.e.x}}}),d=c.keys();function u(){var e=d3.select(document.createElement("div"));return e.style({position:"absolute",top:0,opacity:0,"pointer-events":"none","box-sizing":"border-box"}),e.node()}function f(){return null===r&&(r=u(),document.body.appendChild(r)),d3.select(r)}function h(){for(var e=o||d3.event.target;void 0===e.getScreenCTM&&"undefined"===e.parentNode;)e=e.parentNode;var t={},n=e.getScreenCTM(),r=e.getBBox(),i=r.width,s=r.height,l=r.x,c=r.y;return a.x=l,a.y=c,t.nw=a.matrixTransform(n),a.x+=i,t.ne=a.matrixTransform(n),a.y+=s,t.se=a.matrixTransform(n),a.x-=i,t.sw=a.matrixTransform(n),a.y-=s/2,t.w=a.matrixTransform(n),a.x+=i,t.e=a.matrixTransform(n),a.x-=i/2,a.y-=s/2,t.n=a.matrixTransform(n),a.y+=s,t.s=a.matrixTransform(n),t}return l}})?r.apply(t,i):r)||(e.exports=a)},254:function(e,t,n){"use strict";var r=r||{};r.Text=function(){function e(e,t,n,r){n=n||10;var i=t/3;return"string"==typeof e?(i*=10/(e.substring(0,t/3).length+1.5),i+=1,e.match(/[\u0900-\u0DFF\u1100-\u11FF\u2E80-\u2EFF\u3000-\u9FFF]/)&&(i*=.6),i<n&&(i=n),Math.round(i)):(i<n&&(i=n),Math.round(i))}return{calcFontSizeRaw:e,calcFontSize:function(t,n,r,i){return e(t,n,r)+"px"},getTextWithElipsisIfNeeded:function(e,t){return"string"==typeof e&&e.length>t?e.substring(0,t-3)+"...":e}}}(),r.Transition={fadeIn:function(e,t){e.style("opacity",0).transition().duration(t).style("opacity",1)},fadeOut:function(e,t){e.style("opacity",1).transition().duration(t).style("opacity",0)}},r.Click={delayDblClick:function(){var e=d3.dispatch("click","dblclick");return d3.rebind((function(t){var n,r=null;t.on("mousedown",(function(){n=d3.mouse(document.body),new Date})),t.on("mouseup",(function(t){var i,a;i=n,a=d3.mouse(document.body),Math.sqrt(Math.pow(i[0]-a[0],2),Math.pow(i[1]-a[1],2))>5||(r?(window.clearTimeout(r),r=null,e.dblclick(t)):r=window.setTimeout((d3.event,function(){e.click(t),r=null}),250))}))}),e,"on")}},t.a=r},255:function(e,t,n){"use strict";var r=r||{};r.Export={getCSSRules:function(e){var t=$('link[href="'+e+'"]')[0].sheet.rules,n="";return _.each(t,(function(e){n+=e.cssText})),n},generateBase64ImageSource:function(){var e=d3.selectAll("svg").attr({version:"1.1",xmlns:"http://www.w3.org/2000/svg"}).node().parentNode.innerHTML;return"data:image/svg+xml;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(e)))}},t.a=r},264:function(e,t,n){"use strict";var r=r||{};r.SingleChild={addPlaceholders:function e(t,n){if(t.children){for(var r=0;r<t.children.length;r++)e(t.children[r]);if(1===t.children.length){var i=1.2*t.size;n&&(i=.1*t.children[0].size),t.children.push({name:"placeholder",size:i})}}},removePlaceholders:function e(t){for(var n=t.length-1;n>=0;n--){var r=t[n];"placeholder"===r.name?t.splice(n,1):r.children&&e(r.children)}},centerNodes:function(e){for(var t=0;t<e.length;t++){var n=e[t];if(n.children&&1===n.children.length){var r=n.x-n.children[0].x;n.children[0].x+=r,i(n.children[0],r)}}function i(e,t){if(e.children)for(var n=0;n<e.children.length;n++)e.children[n].x+=t,i(e.children[n],t)}},makePositionsRelativeToZero:function(e){for(var t=e[0].x,n=e[0].y,r=0;r<e.length;r++){var i=e[r];i.x-=t,i.y-=n}}},t.a=r},82:function(e,t,n){"use strict";n.r(t);var r=n(253),i=n.n(r),a=n(264),o=n(254),s=n(255);n(5);function l(e,t,n,r,l,c,d,u,f,h,p,v,y){return{restrict:"AE",template:'<div id="classChart"></div>',scope:{classHierarchyData:"=",flattenedClassNames:"=",selectedClass:"=",currentSliderValue:"=",showClassInfoPanel:"=",showExternalElements:"=",hidePrefixes:"=",currentBrowserLimit:"="},link:function(d,g,m){!function(d,g){var m=d3.layout.pack().size([780,780]).value((function(e){return e.size})),x=d3.scale.linear().domain([0,4]).range(["hsl(19, 70%, 90%)","hsl(19, 70%, 50%)"]).interpolate(d3.interpolateHcl),w=d3.select("#classChart").insert("svg:svg","h2").attr("viewBox","0 0 800 800").attr("preserveAspectRatio","xMidYMid meet").on("dblclick.zoom",null);function S(){return w.append("svg:g").attr({id:"main-group",transform:"translate(400,400)"})}function C(){return"true"===p.get(v.CLASS_HIERARCHY_HIDE_PREFIXES)}function E(){var e=s.a.Export.getCSSRules("css/rdf-class-hierarchy-labels.css?v=2.2.1");d3.selectAll("#main-group").append("defs"),$("defs").append('<style type="text/css"><![CDATA['+e+"]]></style>"),d3.selectAll("g").style("opacity",1);var t=s.a.Export.generateBase64ImageSource();d3.select(this).attr({href:t,download:"class-hierarchy-"+c.getActiveRepository()+".svg"})}d.hidePrefixes=C();var T,R,A=S();if(!d.classHierarchyData.classCount&&c.getActiveRepository()&&!c.isSystemRepository()){e.loader=!0,e.hierarchyError=!1;const t=p.get("classHierarchy-selectedGraph-"+c.getActiveRepository());n.getClassHierarchyData(null!==t?t.contextID.uri:"").success((function(t,n,r){e.loader=!1,207===n&&u.warning(y.instant("graphexplore.update.diagram"),y.instant("graphexplore.repository.data.changed")),d.classHierarchyData=t,d3.select("#download-svg").on("mouseover",E)})).error((function(t){e.loader=!1,e.hierarchyError=getError(t),u.error(y.instant("graphexplore.error.request.failed",{name:h,error:getError(t)}))}))}var H,P,I,b,k,F,L,D,N={};function z(n,s,c,u){I&&I(),b&&b(),d3.selectAll("#main-group").remove(),A=S(),a.a.SingleChild.addPlaceholders(n,!0),P=c||n;var p,v=m.nodes(n);P.isInFocusTransitive=!0,a.a.SingleChild.removePlaceholders(v),a.a.SingleChild.centerNodes(v),a.a.SingleChild.makePositionsRelativeToZero(v);var y=i()().attr("class","d3-tip").customPosition((function(e){return{top:"inherit",bottom:r.innerHeight-d3.event.clientY+"px",right:r.innerWidth-d3.event.clientX+"px"}})).html((function(e){return e.name}));w.call(y);var g=A.selectAll("circle").data(v).enter().append("g");s.doFade&&g.each((function(e){o.a.Transition.fadeIn(d3.select(this),550)}));var C,E=[],k=g.append("circle").attr("class",(function(e){return e.role})).attr("guide-selector",(function(e){return"class-"+e.name})).style("fill",(function(e){return e.children?x(e.depth):"#E0D0D0"})).each((function(e){if(e.circle=d3.select(this),e.name!==h){var t=e.name;E.push({name:t}),N[[t]]=e,e.circle.classed("rdf-class",!0),e.circle.on("mouseover",(function(){s.noPrefixes||e.textHidden?y.show(e):y.hide(e)})),e.circle.on("mouseout",y.hide)}})).on("gdb-focus",R).on("gdb-zoom",B);function F(e){d3.selectAll(".selected").classed("selected",e.selected=!1),e.circle.classed("selected",e.selected=!0),C=e}function L(){d.showClassInfoPanel=!1}E&&(E=_.uniqBy(E,"name"),d.flattenedClassNames=E);var D=o.a.Click.delayDblClick();d3.selectAll(".parent, .topLevelParent, .child, .root").call(D);R=function(e){B(e),e.name===h?(L(),d3.selectAll(".selected").classed("selected",!1)):(F(e),d.selectedClass=C,d.showClassInfoPanel=!0,d.$on("sidePanelClosed",(function(t){d3.selectAll(".selected").classed("selected",e.selected=!1)})))},D.on("click",(function(e){e.id&&r.history.pushState({id:e.id},"classHierarchyPage"+e.id,"hierarchy#"+e.id),y.hide(),R(e)})),D.on("dblclick",(function(t){t!==n&&(y.hide(),F(t),e.$broadcast("goToDomainRangeGraphView",C,P),d3.event.stopPropagation())}));var $=0;w.on("wheel",(function(){y.hide();var e=d3.event;e.preventDefault(),e.stopPropagation();var t=(new Date).getTime();if(t-$>100){$=t;var n="";e.deltaY<=-1?n="in":e.deltaY>=1&&(n="out");var i=e.target.__data__;if(i||(i=P),"in"===n){if(i!==P){for(;i.parent&&!i.parent.isInFocusTransitive;)i=i.parent;i.depth<P.depth&&(i=P)}if(i===P&&i.children){for(var a=i.children[0],o=1;o<i.children.length;o++)i.children[o].sortingRank>a.sortingRank&&(a=i.children[o]);a.children&&(i=a)}else i.children||(i=i.parent);B(i,!0)}else"out"===n&&(i=P.parent)&&B(i,!0);P.name===h&&r.history.replaceState({id:1},"classHierarchyPage1","hierarchy#1"),O()}}));var z=A.selectAll("text").data(v).enter().append("text").attr("class",(function(e){return e.children&&e.children.length?"label":"label child-label"})).each((function(e){e.textSel=d3.select(this)}));s.noPrefixes?(H!==n&&(z.each((function(e){var t=e.name.indexOf(":");e.name.indexOf("http://")>-1?e.noPrefixName=e.name:t>-1&&(e.noPrefixName=e.name.substring(t+1))})),H=n),z.style("font-size",(function(e){return o.a.Text.calcFontSize(e.noPrefixName,e.r)})).text((function(e){return o.a.Text.getTextWithElipsisIfNeeded(e.noPrefixName,e.r/3)}))):z.style("font-size",(function(e){return o.a.Text.calcFontSize(e.name,e.r)})).text((function(e){return o.a.Text.getTextWithElipsisIfNeeded(e.name,e.r/3)})),z.style("display",(function(e){return e.parent===n?(e.textHidden=this.textContent.indexOf("...")+3===this.textContent.length,null):(e.textHidden=!0,"none")})),s.doFade&&!s.keepPrevState&&z.each((function(e){o.a.Transition.fadeIn(d3.select(this),550)})),T=function(){function e(e){e&&k.each((function(t){e==t.id&&R(t)}))}var n=t.hash();r.onpopstate=function(t){t.state&&e(t.state.id)},e(n)};var U=A.selectAll("circle, text");function M(e,t){var n=800/e[2];p=e,U.attr("transform",(function(t){return"translate("+(t.x-e[0])*n+","+(t.y-e[1])*n+")"})),k.attr("r",(function(e){return e.r*n})),t&&z.each((function(e){e.fullName!==P.topLevelParentUri&&P.topLevelParentUri!==h||(e.textSel.style("display","none"),P.children&&P.children.length?_.each(P.children,(function(e){e.textSel.style("display","inline")})):P.textSel.style("display","inline"),P.parent&&_.each(P.parent.children,(function(e){e.name!==P.name&&e.textSel.style("display","inline")})))})),z.style("font-size",(function(e){return s.noPrefixes?o.a.Text.calcFontSize(e.noPrefixName,e.r*n):o.a.Text.calcFontSize(e.name,e.r*n)})).text((function(e){return s.noPrefixes?o.a.Text.getTextWithElipsisIfNeeded(e.noPrefixName,e.r*n/3):o.a.Text.getTextWithElipsisIfNeeded(e.name,e.r*n/3)}))}function V(e){var 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=!0,this.style.display="none")}function Y(e){!e.isInFocusTransitive&&e.parent&&e.parent.isInFocusTransitive&&(e.textHidden=this.textContent.indexOf("...")+3===this.textContent.length,this.style.display="")}function B(e,t){if(l((function(){d.showExternalElements=e.name===h})),P!==e&&(e.id&&r.history.replaceState({id:e.id},"classHierarchyPage"+e.id,"hierarchy#"+e.id),e.children||(e=e.parent,P!==e))){if(t&&(L(),d3.selectAll(".selected").classed("selected",!1)),P.parent)for(var n=P;n;)n.isInFocusTransitive=!1,n=n.parent;for(n=e;n;)n.isInFocusTransitive=n.children,n=n.parent;if(2*(P=e).r/(2*P.r+20)<.3||d.currentSliderValue>d.currentBrowserLimit)M([P.x,P.y,V(P.r)]),z.each((function(e){W.call(this,e),Y.call(this,e)}));else d3.transition().duration(f).tween("zoom",(function(e){var t=d3.interpolateZoom(p,[P.x,P.y,V(P.r)]);return function(e){M(t(e))}})).selectAll("text").each("start",W).each("end",Y)}}M([P.x,P.y,V(P.r)],u),I=d.$on("rootFocus",(function(){r.history.pushState({id:1},"classHierarchyPage1","hierarchy#1"),R(n)})),b=d.$on("classSearch",(function(e){R(e)}))}function O(){var t=d.classHierarchyData.classCount;let n=p.get(v.CLASS_HIERARCHY_CURRENT_SLIDER_VALUE);(!n||n>t)&&(n=t,p.set(v.CLASS_HIERARCHY_CURRENT_SLIDER_VALUE,n)),e.$broadcast("classCount",t,n)}window.addEventListener("resize",O),window.addEventListener("beforeunload",(function e(){window.removeEventListener("resize",O),window.removeEventListener("beforeunload",e)})),d.$watch("classHierarchyData",(function(){k&&k(),F&&F(),L&&L(),D&&D();var e=C();if(d.classHierarchyData.classCount){O();var t=angular.copy(d.classHierarchyData);var n,r,i=function(e){return m.nodes(e).sort((function(e,t){return e.sortingRank>t.sortingRank?-1:e.sortingRank<t.sortingRank||e.depth>t.depth?1:e.depth<t.depth?-1:0}))}(t);function a(e,t){var i={keepPrevState:!0,noPrefixes:C()};r=i.noPrefixes,z(n||e,i,P,!0),l((function(){p.set(v.CLASS_HIERARCHY_SWITCH_PREFIXES,t),T()}),70)}function o(e,i,o){if(e){p.set(v.CLASS_HIERARCHY_CURRENT_SLIDER_VALUE,e),n={name:h,children:[]};for(var s=new Set,l=1;l<=e;l++)s.add(i[l].id),i[l].parent===i[0]&&n.children.push(i[l]);if(function e(t){if(t.children){for(var n=[],r=0;r<t.children.length;r++)s.has(t.children[r].id)&&n.push($.extend({},t.children[r]));t.children=n;for(r=0;r<t.children.length;r++)e(t.children[r])}}(n),o)r=angular.isUndefined(r)?C():r,z(n,{noPrefixes:r});else a(t)}}var s,c=p.get(v.CLASS_HIERARCHY_CURRENT_SLIDER_VALUE);if(c)o(c,i);else{var u={doFade:!0,keepPrevState:!0,noPrefixes:C()};z(t,u),T()}k=d.$watch("hidePrefixes",(function(n){angular.isUndefined(n)||e?e=void 0:l((function(){!function(e){angular.isUndefined(e)||p.set(v.CLASS_HIERARCHY_HIDE_PREFIXES,e)}(n),a(t,!0)}),50)}),!0),F=d.$watch("currentSliderValue",(function(e){o(e,i,!0)}),!0),D=d.$on("onEnterKeypressSearchAction",(function(e){s&&R(s)})),L=d.$on("searchedClass",(function(e,t){(s=N[t.name])&&R(s)}))}}),!0)}(d)}}}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","$licenseService","toastr","ZOOM_DURATION","ROOT_OBJ_NAME","LocalStorageAdapter","LSKeys","$translate"]}}]);
1
+ (window.webpackJsonp=window.webpackJsonp||[]).push([[20],{253:function(e,t,n){var r,i,a;i=[],void 0===(a="function"==typeof(r=function(){return function(){var e=function(){return"n"},t=function(){return[0,0]},n=function(){return" "},r=u(),i=null,a=null,o=null,s=null;function l(e){var t;i="svg"===(t=(t=e).node()).tagName.toLowerCase()?t:t.ownerSVGElement,a=i.createSVGPoint(),document.body.appendChild(r)}l.show=function(){var r=Array.prototype.slice.call(arguments);r[r.length-1]instanceof SVGElement&&(o=r.pop());var i,a=n.apply(this,r),u=t.apply(this,r),h=e.apply(this,r),p=f(),v=d.length,y=document.documentElement.scrollTop||document.body.scrollTop,g=document.documentElement.scrollLeft||document.body.scrollLeft,m=s.apply(this,r);for(p.html(a).style({opacity:1,"pointer-events":"all"});v--;)p.classed(d[v],!1);return i=c.get(h).apply(this),m?p.style(m):p.classed(h,!0).style({top:i.top+u[0]+y+"px",left:i.left+u[1]+g+"px"}),l},l.hide=function(){return f().style({opacity:0,"pointer-events":"none"}),l},l.attr=function(e,t){if(arguments.length<2&&"string"==typeof e)return f().attr(e);var n=Array.prototype.slice.call(arguments);return d3.selection.prototype.attr.apply(f(),n),l},l.style=function(e,t){if(arguments.length<2&&"string"==typeof e)return f().style(e);var n=Array.prototype.slice.call(arguments);return d3.selection.prototype.style.apply(f(),n),l},l.direction=function(t){return arguments.length?(e=null==t?t:d3.functor(t),l):e},l.offset=function(e){return arguments.length?(t=null==e?e:d3.functor(e),l):t},l.html=function(e){return arguments.length?(n=null==e?e:d3.functor(e),l):n},l.customPosition=function(e){return arguments.length?(s=null==e?e:d3.functor(e),l):s},l.destroy=function(){return r&&(f().remove(),r=null),l};var c=d3.map({n:function(){var e=h();return{top:e.n.y-r.offsetHeight,left:e.n.x-r.offsetWidth/2}},s:function(){var e=h();return{top:e.s.y,left:e.s.x-r.offsetWidth/2}},e:function(){var e=h();return{top:e.e.y-r.offsetHeight/2,left:e.e.x}},w:function(){var e=h();return{top:e.w.y-r.offsetHeight/2,left:e.w.x-r.offsetWidth}},nw:function(){var e=h();return{top:e.nw.y-r.offsetHeight,left:e.nw.x-r.offsetWidth}},ne:function(){var e=h();return{top:e.ne.y-r.offsetHeight,left:e.ne.x}},sw:function(){var e=h();return{top:e.sw.y,left:e.sw.x-r.offsetWidth}},se:function(){var e=h();return{top:e.se.y,left:e.e.x}}}),d=c.keys();function u(){var e=d3.select(document.createElement("div"));return e.style({position:"absolute",top:0,opacity:0,"pointer-events":"none","box-sizing":"border-box"}),e.node()}function f(){return null===r&&(r=u(),document.body.appendChild(r)),d3.select(r)}function h(){for(var e=o||d3.event.target;void 0===e.getScreenCTM&&"undefined"===e.parentNode;)e=e.parentNode;var t={},n=e.getScreenCTM(),r=e.getBBox(),i=r.width,s=r.height,l=r.x,c=r.y;return a.x=l,a.y=c,t.nw=a.matrixTransform(n),a.x+=i,t.ne=a.matrixTransform(n),a.y+=s,t.se=a.matrixTransform(n),a.x-=i,t.sw=a.matrixTransform(n),a.y-=s/2,t.w=a.matrixTransform(n),a.x+=i,t.e=a.matrixTransform(n),a.x-=i/2,a.y-=s/2,t.n=a.matrixTransform(n),a.y+=s,t.s=a.matrixTransform(n),t}return l}})?r.apply(t,i):r)||(e.exports=a)},254:function(e,t,n){"use strict";var r=r||{};r.Text=function(){function e(e,t,n,r){n=n||10;var i=t/3;return"string"==typeof e?(i*=10/(e.substring(0,t/3).length+1.5),i+=1,e.match(/[\u0900-\u0DFF\u1100-\u11FF\u2E80-\u2EFF\u3000-\u9FFF]/)&&(i*=.6),i<n&&(i=n),Math.round(i)):(i<n&&(i=n),Math.round(i))}return{calcFontSizeRaw:e,calcFontSize:function(t,n,r,i){return e(t,n,r)+"px"},getTextWithElipsisIfNeeded:function(e,t){return"string"==typeof e&&e.length>t?e.substring(0,t-3)+"...":e}}}(),r.Transition={fadeIn:function(e,t){e.style("opacity",0).transition().duration(t).style("opacity",1)},fadeOut:function(e,t){e.style("opacity",1).transition().duration(t).style("opacity",0)}},r.Click={delayDblClick:function(){var e=d3.dispatch("click","dblclick");return d3.rebind((function(t){var n,r=null;t.on("mousedown",(function(){n=d3.mouse(document.body),new Date})),t.on("mouseup",(function(t){var i,a;i=n,a=d3.mouse(document.body),Math.sqrt(Math.pow(i[0]-a[0],2),Math.pow(i[1]-a[1],2))>5||(r?(window.clearTimeout(r),r=null,e.dblclick(t)):r=window.setTimeout((d3.event,function(){e.click(t),r=null}),250))}))}),e,"on")}},t.a=r},255:function(e,t,n){"use strict";var r=r||{};r.Export={getCSSRules:function(e){var t=$('link[href="'+e+'"]')[0].sheet.rules,n="";return _.each(t,(function(e){n+=e.cssText})),n},generateBase64ImageSource:function(){var e=d3.selectAll("svg").attr({version:"1.1",xmlns:"http://www.w3.org/2000/svg"}).node().parentNode.innerHTML;return"data:image/svg+xml;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(e)))}},t.a=r},264:function(e,t,n){"use strict";var r=r||{};r.SingleChild={addPlaceholders:function e(t,n){if(t.children){for(var r=0;r<t.children.length;r++)e(t.children[r]);if(1===t.children.length){var i=1.2*t.size;n&&(i=.1*t.children[0].size),t.children.push({name:"placeholder",size:i})}}},removePlaceholders:function e(t){for(var n=t.length-1;n>=0;n--){var r=t[n];"placeholder"===r.name?t.splice(n,1):r.children&&e(r.children)}},centerNodes:function(e){for(var t=0;t<e.length;t++){var n=e[t];if(n.children&&1===n.children.length){var r=n.x-n.children[0].x;n.children[0].x+=r,i(n.children[0],r)}}function i(e,t){if(e.children)for(var n=0;n<e.children.length;n++)e.children[n].x+=t,i(e.children[n],t)}},makePositionsRelativeToZero:function(e){for(var t=e[0].x,n=e[0].y,r=0;r<e.length;r++){var i=e[r];i.x-=t,i.y-=n}}},t.a=r},82:function(e,t,n){"use strict";n.r(t);var r=n(253),i=n.n(r),a=n(264),o=n(254),s=n(255);n(5);function l(e,t,n,r,l,c,d,u,f,h,p,v,y){return{restrict:"AE",template:'<div id="classChart"></div>',scope:{classHierarchyData:"=",flattenedClassNames:"=",selectedClass:"=",currentSliderValue:"=",showClassInfoPanel:"=",showExternalElements:"=",hidePrefixes:"=",currentBrowserLimit:"="},link:function(d,g,m){!function(d,g){var m=d3.layout.pack().size([780,780]).value((function(e){return e.size})),x=d3.scale.linear().domain([0,4]).range(["hsl(19, 70%, 90%)","hsl(19, 70%, 50%)"]).interpolate(d3.interpolateHcl),w=d3.select("#classChart").insert("svg:svg","h2").attr("viewBox","0 0 800 800").attr("preserveAspectRatio","xMidYMid meet").on("dblclick.zoom",null);function S(){return w.append("svg:g").attr({id:"main-group",transform:"translate(400,400)"})}function C(){return"true"===p.get(v.CLASS_HIERARCHY_HIDE_PREFIXES)}function E(){var e=s.a.Export.getCSSRules("css/rdf-class-hierarchy-labels.css?v=2.2.2-TR2");d3.selectAll("#main-group").append("defs"),$("defs").append('<style type="text/css"><![CDATA['+e+"]]></style>"),d3.selectAll("g").style("opacity",1);var t=s.a.Export.generateBase64ImageSource();d3.select(this).attr({href:t,download:"class-hierarchy-"+c.getActiveRepository()+".svg"})}d.hidePrefixes=C();var T,R,A=S();if(!d.classHierarchyData.classCount&&c.getActiveRepository()&&!c.isSystemRepository()){e.loader=!0,e.hierarchyError=!1;const t=p.get("classHierarchy-selectedGraph-"+c.getActiveRepository());n.getClassHierarchyData(null!==t?t.contextID.uri:"").success((function(t,n,r){e.loader=!1,207===n&&u.warning(y.instant("graphexplore.update.diagram"),y.instant("graphexplore.repository.data.changed")),d.classHierarchyData=t,d3.select("#download-svg").on("mouseover",E)})).error((function(t){e.loader=!1,e.hierarchyError=getError(t),u.error(y.instant("graphexplore.error.request.failed",{name:h,error:getError(t)}))}))}var H,P,I,b,k,F,L,D,N={};function z(n,s,c,u){I&&I(),b&&b(),d3.selectAll("#main-group").remove(),A=S(),a.a.SingleChild.addPlaceholders(n,!0),P=c||n;var p,v=m.nodes(n);P.isInFocusTransitive=!0,a.a.SingleChild.removePlaceholders(v),a.a.SingleChild.centerNodes(v),a.a.SingleChild.makePositionsRelativeToZero(v);var y=i()().attr("class","d3-tip").customPosition((function(e){return{top:"inherit",bottom:r.innerHeight-d3.event.clientY+"px",right:r.innerWidth-d3.event.clientX+"px"}})).html((function(e){return e.name}));w.call(y);var g=A.selectAll("circle").data(v).enter().append("g");s.doFade&&g.each((function(e){o.a.Transition.fadeIn(d3.select(this),550)}));var C,E=[],k=g.append("circle").attr("class",(function(e){return e.role})).attr("guide-selector",(function(e){return"class-"+e.name})).style("fill",(function(e){return e.children?x(e.depth):"#E0D0D0"})).each((function(e){if(e.circle=d3.select(this),e.name!==h){var t=e.name;E.push({name:t}),N[[t]]=e,e.circle.classed("rdf-class",!0),e.circle.on("mouseover",(function(){s.noPrefixes||e.textHidden?y.show(e):y.hide(e)})),e.circle.on("mouseout",y.hide)}})).on("gdb-focus",R).on("gdb-zoom",B);function F(e){d3.selectAll(".selected").classed("selected",e.selected=!1),e.circle.classed("selected",e.selected=!0),C=e}function L(){d.showClassInfoPanel=!1}E&&(E=_.uniqBy(E,"name"),d.flattenedClassNames=E);var D=o.a.Click.delayDblClick();d3.selectAll(".parent, .topLevelParent, .child, .root").call(D);R=function(e){B(e),e.name===h?(L(),d3.selectAll(".selected").classed("selected",!1)):(F(e),d.selectedClass=C,d.showClassInfoPanel=!0,d.$on("sidePanelClosed",(function(t){d3.selectAll(".selected").classed("selected",e.selected=!1)})))},D.on("click",(function(e){e.id&&r.history.pushState({id:e.id},"classHierarchyPage"+e.id,"hierarchy#"+e.id),y.hide(),R(e)})),D.on("dblclick",(function(t){t!==n&&(y.hide(),F(t),e.$broadcast("goToDomainRangeGraphView",C,P),d3.event.stopPropagation())}));var $=0;w.on("wheel",(function(){y.hide();var e=d3.event;e.preventDefault(),e.stopPropagation();var t=(new Date).getTime();if(t-$>100){$=t;var n="";e.deltaY<=-1?n="in":e.deltaY>=1&&(n="out");var i=e.target.__data__;if(i||(i=P),"in"===n){if(i!==P){for(;i.parent&&!i.parent.isInFocusTransitive;)i=i.parent;i.depth<P.depth&&(i=P)}if(i===P&&i.children){for(var a=i.children[0],o=1;o<i.children.length;o++)i.children[o].sortingRank>a.sortingRank&&(a=i.children[o]);a.children&&(i=a)}else i.children||(i=i.parent);B(i,!0)}else"out"===n&&(i=P.parent)&&B(i,!0);P.name===h&&r.history.replaceState({id:1},"classHierarchyPage1","hierarchy#1"),O()}}));var z=A.selectAll("text").data(v).enter().append("text").attr("class",(function(e){return e.children&&e.children.length?"label":"label child-label"})).each((function(e){e.textSel=d3.select(this)}));s.noPrefixes?(H!==n&&(z.each((function(e){var t=e.name.indexOf(":");e.name.indexOf("http://")>-1?e.noPrefixName=e.name:t>-1&&(e.noPrefixName=e.name.substring(t+1))})),H=n),z.style("font-size",(function(e){return o.a.Text.calcFontSize(e.noPrefixName,e.r)})).text((function(e){return o.a.Text.getTextWithElipsisIfNeeded(e.noPrefixName,e.r/3)}))):z.style("font-size",(function(e){return o.a.Text.calcFontSize(e.name,e.r)})).text((function(e){return o.a.Text.getTextWithElipsisIfNeeded(e.name,e.r/3)})),z.style("display",(function(e){return e.parent===n?(e.textHidden=this.textContent.indexOf("...")+3===this.textContent.length,null):(e.textHidden=!0,"none")})),s.doFade&&!s.keepPrevState&&z.each((function(e){o.a.Transition.fadeIn(d3.select(this),550)})),T=function(){function e(e){e&&k.each((function(t){e==t.id&&R(t)}))}var n=t.hash();r.onpopstate=function(t){t.state&&e(t.state.id)},e(n)};var U=A.selectAll("circle, text");function M(e,t){var n=800/e[2];p=e,U.attr("transform",(function(t){return"translate("+(t.x-e[0])*n+","+(t.y-e[1])*n+")"})),k.attr("r",(function(e){return e.r*n})),t&&z.each((function(e){e.fullName!==P.topLevelParentUri&&P.topLevelParentUri!==h||(e.textSel.style("display","none"),P.children&&P.children.length?_.each(P.children,(function(e){e.textSel.style("display","inline")})):P.textSel.style("display","inline"),P.parent&&_.each(P.parent.children,(function(e){e.name!==P.name&&e.textSel.style("display","inline")})))})),z.style("font-size",(function(e){return s.noPrefixes?o.a.Text.calcFontSize(e.noPrefixName,e.r*n):o.a.Text.calcFontSize(e.name,e.r*n)})).text((function(e){return s.noPrefixes?o.a.Text.getTextWithElipsisIfNeeded(e.noPrefixName,e.r*n/3):o.a.Text.getTextWithElipsisIfNeeded(e.name,e.r*n/3)}))}function V(e){var 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=!0,this.style.display="none")}function Y(e){!e.isInFocusTransitive&&e.parent&&e.parent.isInFocusTransitive&&(e.textHidden=this.textContent.indexOf("...")+3===this.textContent.length,this.style.display="")}function B(e,t){if(l((function(){d.showExternalElements=e.name===h})),P!==e&&(e.id&&r.history.replaceState({id:e.id},"classHierarchyPage"+e.id,"hierarchy#"+e.id),e.children||(e=e.parent,P!==e))){if(t&&(L(),d3.selectAll(".selected").classed("selected",!1)),P.parent)for(var n=P;n;)n.isInFocusTransitive=!1,n=n.parent;for(n=e;n;)n.isInFocusTransitive=n.children,n=n.parent;if(2*(P=e).r/(2*P.r+20)<.3||d.currentSliderValue>d.currentBrowserLimit)M([P.x,P.y,V(P.r)]),z.each((function(e){W.call(this,e),Y.call(this,e)}));else d3.transition().duration(f).tween("zoom",(function(e){var t=d3.interpolateZoom(p,[P.x,P.y,V(P.r)]);return function(e){M(t(e))}})).selectAll("text").each("start",W).each("end",Y)}}M([P.x,P.y,V(P.r)],u),I=d.$on("rootFocus",(function(){r.history.pushState({id:1},"classHierarchyPage1","hierarchy#1"),R(n)})),b=d.$on("classSearch",(function(e){R(e)}))}function O(){var t=d.classHierarchyData.classCount;let n=p.get(v.CLASS_HIERARCHY_CURRENT_SLIDER_VALUE);(!n||n>t)&&(n=t,p.set(v.CLASS_HIERARCHY_CURRENT_SLIDER_VALUE,n)),e.$broadcast("classCount",t,n)}window.addEventListener("resize",O),window.addEventListener("beforeunload",(function e(){window.removeEventListener("resize",O),window.removeEventListener("beforeunload",e)})),d.$watch("classHierarchyData",(function(){k&&k(),F&&F(),L&&L(),D&&D();var e=C();if(d.classHierarchyData.classCount){O();var t=angular.copy(d.classHierarchyData);var n,r,i=function(e){return m.nodes(e).sort((function(e,t){return e.sortingRank>t.sortingRank?-1:e.sortingRank<t.sortingRank||e.depth>t.depth?1:e.depth<t.depth?-1:0}))}(t);function a(e,t){var i={keepPrevState:!0,noPrefixes:C()};r=i.noPrefixes,z(n||e,i,P,!0),l((function(){p.set(v.CLASS_HIERARCHY_SWITCH_PREFIXES,t),T()}),70)}function o(e,i,o){if(e){p.set(v.CLASS_HIERARCHY_CURRENT_SLIDER_VALUE,e),n={name:h,children:[]};for(var s=new Set,l=1;l<=e;l++)s.add(i[l].id),i[l].parent===i[0]&&n.children.push(i[l]);if(function e(t){if(t.children){for(var n=[],r=0;r<t.children.length;r++)s.has(t.children[r].id)&&n.push($.extend({},t.children[r]));t.children=n;for(r=0;r<t.children.length;r++)e(t.children[r])}}(n),o)r=angular.isUndefined(r)?C():r,z(n,{noPrefixes:r});else a(t)}}var s,c=p.get(v.CLASS_HIERARCHY_CURRENT_SLIDER_VALUE);if(c)o(c,i);else{var u={doFade:!0,keepPrevState:!0,noPrefixes:C()};z(t,u),T()}k=d.$watch("hidePrefixes",(function(n){angular.isUndefined(n)||e?e=void 0:l((function(){!function(e){angular.isUndefined(e)||p.set(v.CLASS_HIERARCHY_HIDE_PREFIXES,e)}(n),a(t,!0)}),50)}),!0),F=d.$watch("currentSliderValue",(function(e){o(e,i,!0)}),!0),D=d.$on("onEnterKeypressSearchAction",(function(e){s&&R(s)})),L=d.$on("searchedClass",(function(e,t){(s=N[t.name])&&R(s)}))}}),!0)}(d)}}}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","$licenseService","toastr","ZOOM_DURATION","ROOT_OBJ_NAME","LocalStorageAdapter","LSKeys","$translate"]}}]);
2
2
  //# sourceMappingURL=20.fbcb31706f03a07e8827.bundle.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["webpack:///./src/js/lib/d3-tip/d3-tip-patch.js","webpack:///./src/js/lib/common/d3-utils.js","webpack:///./src/js/lib/common/svg-export.js","webpack:///./src/js/lib/common/circle-packing.js","webpack:///./src/js/angular/graphexplore/directives/rdf-class-hierarchy.directive.js"],"names":["direction","offset","html","node","initNode","svg","point","target","customPosition","tip","vis","el","tagName","toLowerCase","ownerSVGElement","createSVGPoint","document","body","appendChild","show","args","Array","prototype","slice","call","arguments","length","SVGElement","pop","coords","content","apply","this","poffset","dir","nodel","getNodeEl","i","directions","scrollTop","documentElement","scrollLeft","customPos","style","opacity","classed","direction_callbacks","get","top","left","hide","attr","n","v","d3","selection","functor","destroy","remove","map","bbox","getScreenBBox","y","offsetHeight","x","offsetWidth","s","e","w","nw","ne","sw","se","keys","select","createElement","position","targetel","event","getScreenCTM","parentNode","matrix","tbbox","getBBox","width","height","matrixTransform","D3","Text","calcFontSizeRaw","text","radius","minimumSize","isMultiline","textSize","substring","match","Math","round","calcFontSize","getTextWithElipsisIfNeeded","str","threshold","Transition","fadeIn","sel","duration","transition","fadeOut","Click","delayDblClick","dispatch","rebind","down","wait","on","mouse","Date","d","a","b","sqrt","pow","window","clearTimeout","dblclick","setTimeout","click","SVG","Export","getCSSRules","cssSourceFilePath","cssRules","$","sheet","rules","cssStr","_","each","value","cssText","generateBase64ImageSource","exportSvg","selectAll","version","xmlns","innerHTML","btoa","unescape","encodeURIComponent","CirclePacking","SingleChild","addPlaceholders","first","children","placeholderSize","size","push","name","removePlaceholders","nodes","splice","centerNodes","reposition","makePositionsRelativeToZero","offsetX","offsetY","classHierarchyDirective","$rootScope","$location","GraphDataRestService","$window","$timeout","$repositories","$licenseService","toastr","ZOOM_DURATION","ROOT_OBJ_NAME","LocalStorageAdapter","LSKeys","$translate","restrict","template","scope","classHierarchyData","flattenedClassNames","selectedClass","currentSliderValue","showClassInfoPanel","showExternalElements","hidePrefixes","currentBrowserLimit","link","element","attrs","pack","layout","diameter","color","scale","linear","domain","range","interpolate","interpolateHcl","insert","appendMainGroup","append","id","transform","getPrefixesState","CLASS_HIERARCHY_HIDE_PREFIXES","prepareForSVGImageExport","imgSrc","href","download","getActiveRepository","autoZoomToPreviousState","doFocus","g","classCount","isSystemRepository","loader","hierarchyError","selGraphFromCache","getClassHierarchyData","contextID","uri","success","response","status","headers","warning","instant","error","getError","oldRoot","focus","rootFocusEvent","classSearchEvent","prefixesWatch","currentClassCountWatch","searchedClassBroadcast","onEnterClassSearchBroadcast","flattenedClassData","drawDiagram","root","config","newFocus","switchPrefixes","view","isInFocusTransitive","bottom","innerHeight","clientY","right","innerWidth","clientX","circleGroup","data","enter","doFade","circle","role","depth","key","noPrefixes","textHidden","zoom","getCurrentClassDataAndMarkSelected","obj","selected","closeClassInfoPanel","uniqBy","clickCancel","$on","history","pushState","$broadcast","stopPropagation","lastTimeWheel","preventDefault","now","getTime","deltaY","__data__","parent","newobj","sortingRank","replaceState","sendSliderData","textSel","idx","indexOf","noPrefixName","r","textContent","keepPrevState","focusOnCurrentClass","focusHistoryId","hash","onpopstate","state","zoomTo","k","fullName","topLevelParentUri","c","adjustRadius","newr","textUpdateStart","display","textUpdateEnd","shouldClosePanel","p","tween","interpolateZoom","t","currentClassCount","CLASS_HIERARCHY_CURRENT_SLIDER_VALUE","set","addEventListener","removeResizeListener","removeEventListener","$watch","initialPrefixesState","angular","copy","newRoot","noPrefixesGlobal","sorted","sort","sortRoot","restoreDiagramState","currentRoot","prefixesConfig","CLASS_HIERARCHY_SWITCH_PREFIXES","redrawFilteredDiagram","sortedRoot","useSlider","addedIds","Set","add","fixChildren","newChildren","has","extend","isUndefined","currentSearchedClass","basicConfig","undefined","savePrefixesState","searchedClass","renderCirclePacking","module","constant","directive","$inject"],"mappings":"8EAAA,UAQ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AO4I,sCACxD,GAAIpI,EACAsJ,EAAsBtJ,EAAoB+I,OACvC,CACH,IAAImB,EAAc,CACdxF,QAAQ,EACRoC,eAAe,EACf/B,WAAYxD,KAEhBmC,EAAYC,EAAMuG,GAClBpI,IAGJuB,EAAgBzD,EAAM6I,OAAO,gBAAgB,SAAUtI,GAC/CwI,QAAQqB,YAAY7J,IAAiBuI,EACrCA,OAAuByB,EAI3BlL,GAAS,YA1uBrB,SAA2BkB,GAClBwI,QAAQqB,YAAY7J,IACrBZ,EAAoB8I,IAAI7I,EAAOgC,8BAA+BrB,GAyuBtDiK,CAAkBjK,GAClB+I,EAAoBvF,GAAM,KAC3B,OACJ,GAEHL,EAAyB1D,EAAM6I,OAAO,sBAAsB,SAAUzI,GAClEsJ,EAAsBtJ,EAAoB+I,GAAQ,MACnD,GAMHvF,EAA8B5D,EAAM4F,IAAI,+BAA+B,SAAUrM,GACzE8Q,GACAlI,EAAQkI,MAIhB1G,EAAyB3D,EAAM4F,IAAI,iBAAiB,SAAUrM,EAAOkR,IACjEJ,EAAuBxG,EAAmB4G,EAAclM,QAEpD4D,EAAQkI,UAIrB,GAnzBHK,CAAoB1K,KA7B5B+I,QACK4B,OAAO,kDAAmD,CACvD,mDACA,gDAEHC,SAAS,gBAAiB,KAC1BA,SAAS,gBAAiB,uBAC1BC,UAAU,oBAAqB7L,GAEpCA,EAAwB8L,QAAU,CAAC,aAAc,YAAa,uBAAwB,UAAW,WAAY,gBAAiB,kBAAmB,SAAU,gBAAiB,gBAAiB,sBAAuB,SAAU","file":"20.fbcb31706f03a07e8827.bundle.js","sourcesContent":["// d3.tip\n// Copyright (c) 2013 Justin Palmer\n//\n// Tooltips for d3.js SVG visualizations\n\n(function (root, factory) {\n if (typeof define === 'function' && define.amd) {\n // AMD. Register as an anonymous module with d3 as a dependency.\n define([], factory)\n } else if (typeof module === 'object' && module.exports) {\n // CommonJS\n module.exports = function(d3) {\n d3.tip = factory(d3)\n return d3.tip\n }\n } else {\n // Browser global.\n root.d3.tip = factory(root.d3)\n }\n}(this, function () {\n // Public - contructs a new tooltip\n //\n // Returns a tip\n return function() {\n var direction = d3_tip_direction,\n offset = d3_tip_offset,\n html = d3_tip_html,\n node = initNode(),\n svg = null,\n point = null,\n target = null,\n customPosition = null\n\n function tip(vis) {\n svg = getSVGNode(vis)\n point = svg.createSVGPoint()\n document.body.appendChild(node)\n }\n\n // Public - show the tooltip on the screen\n //\n // Returns a tip\n tip.show = function() {\n var args = Array.prototype.slice.call(arguments)\n if(args[args.length - 1] instanceof SVGElement) target = args.pop()\n\n var content = html.apply(this, args),\n poffset = offset.apply(this, args),\n dir = direction.apply(this, args),\n nodel = getNodeEl(),\n i = directions.length,\n coords,\n scrollTop = document.documentElement.scrollTop || document.body.scrollTop,\n scrollLeft = document.documentElement.scrollLeft || document.body.scrollLeft,\n customPos = customPosition.apply(this, args)\n\n nodel.html(content)\n .style({ opacity: 1, 'pointer-events': 'all' })\n\n while(i--) nodel.classed(directions[i], false)\n coords = direction_callbacks.get(dir).apply(this)\n\n if (customPos) {\n nodel.style(customPos)\n } else {\n nodel.classed(dir, true).style({\n top: (coords.top + poffset[0]) + scrollTop + 'px',\n left: (coords.left + poffset[1]) + scrollLeft + 'px'\n })\n }\n\n return tip\n }\n\n // Public - hide the tooltip\n //\n // Returns a tip\n tip.hide = function() {\n var nodel = getNodeEl()\n nodel.style({ opacity: 0, 'pointer-events': 'none' })\n return tip\n }\n\n // Public: Proxy attr calls to the d3 tip container. Sets or gets attribute value.\n //\n // n - name of the attribute\n // v - value of the attribute\n //\n // Returns tip or attribute value\n tip.attr = function(n, v) {\n if (arguments.length < 2 && typeof n === 'string') {\n return getNodeEl().attr(n)\n } else {\n var args = Array.prototype.slice.call(arguments)\n d3.selection.prototype.attr.apply(getNodeEl(), args)\n }\n\n return tip\n }\n\n // Public: Proxy style calls to the d3 tip container. Sets or gets a style value.\n //\n // n - name of the property\n // v - value of the property\n //\n // Returns tip or style property value\n tip.style = function(n, v) {\n if (arguments.length < 2 && typeof n === 'string') {\n return getNodeEl().style(n)\n } else {\n var args = Array.prototype.slice.call(arguments)\n d3.selection.prototype.style.apply(getNodeEl(), args)\n }\n\n return tip\n }\n\n // Public: Set or get the direction of the tooltip\n //\n // v - One of n(north), s(south), e(east), or w(west), nw(northwest),\n // sw(southwest), ne(northeast) or se(southeast)\n //\n // Returns tip or direction\n tip.direction = function(v) {\n if (!arguments.length) return direction\n direction = v == null ? v : d3.functor(v)\n\n return tip\n }\n\n // Public: Sets or gets the offset of the tip\n //\n // v - Array of [x, y] offset\n //\n // Returns offset or\n tip.offset = function(v) {\n if (!arguments.length) return offset\n offset = v == null ? v : d3.functor(v)\n\n return tip\n }\n\n // Public: sets or gets the html value of the tooltip\n //\n // v - String value of the tip\n //\n // Returns html value or tip\n tip.html = function(v) {\n if (!arguments.length) return html\n html = v == null ? v : d3.functor(v)\n\n return tip\n }\n\n tip.customPosition = function(v) {\n if (!arguments.length) return customPosition\n customPosition = v == null ? v : d3.functor(v)\n\n return tip\n }\n\n // Public: destroys the tooltip and removes it from the DOM\n //\n // Returns a tip\n tip.destroy = function() {\n if(node) {\n getNodeEl().remove();\n node = null;\n }\n return tip;\n }\n\n function d3_tip_direction() { return 'n' }\n function d3_tip_offset() { return [0, 0] }\n function d3_tip_html() { return ' ' }\n\n var direction_callbacks = d3.map({\n n: direction_n,\n s: direction_s,\n e: direction_e,\n w: direction_w,\n nw: direction_nw,\n ne: direction_ne,\n sw: direction_sw,\n se: direction_se\n }),\n\n directions = direction_callbacks.keys()\n\n function direction_n() {\n var bbox = getScreenBBox()\n return {\n top: bbox.n.y - node.offsetHeight,\n left: bbox.n.x - node.offsetWidth / 2\n }\n }\n\n function direction_s() {\n var bbox = getScreenBBox()\n return {\n top: bbox.s.y,\n left: bbox.s.x - node.offsetWidth / 2\n }\n }\n\n function direction_e() {\n var bbox = getScreenBBox()\n return {\n top: bbox.e.y - node.offsetHeight / 2,\n left: bbox.e.x\n }\n }\n\n function direction_w() {\n var bbox = getScreenBBox()\n return {\n top: bbox.w.y - node.offsetHeight / 2,\n left: bbox.w.x - node.offsetWidth\n }\n }\n\n function direction_nw() {\n var bbox = getScreenBBox()\n return {\n top: bbox.nw.y - node.offsetHeight,\n left: bbox.nw.x - node.offsetWidth\n }\n }\n\n function direction_ne() {\n var bbox = getScreenBBox()\n return {\n top: bbox.ne.y - node.offsetHeight,\n left: bbox.ne.x\n }\n }\n\n function direction_sw() {\n var bbox = getScreenBBox()\n return {\n top: bbox.sw.y,\n left: bbox.sw.x - node.offsetWidth\n }\n }\n\n function direction_se() {\n var bbox = getScreenBBox()\n return {\n top: bbox.se.y,\n left: bbox.e.x\n }\n }\n\n function initNode() {\n var node = d3.select(document.createElement('div'))\n node.style({\n position: 'absolute',\n top: 0,\n opacity: 0,\n 'pointer-events': 'none',\n 'box-sizing': 'border-box'\n })\n\n return node.node()\n }\n\n function getSVGNode(el) {\n el = el.node()\n if(el.tagName.toLowerCase() === 'svg')\n return el\n\n return el.ownerSVGElement\n }\n\n function getNodeEl() {\n if(node === null) {\n node = initNode();\n // re-add node to DOM\n document.body.appendChild(node);\n };\n return d3.select(node);\n }\n\n // Private - gets the screen coordinates of a shape\n //\n // Given a shape on the screen, will return an SVGPoint for the directions\n // n(north), s(south), e(east), w(west), ne(northeast), se(southeast), nw(northwest),\n // sw(southwest).\n //\n // +-+-+\n // | |\n // + +\n // | |\n // +-+-+\n //\n // Returns an Object {n, s, e, w, nw, sw, ne, se}\n function getScreenBBox() {\n var targetel = target || d3.event.target;\n\n while ('undefined' === typeof targetel.getScreenCTM && 'undefined' === targetel.parentNode) {\n targetel = targetel.parentNode;\n }\n\n var bbox = {},\n matrix = targetel.getScreenCTM(),\n tbbox = targetel.getBBox(),\n width = tbbox.width,\n height = tbbox.height,\n x = tbbox.x,\n y = tbbox.y\n\n point.x = x\n point.y = y\n bbox.nw = point.matrixTransform(matrix)\n point.x += width\n bbox.ne = point.matrixTransform(matrix)\n point.y += height\n bbox.se = point.matrixTransform(matrix)\n point.x -= width\n bbox.sw = point.matrixTransform(matrix)\n point.y -= height / 2\n bbox.w = point.matrixTransform(matrix)\n point.x += width\n bbox.e = point.matrixTransform(matrix)\n point.x -= width / 2\n point.y -= height / 2\n bbox.n = point.matrixTransform(matrix)\n point.y += height\n bbox.s = point.matrixTransform(matrix)\n\n return bbox\n }\n\n return tip\n };\n\n}));","var D3 = D3 || {};\n\nD3.Text = function () {\n function calcFontSizeRaw(text, radius, minimumSize, isMultiline) {\n minimumSize = minimumSize || 10;\n\n var textSize = radius / 3;\n if (typeof text === \"string\") {\n var len = text.substring(0, radius / 3).length + 1.5;\n textSize *= 10 / len;\n textSize += 1;\n // experimental alternative method:\n // var textSize = 3.3 * radius / text.length;\n\n // Tweak for Indian scripts and CJK ones\n if (text.match(/[\\u0900-\\u0DFF\\u1100-\\u11FF\\u2E80-\\u2EFF\\u3000-\\u9FFF]/)) {\n textSize *= 0.6;\n }\n\n if (textSize < minimumSize) {\n textSize = minimumSize;\n }\n\n /* Disabled for the time being, better without this\n if (isMultiline) {\n var numWords = text.split(/\\s+/).length;\n if (numWords > 1) {\n if (numWords > 4) {\n numWords = 4;\n }\n textSize += textSize * (4 - numWords) * 0.1;\n }\n }\n */\n\n return Math.round(textSize);\n }\n\n if (textSize < minimumSize) {\n textSize = minimumSize;\n }\n\n return Math.round(textSize);\n }\n\n function calcFontSize(text, radius, minimumSize, isMultiline) {\n return calcFontSizeRaw(text, radius, minimumSize, isMultiline) + 'px';\n }\n\n function getTextWithElipsisIfNeeded(str, threshold) {\n if (typeof str === \"string\") {\n if (str.length > threshold) {\n return str.substring(0, threshold - 3) + \"...\";\n }\n }\n return str;\n }\n\n return {\n calcFontSizeRaw: calcFontSizeRaw,\n calcFontSize: calcFontSize,\n getTextWithElipsisIfNeeded: getTextWithElipsisIfNeeded\n };\n}();\n\nD3.Transition = function () {\n function fadeIn(sel, duration) {\n sel.style(\"opacity\", 0.0)\n .transition()\n .duration(duration)\n .style(\"opacity\", 1.0);\n }\n\n function fadeOut(sel, duration) {\n sel.style(\"opacity\", 1.0)\n .transition()\n .duration(duration)\n .style(\"opacity\", 0.0);\n }\n\n return {\n fadeIn: fadeIn,\n fadeOut: fadeOut\n };\n}();\n\nD3.Click = function () {\n function delayDblClick() {\n var event = d3.dispatch('click', 'dblclick');\n\n function cc(selection) {\n var down,\n tolerance = 5,\n last,\n wait = null;\n\n // euclidean distance\n function dist(a, b) {\n return Math.sqrt(Math.pow(a[0] - b[0], 2), Math.pow(a[1] - b[1], 2));\n }\n\n selection.on('mousedown', function () {\n down = d3.mouse(document.body);\n last = +new Date();\n });\n selection.on('mouseup', function (d) {\n if (dist(down, d3.mouse(document.body)) > tolerance) {\n return;\n } else {\n if (wait) {\n window.clearTimeout(wait);\n wait = null;\n event.dblclick(d);\n } else {\n wait = window.setTimeout((function (e) {\n return function () {\n event.click(d);\n wait = null;\n };\n })(d3.event), 250);\n }\n }\n });\n }\n\n return d3.rebind(cc, event, 'on');\n }\n\n return {\n delayDblClick: delayDblClick\n };\n}();\n\nexport default D3;\n","var SVG = SVG || {};\n\nSVG.Export = function () {\n function getCSSRules(cssSourceFilePath) {\n var cssRules = $('link[href=\"' + cssSourceFilePath + '\"]')[0].sheet.rules;\n var cssStr = \"\";\n _.each(cssRules, function (value) {\n cssStr += value.cssText;\n });\n return cssStr;\n }\n\n function generateBase64ImageSource() {\n // add needed xml namespace\n var exportSvg = d3.selectAll(\"svg\")\n .attr({\n version: \"1.1\",\n xmlns: \"http://www.w3.org/2000/svg\"\n })\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","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.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 d3tip from 'lib/d3-tip/d3-tip-patch';\nimport CirclePacking from 'lib/common/circle-packing';\nimport D3 from 'lib/common/d3-utils';\nimport SVG from 'lib/common/svg-export';\nimport 'angular/utils/local-storage-adapter';\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', '$licenseService', 'toastr', 'ZOOM_DURATION', 'ROOT_OBJ_NAME', 'LocalStorageAdapter', 'LSKeys', '$translate'];\n\nfunction classHierarchyDirective($rootScope, $location, GraphDataRestService, $window, $timeout, $repositories, $licenseService, 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 var width = 800,\n height = 800,\n diameter = height,\n margin = 20,\n node,\n root;\n\n var pack = d3.layout.pack()\n .size([diameter - margin, diameter - margin])\n .value(function (d) {\n return d.size;\n });\n\n var colors = [\n \"hsl(33, 75%, 75%)\",\n \"hsl(213, 75%, 75%)\",\n \"hsl(333, 75%, 75%)\",\n \"hsl(153, 75%, 75%)\",\n \"hsl(273, 75%, 75%)\",\n \"hsl(93, 75%, 75%)\"\n ];\n\n var color = d3.scale.linear()\n .domain([0, 4])\n .range([\"hsl(19, 70%, 90%)\", \"hsl(19, 70%, 50%)\"])\n .interpolate(d3.interpolateHcl);\n\n var 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 .attr({\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 var cssRules = SVG.Export.getCSSRules(\"css/rdf-class-hierarchy-labels.css?v=2.2.1\");\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 var imgSrc = SVG.Export.generateBase64ImageSource();\n\n // set the binary image and a name for the downloadable file on the export button\n d3.select(this).attr({\n href: imgSrc,\n download: \"class-hierarchy-\" + $repositories.getActiveRepository() + \".svg\"\n });\n }\n\n scope.hidePrefixes = getPrefixesState();\n\n var g = appendMainGroup();\n\n if (!scope.classHierarchyData.classCount && $repositories.getActiveRepository() && !$repositories.isSystemRepository()) {\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, headers) {\n $rootScope.loader = false;\n if (status === 207) {\n toastr.warning($translate.instant('graphexplore.update.diagram'), $translate.instant('graphexplore.repository.data.changed'));\n }\n scope.classHierarchyData = response;\n\n d3.select(\"#download-svg\")\n .on(\"mouseover\", prepareForSVGImageExport);\n\n }).error(function (response) {\n $rootScope.loader = false;\n $rootScope.hierarchyError = getError(response);\n toastr.error($translate.instant('graphexplore.error.request.failed', {name: ROOT_OBJ_NAME, error: getError(response)}));\n });\n }\n\n\n var autoZoomToPreviousState,\n doFocus;\n\n var oldRoot,\n focus,\n rootFocusEvent,\n classSearchEvent,\n 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 focus = newFocus ? newFocus : root;\n\n var nodes = pack.nodes(root),\n 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 var tip = d3tip()\n .attr('class', 'd3-tip')\n //.offset([-10, 0])\n .customPosition(function (d) {\n return {\n top: 'inherit',\n bottom: ($window.innerHeight - d3.event.clientY) + 'px',\n right: ($window.innerWidth - d3.event.clientX) + 'px'\n };\n })\n .html(function (d) {\n return d.name;\n });\n\n svg.call(tip);\n\n var 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 var flattenedClassNames = [];\n\n var circle = circleGroup\n .append(\"circle\")\n .attr(\"class\", function (d) {\n return d.role;\n })\n .attr(\"guide-selector\", function (d) {\n return \"class-\" + d.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.name !== ROOT_OBJ_NAME) {\n var key = d.name;\n flattenedClassNames.push({name: key});\n flattenedClassData[[key]] = d;\n\n d.circle.classed(\"rdf-class\", true);\n d.circle.on('mouseover', function () {\n if (config.noPrefixes) {\n tip.show(d);\n } else if (!d.textHidden) {\n tip.hide(d);\n } else {\n tip.show(d);\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\", doFocus)\n .on(\"gdb-zoom\", zoom);\n\n\n if (flattenedClassNames) {\n flattenedClassNames = _.uniqBy(flattenedClassNames, 'name');\n scope.flattenedClassNames = flattenedClassNames;\n }\n\n var 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 var clickCancel = D3.Click.delayDblClick();\n var parentCircles = d3.selectAll(\".parent, .topLevelParent, .child, .root\")\n .call(clickCancel);\n\n doFocus = function (obj) {\n zoom(obj);\n\n if (obj.name === ROOT_OBJ_NAME) {\n closeClassInfoPanel();\n d3.selectAll(\".selected\").classed(\"selected\", false);\n } else {\n getCurrentClassDataAndMarkSelected(obj);\n showClassInfoPanel();\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 (obj) {\n // add clicked class to browser history\n if (obj.id) {\n $window.history.pushState({id: obj.id}, \"classHierarchyPage\" + obj.id, \"hierarchy#\" + obj.id);\n }\n\n //hide current d3-tip tooltip\n tip.hide();\n\n doFocus(obj);\n });\n\n clickCancel.on(\"dblclick\", function (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 d3.event.stopPropagation();\n });\n\n var lastTimeWheel = 0;\n svg.on('wheel', function () {\n // hide current d3-tip tooltip\n tip.hide();\n\n var e = d3.event;\n e.preventDefault();\n e.stopPropagation();\n\n // at least 100ms must have passed since last time we updated\n var now = new Date().getTime();\n if (now - lastTimeWheel > 100) {\n lastTimeWheel = now;\n } else {\n return;\n }\n\n var direction = '';\n if (e.deltaY <= -1) {\n direction = 'in';\n } else if (e.deltaY >= 1) {\n direction = 'out';\n }\n\n var obj = e.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 var newobj = obj.children[0];\n for (var 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.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 var 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 var idx = d.name.indexOf(\":\");\n var absUriIdx = d.name.indexOf(\"http://\");\n if (absUriIdx > -1) {\n // if we have no prefix available ignore\n d.noPrefixName = d.name;\n } else if (idx > -1) {\n d.noPrefixName = d.name.substring(idx + 1);\n }\n }\n\n if (config.noPrefixes) {\n if (oldRoot !== root) {\n text.each(trimPrefixes);\n oldRoot = root;\n }\n\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.name, d.r);\n })\n .text(function (d) {\n return D3.Text.getTextWithElipsisIfNeeded(d.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 === root) {\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.id) {\n doFocus(d);\n }\n });\n }\n }\n\n var focusHistoryId = $location.hash();\n\n $window.onpopstate = function (event) {\n if (event.state) {\n var focusHistoryId = event.state.id;\n focusOnCurrentClass(focusHistoryId);\n }\n };\n\n focusOnCurrentClass(focusHistoryId);\n };\n\n var node = g.selectAll(\"circle, text\");\n\n function zoomTo(v, switchPrefixes) {\n var 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.fullName === focus.topLevelParentUri || focus.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.name !== focus.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.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.name, d.r * k / 3);\n });\n }\n\n\n function adjustRadius(r) {\n var 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 textUpdateStart(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 }\n }\n\n function textUpdateEnd(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 // 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.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.id) {\n $window.history.replaceState({id: d.id}, \"classHierarchyPage\" + d.id, \"hierarchy#\" + d.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 var p = focus;\n while (p) {\n p.isInFocusTransitive = false;\n p = p.parent;\n }\n }\n\n var p = d;\n while (p) {\n p.isInFocusTransitive = p.children;\n p = p.parent;\n }\n\n focus = d;\n\n var 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 textUpdateStart.call(this, d);\n textUpdateEnd.call(this, d);\n });\n } else {\n // the fancy version for faster browsers\n var transition = d3.transition()\n .duration(ZOOM_DURATION)\n .tween(\"zoom\", function (d) {\n var 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(\"start\", textUpdateStart)\n .each(\"end\", textUpdateEnd);\n }\n }\n\n rootFocusEvent = scope.$on('rootFocus', function () {\n $window.history.pushState({id: 1}, \"classHierarchyPage1\", \"hierarchy#1\");\n doFocus(root);\n });\n\n classSearchEvent = scope.$on('classSearch', function (selectedClass) {\n doFocus(selectedClass);\n });\n }\n\n function sendSliderData() {\n var 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 var prefixesWatch,\n currentClassCountWatch,\n searchedClassBroadcast,\n 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 var initialPrefixesState = getPrefixesState();\n\n if (scope.classHierarchyData.classCount) {\n sendSliderData();\n\n var root = angular.copy(scope.classHierarchyData);\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 return pack\n .nodes(root)\n .sort(function (a, b) {\n if (a.sortingRank > b.sortingRank) {\n return -1;\n } else if (a.sortingRank < b.sortingRank) {\n return 1;\n } else if (a.depth > b.depth) {\n return 1;\n } else if (a.depth < b.depth) {\n return -1;\n } else {\n return 0;\n }\n });\n }\n\n var sorted = sortRoot(root);\n\n // we start with an empty new root\n var newRoot;\n var noPrefixesGlobal;\n\n\n function restoreDiagramState(currentRoot, switchPrefixes) {\n var prefixesConfig = {\n keepPrevState: true,\n noPrefixes: getPrefixesState()\n };\n\n // get noPrefixes flag from drawDiagram configuration params\n noPrefixesGlobal = prefixesConfig.noPrefixes;\n\n if (newRoot) {\n drawDiagram(newRoot, prefixesConfig, focus, true);\n } else {\n drawDiagram(currentRoot, prefixesConfig, focus, true);\n }\n\n $timeout(function () {\n LocalStorageAdapter.set(LSKeys.CLASS_HIERARCHY_SWITCH_PREFIXES, switchPrefixes);\n autoZoomToPreviousState();\n }, 70);\n }\n\n function redrawFilteredDiagram(currentSliderValue, sortedRoot, useSlider) {\n if (!currentSliderValue) {\n return;\n }\n\n LocalStorageAdapter.set(LSKeys.CLASS_HIERARCHY_CURRENT_SLIDER_VALUE, currentSliderValue);\n\n newRoot = {\n name: ROOT_OBJ_NAME,\n children: []\n };\n\n // walk through the given count of (sorted) classes\n // - record the id of each class we've seen\n // - add the root level classes to the new root\n var addedIds = new Set();\n for (var k = 1; k <= currentSliderValue; k++) {\n addedIds.add(sortedRoot[k].id);\n if (sortedRoot[k].parent === sortedRoot[0]) { // i.e. the parent is the \"class hierarchy\"\n newRoot.children.push(sortedRoot[k]);\n }\n }\n\n // walk through all the classes in the new root 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 var newChildren = [];\n for (var i = 0; i < node.children.length; i++) {\n if (addedIds.has(node.children[i].id)) {\n newChildren.push($.extend({}, node.children[i]));\n }\n }\n node.children = newChildren;\n for (var i = 0; i < node.children.length; i++) {\n fixChildren(node.children[i]);\n }\n }\n\n fixChildren(newRoot);\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 var redrawConfig = {\n noPrefixes: noPrefixesGlobal\n };\n drawDiagram(newRoot, 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(root);\n }\n }\n\n var currentSliderValue = LocalStorageAdapter.get(LSKeys.CLASS_HIERARCHY_CURRENT_SLIDER_VALUE);\n if (currentSliderValue) {\n redrawFilteredDiagram(currentSliderValue, sorted);\n } else {\n var basicConfig = {\n doFade: true,\n keepPrevState: true,\n noPrefixes: getPrefixesState()\n };\n drawDiagram(root, 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 savePrefixesState(hidePrefixes);\n restoreDiagramState(root, true);\n }, 50);\n }, true);\n\n currentClassCountWatch = scope.$watch('currentSliderValue', function (currentSliderValue) {\n redrawFilteredDiagram(currentSliderValue, sorted, 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 var 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"],"sourceRoot":""}
1
+ {"version":3,"sources":["webpack:///./src/js/lib/d3-tip/d3-tip-patch.js","webpack:///./src/js/lib/common/d3-utils.js","webpack:///./src/js/lib/common/svg-export.js","webpack:///./src/js/lib/common/circle-packing.js","webpack:///./src/js/angular/graphexplore/directives/rdf-class-hierarchy.directive.js"],"names":["direction","offset","html","node","initNode","svg","point","target","customPosition","tip","vis","el","tagName","toLowerCase","ownerSVGElement","createSVGPoint","document","body","appendChild","show","args","Array","prototype","slice","call","arguments","length","SVGElement","pop","coords","content","apply","this","poffset","dir","nodel","getNodeEl","i","directions","scrollTop","documentElement","scrollLeft","customPos","style","opacity","classed","direction_callbacks","get","top","left","hide","attr","n","v","d3","selection","functor","destroy","remove","map","bbox","getScreenBBox","y","offsetHeight","x","offsetWidth","s","e","w","nw","ne","sw","se","keys","select","createElement","position","targetel","event","getScreenCTM","parentNode","matrix","tbbox","getBBox","width","height","matrixTransform","D3","Text","calcFontSizeRaw","text","radius","minimumSize","isMultiline","textSize","substring","match","Math","round","calcFontSize","getTextWithElipsisIfNeeded","str","threshold","Transition","fadeIn","sel","duration","transition","fadeOut","Click","delayDblClick","dispatch","rebind","down","wait","on","mouse","Date","d","a","b","sqrt","pow","window","clearTimeout","dblclick","setTimeout","click","SVG","Export","getCSSRules","cssSourceFilePath","cssRules","$","sheet","rules","cssStr","_","each","value","cssText","generateBase64ImageSource","exportSvg","selectAll","version","xmlns","innerHTML","btoa","unescape","encodeURIComponent","CirclePacking","SingleChild","addPlaceholders","first","children","placeholderSize","size","push","name","removePlaceholders","nodes","splice","centerNodes","reposition","makePositionsRelativeToZero","offsetX","offsetY","classHierarchyDirective","$rootScope","$location","GraphDataRestService","$window","$timeout","$repositories","$licenseService","toastr","ZOOM_DURATION","ROOT_OBJ_NAME","LocalStorageAdapter","LSKeys","$translate","restrict","template","scope","classHierarchyData","flattenedClassNames","selectedClass","currentSliderValue","showClassInfoPanel","showExternalElements","hidePrefixes","currentBrowserLimit","link","element","attrs","pack","layout","diameter","color","scale","linear","domain","range","interpolate","interpolateHcl","insert","appendMainGroup","append","id","transform","getPrefixesState","CLASS_HIERARCHY_HIDE_PREFIXES","prepareForSVGImageExport","imgSrc","href","download","getActiveRepository","autoZoomToPreviousState","doFocus","g","classCount","isSystemRepository","loader","hierarchyError","selGraphFromCache","getClassHierarchyData","contextID","uri","success","response","status","headers","warning","instant","error","getError","oldRoot","focus","rootFocusEvent","classSearchEvent","prefixesWatch","currentClassCountWatch","searchedClassBroadcast","onEnterClassSearchBroadcast","flattenedClassData","drawDiagram","root","config","newFocus","switchPrefixes","view","isInFocusTransitive","bottom","innerHeight","clientY","right","innerWidth","clientX","circleGroup","data","enter","doFade","circle","role","depth","key","noPrefixes","textHidden","zoom","getCurrentClassDataAndMarkSelected","obj","selected","closeClassInfoPanel","uniqBy","clickCancel","$on","history","pushState","$broadcast","stopPropagation","lastTimeWheel","preventDefault","now","getTime","deltaY","__data__","parent","newobj","sortingRank","replaceState","sendSliderData","textSel","idx","indexOf","noPrefixName","r","textContent","keepPrevState","focusOnCurrentClass","focusHistoryId","hash","onpopstate","state","zoomTo","k","fullName","topLevelParentUri","c","adjustRadius","newr","textUpdateStart","display","textUpdateEnd","shouldClosePanel","p","tween","interpolateZoom","t","currentClassCount","CLASS_HIERARCHY_CURRENT_SLIDER_VALUE","set","addEventListener","removeResizeListener","removeEventListener","$watch","initialPrefixesState","angular","copy","newRoot","noPrefixesGlobal","sorted","sort","sortRoot","restoreDiagramState","currentRoot","prefixesConfig","CLASS_HIERARCHY_SWITCH_PREFIXES","redrawFilteredDiagram","sortedRoot","useSlider","addedIds","Set","add","fixChildren","newChildren","has","extend","isUndefined","currentSearchedClass","basicConfig","undefined","savePrefixesState","searchedClass","renderCirclePacking","module","constant","directive","$inject"],"mappings":"8EAAA,UAQQ,EAAO,QAAW,0BAAP,EAWX,WAIJ,OAAO,WACH,IAAIA,EAoJJ,WAA8B,MAAO,KAnJjCC,EAoJJ,WAA2B,MAAO,CAAC,EAAG,IAnJlCC,EAoJJ,WAAyB,MAAO,KAnJ5BC,EAAYC,IACZC,EAAY,KACZC,EAAY,KACZC,EAAY,KACZC,EAAiB,KAErB,SAASC,EAAIC,GAyOb,IAAoBC,EAxOhBN,EA0OgC,SADhCM,GADgBA,EAxOCD,GAyOTP,QACFS,QAAQC,cACHF,EAEJA,EAAGG,gBA5OVR,EAAQD,EAAIU,iBACZC,SAASC,KAAKC,YAAYf,GAM9BM,EAAIU,KAAO,WACP,IAAIC,EAAOC,MAAMC,UAAUC,MAAMC,KAAKC,WACnCL,EAAKA,EAAKM,OAAS,aAAcC,aAAYpB,EAASa,EAAKQ,OAE9D,IA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D,EAAM4F,IAAI,+BAA+B,SAAUrM,GACzE8Q,GACAlI,EAAQkI,MAIhB1G,EAAyB3D,EAAM4F,IAAI,iBAAiB,SAAUrM,EAAOkR,IACjEJ,EAAuBxG,EAAmB4G,EAAclM,QAEpD4D,EAAQkI,UAIrB,GAnzBHK,CAAoB1K,KA7B5B+I,QACK4B,OAAO,kDAAmD,CACvD,mDACA,gDAEHC,SAAS,gBAAiB,KAC1BA,SAAS,gBAAiB,uBAC1BC,UAAU,oBAAqB7L,GAEpCA,EAAwB8L,QAAU,CAAC,aAAc,YAAa,uBAAwB,UAAW,WAAY,gBAAiB,kBAAmB,SAAU,gBAAiB,gBAAiB,sBAAuB,SAAU","file":"20.fbcb31706f03a07e8827.bundle.js","sourcesContent":["// d3.tip\n// Copyright (c) 2013 Justin Palmer\n//\n// Tooltips for d3.js SVG visualizations\n\n(function (root, factory) {\n if (typeof define === 'function' && define.amd) {\n // AMD. Register as an anonymous module with d3 as a dependency.\n define([], factory)\n } else if (typeof module === 'object' && module.exports) {\n // CommonJS\n module.exports = function(d3) {\n d3.tip = factory(d3)\n return d3.tip\n }\n } else {\n // Browser global.\n root.d3.tip = factory(root.d3)\n }\n}(this, function () {\n // Public - contructs a new tooltip\n //\n // Returns a tip\n return function() {\n var direction = d3_tip_direction,\n offset = d3_tip_offset,\n html = d3_tip_html,\n node = initNode(),\n svg = null,\n point = null,\n target = null,\n customPosition = null\n\n function tip(vis) {\n svg = getSVGNode(vis)\n point = svg.createSVGPoint()\n document.body.appendChild(node)\n }\n\n // Public - show the tooltip on the screen\n //\n // Returns a tip\n tip.show = function() {\n var args = Array.prototype.slice.call(arguments)\n if(args[args.length - 1] instanceof SVGElement) target = args.pop()\n\n var content = html.apply(this, args),\n poffset = offset.apply(this, args),\n dir = direction.apply(this, args),\n nodel = getNodeEl(),\n i = directions.length,\n coords,\n scrollTop = document.documentElement.scrollTop || document.body.scrollTop,\n scrollLeft = document.documentElement.scrollLeft || document.body.scrollLeft,\n customPos = customPosition.apply(this, args)\n\n nodel.html(content)\n .style({ opacity: 1, 'pointer-events': 'all' })\n\n while(i--) nodel.classed(directions[i], false)\n coords = direction_callbacks.get(dir).apply(this)\n\n if (customPos) {\n nodel.style(customPos)\n } else {\n nodel.classed(dir, true).style({\n top: (coords.top + poffset[0]) + scrollTop + 'px',\n left: (coords.left + poffset[1]) + scrollLeft + 'px'\n })\n }\n\n return tip\n }\n\n // Public - hide the tooltip\n //\n // Returns a tip\n tip.hide = function() {\n var nodel = getNodeEl()\n nodel.style({ opacity: 0, 'pointer-events': 'none' })\n return tip\n }\n\n // Public: Proxy attr calls to the d3 tip container. Sets or gets attribute value.\n //\n // n - name of the attribute\n // v - value of the attribute\n //\n // Returns tip or attribute value\n tip.attr = function(n, v) {\n if (arguments.length < 2 && typeof n === 'string') {\n return getNodeEl().attr(n)\n } else {\n var args = Array.prototype.slice.call(arguments)\n d3.selection.prototype.attr.apply(getNodeEl(), args)\n }\n\n return tip\n }\n\n // Public: Proxy style calls to the d3 tip container. Sets or gets a style value.\n //\n // n - name of the property\n // v - value of the property\n //\n // Returns tip or style property value\n tip.style = function(n, v) {\n if (arguments.length < 2 && typeof n === 'string') {\n return getNodeEl().style(n)\n } else {\n var args = Array.prototype.slice.call(arguments)\n d3.selection.prototype.style.apply(getNodeEl(), args)\n }\n\n return tip\n }\n\n // Public: Set or get the direction of the tooltip\n //\n // v - One of n(north), s(south), e(east), or w(west), nw(northwest),\n // sw(southwest), ne(northeast) or se(southeast)\n //\n // Returns tip or direction\n tip.direction = function(v) {\n if (!arguments.length) return direction\n direction = v == null ? v : d3.functor(v)\n\n return tip\n }\n\n // Public: Sets or gets the offset of the tip\n //\n // v - Array of [x, y] offset\n //\n // Returns offset or\n tip.offset = function(v) {\n if (!arguments.length) return offset\n offset = v == null ? v : d3.functor(v)\n\n return tip\n }\n\n // Public: sets or gets the html value of the tooltip\n //\n // v - String value of the tip\n //\n // Returns html value or tip\n tip.html = function(v) {\n if (!arguments.length) return html\n html = v == null ? v : d3.functor(v)\n\n return tip\n }\n\n tip.customPosition = function(v) {\n if (!arguments.length) return customPosition\n customPosition = v == null ? v : d3.functor(v)\n\n return tip\n }\n\n // Public: destroys the tooltip and removes it from the DOM\n //\n // Returns a tip\n tip.destroy = function() {\n if(node) {\n getNodeEl().remove();\n node = null;\n }\n return tip;\n }\n\n function d3_tip_direction() { return 'n' }\n function d3_tip_offset() { return [0, 0] }\n function d3_tip_html() { return ' ' }\n\n var direction_callbacks = d3.map({\n n: direction_n,\n s: direction_s,\n e: direction_e,\n w: direction_w,\n nw: direction_nw,\n ne: direction_ne,\n sw: direction_sw,\n se: direction_se\n }),\n\n directions = direction_callbacks.keys()\n\n function direction_n() {\n var bbox = getScreenBBox()\n return {\n top: bbox.n.y - node.offsetHeight,\n left: bbox.n.x - node.offsetWidth / 2\n }\n }\n\n function direction_s() {\n var bbox = getScreenBBox()\n return {\n top: bbox.s.y,\n left: bbox.s.x - node.offsetWidth / 2\n }\n }\n\n function direction_e() {\n var bbox = getScreenBBox()\n return {\n top: bbox.e.y - node.offsetHeight / 2,\n left: bbox.e.x\n }\n }\n\n function direction_w() {\n var bbox = getScreenBBox()\n return {\n top: bbox.w.y - node.offsetHeight / 2,\n left: bbox.w.x - node.offsetWidth\n }\n }\n\n function direction_nw() {\n var bbox = getScreenBBox()\n return {\n top: bbox.nw.y - node.offsetHeight,\n left: bbox.nw.x - node.offsetWidth\n }\n }\n\n function direction_ne() {\n var bbox = getScreenBBox()\n return {\n top: bbox.ne.y - node.offsetHeight,\n left: bbox.ne.x\n }\n }\n\n function direction_sw() {\n var bbox = getScreenBBox()\n return {\n top: bbox.sw.y,\n left: bbox.sw.x - node.offsetWidth\n }\n }\n\n function direction_se() {\n var bbox = getScreenBBox()\n return {\n top: bbox.se.y,\n left: bbox.e.x\n }\n }\n\n function initNode() {\n var node = d3.select(document.createElement('div'))\n node.style({\n position: 'absolute',\n top: 0,\n opacity: 0,\n 'pointer-events': 'none',\n 'box-sizing': 'border-box'\n })\n\n return node.node()\n }\n\n function getSVGNode(el) {\n el = el.node()\n if(el.tagName.toLowerCase() === 'svg')\n return el\n\n return el.ownerSVGElement\n }\n\n function getNodeEl() {\n if(node === null) {\n node = initNode();\n // re-add node to DOM\n document.body.appendChild(node);\n };\n return d3.select(node);\n }\n\n // Private - gets the screen coordinates of a shape\n //\n // Given a shape on the screen, will return an SVGPoint for the directions\n // n(north), s(south), e(east), w(west), ne(northeast), se(southeast), nw(northwest),\n // sw(southwest).\n //\n // +-+-+\n // | |\n // + +\n // | |\n // +-+-+\n //\n // Returns an Object {n, s, e, w, nw, sw, ne, se}\n function getScreenBBox() {\n var targetel = target || d3.event.target;\n\n while ('undefined' === typeof targetel.getScreenCTM && 'undefined' === targetel.parentNode) {\n targetel = targetel.parentNode;\n }\n\n var bbox = {},\n matrix = targetel.getScreenCTM(),\n tbbox = targetel.getBBox(),\n width = tbbox.width,\n height = tbbox.height,\n x = tbbox.x,\n y = tbbox.y\n\n point.x = x\n point.y = y\n bbox.nw = point.matrixTransform(matrix)\n point.x += width\n bbox.ne = point.matrixTransform(matrix)\n point.y += height\n bbox.se = point.matrixTransform(matrix)\n point.x -= width\n bbox.sw = point.matrixTransform(matrix)\n point.y -= height / 2\n bbox.w = point.matrixTransform(matrix)\n point.x += width\n bbox.e = point.matrixTransform(matrix)\n point.x -= width / 2\n point.y -= height / 2\n bbox.n = point.matrixTransform(matrix)\n point.y += height\n bbox.s = point.matrixTransform(matrix)\n\n return bbox\n }\n\n return tip\n };\n\n}));","var D3 = D3 || {};\n\nD3.Text = function () {\n function calcFontSizeRaw(text, radius, minimumSize, isMultiline) {\n minimumSize = minimumSize || 10;\n\n var textSize = radius / 3;\n if (typeof text === \"string\") {\n var len = text.substring(0, radius / 3).length + 1.5;\n textSize *= 10 / len;\n textSize += 1;\n // experimental alternative method:\n // var textSize = 3.3 * radius / text.length;\n\n // Tweak for Indian scripts and CJK ones\n if (text.match(/[\\u0900-\\u0DFF\\u1100-\\u11FF\\u2E80-\\u2EFF\\u3000-\\u9FFF]/)) {\n textSize *= 0.6;\n }\n\n if (textSize < minimumSize) {\n textSize = minimumSize;\n }\n\n /* Disabled for the time being, better without this\n if (isMultiline) {\n var numWords = text.split(/\\s+/).length;\n if (numWords > 1) {\n if (numWords > 4) {\n numWords = 4;\n }\n textSize += textSize * (4 - numWords) * 0.1;\n }\n }\n */\n\n return Math.round(textSize);\n }\n\n if (textSize < minimumSize) {\n textSize = minimumSize;\n }\n\n return Math.round(textSize);\n }\n\n function calcFontSize(text, radius, minimumSize, isMultiline) {\n return calcFontSizeRaw(text, radius, minimumSize, isMultiline) + 'px';\n }\n\n function getTextWithElipsisIfNeeded(str, threshold) {\n if (typeof str === \"string\") {\n if (str.length > threshold) {\n return str.substring(0, threshold - 3) + \"...\";\n }\n }\n return str;\n }\n\n return {\n calcFontSizeRaw: calcFontSizeRaw,\n calcFontSize: calcFontSize,\n getTextWithElipsisIfNeeded: getTextWithElipsisIfNeeded\n };\n}();\n\nD3.Transition = function () {\n function fadeIn(sel, duration) {\n sel.style(\"opacity\", 0.0)\n .transition()\n .duration(duration)\n .style(\"opacity\", 1.0);\n }\n\n function fadeOut(sel, duration) {\n sel.style(\"opacity\", 1.0)\n .transition()\n .duration(duration)\n .style(\"opacity\", 0.0);\n }\n\n return {\n fadeIn: fadeIn,\n fadeOut: fadeOut\n };\n}();\n\nD3.Click = function () {\n function delayDblClick() {\n var event = d3.dispatch('click', 'dblclick');\n\n function cc(selection) {\n var down,\n tolerance = 5,\n last,\n wait = null;\n\n // euclidean distance\n function dist(a, b) {\n return Math.sqrt(Math.pow(a[0] - b[0], 2), Math.pow(a[1] - b[1], 2));\n }\n\n selection.on('mousedown', function () {\n down = d3.mouse(document.body);\n last = +new Date();\n });\n selection.on('mouseup', function (d) {\n if (dist(down, d3.mouse(document.body)) > tolerance) {\n return;\n } else {\n if (wait) {\n window.clearTimeout(wait);\n wait = null;\n event.dblclick(d);\n } else {\n wait = window.setTimeout((function (e) {\n return function () {\n event.click(d);\n wait = null;\n };\n })(d3.event), 250);\n }\n }\n });\n }\n\n return d3.rebind(cc, event, 'on');\n }\n\n return {\n delayDblClick: delayDblClick\n };\n}();\n\nexport default D3;\n","var SVG = SVG || {};\n\nSVG.Export = function () {\n function getCSSRules(cssSourceFilePath) {\n var cssRules = $('link[href=\"' + cssSourceFilePath + '\"]')[0].sheet.rules;\n var cssStr = \"\";\n _.each(cssRules, function (value) {\n cssStr += value.cssText;\n });\n return cssStr;\n }\n\n function generateBase64ImageSource() {\n // add needed xml namespace\n var exportSvg = d3.selectAll(\"svg\")\n .attr({\n version: \"1.1\",\n xmlns: \"http://www.w3.org/2000/svg\"\n })\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","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.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 d3tip from 'lib/d3-tip/d3-tip-patch';\nimport CirclePacking from 'lib/common/circle-packing';\nimport D3 from 'lib/common/d3-utils';\nimport SVG from 'lib/common/svg-export';\nimport 'angular/utils/local-storage-adapter';\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', '$licenseService', 'toastr', 'ZOOM_DURATION', 'ROOT_OBJ_NAME', 'LocalStorageAdapter', 'LSKeys', '$translate'];\n\nfunction classHierarchyDirective($rootScope, $location, GraphDataRestService, $window, $timeout, $repositories, $licenseService, 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 var width = 800,\n height = 800,\n diameter = height,\n margin = 20,\n node,\n root;\n\n var pack = d3.layout.pack()\n .size([diameter - margin, diameter - margin])\n .value(function (d) {\n return d.size;\n });\n\n var colors = [\n \"hsl(33, 75%, 75%)\",\n \"hsl(213, 75%, 75%)\",\n \"hsl(333, 75%, 75%)\",\n \"hsl(153, 75%, 75%)\",\n \"hsl(273, 75%, 75%)\",\n \"hsl(93, 75%, 75%)\"\n ];\n\n var color = d3.scale.linear()\n .domain([0, 4])\n .range([\"hsl(19, 70%, 90%)\", \"hsl(19, 70%, 50%)\"])\n .interpolate(d3.interpolateHcl);\n\n var 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 .attr({\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 var cssRules = SVG.Export.getCSSRules(\"css/rdf-class-hierarchy-labels.css?v=2.2.2-TR2\");\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 var imgSrc = SVG.Export.generateBase64ImageSource();\n\n // set the binary image and a name for the downloadable file on the export button\n d3.select(this).attr({\n href: imgSrc,\n download: \"class-hierarchy-\" + $repositories.getActiveRepository() + \".svg\"\n });\n }\n\n scope.hidePrefixes = getPrefixesState();\n\n var g = appendMainGroup();\n\n if (!scope.classHierarchyData.classCount && $repositories.getActiveRepository() && !$repositories.isSystemRepository()) {\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, headers) {\n $rootScope.loader = false;\n if (status === 207) {\n toastr.warning($translate.instant('graphexplore.update.diagram'), $translate.instant('graphexplore.repository.data.changed'));\n }\n scope.classHierarchyData = response;\n\n d3.select(\"#download-svg\")\n .on(\"mouseover\", prepareForSVGImageExport);\n\n }).error(function (response) {\n $rootScope.loader = false;\n $rootScope.hierarchyError = getError(response);\n toastr.error($translate.instant('graphexplore.error.request.failed', {name: ROOT_OBJ_NAME, error: getError(response)}));\n });\n }\n\n\n var autoZoomToPreviousState,\n doFocus;\n\n var oldRoot,\n focus,\n rootFocusEvent,\n classSearchEvent,\n 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 focus = newFocus ? newFocus : root;\n\n var nodes = pack.nodes(root),\n 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 var tip = d3tip()\n .attr('class', 'd3-tip')\n //.offset([-10, 0])\n .customPosition(function (d) {\n return {\n top: 'inherit',\n bottom: ($window.innerHeight - d3.event.clientY) + 'px',\n right: ($window.innerWidth - d3.event.clientX) + 'px'\n };\n })\n .html(function (d) {\n return d.name;\n });\n\n svg.call(tip);\n\n var 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 var flattenedClassNames = [];\n\n var circle = circleGroup\n .append(\"circle\")\n .attr(\"class\", function (d) {\n return d.role;\n })\n .attr(\"guide-selector\", function (d) {\n return \"class-\" + d.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.name !== ROOT_OBJ_NAME) {\n var key = d.name;\n flattenedClassNames.push({name: key});\n flattenedClassData[[key]] = d;\n\n d.circle.classed(\"rdf-class\", true);\n d.circle.on('mouseover', function () {\n if (config.noPrefixes) {\n tip.show(d);\n } else if (!d.textHidden) {\n tip.hide(d);\n } else {\n tip.show(d);\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\", doFocus)\n .on(\"gdb-zoom\", zoom);\n\n\n if (flattenedClassNames) {\n flattenedClassNames = _.uniqBy(flattenedClassNames, 'name');\n scope.flattenedClassNames = flattenedClassNames;\n }\n\n var 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 var clickCancel = D3.Click.delayDblClick();\n var parentCircles = d3.selectAll(\".parent, .topLevelParent, .child, .root\")\n .call(clickCancel);\n\n doFocus = function (obj) {\n zoom(obj);\n\n if (obj.name === ROOT_OBJ_NAME) {\n closeClassInfoPanel();\n d3.selectAll(\".selected\").classed(\"selected\", false);\n } else {\n getCurrentClassDataAndMarkSelected(obj);\n showClassInfoPanel();\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 (obj) {\n // add clicked class to browser history\n if (obj.id) {\n $window.history.pushState({id: obj.id}, \"classHierarchyPage\" + obj.id, \"hierarchy#\" + obj.id);\n }\n\n //hide current d3-tip tooltip\n tip.hide();\n\n doFocus(obj);\n });\n\n clickCancel.on(\"dblclick\", function (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 d3.event.stopPropagation();\n });\n\n var lastTimeWheel = 0;\n svg.on('wheel', function () {\n // hide current d3-tip tooltip\n tip.hide();\n\n var e = d3.event;\n e.preventDefault();\n e.stopPropagation();\n\n // at least 100ms must have passed since last time we updated\n var now = new Date().getTime();\n if (now - lastTimeWheel > 100) {\n lastTimeWheel = now;\n } else {\n return;\n }\n\n var direction = '';\n if (e.deltaY <= -1) {\n direction = 'in';\n } else if (e.deltaY >= 1) {\n direction = 'out';\n }\n\n var obj = e.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 var newobj = obj.children[0];\n for (var 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.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 var 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 var idx = d.name.indexOf(\":\");\n var absUriIdx = d.name.indexOf(\"http://\");\n if (absUriIdx > -1) {\n // if we have no prefix available ignore\n d.noPrefixName = d.name;\n } else if (idx > -1) {\n d.noPrefixName = d.name.substring(idx + 1);\n }\n }\n\n if (config.noPrefixes) {\n if (oldRoot !== root) {\n text.each(trimPrefixes);\n oldRoot = root;\n }\n\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.name, d.r);\n })\n .text(function (d) {\n return D3.Text.getTextWithElipsisIfNeeded(d.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 === root) {\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.id) {\n doFocus(d);\n }\n });\n }\n }\n\n var focusHistoryId = $location.hash();\n\n $window.onpopstate = function (event) {\n if (event.state) {\n var focusHistoryId = event.state.id;\n focusOnCurrentClass(focusHistoryId);\n }\n };\n\n focusOnCurrentClass(focusHistoryId);\n };\n\n var node = g.selectAll(\"circle, text\");\n\n function zoomTo(v, switchPrefixes) {\n var 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.fullName === focus.topLevelParentUri || focus.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.name !== focus.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.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.name, d.r * k / 3);\n });\n }\n\n\n function adjustRadius(r) {\n var 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 textUpdateStart(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 }\n }\n\n function textUpdateEnd(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 // 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.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.id) {\n $window.history.replaceState({id: d.id}, \"classHierarchyPage\" + d.id, \"hierarchy#\" + d.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 var p = focus;\n while (p) {\n p.isInFocusTransitive = false;\n p = p.parent;\n }\n }\n\n var p = d;\n while (p) {\n p.isInFocusTransitive = p.children;\n p = p.parent;\n }\n\n focus = d;\n\n var 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 textUpdateStart.call(this, d);\n textUpdateEnd.call(this, d);\n });\n } else {\n // the fancy version for faster browsers\n var transition = d3.transition()\n .duration(ZOOM_DURATION)\n .tween(\"zoom\", function (d) {\n var 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(\"start\", textUpdateStart)\n .each(\"end\", textUpdateEnd);\n }\n }\n\n rootFocusEvent = scope.$on('rootFocus', function () {\n $window.history.pushState({id: 1}, \"classHierarchyPage1\", \"hierarchy#1\");\n doFocus(root);\n });\n\n classSearchEvent = scope.$on('classSearch', function (selectedClass) {\n doFocus(selectedClass);\n });\n }\n\n function sendSliderData() {\n var 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 var prefixesWatch,\n currentClassCountWatch,\n searchedClassBroadcast,\n 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 var initialPrefixesState = getPrefixesState();\n\n if (scope.classHierarchyData.classCount) {\n sendSliderData();\n\n var root = angular.copy(scope.classHierarchyData);\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 return pack\n .nodes(root)\n .sort(function (a, b) {\n if (a.sortingRank > b.sortingRank) {\n return -1;\n } else if (a.sortingRank < b.sortingRank) {\n return 1;\n } else if (a.depth > b.depth) {\n return 1;\n } else if (a.depth < b.depth) {\n return -1;\n } else {\n return 0;\n }\n });\n }\n\n var sorted = sortRoot(root);\n\n // we start with an empty new root\n var newRoot;\n var noPrefixesGlobal;\n\n\n function restoreDiagramState(currentRoot, switchPrefixes) {\n var prefixesConfig = {\n keepPrevState: true,\n noPrefixes: getPrefixesState()\n };\n\n // get noPrefixes flag from drawDiagram configuration params\n noPrefixesGlobal = prefixesConfig.noPrefixes;\n\n if (newRoot) {\n drawDiagram(newRoot, prefixesConfig, focus, true);\n } else {\n drawDiagram(currentRoot, prefixesConfig, focus, true);\n }\n\n $timeout(function () {\n LocalStorageAdapter.set(LSKeys.CLASS_HIERARCHY_SWITCH_PREFIXES, switchPrefixes);\n autoZoomToPreviousState();\n }, 70);\n }\n\n function redrawFilteredDiagram(currentSliderValue, sortedRoot, useSlider) {\n if (!currentSliderValue) {\n return;\n }\n\n LocalStorageAdapter.set(LSKeys.CLASS_HIERARCHY_CURRENT_SLIDER_VALUE, currentSliderValue);\n\n newRoot = {\n name: ROOT_OBJ_NAME,\n children: []\n };\n\n // walk through the given count of (sorted) classes\n // - record the id of each class we've seen\n // - add the root level classes to the new root\n var addedIds = new Set();\n for (var k = 1; k <= currentSliderValue; k++) {\n addedIds.add(sortedRoot[k].id);\n if (sortedRoot[k].parent === sortedRoot[0]) { // i.e. the parent is the \"class hierarchy\"\n newRoot.children.push(sortedRoot[k]);\n }\n }\n\n // walk through all the classes in the new root 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 var newChildren = [];\n for (var i = 0; i < node.children.length; i++) {\n if (addedIds.has(node.children[i].id)) {\n newChildren.push($.extend({}, node.children[i]));\n }\n }\n node.children = newChildren;\n for (var i = 0; i < node.children.length; i++) {\n fixChildren(node.children[i]);\n }\n }\n\n fixChildren(newRoot);\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 var redrawConfig = {\n noPrefixes: noPrefixesGlobal\n };\n drawDiagram(newRoot, 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(root);\n }\n }\n\n var currentSliderValue = LocalStorageAdapter.get(LSKeys.CLASS_HIERARCHY_CURRENT_SLIDER_VALUE);\n if (currentSliderValue) {\n redrawFilteredDiagram(currentSliderValue, sorted);\n } else {\n var basicConfig = {\n doFade: true,\n keepPrevState: true,\n noPrefixes: getPrefixesState()\n };\n drawDiagram(root, 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 savePrefixesState(hidePrefixes);\n restoreDiagramState(root, true);\n }, 50);\n }, true);\n\n currentClassCountWatch = scope.$watch('currentSliderValue', function (currentSliderValue) {\n redrawFilteredDiagram(currentSliderValue, sorted, 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 var 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"],"sourceRoot":""}
@@ -1,2 +1,2 @@
1
- (window.webpackJsonp=window.webpackJsonp||[]).push([[21,53,107,108,124],{100:function(e,r,o){"use strict";o.r(r);o(4),o(11),o(8),o(64),o(21),o(12),o(34),o(35);function t(e){e.interceptors.push("$unauthorizedInterceptor")}function i(e,r,o){e.$on("$locationChangeStart",(function(){o.isLicenseHardcoded&&"/license/register"===r.url()&&r.path("license")}))}angular.module("graphdb.framework.settings",["toastr","ui.bootstrap","graphdb.framework.rest.license.service","graphdb.framework.settings.controllers","graphdb.framework.core.interceptors.unauthorized","graphdb.framework.core.services.jwtauth"]).config(t).run(i),t.$inject=["$httpProvider","$routeProvider"],i.$inject=["$rootScope","$location","$licenseService"]},150:function(e,r,o){"use strict";o.r(r);o(4),o(11),o(16),o(65),o(98),o(99),o(10),o(100),o(34),o(35);angular.module("graphdb.framework.repositories",["ui.bootstrap","toastr","ngCookies","ngRoute","graphdb.framework.repositories.controllers","graphdb.framework.repositories.ontop-repo.directive","graphdb.framework.repositories.fedx-repo.directive","graphdb.framework.core.services.repositories","graphdb.framework.core.directives","graphdb.framework.core.controllers","graphdb.framework.settings"])},64:function(e,r,o){"use strict";o.r(r);o(4),o(12);function t(e,r,o,t,i){e.supportsStatistics=!0,e.settings={statistics:!1},e.getSettings=function(){e.loader=!0,t.getStatistics().then((function(r){e.settings.statistics="true"===r.data,e.supportsStatistics=!0}),(function(o){if(404===o.status)e.supportsStatistics=!1;else{const e=getError(o.data);r.error(e,i.instant("error.getting.settings"))}}))},e.getSettings(),e.setSettings=function(){e.loader=!0,t.toggleStatistics(e.settings.statistics).then((function(){o.close(),r.success(i.instant("saving.settings.success"))}),(function(e){const o=getError(e.data);r.error(o,i.instant("saving.settings.error"))}))},e.submitForm=function(){e.setSettings()},e.cancel=function(){o.dismiss("cancel")}}function i(e,r,o,t,i,s,n){e.loadingLicense=function(){return o.loadingLicense},o.checkLicenseStatus(),e.revertToFree=function(){s.openSimpleModal({title:n.instant("confirm.operation"),message:n.instant("revert.to.free.warning.msg"),warning:!0}).result.then((function(){r.unregisterLicense().success((function(){o.checkLicenseStatus()}))}))}}function s(e,r,o,t,i,s,n,a){e.$on("securityInit",(function(){n.isAdmin()||o.path("/license")})),e.sendLicenseToValidateAndActivate=l;const c=$(".license-textarea");function l(e){r.sendLicenseToValidate(e).success((function(o){"Invalid"!==o.licensee?(c.val(e),function(e,o){t.open({templateUrl:"js/angular/settings/modal/validate-license.html",controller:"ValidateLicenseModalCtrl",size:"lg",resolve:{license:function(){return e}}}).result.then((function(){!function(e){e||(e=c.val());if(e){const o=atob(e.replace(/\s/g,""));r.registerLicense(o).success((function(){s.history.back()})).error((function(){i.error(a.instant("license.register.error"))}))}else i.error(a.instant("no.license.code.error"))}(o)}))}(o,e)):(c.val(""),i.error(o.message))})).error((function(){i.error(a.instant("invalid.license"))}))}e.$watch("currentFile",(function(){if(e.currentFile){const o=e.currentFile;r.extractFromLicenseFile(o).success((function(e){l(e)})).error((function(){i.error(a.instant("could.not.upload.file.error"))}))}})),e.getBackToPreviousPage=function(){s.history.back()}}function n(e,r,o){e.ok=function(){r.close()},e.cancel=function(){r.dismiss("cancel")},e.license=o}function a(e){e.loader=!0,e.setLoader=function(r){e.loader=r}}angular.module("graphdb.framework.settings.controllers",["ngCookies","ui.bootstrap","graphdb.framework.core.services.jwtauth","toastr"]).controller("ActiveLocationSettingsCtrl",t).controller("ValidateLicenseModalCtrl",n).controller("LicenseCtrl",i).controller("RegisterLicenseCtrl",s).controller("LoaderSamplesCtrl",a),t.$inject=["$scope","toastr","$modalInstance","LicenseRestService","$translate"],i.$inject=["$scope","LicenseRestService","$licenseService","toastr","$rootScope","ModalService","$translate"],s.$inject=["$scope","LicenseRestService","$location","$modal","toastr","$window","$jwtAuth","$translate"],n.$inject=["$scope","$modalInstance","license"],a.$inject=["$scope"]},98:function(e,r,o){"use strict";o.r(r);var t=o(65);function i(e,r,o,i,s){return{restrict:"E",scope:!1,templateUrl:"js/angular/repositories/templates/ontop-repo.html",link:function(n){n.selectedDriver={driverType:"generic",driverName:"Generic JDBC Driver",jdbc:{hostName:"",port:"",databaseName:"",userName:"",password:"",driverClass:"",url:""},urlTemplate:"",downloadDriverUrl:""},n.ontopRepoFileNames={},n.supportedDriversData=[],n.ontopRepoFileLabels={propertiesFile:"JDBC properties",obdaFile:"OBDA or R2RML",owlFile:"ontology file",constraintFile:"constraint file",dbMetadataFile:"DB metadata file"},n.ontopRepoFiles=Object.keys(n.ontopRepoFileLabels),n.ontopRepoFiles.forEach((function(e){n.repositoryInfo.params[e]&&(n.ontopRepoFileNames[e]=Object(t.getFileName)(n.repositoryInfo.params[e].value))})),n.supportedDriverLabels={hostName:"Hostname",port:"Port",databaseName:"Database name",userName:"Username",password:"Password",driverClass:"Driver class",url:"URL"},n.propertiesFileParams=Object.keys(n.supportedDriverLabels),n.classAvailable=!1,n.genericDriverType="generic",n.propertiesFile="propertiesFile";const a=[n.propertiesFile,"obdaFile"],c=["hostName","databaseName","userName"];function l(){return n.selectedDriver.driverType!==n.genericDriverType?c.filter((function(e){return!n.selectedDriver.jdbc[e]})).length>0&&(o.error(s.instant("missing.required.field.error")),1)?Promise.reject(s.instant("missing.required.field.error")):(n.uploadFileLoader=!0,r.updatePropertiesFile(n.repositoryInfo.params[n.propertiesFile].value,n.selectedDriver.jdbc,n.repositoryInfo.location).success((function(e){n.ontopRepoFileNames[n.propertiesFile]=Object(t.getFileName)(e.fileLocation),n.repositoryInfo.params[n.propertiesFile].value=e.fileLocation,n.uploadFileLoader=!1})).error((function(e){p(s.instant("common.error"),e),n.uploadFileLoader=!1}))):Promise.resolve()}function p(e,r){const t=getError(r);o.error(t,e)}n.loadDriverByClass=function(e){const r=n.supportedDriversData.find(r=>r.driverClass===e);return r&&n.copyDriverProperties(r),r},n.selectDriverByType=function(e){n.copyDriverProperties(n.supportedDriversData.find(r=>r.driverType===e)),n.concatURL("hostName",n)},n.copyDriverProperties=function(e){n.selectedDriver.driverType=e.driverType,n.selectedDriver.jdbc.driverClass=e.driverClass,n.selectedDriver.jdbc.url=e.urlTemplate,n.selectedDriver.urlTemplate=e.urlTemplate,n.selectedDriver.downloadDriverUrl=e.downloadDriverUrl,n.selectedDriver.portRequired=e.portRequired,n.classAvailable=e.classAvailable},n.isReadOnly=function(e){return"driverClass"===e||"url"===e},n.editFile=function(o){e.open({templateUrl:"js/angular/templates/modal/editRepoFile.html",controller:"EditRepositoryFileCtrl",resolve:{file:function(){return n.repositoryInfo.params[o]?n.repositoryInfo.params[o].value:""}}}).result.then((function(e){r.updateRepositoryFileContent(e.fileLocation,e.content,n.repositoryInfo.location).success((function(e){n.ontopRepoFileNames[o]=Object(t.getFileName)(e.fileLocation),n.repositoryInfo.params[o].value=e.fileLocation})).error((function(e){p(s.instant("common.error"),e)}))}))},n.uploadOntopRepoFile=function(e,r){e&&e.length&&(n.uploadFile=e[0],n.uploadFileLoader=!0,i.upload({url:"rest/repositories/file/upload",data:{file:n.uploadFile,location:n.repositoryInfo.location}}).success((function(e){e.success?(n.ontopRepoFileNames[r]=n.uploadFile.name,n.repositoryInfo.params[r].value=e.fileLocation):o.error(e.errorMessage),n.uploadFileLoader=!1})).error((function(e){p(s.instant("common.error"),e),n.uploadFile="",n.uploadFileLoader=!1})))},n.concatURL=function(e){if("hostName"===e||"port"===e||"databaseName"===e){let e=n.selectedDriver.urlTemplate;n.selectedDriver.jdbc.hostName&&(e=n.selectedDriver.jdbc.port?e.replace("{hostport}",`${n.selectedDriver.jdbc.hostName}:${n.selectedDriver.jdbc.port}`):e.replace("{hostport}",n.selectedDriver.jdbc.hostName)),n.selectedDriver.jdbc.databaseName&&(e=e.replace("{database}",n.selectedDriver.jdbc.databaseName)),n.selectedDriver.jdbc.url=e}},n.getInputType=function(e){switch(e){case"password":return"password";case"port":return"number";default:return"text"}},n.checkForRequiredOntopFiles=function(){return l().then((function(){return a.filter((function(e){return!n.repositoryInfo.params[e].value})).length>0?(o.error(s.instant("ontop.repo.missing.required.file.error")),Promise.reject(s.instant("ontop.repo.missing.required.file.error"))):Promise.resolve()}))},n.validateOntopPropertiesConnection=function(){l().then((function(){r.validateOntopPropertiesConnection(n.repositoryInfo).success((function(){o.success(s.instant("ontop.repo.successful.connection.msg"))})).error((function(e){p(s.instant("ontop.repo.failed.to.connect"),e)}))}))},n.isOntopRepoFileUploaded=function(){return n.repositoryInfo.params.propertiesFile&&n.repositoryInfo.params.propertiesFile.value.length>0},n.isRequiredOntopRepoFile=function(e){return a.indexOf(e)>-1},n.isRequiredField=function(e){return c.indexOf(e)>-1||"port"===e&&n.selectedDriver.portRequired},n.getFieldTooltip=function(e){return"port"===e&&n.selectedDriver.portRequired&&(e="portIfRequired"),n.repoTooltips.ontop[e]},n.editOntopRepo=function(){n.checkForRequiredOntopFiles().then((function(){n.editRepository()})).catch((function(e){}))},n.createOntopRepo=function(){n.repositoryInfo.id?n.checkForRequiredOntopFiles().then((function(){n.createRepo()})).catch((function(e){})):o.error(s.instant("empty.repoid.warning"))},n.goBackToPrevious=function(){n.goBackToPreviousLocation()},r.getSupportedDriversData(n.repositoryInfo).success((function(e){n.supportedDriversData=e})).error((function(e){p(s.instant("common.error"),e)})).then((function(){n.editRepoPage&&r.loadPropertiesFile(n.repositoryInfo.params[n.propertiesFile].value,n.repositoryInfo.location).success((function(e){n.loadDriverByClass(e.driverClass)&&(n.selectedDriver.jdbc.hostName=e.hostName,n.selectedDriver.jdbc.port=parseInt(e.port),n.selectedDriver.jdbc.databaseName=e.databaseName,n.selectedDriver.jdbc.userName=e.userName,n.selectedDriver.jdbc.password=e.password,n.selectedDriver.jdbc.url=e.url)})).error((function(e){p(s.instant("common.error"),e),n.uploadFileLoader=!1}))}))}}}angular.module("graphdb.framework.repositories.ontop-repo.directive",[]).directive("ontopRepo",i),i.$inject=["$modal","RepositoriesRestService","toastr","Upload","$translate"]},99:function(e,r){function o(e,r,o,t){return{restrict:"E",scope:!0,templateUrl:"js/angular/repositories/templates/fedx-repo.html",link:function(i){const s="ResolvableRepository";i.fedxMembers=[],i.knownRepos=[],i.allAttachedRepos=[],i.editRepoPage&&(i.fedxMembers=i.repositoryInfo.params.member.value.slice());function n(){for(const e of i.fedxMembers)i.knownRepos=i.knownRepos.filter((function(r){return e.repositoryServer?r.id!==e.repositoryName||r.location!==e.repositoryServer:r.id!==e.repositoryName||!r.local}))}function a(){r.getRepositories(i.repositoryInfo.location).success((function(e){let r=[];_.values(e).forEach(e=>{r.push.apply(r,e)}),i.allAttachedRepos=_.cloneDeep(r)})).error((function(e){const r=getError(e);o.error(r,t.instant("common.error"))})).then((function(){i.knownRepos=i.allAttachedRepos.slice(),n()}))}i.setWritableRepo=function(e){let r=i.fedxMembers.find(e=>"true"===e.writable);r&&((r.store!==s||e.store===s&&r.repositoryName===e.repositoryName)&&("RemoteRepository"!==r.store||"RemoteRepository"===e.store&&r.repositoryName===e.repositoryName&&r.repositoryServer===e.repositoryServer)||(r.writable="false")),e.writable=JSON.stringify("false"===e.writable)},i.getActiveClass=function(e){return"true"===e.writable?" active":""},i.checkIfRepoExist=function(e){return!i.allAttachedRepos.length||(e.store===s?i.allAttachedRepos.find(r=>r.id===e.repositoryName&&!r.location):"RemoteRepository"!==e.store||i.allAttachedRepos.find(r=>r.id===e.repositoryName&&r.location===e.repositoryServer))},i.getRepositoryServer=function(e){return e.local?"Local":e.location};const c=setInterval((function(){a()}),5e3);function l(e){i.fedxMembers.push(e),i.repositoryInfo.params.member.value=i.fedxMembers}function p(e){return"/"===e.slice(-1)?e.slice(0,-1):e}function d(){return i.editRepoPage&&!i.editRepoPage||!i.model.editMode}i.$on("$destroy",(function(){clearInterval(c)})),i.addMember=function(e){let r;r="Local"===i.getRepositoryServer(e)?{store:s,repositoryName:e.id,repoType:e.type,respectRights:"true",writable:"false"}:{store:"RemoteRepository",repositoryName:e.id,repositoryServer:e.location,username:"",password:"",supportsASKQueries:"true",writable:"false"},i.knownRepos=i.knownRepos.filter(r=>r.id!==e.id||r.location!==e.location),l(r)},i.removeMember=function(e){e.store&&e.store===s?(i.fedxMembers=i.fedxMembers.filter(r=>r.store!==e.store||r.repositoryName!==e.repositoryName&&!r.repositoryServer),a()):e.store&&"SPARQLEndpoint"===e.store?i.fedxMembers=i.fedxMembers.filter(r=>r.endpoint!==e.endpoint):e.store&&"NativeStore"===e.store?i.fedxMembers=i.fedxMembers.filter(r=>r.repositoryLocation!==e.repositoryLocation):e.store&&"RemoteRepository"===e.store&&(i.fedxMembers=i.fedxMembers.filter(r=>r.store!==e.store||r.repositoryName!==e.repositoryName||r.repositoryServer!==e.repositoryServer),a()),i.repositoryInfo.params.member.value=i.fedxMembers},i.addRemoteMember=function(){i.mode="remote",i.model={editMode:!1,store:"RemoteRepository",repositoryName:"",repositoryServer:"",sparqlEndpoint:"",username:"",password:"",supportsASKQueries:"true",writable:"false"},i.$modalInstance=e.open({templateUrl:"js/angular/templates/modal/add-fedx-remote-repo.html",scope:i})},i.getMemberIcon=function(e){return e.repoType?"icon-repo-"+e.repoType:"NativeStore"===e.store?"icon-warning":"icon-link"},i.editFedXRepository=function(r){r.store===s?(i.mode="local",i.model={editMode:!0,store:r.store,respectRights:r.respectRights,repositoryName:r.repositoryName,repoType:r.repoType,writable:r.writable}):(i.mode="remote",i.model={editMode:!0,store:r.store,repositoryName:r.repositoryName,repositoryServer:r.repositoryServer,sparqlEndpoint:"SPARQLEndpoint"===r.store?r.endpoint:r.repositoryLocation,username:r.username,password:r.password,supportsASKQueries:r.supportsASKQueries,writable:r.writable}),i.$modalInstance=e.open({templateUrl:"js/angular/templates/modal/add-fedx-remote-repo.html",scope:i})},i.resolveName=function(e){switch(e.store){case s:return e.repositoryName;case"RemoteRepository":return e.repositoryName+"@"+e.repositoryServer;case"SPARQLEndpoint":return e.endpoint;case"NativeStore":return e.repositoryLocation;default:return""}},i.cancel=function(){i.$modalInstance.dismiss("cancel")},i.ok=function(){let e;if(i.model.repositoryName&&i.model.store===s)e={store:s,repositoryName:i.model.repositoryName,repoType:i.model.repoType,respectRights:i.model.respectRights,writable:i.model.writable},i.fedxMembers=i.fedxMembers.filter(r=>r.repositoryName!==e.repositoryName||r.store!==e.store);else if(i.model.repositoryName&&"RemoteRepository"===i.model.store){if(e={store:"RemoteRepository",repositoryName:i.model.repositoryName,repositoryServer:p(i.model.repositoryServer),username:i.model.username,password:i.model.password,writable:i.model.writable},d()&&i.fedxMembers.find(r=>r.repositoryName===e.repositoryName&&r.repositoryServer===e.repositoryServer)){let r=i.resolveName(e);return o.error(t.instant("fedx.repo.already.added.member.error",{name:r})),void i.$modalInstance.close()}i.fedxMembers=i.fedxMembers.filter(r=>r.repositoryName!==e.repositoryName||r.repositoryServer!==e.repositoryServer)}else{if(e={store:"SPARQLEndpoint",endpoint:p(i.model.sparqlEndpoint),username:i.model.username,password:i.model.password,supportsASKQueries:i.model.supportsASKQueries,writable:i.model.writable},d()&&i.fedxMembers.find(r=>r.endpoint===e.endpoint)){let r=i.resolveName(e);return o.error(t.instant("fedx.repo.already.added.sparql.endpoint.error",{name:r})),void i.$modalInstance.close()}i.fedxMembers=i.fedxMembers.filter(r=>r.endpoint!==e.endpoint)}l(e),n(),i.$modalInstance.close()},i.$on("changedLocation",(function(){i.fedxMembers=[],a()})),a()}}}angular.module("graphdb.framework.repositories.fedx-repo.directive",[]).directive("fedxRepo",o),o.$inject=["$modal","RepositoriesRestService","toastr","$translate"]}}]);
2
- //# sourceMappingURL=21.7f0a59ea2ad9340dcb2f.bundle.js.map
1
+ (window.webpackJsonp=window.webpackJsonp||[]).push([[21,53,107,108,124],{100:function(e,r,o){"use strict";o.r(r);o(4),o(11),o(8),o(64),o(21),o(12),o(34),o(35);function t(e){e.interceptors.push("$unauthorizedInterceptor")}function i(e,r,o){e.$on("$locationChangeStart",(function(){o.isLicenseHardcoded&&"/license/register"===r.url()&&r.path("license")}))}angular.module("graphdb.framework.settings",["toastr","ui.bootstrap","graphdb.framework.rest.license.service","graphdb.framework.settings.controllers","graphdb.framework.core.interceptors.unauthorized","graphdb.framework.core.services.jwtauth"]).config(t).run(i),t.$inject=["$httpProvider","$routeProvider"],i.$inject=["$rootScope","$location","$licenseService"]},150:function(e,r,o){"use strict";o.r(r);o(4),o(11),o(16),o(65),o(98),o(99),o(10),o(100),o(34),o(35);angular.module("graphdb.framework.repositories",["ui.bootstrap","toastr","ngCookies","ngRoute","graphdb.framework.repositories.controllers","graphdb.framework.repositories.ontop-repo.directive","graphdb.framework.repositories.fedx-repo.directive","graphdb.framework.core.services.repositories","graphdb.framework.core.directives","graphdb.framework.core.controllers","graphdb.framework.settings"])},64:function(e,r,o){"use strict";o.r(r);o(4),o(12);function t(e,r,o,t,i){e.supportsStatistics=!0,e.settings={statistics:!1},e.getSettings=function(){e.loader=!0,t.getStatistics().then((function(r){e.settings.statistics="true"===r.data,e.supportsStatistics=!0}),(function(o){if(404===o.status)e.supportsStatistics=!1;else{const e=getError(o.data);r.error(e,i.instant("error.getting.settings"))}}))},e.getSettings(),e.setSettings=function(){e.loader=!0,t.toggleStatistics(e.settings.statistics).then((function(){o.close(),r.success(i.instant("saving.settings.success"))}),(function(e){const o=getError(e.data);r.error(o,i.instant("saving.settings.error"))}))},e.submitForm=function(){e.setSettings()},e.cancel=function(){o.dismiss("cancel")}}function i(e,r,o,t,i,s,n){e.loadingLicense=function(){return o.loadingLicense},o.checkLicenseStatus(),e.revertToFree=function(){s.openSimpleModal({title:n.instant("confirm.operation"),message:n.instant("revert.to.free.warning.msg"),warning:!0}).result.then((function(){r.unregisterLicense().success((function(){o.checkLicenseStatus()}))}))}}function s(e,r,o,t,i,s,n,a){e.$on("securityInit",(function(){n.isAdmin()||o.path("/license")})),e.sendLicenseToValidateAndActivate=l;const c=$(".license-textarea");function l(e){r.sendLicenseToValidate(e).success((function(o){"Invalid"!==o.licensee?(c.val(e),function(e,o){t.open({templateUrl:"js/angular/settings/modal/validate-license.html",controller:"ValidateLicenseModalCtrl",size:"lg",resolve:{license:function(){return e}}}).result.then((function(){!function(e){e||(e=c.val());if(e){const o=atob(e.replace(/\s/g,""));r.registerLicense(o).success((function(){s.history.back()})).error((function(){i.error(a.instant("license.register.error"))}))}else i.error(a.instant("no.license.code.error"))}(o)}))}(o,e)):(c.val(""),i.error(o.message))})).error((function(){i.error(a.instant("invalid.license"))}))}e.$watch("currentFile",(function(){if(e.currentFile){const o=e.currentFile;r.extractFromLicenseFile(o).success((function(e){l(e)})).error((function(){i.error(a.instant("could.not.upload.file.error"))}))}})),e.getBackToPreviousPage=function(){s.history.back()}}function n(e,r,o){e.ok=function(){r.close()},e.cancel=function(){r.dismiss("cancel")},e.license=o}function a(e){e.loader=!0,e.setLoader=function(r){e.loader=r}}angular.module("graphdb.framework.settings.controllers",["ngCookies","ui.bootstrap","graphdb.framework.core.services.jwtauth","toastr"]).controller("ActiveLocationSettingsCtrl",t).controller("ValidateLicenseModalCtrl",n).controller("LicenseCtrl",i).controller("RegisterLicenseCtrl",s).controller("LoaderSamplesCtrl",a),t.$inject=["$scope","toastr","$modalInstance","LicenseRestService","$translate"],i.$inject=["$scope","LicenseRestService","$licenseService","toastr","$rootScope","ModalService","$translate"],s.$inject=["$scope","LicenseRestService","$location","$modal","toastr","$window","$jwtAuth","$translate"],n.$inject=["$scope","$modalInstance","license"],a.$inject=["$scope"]},98:function(e,r,o){"use strict";o.r(r);var t=o(65);function i(e,r,o,i,s){return{restrict:"E",scope:!1,templateUrl:"js/angular/repositories/templates/ontop-repo.html",link:function(n){n.selectedDriver={driverType:"generic",driverName:"Generic JDBC Driver",jdbc:{hostName:"",port:"",databaseName:"",userName:"",password:"",driverClass:"",url:""},urlTemplate:"",downloadDriverUrl:""},n.ontopRepoFileNames={},n.supportedDriversData=[],n.ontopRepoFileLabels={propertiesFile:"JDBC properties",obdaFile:"OBDA or R2RML",owlFile:"ontology file",constraintFile:"constraint file",dbMetadataFile:"DB metadata file"},n.ontopRepoFiles=Object.keys(n.ontopRepoFileLabels),n.ontopRepoFiles.forEach((function(e){n.repositoryInfo.params[e]&&(n.ontopRepoFileNames[e]=Object(t.getFileName)(n.repositoryInfo.params[e].value))})),n.supportedDriverLabels={hostName:"Hostname",port:"Port",databaseName:"Database name",userName:"Username",password:"Password",driverClass:"Driver class",url:"URL"},n.propertiesFileParams=Object.keys(n.supportedDriverLabels),n.classAvailable=!1,n.genericDriverType="generic",n.propertiesFile="propertiesFile";const a=[n.propertiesFile,"obdaFile"],c=["hostName","databaseName","userName"];function l(){return n.selectedDriver.driverType!==n.genericDriverType?c.filter((function(e){return!n.selectedDriver.jdbc[e]})).length>0&&(o.error(s.instant("missing.required.field.error")),1)?Promise.reject(s.instant("missing.required.field.error")):(n.uploadFileLoader=!0,r.updatePropertiesFile(n.repositoryInfo.params[n.propertiesFile].value,n.selectedDriver.jdbc,n.repositoryInfo.location).success((function(e){n.ontopRepoFileNames[n.propertiesFile]=Object(t.getFileName)(e.fileLocation),n.repositoryInfo.params[n.propertiesFile].value=e.fileLocation,n.uploadFileLoader=!1})).error((function(e){p(s.instant("common.error"),e),n.uploadFileLoader=!1}))):Promise.resolve()}function p(e,r){const t=getError(r);o.error(t,e)}n.loadDriverByClass=function(e){const r=n.supportedDriversData.find(r=>r.driverClass===e);return r&&n.copyDriverProperties(r),r},n.selectDriverByType=function(e){n.copyDriverProperties(n.supportedDriversData.find(r=>r.driverType===e)),n.concatURL("hostName",n)},n.copyDriverProperties=function(e){n.selectedDriver.driverType=e.driverType,n.selectedDriver.jdbc.driverClass=e.driverClass,n.selectedDriver.jdbc.url=e.urlTemplate,n.selectedDriver.urlTemplate=e.urlTemplate,n.selectedDriver.downloadDriverUrl=e.downloadDriverUrl,n.selectedDriver.portRequired=e.portRequired,n.classAvailable=e.classAvailable},n.isReadOnly=function(e){return"driverClass"===e||"url"===e},n.editFile=function(o){e.open({templateUrl:"js/angular/templates/modal/editRepoFile.html",controller:"EditRepositoryFileCtrl",resolve:{file:function(){return n.repositoryInfo.params[o]?n.repositoryInfo.params[o].value:""}}}).result.then((function(e){r.updateRepositoryFileContent(e.fileLocation,e.content,n.repositoryInfo.location).success((function(e){n.ontopRepoFileNames[o]=Object(t.getFileName)(e.fileLocation),n.repositoryInfo.params[o].value=e.fileLocation})).error((function(e){p(s.instant("common.error"),e)}))}))},n.uploadOntopRepoFile=function(e,r){e&&e.length&&(n.uploadFile=e[0],n.uploadFileLoader=!0,i.upload({url:"rest/repositories/file/upload",data:{file:n.uploadFile,location:n.repositoryInfo.location}}).success((function(e){e.success?(n.ontopRepoFileNames[r]=n.uploadFile.name,n.repositoryInfo.params[r].value=e.fileLocation):o.error(e.errorMessage),n.uploadFileLoader=!1})).error((function(e){p(s.instant("common.error"),e),n.uploadFile="",n.uploadFileLoader=!1})))},n.concatURL=function(e){if("hostName"===e||"port"===e||"databaseName"===e){let e=n.selectedDriver.urlTemplate;n.selectedDriver.jdbc.hostName&&(e=n.selectedDriver.jdbc.port?e.replace("{hostport}",`${n.selectedDriver.jdbc.hostName}:${n.selectedDriver.jdbc.port}`):e.replace("{hostport}",n.selectedDriver.jdbc.hostName)),n.selectedDriver.jdbc.databaseName&&(e=e.replace("{database}",n.selectedDriver.jdbc.databaseName)),n.selectedDriver.jdbc.url=e}},n.getInputType=function(e){switch(e){case"password":return"password";case"port":return"number";default:return"text"}},n.checkForRequiredOntopFiles=function(){return l().then((function(){return a.filter((function(e){return!n.repositoryInfo.params[e].value})).length>0?(o.error(s.instant("ontop.repo.missing.required.file.error")),Promise.reject(s.instant("ontop.repo.missing.required.file.error"))):Promise.resolve()}))},n.validateOntopPropertiesConnection=function(){l().then((function(){r.validateOntopPropertiesConnection(n.repositoryInfo).success((function(){o.success(s.instant("ontop.repo.successful.connection.msg"))})).error((function(e){p(s.instant("ontop.repo.failed.to.connect"),e)}))}))},n.isOntopRepoFileUploaded=function(){return n.repositoryInfo.params.propertiesFile&&n.repositoryInfo.params.propertiesFile.value.length>0},n.isRequiredOntopRepoFile=function(e){return a.indexOf(e)>-1},n.isRequiredField=function(e){return c.indexOf(e)>-1||"port"===e&&n.selectedDriver.portRequired},n.getFieldTooltip=function(e){return"port"===e&&n.selectedDriver.portRequired&&(e="portIfRequired"),s.instant("repoTooltips.ontop."+e)},n.editOntopRepo=function(){n.checkForRequiredOntopFiles().then((function(){n.editRepository()})).catch((function(e){}))},n.createOntopRepo=function(){n.repositoryInfo.id?n.checkForRequiredOntopFiles().then((function(){n.createRepo()})).catch((function(e){})):o.error(s.instant("empty.repoid.warning"))},n.goBackToPrevious=function(){n.goBackToPreviousLocation()},r.getSupportedDriversData(n.repositoryInfo).success((function(e){n.supportedDriversData=e})).error((function(e){p(s.instant("common.error"),e)})).then((function(){n.editRepoPage&&r.loadPropertiesFile(n.repositoryInfo.params[n.propertiesFile].value,n.repositoryInfo.location).success((function(e){n.loadDriverByClass(e.driverClass)&&(n.selectedDriver.jdbc.hostName=e.hostName,n.selectedDriver.jdbc.port=parseInt(e.port),n.selectedDriver.jdbc.databaseName=e.databaseName,n.selectedDriver.jdbc.userName=e.userName,n.selectedDriver.jdbc.password=e.password,n.selectedDriver.jdbc.url=e.url)})).error((function(e){p(s.instant("common.error"),e),n.uploadFileLoader=!1}))}))}}}angular.module("graphdb.framework.repositories.ontop-repo.directive",[]).directive("ontopRepo",i),i.$inject=["$modal","RepositoriesRestService","toastr","Upload","$translate"]},99:function(e,r){function o(e,r,o,t){return{restrict:"E",scope:!0,templateUrl:"js/angular/repositories/templates/fedx-repo.html",link:function(i){const s="ResolvableRepository";i.fedxMembers=[],i.knownRepos=[],i.allAttachedRepos=[],i.editRepoPage&&(i.fedxMembers=i.repositoryInfo.params.member.value.slice());function n(){for(const e of i.fedxMembers)i.knownRepos=i.knownRepos.filter((function(r){return e.repositoryServer?r.id!==e.repositoryName||r.location!==e.repositoryServer:r.id!==e.repositoryName||!r.local}))}function a(){r.getRepositories(i.repositoryInfo.location).success((function(e){let r=[];_.values(e).forEach(e=>{r.push.apply(r,e)}),i.allAttachedRepos=_.cloneDeep(r)})).error((function(e){const r=getError(e);o.error(r,t.instant("common.error"))})).then((function(){i.knownRepos=i.allAttachedRepos.slice(),n()}))}i.setWritableRepo=function(e){let r=i.fedxMembers.find(e=>"true"===e.writable);r&&((r.store!==s||e.store===s&&r.repositoryName===e.repositoryName)&&("RemoteRepository"!==r.store||"RemoteRepository"===e.store&&r.repositoryName===e.repositoryName&&r.repositoryServer===e.repositoryServer)||(r.writable="false")),e.writable=JSON.stringify("false"===e.writable)},i.getActiveClass=function(e){return"true"===e.writable?" active":""},i.checkIfRepoExist=function(e){return!i.allAttachedRepos.length||(e.store===s?i.allAttachedRepos.find(r=>r.id===e.repositoryName&&!r.location):"RemoteRepository"!==e.store||i.allAttachedRepos.find(r=>r.id===e.repositoryName&&r.location===e.repositoryServer))},i.getRepositoryServer=function(e){return e.local?"Local":e.location};const c=setInterval((function(){a()}),5e3);function l(e){i.fedxMembers.push(e),i.repositoryInfo.params.member.value=i.fedxMembers}function p(e){return"/"===e.slice(-1)?e.slice(0,-1):e}function d(){return i.editRepoPage&&!i.editRepoPage||!i.model.editMode}i.$on("$destroy",(function(){clearInterval(c)})),i.addMember=function(e){let r;r="Local"===i.getRepositoryServer(e)?{store:s,repositoryName:e.id,repoType:e.type,respectRights:"true",writable:"false"}:{store:"RemoteRepository",repositoryName:e.id,repositoryServer:e.location,username:"",password:"",supportsASKQueries:"true",writable:"false"},i.knownRepos=i.knownRepos.filter(r=>r.id!==e.id||r.location!==e.location),l(r)},i.removeMember=function(e){e.store&&e.store===s?(i.fedxMembers=i.fedxMembers.filter(r=>r.store!==e.store||r.repositoryName!==e.repositoryName&&!r.repositoryServer),a()):e.store&&"SPARQLEndpoint"===e.store?i.fedxMembers=i.fedxMembers.filter(r=>r.endpoint!==e.endpoint):e.store&&"NativeStore"===e.store?i.fedxMembers=i.fedxMembers.filter(r=>r.repositoryLocation!==e.repositoryLocation):e.store&&"RemoteRepository"===e.store&&(i.fedxMembers=i.fedxMembers.filter(r=>r.store!==e.store||r.repositoryName!==e.repositoryName||r.repositoryServer!==e.repositoryServer),a()),i.repositoryInfo.params.member.value=i.fedxMembers},i.addRemoteMember=function(){i.mode="remote",i.model={editMode:!1,store:"RemoteRepository",repositoryName:"",repositoryServer:"",sparqlEndpoint:"",username:"",password:"",supportsASKQueries:"true",writable:"false"},i.$modalInstance=e.open({templateUrl:"js/angular/templates/modal/add-fedx-remote-repo.html",scope:i})},i.getMemberIcon=function(e){return e.repoType?"icon-repo-"+e.repoType:"NativeStore"===e.store?"icon-warning":"icon-link"},i.editFedXRepository=function(r){r.store===s?(i.mode="local",i.model={editMode:!0,store:r.store,respectRights:r.respectRights,repositoryName:r.repositoryName,repoType:r.repoType,writable:r.writable}):(i.mode="remote",i.model={editMode:!0,store:r.store,repositoryName:r.repositoryName,repositoryServer:r.repositoryServer,sparqlEndpoint:"SPARQLEndpoint"===r.store?r.endpoint:r.repositoryLocation,username:r.username,password:r.password,supportsASKQueries:r.supportsASKQueries,writable:r.writable}),i.$modalInstance=e.open({templateUrl:"js/angular/templates/modal/add-fedx-remote-repo.html",scope:i})},i.resolveName=function(e){switch(e.store){case s:return e.repositoryName;case"RemoteRepository":return e.repositoryName+"@"+e.repositoryServer;case"SPARQLEndpoint":return e.endpoint;case"NativeStore":return e.repositoryLocation;default:return""}},i.cancel=function(){i.$modalInstance.dismiss("cancel")},i.ok=function(){let e;if(i.model.repositoryName&&i.model.store===s)e={store:s,repositoryName:i.model.repositoryName,repoType:i.model.repoType,respectRights:i.model.respectRights,writable:i.model.writable},i.fedxMembers=i.fedxMembers.filter(r=>r.repositoryName!==e.repositoryName||r.store!==e.store);else if(i.model.repositoryName&&"RemoteRepository"===i.model.store){if(e={store:"RemoteRepository",repositoryName:i.model.repositoryName,repositoryServer:p(i.model.repositoryServer),username:i.model.username,password:i.model.password,writable:i.model.writable},d()&&i.fedxMembers.find(r=>r.repositoryName===e.repositoryName&&r.repositoryServer===e.repositoryServer)){let r=i.resolveName(e);return o.error(t.instant("fedx.repo.already.added.member.error",{name:r})),void i.$modalInstance.close()}i.fedxMembers=i.fedxMembers.filter(r=>r.repositoryName!==e.repositoryName||r.repositoryServer!==e.repositoryServer)}else{if(e={store:"SPARQLEndpoint",endpoint:p(i.model.sparqlEndpoint),username:i.model.username,password:i.model.password,supportsASKQueries:i.model.supportsASKQueries,writable:i.model.writable},d()&&i.fedxMembers.find(r=>r.endpoint===e.endpoint)){let r=i.resolveName(e);return o.error(t.instant("fedx.repo.already.added.sparql.endpoint.error",{name:r})),void i.$modalInstance.close()}i.fedxMembers=i.fedxMembers.filter(r=>r.endpoint!==e.endpoint)}l(e),n(),i.$modalInstance.close()},i.$on("changedLocation",(function(){i.fedxMembers=[],a()})),a()}}}angular.module("graphdb.framework.repositories.fedx-repo.directive",[]).directive("fedxRepo",o),o.$inject=["$modal","RepositoriesRestService","toastr","$translate"]}}]);
2
+ //# sourceMappingURL=21.ea150df1291050bc1c4a.bundle.js.map