graphdb-workbench 2.0.0 → 2.0.2

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 (51) hide show
  1. package/dist/10.f63a9f9189528238aa8f.bundle.js +2 -0
  2. package/dist/10.f63a9f9189528238aa8f.bundle.js.map +1 -0
  3. package/dist/11.3957302d7a301df30dd1.bundle.js +1 -1
  4. package/dist/11.3957302d7a301df30dd1.bundle.js.map +1 -1
  5. package/dist/120.80843604737b7c260788.bundle.js +1 -1
  6. package/dist/120.80843604737b7c260788.bundle.js.map +1 -1
  7. package/dist/18.44723ea06155c72f46ae.bundle.js +1 -1
  8. package/dist/18.44723ea06155c72f46ae.bundle.js.map +1 -1
  9. package/dist/25.9e0925889b3a3f79c7fe.bundle.js +1 -1
  10. package/dist/25.9e0925889b3a3f79c7fe.bundle.js.map +1 -1
  11. package/dist/29.9bdb27c21d6eacac1341.bundle.js +1 -1
  12. package/dist/29.9bdb27c21d6eacac1341.bundle.js.map +1 -1
  13. package/dist/30.34b74ada583b1b0af913.bundle.js +1 -1
  14. package/dist/30.34b74ada583b1b0af913.bundle.js.map +1 -1
  15. package/dist/68.e25480b7770a679a9654.bundle.js +1 -1
  16. package/dist/68.e25480b7770a679a9654.bundle.js.map +1 -1
  17. package/dist/{bundle.a8677c75aad1ad7b3b6a.bundle.js → bundle.7d5dd8e4d7cb8ed01086.bundle.js} +3 -3
  18. package/dist/bundle.7d5dd8e4d7cb8ed01086.bundle.js.map +1 -0
  19. package/dist/index.html +3 -3
  20. package/dist/js/angular/core/directives/rdfresourcesearch/templates/rdfResourceSearchTemplate.html +1 -1
  21. package/dist/pages/autocomplete.html +1 -1
  22. package/dist/pages/choose-repository-type.html +1 -1
  23. package/dist/pages/cluster-management/clusterInfo.html +3 -3
  24. package/dist/pages/create-index.html +4 -4
  25. package/dist/pages/dependencies.html +1 -1
  26. package/dist/pages/domainRangeInfo.html +2 -2
  27. package/dist/pages/edit.html +1 -1
  28. package/dist/pages/explore.html +1 -1
  29. package/dist/pages/export.html +1 -1
  30. package/dist/pages/find.html +1 -1
  31. package/dist/pages/graph-config/saveGraphConfig.html +11 -11
  32. package/dist/pages/graphs-visualizations.html +7 -7
  33. package/dist/pages/import.html +1 -1
  34. package/dist/pages/jdbc-create.html +5 -5
  35. package/dist/pages/monitor/queries.html +1 -1
  36. package/dist/pages/monitor/resources.html +2 -2
  37. package/dist/pages/namespaces.html +2 -2
  38. package/dist/pages/plugins.html +1 -1
  39. package/dist/pages/rdfClassHierarchyInfo.html +7 -7
  40. package/dist/pages/rdfrank.html +2 -2
  41. package/dist/pages/repositories.html +2 -2
  42. package/dist/pages/repository.html +2 -2
  43. package/dist/pages/similarity-indexes.html +1 -1
  44. package/dist/pages/sparql-template-create.html +5 -5
  45. package/dist/pages/sparql.html +3 -3
  46. package/dist/pages/webapi.html +2 -2
  47. package/dist/res/swagger/index.html +27 -27
  48. package/package.json +1 -1
  49. package/dist/10.eab0a417fa2f2831905e.bundle.js +0 -2
  50. package/dist/10.eab0a417fa2f2831905e.bundle.js.map +0 -1
  51. package/dist/bundle.a8677c75aad1ad7b3b6a.bundle.js.map +0 -1
@@ -1,2 +1,2 @@
1
- (window.webpackJsonp=window.webpackJsonp||[]).push([[120],{180:function(module,exports){module.exports=function(obj){obj||(obj={});var __t,__p="";with(obj)__p+='<link href="css/rdf-resource-search.css?v=2.0.0" rel="stylesheet"/>\n\n<div ng-if="getActiveRepository() && hasActiveLocation() && isNotLoading()" ng-cloak>\n <div id="search-box" class="card search-rdf-input" ng-keydown="onKeyDown($event)" ng-if="!isHomePage()">\n <div class="card-block">\n <search-resource-input namespacespromise="getNamespacesPromise"\n autocompletepromisestatus="getAutocompletePromise"\n empty="empty"\n open-in-new-tab="true"\n preserve-search="true"\n radio-buttons="true"\n clear-input-icon="true">\n </search-resource-input>\n <button class="btn btn-link close-rdf-search-btn"\n tooltip="{{\'search.resource.close.msg\' | translate}}" tooltip-placement="bottom"\n tooltip-trigger="mouseenter"\n ng-click="hideInput()">\n <i class="icon-close icon-2x" aria-hidden="true"></i>\n </button>\n </div>\n </div>\n <button class="btn btn-link search-rdf-btn"\n tooltip="{{\'search.resources.msg\' | translate}}"\n tooltip-placement="bottom"\n tooltip-trigger="mouseenter"\n ng-click="showInput()">\n <i class="icon-search icon-2x" aria-hidden="true"></i>\n </button>\n</div>\n';return __p}}}]);
1
+ (window.webpackJsonp=window.webpackJsonp||[]).push([[120],{180:function(module,exports){module.exports=function(obj){obj||(obj={});var __t,__p="";with(obj)__p+='<link href="css/rdf-resource-search.css?v=2.0.2" rel="stylesheet"/>\n\n<div ng-if="getActiveRepository() && hasActiveLocation() && isNotLoading()" ng-cloak>\n <div id="search-box" class="card search-rdf-input" ng-keydown="onKeyDown($event)" ng-if="!isHomePage()">\n <div class="card-block">\n <search-resource-input namespacespromise="getNamespacesPromise"\n autocompletepromisestatus="getAutocompletePromise"\n empty="empty"\n open-in-new-tab="true"\n preserve-search="true"\n radio-buttons="true"\n clear-input-icon="true">\n </search-resource-input>\n <button class="btn btn-link close-rdf-search-btn"\n tooltip="{{\'search.resource.close.msg\' | translate}}" tooltip-placement="bottom"\n tooltip-trigger="mouseenter"\n ng-click="hideInput()">\n <i class="icon-close icon-2x" aria-hidden="true"></i>\n </button>\n </div>\n </div>\n <button class="btn btn-link search-rdf-btn"\n tooltip="{{\'search.resources.msg\' | translate}}"\n tooltip-placement="bottom"\n tooltip-trigger="mouseenter"\n ng-click="showInput()">\n <i class="icon-search icon-2x" aria-hidden="true"></i>\n </button>\n</div>\n';return __p}}}]);
2
2
  //# sourceMappingURL=120.80843604737b7c260788.bundle.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["webpack:///./src/js/angular/core/directives/rdfresourcesearch/templates/rdfResourceSearchTemplate.html"],"names":["module","exports","obj","__t","__p"],"mappings":"wFAAAA,OAAOC,QAAU,SAASC,KAC1BA,MAAQA,IAAM,IACd,IAAIC,IAAKC,IAAM,GACf,KAAMF,IACNE,KAAO,u+CAGP,OAAOA","file":"120.80843604737b7c260788.bundle.js","sourcesContent":["module.exports = function(obj) {\nobj || (obj = {});\nvar __t, __p = '';\nwith (obj) {\n__p += '<link href=\"css/rdf-resource-search.css?v=2.0.0\" rel=\"stylesheet\"/>\\n\\n<div ng-if=\"getActiveRepository() && hasActiveLocation() && isNotLoading()\" ng-cloak>\\n <div id=\"search-box\" class=\"card search-rdf-input\" ng-keydown=\"onKeyDown($event)\" ng-if=\"!isHomePage()\">\\n <div class=\"card-block\">\\n <search-resource-input namespacespromise=\"getNamespacesPromise\"\\n autocompletepromisestatus=\"getAutocompletePromise\"\\n empty=\"empty\"\\n open-in-new-tab=\"true\"\\n preserve-search=\"true\"\\n radio-buttons=\"true\"\\n clear-input-icon=\"true\">\\n </search-resource-input>\\n <button class=\"btn btn-link close-rdf-search-btn\"\\n tooltip=\"{{\\'search.resource.close.msg\\' | translate}}\" tooltip-placement=\"bottom\"\\n tooltip-trigger=\"mouseenter\"\\n ng-click=\"hideInput()\">\\n <i class=\"icon-close icon-2x\" aria-hidden=\"true\"></i>\\n </button>\\n </div>\\n </div>\\n <button class=\"btn btn-link search-rdf-btn\"\\n tooltip=\"{{\\'search.resources.msg\\' | translate}}\"\\n tooltip-placement=\"bottom\"\\n tooltip-trigger=\"mouseenter\"\\n ng-click=\"showInput()\">\\n <i class=\"icon-search icon-2x\" aria-hidden=\"true\"></i>\\n </button>\\n</div>\\n';\n\n}\nreturn __p\n}"],"sourceRoot":""}
1
+ {"version":3,"sources":["webpack:///./src/js/angular/core/directives/rdfresourcesearch/templates/rdfResourceSearchTemplate.html"],"names":["module","exports","obj","__t","__p"],"mappings":"wFAAAA,OAAOC,QAAU,SAASC,KAC1BA,MAAQA,IAAM,IACd,IAAIC,IAAKC,IAAM,GACf,KAAMF,IACNE,KAAO,u+CAGP,OAAOA","file":"120.80843604737b7c260788.bundle.js","sourcesContent":["module.exports = function(obj) {\nobj || (obj = {});\nvar __t, __p = '';\nwith (obj) {\n__p += '<link href=\"css/rdf-resource-search.css?v=2.0.2\" rel=\"stylesheet\"/>\\n\\n<div ng-if=\"getActiveRepository() && hasActiveLocation() && isNotLoading()\" ng-cloak>\\n <div id=\"search-box\" class=\"card search-rdf-input\" ng-keydown=\"onKeyDown($event)\" ng-if=\"!isHomePage()\">\\n <div class=\"card-block\">\\n <search-resource-input namespacespromise=\"getNamespacesPromise\"\\n autocompletepromisestatus=\"getAutocompletePromise\"\\n empty=\"empty\"\\n open-in-new-tab=\"true\"\\n preserve-search=\"true\"\\n radio-buttons=\"true\"\\n clear-input-icon=\"true\">\\n </search-resource-input>\\n <button class=\"btn btn-link close-rdf-search-btn\"\\n tooltip=\"{{\\'search.resource.close.msg\\' | translate}}\" tooltip-placement=\"bottom\"\\n tooltip-trigger=\"mouseenter\"\\n ng-click=\"hideInput()\">\\n <i class=\"icon-close icon-2x\" aria-hidden=\"true\"></i>\\n </button>\\n </div>\\n </div>\\n <button class=\"btn btn-link search-rdf-btn\"\\n tooltip=\"{{\\'search.resources.msg\\' | translate}}\"\\n tooltip-placement=\"bottom\"\\n tooltip-trigger=\"mouseenter\"\\n ng-click=\"showInput()\">\\n <i class=\"icon-search icon-2x\" aria-hidden=\"true\"></i>\\n </button>\\n</div>\\n';\n\n}\nreturn __p\n}"],"sourceRoot":""}
@@ -1,2 +1,2 @@
1
- (window.webpackJsonp=window.webpackJsonp||[]).push([[18],{220: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)},221: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},222: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},229: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},66:function(e,t,n){"use strict";n.r(t);var r=n(220),i=n.n(r),a=n(229),o=n(221),s=n(222);n(4);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=800,x=800,w=x,S=20,C=d3.layout.pack().size([w-S,w-S]).value((function(e){return e.size})),E=d3.scale.linear().domain([0,4]).range(["hsl(19, 70%, 90%)","hsl(19, 70%, 50%)"]).interpolate(d3.interpolateHcl),T=d3.select("#classChart").insert("svg:svg","h2").attr("viewBox","0 0 "+m+" "+x).attr("preserveAspectRatio","xMidYMid meet").on("dblclick.zoom",null);function R(){return T.append("svg:g").attr({id:"main-group",transform:"translate("+m/2+","+x/2+")"})}function A(){return"true"===p.get(v.CLASS_HIERARCHY_HIDE_PREFIXES)}function H(){var e=s.a.Export.getCSSRules("css/rdf-class-hierarchy-labels.css?v=2.0.0");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=A();var P,I,b=R();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",H)})).error((function(t){e.loader=!1,e.hierarchyError=getError(t),u.error(y.instant("graphexplore.error.request.failed",{name:h,error:getError(t)}))}))}var k,F,L,D,N,z,O,U,M={};function V(n,s,c,u){L&&L(),D&&D(),d3.selectAll("#main-group").remove(),b=R(),a.a.SingleChild.addPlaceholders(n,!0),F=c||n;var p,v=C.nodes(n);F.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}));T.call(y);var g=b.selectAll("circle").data(v).enter().append("g");s.doFade&&g.each((function(e){o.a.Transition.fadeIn(d3.select(this),550)}));var m,x=[],A=g.append("circle").attr("class",(function(e){return e.role})).style("fill",(function(e){return e.children?E(e.depth):"#E0D0D0"})).each((function(e){if(e.circle=d3.select(this),e.name!==h){var t=e.name;x.push({name:t}),M[[t]]=e,e.circle.classed("rdf-class",!0),e.circle.on("mouseover",(function(){s.noPrefixes?y.show(e):e.textHidden?y.show(e):y.hide(e)})),e.circle.on("mouseout",y.hide)}}));function H(e){d3.selectAll(".selected").classed("selected",e.selected=!1),e.circle.classed("selected",e.selected=!0),m=e}function N(){d.showClassInfoPanel=!1}x&&(x=_.uniqBy(x,"name"),d.flattenedClassNames=x);var $=o.a.Click.delayDblClick();d3.selectAll(".parent, .topLevelParent, .child, .root").call($);I=function(e){Z(e),e.name===h?(N(),d3.selectAll(".selected").classed("selected",!1)):(H(e),d.selectedClass=m,d.showClassInfoPanel=!0,d.$on("sidePanelClosed",(function(t){d3.selectAll(".selected").classed("selected",e.selected=!1)})))},$.on("click",(function(e){e.id&&r.history.pushState({id:e.id},"classHierarchyPage"+e.id,"hierarchy#"+e.id),y.hide(),I(e)})),$.on("dblclick",(function(t){t!==n&&(y.hide(),H(t),e.$broadcast("goToDomainRangeGraphView",m,F),d3.event.stopPropagation())}));var z=0;T.on("wheel",(function(){y.hide();var e=d3.event;e.preventDefault(),e.stopPropagation();var t=(new Date).getTime();if(t-z>100){z=t;var n="";e.deltaY<=-1?n="in":e.deltaY>=1&&(n="out");var i=e.target.__data__;if(i||(i=F),"in"===n){if(i!==F){for(;i.parent&&!i.parent.isInFocusTransitive;)i=i.parent;i.depth<F.depth&&(i=F)}if(i===F&&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]);i=a}Z(i,!0)}else"out"===n&&(i=F.parent)&&Z(i,!0);F.name===h&&r.history.replaceState({id:1},"classHierarchyPage1","hierarchy#1"),W()}}));var O=b.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?(k!==n&&(O.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))})),k=n),O.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)}))):O.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)})),O.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&&O.each((function(e){o.a.Transition.fadeIn(d3.select(this),550)})),P=function(){function e(e){e&&A.each((function(t){e==t.id&&I(t)}))}var n=t.hash();r.onpopstate=function(t){t.state&&e(t.state.id)},e(n)};var U=b.selectAll("circle, text");function V(e,t){var n=w/e[2];p=e,U.attr("transform",(function(t){return"translate("+(t.x-e[0])*n+","+(t.y-e[1])*n+")"})),A.attr("r",(function(e){return e.r*n})),t&&O.each((function(e){e.fullName!==F.topLevelParentUri&&F.topLevelParentUri!==h||(e.textSel.style("display","none"),F.children&&F.children.length?_.each(F.children,(function(e){e.textSel.style("display","inline")})):F.textSel.style("display","inline"),F.parent&&_.each(F.parent.children,(function(e){e.name!==F.name&&e.textSel.style("display","inline")})))})),O.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 Y(e){var t=2*e+S;return 2*e/t<.3&&(t=2*e+2),t}function B(e){!e.isInFocusTransitive&&e.parent&&e.parent.isInFocusTransitive||(e.textHidden=!0,this.style.display="none")}function G(e){!e.isInFocusTransitive&&e.parent&&e.parent.isInFocusTransitive&&(e.textHidden=this.textContent.indexOf("...")+3===this.textContent.length,this.style.display="")}function Z(e,t){if(l((function(){d.showExternalElements=e.name===h})),e.id&&r.history.replaceState({id:e.id},"classHierarchyPage"+e.id,"hierarchy#"+e.id),F!==e){if(t&&(N(),d3.selectAll(".selected").classed("selected",!1)),F.parent)for(var n=F;n;)n.isInFocusTransitive=!1,n=n.parent;for(n=e;n;)n.isInFocusTransitive=n.children,n=n.parent;if(2*(F=e).r/(2*F.r+S)<.3||d.currentSliderValue>d.currentBrowserLimit)V([F.x,F.y,Y(F.r)]),O.each((function(e){B.call(this,e),G.call(this,e)}));else d3.transition().duration(f).tween("zoom",(function(e){var t=d3.interpolateZoom(p,[F.x,F.y,Y(F.r)]);return function(e){V(t(e))}})).selectAll("text").each("start",B).each("end",G)}}V([F.x,F.y,Y(F.r)],u),L=d.$on("rootFocus",(function(){r.history.pushState({id:1},"classHierarchyPage1","hierarchy#1"),I(n)})),D=d.$on("classSearch",(function(e){I(e)}))}function W(){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",W),window.addEventListener("beforeunload",(function e(){window.removeEventListener("resize",W),window.removeEventListener("beforeunload",e)})),d.$watch("classHierarchyData",(function(){N&&N(),z&&z(),O&&O(),U&&U();var e=A();if(d.classHierarchyData.classCount){W();var t=angular.copy(d.classHierarchyData);var n,r,i=function(e){return C.nodes(e).sort((function(e,t){return e.sortingRank>t.sortingRank?-1:e.sortingRank<t.sortingRank?1:e.depth>t.depth?1:e.depth<t.depth?-1:0}))}(t);function a(e,t){var i={keepPrevState:!0,noPrefixes:A()};r=i.noPrefixes,V(n||e,i,F,!0),l((function(){p.set(v.CLASS_HIERARCHY_SWITCH_PREFIXES,t),P()}),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)?A():r,V(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:A()};V(t,u),P()}N=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),z=d.$watch("currentSliderValue",(function(e){o(e,i,!0)}),!0),U=d.$on("onEnterKeypressSearchAction",(function(e){s&&I(s)})),O=d.$on("searchedClass",(function(e,t){(s=M[t.name])&&I(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([[18],{220: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)},221: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},222: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},229: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},66:function(e,t,n){"use strict";n.r(t);var r=n(220),i=n.n(r),a=n(229),o=n(221),s=n(222);n(4);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=800,x=800,w=x,S=20,C=d3.layout.pack().size([w-S,w-S]).value((function(e){return e.size})),E=d3.scale.linear().domain([0,4]).range(["hsl(19, 70%, 90%)","hsl(19, 70%, 50%)"]).interpolate(d3.interpolateHcl),T=d3.select("#classChart").insert("svg:svg","h2").attr("viewBox","0 0 "+m+" "+x).attr("preserveAspectRatio","xMidYMid meet").on("dblclick.zoom",null);function R(){return T.append("svg:g").attr({id:"main-group",transform:"translate("+m/2+","+x/2+")"})}function A(){return"true"===p.get(v.CLASS_HIERARCHY_HIDE_PREFIXES)}function H(){var e=s.a.Export.getCSSRules("css/rdf-class-hierarchy-labels.css?v=2.0.2");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=A();var P,I,b=R();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",H)})).error((function(t){e.loader=!1,e.hierarchyError=getError(t),u.error(y.instant("graphexplore.error.request.failed",{name:h,error:getError(t)}))}))}var k,F,L,D,N,z,O,U,M={};function V(n,s,c,u){L&&L(),D&&D(),d3.selectAll("#main-group").remove(),b=R(),a.a.SingleChild.addPlaceholders(n,!0),F=c||n;var p,v=C.nodes(n);F.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}));T.call(y);var g=b.selectAll("circle").data(v).enter().append("g");s.doFade&&g.each((function(e){o.a.Transition.fadeIn(d3.select(this),550)}));var m,x=[],A=g.append("circle").attr("class",(function(e){return e.role})).style("fill",(function(e){return e.children?E(e.depth):"#E0D0D0"})).each((function(e){if(e.circle=d3.select(this),e.name!==h){var t=e.name;x.push({name:t}),M[[t]]=e,e.circle.classed("rdf-class",!0),e.circle.on("mouseover",(function(){s.noPrefixes?y.show(e):e.textHidden?y.show(e):y.hide(e)})),e.circle.on("mouseout",y.hide)}}));function H(e){d3.selectAll(".selected").classed("selected",e.selected=!1),e.circle.classed("selected",e.selected=!0),m=e}function N(){d.showClassInfoPanel=!1}x&&(x=_.uniqBy(x,"name"),d.flattenedClassNames=x);var $=o.a.Click.delayDblClick();d3.selectAll(".parent, .topLevelParent, .child, .root").call($);I=function(e){Z(e),e.name===h?(N(),d3.selectAll(".selected").classed("selected",!1)):(H(e),d.selectedClass=m,d.showClassInfoPanel=!0,d.$on("sidePanelClosed",(function(t){d3.selectAll(".selected").classed("selected",e.selected=!1)})))},$.on("click",(function(e){e.id&&r.history.pushState({id:e.id},"classHierarchyPage"+e.id,"hierarchy#"+e.id),y.hide(),I(e)})),$.on("dblclick",(function(t){t!==n&&(y.hide(),H(t),e.$broadcast("goToDomainRangeGraphView",m,F),d3.event.stopPropagation())}));var z=0;T.on("wheel",(function(){y.hide();var e=d3.event;e.preventDefault(),e.stopPropagation();var t=(new Date).getTime();if(t-z>100){z=t;var n="";e.deltaY<=-1?n="in":e.deltaY>=1&&(n="out");var i=e.target.__data__;if(i||(i=F),"in"===n){if(i!==F){for(;i.parent&&!i.parent.isInFocusTransitive;)i=i.parent;i.depth<F.depth&&(i=F)}if(i===F&&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]);i=a}Z(i,!0)}else"out"===n&&(i=F.parent)&&Z(i,!0);F.name===h&&r.history.replaceState({id:1},"classHierarchyPage1","hierarchy#1"),W()}}));var O=b.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?(k!==n&&(O.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))})),k=n),O.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)}))):O.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)})),O.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&&O.each((function(e){o.a.Transition.fadeIn(d3.select(this),550)})),P=function(){function e(e){e&&A.each((function(t){e==t.id&&I(t)}))}var n=t.hash();r.onpopstate=function(t){t.state&&e(t.state.id)},e(n)};var U=b.selectAll("circle, text");function V(e,t){var n=w/e[2];p=e,U.attr("transform",(function(t){return"translate("+(t.x-e[0])*n+","+(t.y-e[1])*n+")"})),A.attr("r",(function(e){return e.r*n})),t&&O.each((function(e){e.fullName!==F.topLevelParentUri&&F.topLevelParentUri!==h||(e.textSel.style("display","none"),F.children&&F.children.length?_.each(F.children,(function(e){e.textSel.style("display","inline")})):F.textSel.style("display","inline"),F.parent&&_.each(F.parent.children,(function(e){e.name!==F.name&&e.textSel.style("display","inline")})))})),O.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 Y(e){var t=2*e+S;return 2*e/t<.3&&(t=2*e+2),t}function B(e){!e.isInFocusTransitive&&e.parent&&e.parent.isInFocusTransitive||(e.textHidden=!0,this.style.display="none")}function G(e){!e.isInFocusTransitive&&e.parent&&e.parent.isInFocusTransitive&&(e.textHidden=this.textContent.indexOf("...")+3===this.textContent.length,this.style.display="")}function Z(e,t){if(l((function(){d.showExternalElements=e.name===h})),e.id&&r.history.replaceState({id:e.id},"classHierarchyPage"+e.id,"hierarchy#"+e.id),F!==e){if(t&&(N(),d3.selectAll(".selected").classed("selected",!1)),F.parent)for(var n=F;n;)n.isInFocusTransitive=!1,n=n.parent;for(n=e;n;)n.isInFocusTransitive=n.children,n=n.parent;if(2*(F=e).r/(2*F.r+S)<.3||d.currentSliderValue>d.currentBrowserLimit)V([F.x,F.y,Y(F.r)]),O.each((function(e){B.call(this,e),G.call(this,e)}));else d3.transition().duration(f).tween("zoom",(function(e){var t=d3.interpolateZoom(p,[F.x,F.y,Y(F.r)]);return function(e){V(t(e))}})).selectAll("text").each("start",B).each("end",G)}}V([F.x,F.y,Y(F.r)],u),L=d.$on("rootFocus",(function(){r.history.pushState({id:1},"classHierarchyPage1","hierarchy#1"),I(n)})),D=d.$on("classSearch",(function(e){I(e)}))}function W(){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",W),window.addEventListener("beforeunload",(function e(){window.removeEventListener("resize",W),window.removeEventListener("beforeunload",e)})),d.$watch("classHierarchyData",(function(){N&&N(),z&&z(),O&&O(),U&&U();var e=A();if(d.classHierarchyData.classCount){W();var t=angular.copy(d.classHierarchyData);var n,r,i=function(e){return C.nodes(e).sort((function(e,t){return e.sortingRank>t.sortingRank?-1:e.sortingRank<t.sortingRank?1:e.depth>t.depth?1:e.depth<t.depth?-1:0}))}(t);function a(e,t){var i={keepPrevState:!0,noPrefixes:A()};r=i.noPrefixes,V(n||e,i,F,!0),l((function(){p.set(v.CLASS_HIERARCHY_SWITCH_PREFIXES,t),P()}),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)?A():r,V(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:A()};V(t,u),P()}N=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),z=d.$watch("currentSliderValue",(function(e){o(e,i,!0)}),!0),U=d.$on("onEnterKeypressSearchAction",(function(e){s&&I(s)})),O=d.$on("searchedClass",(function(e,t){(s=M[t.name])&&I(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=18.44723ea06155c72f46ae.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","diameter","margin","pack","layout","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","getCurrentClassDataAndMarkSelected","obj","selected","closeClassInfoPanel","uniqBy","clickCancel","zoom","$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,IAKIC,EALAC,EAAU5B,EAAK6B,MAAMC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BAAiB,SAAUtM,EAAOmR,IACjEJ,EAAuBxG,EAAmB4G,EAAcnM,QAEpD6D,EAAQkI,UAIrB,GA3xBHK,CAAoB3K,KA7B5BgJ,QACK4B,OAAO,kDAAmD,CACvD,mDACA,gDAEHC,SAAS,gBAAiB,KAC1BA,SAAS,gBAAiB,uBAC1BC,UAAU,oBAAqB9L,GAEpCA,EAAwB+L,QAAU,CAAC,aAAc,YAAa,uBAAwB,UAAW,WAAY,gBAAiB,kBAAmB,SAAU,gBAAiB,gBAAiB,sBAAuB,SAAU","file":"18.44723ea06155c72f46ae.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.0.0\");\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 .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\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 obj = newobj;\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 (d.id) {\n $window.history.replaceState({id: d.id}, \"classHierarchyPage\" + d.id, \"hierarchy#\" + d.id);\n }\n\n if (focus === d) {\n return;\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","diameter","margin","pack","layout","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","getCurrentClassDataAndMarkSelected","obj","selected","closeClassInfoPanel","uniqBy","clickCancel","zoom","$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,KA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A2BkB,GAClByI,QAAQqB,YAAY9J,IACrBZ,EAAoB+I,IAAI9I,EAAOiC,8BAA+BtB,GAitBtDkK,CAAkBlK,GAClBgJ,EAAoBvF,GAAM,KAC3B,OACJ,GAEHL,EAAyB3D,EAAM8I,OAAO,sBAAsB,SAAU1I,GAClEuJ,EAAsBvJ,EAAoBgJ,GAAQ,MACnD,GAMHvF,EAA8B7D,EAAM6F,IAAI,+BAA+B,SAAUtM,GACzE+Q,GACAlI,EAAQkI,MAIhB1G,EAAyB5D,EAAM6F,IAAI,iBAAiB,SAAUtM,EAAOmR,IACjEJ,EAAuBxG,EAAmB4G,EAAcnM,QAEpD6D,EAAQkI,UAIrB,GA3xBHK,CAAoB3K,KA7B5BgJ,QACK4B,OAAO,kDAAmD,CACvD,mDACA,gDAEHC,SAAS,gBAAiB,KAC1BA,SAAS,gBAAiB,uBAC1BC,UAAU,oBAAqB9L,GAEpCA,EAAwB+L,QAAU,CAAC,aAAc,YAAa,uBAAwB,UAAW,WAAY,gBAAiB,kBAAmB,SAAU,gBAAiB,gBAAiB,sBAAuB,SAAU","file":"18.44723ea06155c72f46ae.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.0.2\");\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 .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\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 obj = newobj;\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 (d.id) {\n $window.history.replaceState({id: d.id}, \"classHierarchyPage\" + d.id, \"hierarchy#\" + d.id);\n }\n\n if (focus === d) {\n return;\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":""}