graphdb-workbench 2.2.3-TR3 → 2.2.3

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 (53) hide show
  1. package/dist/11.f7cb87be309f6bd00aa5.bundle.js +1 -1
  2. package/dist/11.f7cb87be309f6bd00aa5.bundle.js.map +1 -1
  3. package/dist/148.45985ae23de642595544.bundle.js +1 -1
  4. package/dist/148.45985ae23de642595544.bundle.js.map +1 -1
  5. package/dist/20.4eb25ede434dc329ecf1.bundle.js +1 -1
  6. package/dist/20.4eb25ede434dc329ecf1.bundle.js.map +1 -1
  7. package/dist/27.fef157d9275358c9f1a0.bundle.js +1 -1
  8. package/dist/27.fef157d9275358c9f1a0.bundle.js.map +1 -1
  9. package/dist/33.fde8076c81c87c25c367.bundle.js +1 -1
  10. package/dist/33.fde8076c81c87c25c367.bundle.js.map +1 -1
  11. package/dist/4.ca3eb6b5da0890c0abe0.bundle.js +2 -0
  12. package/dist/4.ca3eb6b5da0890c0abe0.bundle.js.map +1 -0
  13. package/dist/40.10f42e3f6d8d87bd3221.bundle.js +1 -1
  14. package/dist/40.10f42e3f6d8d87bd3221.bundle.js.map +1 -1
  15. package/dist/94.94158487a9024ff3a623.bundle.js +1 -1
  16. package/dist/94.94158487a9024ff3a623.bundle.js.map +1 -1
  17. package/dist/{bundle.ad25ae9ac5a096a64118.bundle.js → bundle.d34ddcc40dd190254f1c.bundle.js} +3 -3
  18. package/dist/{bundle.ad25ae9ac5a096a64118.bundle.js.map → bundle.d34ddcc40dd190254f1c.bundle.js.map} +1 -1
  19. package/dist/i18n/locale-en.json +1 -1
  20. package/dist/i18n/locale-fr.json +1 -1
  21. package/dist/index.html +3 -3
  22. package/dist/js/angular/core/directives/rdfresourcesearch/templates/rdfResourceSearchTemplate.html +1 -1
  23. package/dist/pages/autocomplete.html +1 -1
  24. package/dist/pages/choose-repository-type.html +1 -1
  25. package/dist/pages/cluster-management/clusterInfo.html +5 -5
  26. package/dist/pages/create-index.html +4 -4
  27. package/dist/pages/dependencies.html +1 -1
  28. package/dist/pages/domainRangeInfo.html +2 -2
  29. package/dist/pages/edit.html +1 -1
  30. package/dist/pages/explore.html +1 -1
  31. package/dist/pages/export.html +1 -1
  32. package/dist/pages/find.html +1 -1
  33. package/dist/pages/graph-config/saveGraphConfig.html +11 -11
  34. package/dist/pages/graphs-visualizations.html +7 -7
  35. package/dist/pages/guides.html +1 -1
  36. package/dist/pages/import.html +1 -1
  37. package/dist/pages/jdbc-create.html +5 -5
  38. package/dist/pages/monitor/queries.html +1 -1
  39. package/dist/pages/monitor/resources.html +2 -2
  40. package/dist/pages/namespaces.html +2 -2
  41. package/dist/pages/plugins.html +1 -1
  42. package/dist/pages/rdfClassHierarchyInfo.html +7 -7
  43. package/dist/pages/rdfrank.html +2 -2
  44. package/dist/pages/repositories.html +2 -2
  45. package/dist/pages/repository.html +2 -2
  46. package/dist/pages/similarity-indexes.html +1 -1
  47. package/dist/pages/sparql-template-create.html +5 -5
  48. package/dist/pages/sparql.html +3 -3
  49. package/dist/pages/webapi.html +2 -2
  50. package/dist/res/swagger/index.html +27 -27
  51. package/package.json +1 -1
  52. package/dist/4.9bdad67508aabe526dcc.bundle.js +0 -2
  53. package/dist/4.9bdad67508aabe526dcc.bundle.js.map +0 -1
@@ -1,2 +1,2 @@
1
- (window.webpackJsonp=window.webpackJsonp||[]).push([[33],{256:function(t,e,r){"use strict";var a=a||{};a.Text=function(){function t(t,e,r,a){r=r||10;var n=e/3;return"string"==typeof t?(n*=10/(t.substring(0,e/3).length+1.5),n+=1,t.match(/[\u0900-\u0DFF\u1100-\u11FF\u2E80-\u2EFF\u3000-\u9FFF]/)&&(n*=.6),n<r&&(n=r),Math.round(n)):(n<r&&(n=r),Math.round(n))}return{calcFontSizeRaw:t,calcFontSize:function(e,r,a,n){return t(e,r,a)+"px"},getTextWithElipsisIfNeeded:function(t,e){return"string"==typeof t&&t.length>e?t.substring(0,e-3)+"...":t}}}(),a.Transition={fadeIn:function(t,e){t.style("opacity",0).transition().duration(e).style("opacity",1)},fadeOut:function(t,e){t.style("opacity",1).transition().duration(e).style("opacity",0)}},a.Click={delayDblClick:function(){var t=d3.dispatch("click","dblclick");return d3.rebind((function(e){var r,a=null;e.on("mousedown",(function(){r=d3.mouse(document.body),new Date})),e.on("mouseup",(function(e){var n,o;n=r,o=d3.mouse(document.body),Math.sqrt(Math.pow(n[0]-o[0],2),Math.pow(n[1]-o[1],2))>5||(a?(window.clearTimeout(a),a=null,t.dblclick(e)):a=window.setTimeout((d3.event,function(){t.click(e),a=null}),250))}))}),t,"on")}},e.a=a},257:function(t,e,r){"use strict";var a=a||{};a.Export={getCSSRules:function(t){var e=$('link[href="'+t+'"]')[0].sheet.rules,r="";return _.each(e,(function(t){r+=t.cssText})),r},generateBase64ImageSource:function(){var t=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(t)))}},e.a=a},84:function(t,e,r){"use strict";r.r(e);var a=r(257),n=r(256);r(5);function o(t,e,r,o,s,i,c,l,d,u,p,f,g){return{restrict:"AE",template:'<div id="domain-range"></div>',scope:{showPredicatesInfoPanel:"=",selectedPredicate:"=",collapseEdges:"="},link:function(u){const p=l((function(){!function(u){d3.selection.prototype.moveToFront=function(){return this.each((function(){d3.select(this.parentNode.appendChild(this))}))},d3.selection.prototype.moveToBack=function(){return this.each((function(){const t=this.parentNode.firstChild;t&&this.parentNode.insertBefore(this,t)}))};var p=d3.layout.force().size([1200,600]).charge(-900),h=p.drag().on("dragstart",(function(t){d3.select(this).classed("selected",t.selected=!0)})),y=d3.select("#domain-range").append("svg").attr("viewBox","0 0 1200 600").attr("preserveAspectRatio","xMidYMid meet").on("dblclick.zoom",null),x=y.append("defs");x.append("marker").attr({id:"arrow",viewBox:"0 -5 10 10",refX:10,refY:0,markerUnits:"strokeWidth",markerWidth:5,markerHeight:5,orient:"auto",fill:f}).append("path").attr({d:"M0,-5L10,0L0,5",class:"arrowHead"}),x.append("marker").attr({id:"collapsed-arrow",viewBox:"0 -5 10 10",refX:9,refY:0,markerUnits:"strokeWidth",markerWidth:4,markerHeight:4,orient:"auto",fill:f}).append("path").attr({d:"M0,-5L10,0L0,5",class:"arrowHead"}),x.append("marker").attr({id:"arrow-loop",viewBox:"0 -5 10 10",refX:7,refY:0,markerUnits:"strokeWidth",markerWidth:5,markerHeight:5,orient:"auto",fill:f}).append("path").attr({d:"M0,-5L10,0L0,5",class:"arrowHead"}),d3.select("#download-svg").on("mouseover",(function(){var t=a.a.Export.getCSSRules("css/domain-range-graph.css?v=2.2.3-TR3");$("defs").append('<style type="text/css"><![CDATA['+t+"]]></style>");var e=a.a.Export.generateBase64ImageSource();d3.select(this).attr({href:e,download:"domain-range-graph-"+r.getActiveRepository()+".svg"})}));var m=d3.select(".legend-container").append("svg").attr("viewBox","0 0 "+1200/7+" "+1200/7*1.2).attr("preserveAspectRatio","xMidYMid meet");m.append("rect").attr({width:1200/7,height:1200/7*1.2}).style("fill","rgba(235, 235, 235, 0.9)");var v=16+1200/18/2.5,k=v+1200/90;m.append("circle").attr({class:"legend-class-node",cx:(16+v)/2,cy:30,r:1200/18/4.5});m.append("text").attr({x:k,y:30+1200/370}).style("font-size",1200/90/1.1+"px").text("main class node");m.append("circle").attr({class:"legend-object-node",cx:(16+v)/2,cy:70,r:1200/110/1.25});m.append("text").attr({x:k,y:30+1200/370+40}).style("font-size",1200/90/1.1+"px").text("class node");m.append("circle").attr({class:"legend-datatype-node",cx:(16+v)/2,cy:70+1200/45,r:1200/110/2});m.append("text").attr({x:k,y:99.90990990990991}).style("font-size",1200/90/1.1+"px").text("datatype node");d3.select(".legend-class-node");m.append("line").attr({class:"property-arrow",x1:16,y1:123.33333333333334,x2:v,y2:123.33333333333334}).style("stroke-width",1.2).attr("marker-end","url("+s.absUrl()+"#arrow)"),m.append("text").attr({x:k,y:126.57657657657658}).style("font-size",1200/90/1.1+"px").text("explicit property");m.append("line").attr({class:"implicit-property-arrow",x1:16,y1:150,x2:v,y2:150}).style("stroke-width",1.2).attr("marker-end","url("+s.absUrl()+"#arrow)"),m.append("text").attr({x:k,y:150+1200/370}).style("font-size",1200/90/1.1+"px").text("implicit property");m.append("line").attr({class:"collapsed-property-arrow",x1:16,y1:150+1200/45,x2:v,y2:150+1200/45}).style("stroke-width",2).attr("marker-end","url("+s.absUrl()+"#collapsed-arrow)"),m.append("text").attr({x:k,y:179.9099099099099}).style("font-size",1200/90/1.1+"px").text("collapsed property");var b=y,w=s.search().uri,E=s.search().name,N=s.search().collapsed;o.getDomainRangeData(w,N).success((function(t,e,r){u.domainRangeGraphData=t})).error((function(t){d.error("Request for "+E+" failed!")})),$(window).on("popstate",(function(){i.set(c.DOMAIN_RANGE_WENT_BACK,!0)})),e.onpopstate=function(e){e.state&&t.$broadcast("changeCollapsedEdgesState",e.state.collapsed)},u.$watch("collapseEdges",(function(){angular.isUndefined(u.collapseEdges)||(i.set(c.DOMAIN_RANGE_COLLAPSE_EDGES,u.collapseEdges),"true"!==i.get(c.DOMAIN_RANGE_WENT_BACK)&&function(e){t.$broadcast("switchEdgeMode",{uri:w,name:E,collapsed:e})}(u.collapseEdges),i.remove(c.DOMAIN_RANGE_WENT_BACK))})),u.$watch("domainRangeGraphData",(function(){if(u.domainRangeGraphData){var r=angular.copy(u.domainRangeGraphData);p.nodes(r.nodes).links(r.links);var a=b.selectAll(".link").data(r.links).enter().append("g");function o(t){t.style("stroke",f),t.style("stroke-width",2),t.attr("marker-end","url("+s.absUrl()+"#collapsed-arrow)")}var i,c,d=0;a.each((function(t){if(t.objectPropNodeClassUri!==w)i=a.append("line").attr({class:"link","marker-end":"url("+s.absUrl()+"#arrow)"}).style("stroke-width",1.2).each((function(t){switch(t.propertyType){case"objectLeft":t.targetRadius=1200/18;break;case"objectRight":t.targetRadius=1200/110;break;case"datatype":t.targetRadius=1200/110/2;break;default:t.targetRadius=0}var e=d3.select(this);t.targetNodeEdgeCount>1?o(e):t.implicit&&e.style("stroke-dasharray","3, 3")}));else{if(angular.isUndefined(c)){c=d3.select(this).append("path").attr({d:"M 0 0 A "+1200/18/2+" "+1200/18/2+" 0 1 1 0 "+1200/18/2,class:"loop-link",fill:"none","marker-end":"url("+s.absUrl()+"#arrow-loop)"}).style("stroke-width",1.2)}(d+=t.targetNodeEdgeCount)>1&&o(d3.select(".loop-link"))}}));var y={};function x(){$.isEmptyObject(y)||(y.text.style("fill","black"),y.background.style("fill","#f0f0f0"))}function m(t){x(),y.text=d3.select(this),y.background=d3.select(this.previousSibling),y.text.style("fill","white"),y.background.style("fill",f),l((function(){u.showPredicatesInfoPanel=!0,u.selectedPredicate=t})),d3.event.stopPropagation()}$("document").ready((function(){$("#domain-range").bind("click",x)}));var v=a.append("text").attr("class",(function(t){return t.objectPropNodeClassUri===w?"loop-link-property-name":"property-name"})).attr("dx",(function(t){return 1200/18/2*("objectLeft"===t.propertyType?1:-1)})).style("text-anchor",(function(t){return"objectLeft"===t.propertyType?"end":"start"})).style("font-size",1200/90).text((function(t){return t.targetNodeEdgeCount>1?t.targetNodeEdgeCount+" predicates":t.name}));v.each((function(t){var r=d3.select(this);/\d\spredicates/.test(r.text())?r.style("font-weight","bold").on("click",m):r.on("click",(function(t){e.open("resource?uri="+encodeURIComponent(t.uri),"_blank")}))}));var k=a.append("rect").attr("class",(function(t){return t.objectPropNodeClassUri!==w?"link-background":"loop-link-background"})).attr("width",(function(t){return t.calculatedWidth=this.previousSibling.getBBox().width,t.calculatedWidth+4})).attr("height",(function(t){return t.calculatedHeight=this.previousSibling.getBBox().height,t.calculatedHeight+2})).attr("transform",(function(t){var e=2-1200/18/2*("objectLeft"===t.propertyType?1:-1);return"objectLeft"===t.propertyType&&(e+=t.calculatedWidth),"translate(-"+e+",-"+(2+t.calculatedHeight/2)+")"})).on("click",(function(t){d3.event.stopPropagation()})),N=b.selectAll(".node").data(r.nodes).enter().append("g"),R=N.filter((function(t){return t.objectPropClassUri!==w})).append("circle").each((function(t){var e=d3.select(this);"main"===t.classPosition?e.attr({class:"class-node",r:1200/18}).attr("marker-end","url("+s.absUrl()+"#loop-link)"):null===t.objectPropClassName?e.attr({class:"datatype-node",r:1200/110/2}):e.attr({class:"object-prop-node",r:1200/110})})).call(h);d3.selectAll(".object-prop-node").on("dblclick",(function(e,r){u.$apply((function(){t.$broadcast("reloadDomainRangeGraphView",e,r)}))})),N.filter((function(t){return t.objectPropClassName&&t.objectPropClassUri!==w})).append("text").attr("class",(function(t){return t.classPosition+"-class-label"})).style("font-size",1200/90).text((function(t){return t.objectPropClassName})).on("click",(function(t){e.open("resource?uri="+encodeURIComponent(t.objectPropClassUri),"_blank")}));var C=N.select("text");b.select(".class-node").each((function(){d3.select(this.parentNode).append("text").attr("class","rdf-class-label").style("font-size",(function(t){return n.a.Text.calcFontSize(E,1200/18)})).text(E).on("click",(function(t){e.open("resource?uri="+encodeURIComponent(w),"_blank")}))}));var T=b.select(".class-node + text"),A=d3.select(".class-node"),L=d3.selectAll(".loop-link-background"),_=d3.selectAll(".loop-link-property-name");if(v=d3.selectAll(".property-name"),!angular.isUndefined(c)){var M=[];L.each((function(t,e){d3.select(this);M.push({idx:e,width:t.calculatedWidth,height:t.calculatedHeight})}))}p.on("tick",(function(t){var e=8*t.alpha;function r(t){var e=t.x+1200/18*2,r=t.y-1200/18/1.9;var a=[];L.each((function(n,o){a.push(n),o<g?function(a,n){var o=$.grep(M,(function(t){return t.idx==n}));n>0&&(e+=parseFloat(n*(o[0].height/(n/1.4)))),a.attr({transform:"rotate(270, "+t.x+","+t.y+") translate("+e+","+r+")",width:o[0].height,height:o[0].width})}(d3.select(this),o):d3.select(this).remove()})),function(t){var e;d3.select(".view-more-preds-label").style("font-weight","bold").each((function(r){r.target.allEdges=t,e=this.getComputedTextLength()})).on("click",m),d3.select(".view-more-preds-rect").attr("height",e+4)}(a)}i.filter((function(t){return t.objectPropNodeClassUri!==w})).attr("x1",(function(t){return t.source.x})).attr("y1",(function(t){return t.source.y})).attr("x2",(function(t){return t.targetX})).attr("y2",(function(t){return t.targetY})).each((function(t){!function(t){"objectLeft"===t.propertyType?(t.source.x-=8*e,t.source.y-=e/9):(t.target.x+=8*e,t.target.y-=e/9)}(t);var r=Math.atan2(t.target.y-t.source.y,t.target.x-t.source.x);t.targetX=t.target.x-Math.cos(r)*t.targetRadius,t.targetY=t.target.y-Math.sin(r)*t.targetRadius})),R.each((function(t){"main"!==t.classPosition||angular.isUndefined(c)||(!function(t){var e=t.x+64,r=t.y-1200/18/5.7-5;c.attr("transform","rotate(270, "+t.x+","+t.y+") translate("+e+","+r+")")}(t),function(t){function e(e,r){var a=$.grep(M,(function(t){return t.idx==r})),n=0;r>0&&(n=parseFloat(2*r*(a[0].height/1.4)));var o=t.x,s=t.y-1200/18*2.1-n;e.attr({x:o,y:s}).moveToFront()}_.each((function(t,r){var a=d3.select(this),n=_.size()-g;n<0?e(a,r):(0==r&&!u.collapseEdges&&n>1&&(!function(t,e,r){t.classed("view-more-preds-label",!0).text(r+" predicates more ..."),null!==this.nextSibling&&e.classed("view-more-preds-rect",!0)}(a,d3.select(this.nextSibling),n),e(a,r)),r<g?e(a,r):a.remove())}))}(t),r(t)),t.objectPropClassUri!==w&&d3.select(this).attr("cx",(function(t){return"main"===t.classPosition?function(t){!window.ActiveXObject&&"ActiveXObject"in window&&(Math.log10=function(t){return Math.log(t)/Math.LN10});var e=A.attr("cx")-600,r=.5*Math.log10(Math.abs(e));return t.x+=e>0?-r:r,t.x}(t):t.x})).attr("cy",(function(t){return t.y}))})),T.attr("x",(function(t){return t.x})).attr("y",(function(t){return t.y})).moveToFront(),k.filter((function(t){return t.objectPropNodeClassUri!==w})).attr("x",(function(t){return t.target.x>t.source.x?t.source.x+(t.target.x-t.source.x)/2:t.target.x+(t.source.x-t.target.x)/2})).attr("y",(function(t){return t.target.y>t.source.y?t.source.y+(t.target.y-t.source.y)/2:t.target.y+(t.source.y-t.target.y)/2})).moveToFront(),v.attr("x",(function(t){return t.target.x>t.source.x?t.source.x+(t.target.x-t.source.x)/2:t.target.x+(t.source.x-t.target.x)/2})).attr("y",(function(t){return t.target.y>t.source.y?t.source.y+(t.target.y-t.source.y)/2:t.target.y+(t.source.y-t.target.y)/2})).moveToFront(),C.attr("x",(function(t){return"right"===t.classPosition?t.x+1200/110*1.2:t.x-1200/110*1.2})).attr("y",(function(t){return t.y})).moveToFront()})).linkDistance(1200/3.5).start()}}))}(u)}),50);u.$on("$destroy",(function(){l.cancel(p)}))}}}angular.module("graphdb.framework.graphexplore.directives.domainrange",["graphdb.framework.graphexplore.controllers.domainrange","graphdb.framework.utils.localstorageadapter"]).constant("ONTO_RED","var(--onto-orange)").constant("ONTO_GREEN","var(--onto-green)").constant("ONTO_BLUE","var(--onto-blue)").constant("NON_COLLAPSED_REFLEXIVE_LINK_LIMIT",6).directive("domainRangeGraph",o),o.$inject=["$rootScope","$window","$repositories","GraphDataRestService","$location","LocalStorageAdapter","LSKeys","$timeout","toastr","ONTO_RED","ONTO_GREEN","ONTO_BLUE","NON_COLLAPSED_REFLEXIVE_LINK_LIMIT"]}}]);
1
+ (window.webpackJsonp=window.webpackJsonp||[]).push([[33],{256:function(t,e,r){"use strict";var a=a||{};a.Text=function(){function t(t,e,r,a){r=r||10;var n=e/3;return"string"==typeof t?(n*=10/(t.substring(0,e/3).length+1.5),n+=1,t.match(/[\u0900-\u0DFF\u1100-\u11FF\u2E80-\u2EFF\u3000-\u9FFF]/)&&(n*=.6),n<r&&(n=r),Math.round(n)):(n<r&&(n=r),Math.round(n))}return{calcFontSizeRaw:t,calcFontSize:function(e,r,a,n){return t(e,r,a)+"px"},getTextWithElipsisIfNeeded:function(t,e){return"string"==typeof t&&t.length>e?t.substring(0,e-3)+"...":t}}}(),a.Transition={fadeIn:function(t,e){t.style("opacity",0).transition().duration(e).style("opacity",1)},fadeOut:function(t,e){t.style("opacity",1).transition().duration(e).style("opacity",0)}},a.Click={delayDblClick:function(){var t=d3.dispatch("click","dblclick");return d3.rebind((function(e){var r,a=null;e.on("mousedown",(function(){r=d3.mouse(document.body),new Date})),e.on("mouseup",(function(e){var n,o;n=r,o=d3.mouse(document.body),Math.sqrt(Math.pow(n[0]-o[0],2),Math.pow(n[1]-o[1],2))>5||(a?(window.clearTimeout(a),a=null,t.dblclick(e)):a=window.setTimeout((d3.event,function(){t.click(e),a=null}),250))}))}),t,"on")}},e.a=a},257:function(t,e,r){"use strict";var a=a||{};a.Export={getCSSRules:function(t){var e=$('link[href="'+t+'"]')[0].sheet.rules,r="";return _.each(e,(function(t){r+=t.cssText})),r},generateBase64ImageSource:function(){var t=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(t)))}},e.a=a},84:function(t,e,r){"use strict";r.r(e);var a=r(257),n=r(256);r(5);function o(t,e,r,o,s,i,c,l,d,u,p,f,g){return{restrict:"AE",template:'<div id="domain-range"></div>',scope:{showPredicatesInfoPanel:"=",selectedPredicate:"=",collapseEdges:"="},link:function(u){const p=l((function(){!function(u){d3.selection.prototype.moveToFront=function(){return this.each((function(){d3.select(this.parentNode.appendChild(this))}))},d3.selection.prototype.moveToBack=function(){return this.each((function(){const t=this.parentNode.firstChild;t&&this.parentNode.insertBefore(this,t)}))};var p=d3.layout.force().size([1200,600]).charge(-900),h=p.drag().on("dragstart",(function(t){d3.select(this).classed("selected",t.selected=!0)})),y=d3.select("#domain-range").append("svg").attr("viewBox","0 0 1200 600").attr("preserveAspectRatio","xMidYMid meet").on("dblclick.zoom",null),x=y.append("defs");x.append("marker").attr({id:"arrow",viewBox:"0 -5 10 10",refX:10,refY:0,markerUnits:"strokeWidth",markerWidth:5,markerHeight:5,orient:"auto",fill:f}).append("path").attr({d:"M0,-5L10,0L0,5",class:"arrowHead"}),x.append("marker").attr({id:"collapsed-arrow",viewBox:"0 -5 10 10",refX:9,refY:0,markerUnits:"strokeWidth",markerWidth:4,markerHeight:4,orient:"auto",fill:f}).append("path").attr({d:"M0,-5L10,0L0,5",class:"arrowHead"}),x.append("marker").attr({id:"arrow-loop",viewBox:"0 -5 10 10",refX:7,refY:0,markerUnits:"strokeWidth",markerWidth:5,markerHeight:5,orient:"auto",fill:f}).append("path").attr({d:"M0,-5L10,0L0,5",class:"arrowHead"}),d3.select("#download-svg").on("mouseover",(function(){var t=a.a.Export.getCSSRules("css/domain-range-graph.css?v=2.2.3");$("defs").append('<style type="text/css"><![CDATA['+t+"]]></style>");var e=a.a.Export.generateBase64ImageSource();d3.select(this).attr({href:e,download:"domain-range-graph-"+r.getActiveRepository()+".svg"})}));var m=d3.select(".legend-container").append("svg").attr("viewBox","0 0 "+1200/7+" "+1200/7*1.2).attr("preserveAspectRatio","xMidYMid meet");m.append("rect").attr({width:1200/7,height:1200/7*1.2}).style("fill","rgba(235, 235, 235, 0.9)");var v=16+1200/18/2.5,k=v+1200/90;m.append("circle").attr({class:"legend-class-node",cx:(16+v)/2,cy:30,r:1200/18/4.5});m.append("text").attr({x:k,y:30+1200/370}).style("font-size",1200/90/1.1+"px").text("main class node");m.append("circle").attr({class:"legend-object-node",cx:(16+v)/2,cy:70,r:1200/110/1.25});m.append("text").attr({x:k,y:30+1200/370+40}).style("font-size",1200/90/1.1+"px").text("class node");m.append("circle").attr({class:"legend-datatype-node",cx:(16+v)/2,cy:70+1200/45,r:1200/110/2});m.append("text").attr({x:k,y:99.90990990990991}).style("font-size",1200/90/1.1+"px").text("datatype node");d3.select(".legend-class-node");m.append("line").attr({class:"property-arrow",x1:16,y1:123.33333333333334,x2:v,y2:123.33333333333334}).style("stroke-width",1.2).attr("marker-end","url("+s.absUrl()+"#arrow)"),m.append("text").attr({x:k,y:126.57657657657658}).style("font-size",1200/90/1.1+"px").text("explicit property");m.append("line").attr({class:"implicit-property-arrow",x1:16,y1:150,x2:v,y2:150}).style("stroke-width",1.2).attr("marker-end","url("+s.absUrl()+"#arrow)"),m.append("text").attr({x:k,y:150+1200/370}).style("font-size",1200/90/1.1+"px").text("implicit property");m.append("line").attr({class:"collapsed-property-arrow",x1:16,y1:150+1200/45,x2:v,y2:150+1200/45}).style("stroke-width",2).attr("marker-end","url("+s.absUrl()+"#collapsed-arrow)"),m.append("text").attr({x:k,y:179.9099099099099}).style("font-size",1200/90/1.1+"px").text("collapsed property");var b=y,w=s.search().uri,E=s.search().name,N=s.search().collapsed;o.getDomainRangeData(w,N).success((function(t,e,r){u.domainRangeGraphData=t})).error((function(t){d.error("Request for "+E+" failed!")})),$(window).on("popstate",(function(){i.set(c.DOMAIN_RANGE_WENT_BACK,!0)})),e.onpopstate=function(e){e.state&&t.$broadcast("changeCollapsedEdgesState",e.state.collapsed)},u.$watch("collapseEdges",(function(){angular.isUndefined(u.collapseEdges)||(i.set(c.DOMAIN_RANGE_COLLAPSE_EDGES,u.collapseEdges),"true"!==i.get(c.DOMAIN_RANGE_WENT_BACK)&&function(e){t.$broadcast("switchEdgeMode",{uri:w,name:E,collapsed:e})}(u.collapseEdges),i.remove(c.DOMAIN_RANGE_WENT_BACK))})),u.$watch("domainRangeGraphData",(function(){if(u.domainRangeGraphData){var r=angular.copy(u.domainRangeGraphData);p.nodes(r.nodes).links(r.links);var a=b.selectAll(".link").data(r.links).enter().append("g");function o(t){t.style("stroke",f),t.style("stroke-width",2),t.attr("marker-end","url("+s.absUrl()+"#collapsed-arrow)")}var i,c,d=0;a.each((function(t){if(t.objectPropNodeClassUri!==w)i=a.append("line").attr({class:"link","marker-end":"url("+s.absUrl()+"#arrow)"}).style("stroke-width",1.2).each((function(t){switch(t.propertyType){case"objectLeft":t.targetRadius=1200/18;break;case"objectRight":t.targetRadius=1200/110;break;case"datatype":t.targetRadius=1200/110/2;break;default:t.targetRadius=0}var e=d3.select(this);t.targetNodeEdgeCount>1?o(e):t.implicit&&e.style("stroke-dasharray","3, 3")}));else{if(angular.isUndefined(c)){c=d3.select(this).append("path").attr({d:"M 0 0 A "+1200/18/2+" "+1200/18/2+" 0 1 1 0 "+1200/18/2,class:"loop-link",fill:"none","marker-end":"url("+s.absUrl()+"#arrow-loop)"}).style("stroke-width",1.2)}(d+=t.targetNodeEdgeCount)>1&&o(d3.select(".loop-link"))}}));var y={};function x(){$.isEmptyObject(y)||(y.text.style("fill","black"),y.background.style("fill","#f0f0f0"))}function m(t){x(),y.text=d3.select(this),y.background=d3.select(this.previousSibling),y.text.style("fill","white"),y.background.style("fill",f),l((function(){u.showPredicatesInfoPanel=!0,u.selectedPredicate=t})),d3.event.stopPropagation()}$("document").ready((function(){$("#domain-range").bind("click",x)}));var v=a.append("text").attr("class",(function(t){return t.objectPropNodeClassUri===w?"loop-link-property-name":"property-name"})).attr("dx",(function(t){return 1200/18/2*("objectLeft"===t.propertyType?1:-1)})).style("text-anchor",(function(t){return"objectLeft"===t.propertyType?"end":"start"})).style("font-size",1200/90).text((function(t){return t.targetNodeEdgeCount>1?t.targetNodeEdgeCount+" predicates":t.name}));v.each((function(t){var r=d3.select(this);/\d\spredicates/.test(r.text())?r.style("font-weight","bold").on("click",m):r.on("click",(function(t){e.open("resource?uri="+encodeURIComponent(t.uri),"_blank")}))}));var k=a.append("rect").attr("class",(function(t){return t.objectPropNodeClassUri!==w?"link-background":"loop-link-background"})).attr("width",(function(t){return t.calculatedWidth=this.previousSibling.getBBox().width,t.calculatedWidth+4})).attr("height",(function(t){return t.calculatedHeight=this.previousSibling.getBBox().height,t.calculatedHeight+2})).attr("transform",(function(t){var e=2-1200/18/2*("objectLeft"===t.propertyType?1:-1);return"objectLeft"===t.propertyType&&(e+=t.calculatedWidth),"translate(-"+e+",-"+(2+t.calculatedHeight/2)+")"})).on("click",(function(t){d3.event.stopPropagation()})),N=b.selectAll(".node").data(r.nodes).enter().append("g"),R=N.filter((function(t){return t.objectPropClassUri!==w})).append("circle").each((function(t){var e=d3.select(this);"main"===t.classPosition?e.attr({class:"class-node",r:1200/18}).attr("marker-end","url("+s.absUrl()+"#loop-link)"):null===t.objectPropClassName?e.attr({class:"datatype-node",r:1200/110/2}):e.attr({class:"object-prop-node",r:1200/110})})).call(h);d3.selectAll(".object-prop-node").on("dblclick",(function(e,r){u.$apply((function(){t.$broadcast("reloadDomainRangeGraphView",e,r)}))})),N.filter((function(t){return t.objectPropClassName&&t.objectPropClassUri!==w})).append("text").attr("class",(function(t){return t.classPosition+"-class-label"})).style("font-size",1200/90).text((function(t){return t.objectPropClassName})).on("click",(function(t){e.open("resource?uri="+encodeURIComponent(t.objectPropClassUri),"_blank")}));var C=N.select("text");b.select(".class-node").each((function(){d3.select(this.parentNode).append("text").attr("class","rdf-class-label").style("font-size",(function(t){return n.a.Text.calcFontSize(E,1200/18)})).text(E).on("click",(function(t){e.open("resource?uri="+encodeURIComponent(w),"_blank")}))}));var T=b.select(".class-node + text"),A=d3.select(".class-node"),L=d3.selectAll(".loop-link-background"),_=d3.selectAll(".loop-link-property-name");if(v=d3.selectAll(".property-name"),!angular.isUndefined(c)){var M=[];L.each((function(t,e){d3.select(this);M.push({idx:e,width:t.calculatedWidth,height:t.calculatedHeight})}))}p.on("tick",(function(t){var e=8*t.alpha;function r(t){var e=t.x+1200/18*2,r=t.y-1200/18/1.9;var a=[];L.each((function(n,o){a.push(n),o<g?function(a,n){var o=$.grep(M,(function(t){return t.idx==n}));n>0&&(e+=parseFloat(n*(o[0].height/(n/1.4)))),a.attr({transform:"rotate(270, "+t.x+","+t.y+") translate("+e+","+r+")",width:o[0].height,height:o[0].width})}(d3.select(this),o):d3.select(this).remove()})),function(t){var e;d3.select(".view-more-preds-label").style("font-weight","bold").each((function(r){r.target.allEdges=t,e=this.getComputedTextLength()})).on("click",m),d3.select(".view-more-preds-rect").attr("height",e+4)}(a)}i.filter((function(t){return t.objectPropNodeClassUri!==w})).attr("x1",(function(t){return t.source.x})).attr("y1",(function(t){return t.source.y})).attr("x2",(function(t){return t.targetX})).attr("y2",(function(t){return t.targetY})).each((function(t){!function(t){"objectLeft"===t.propertyType?(t.source.x-=8*e,t.source.y-=e/9):(t.target.x+=8*e,t.target.y-=e/9)}(t);var r=Math.atan2(t.target.y-t.source.y,t.target.x-t.source.x);t.targetX=t.target.x-Math.cos(r)*t.targetRadius,t.targetY=t.target.y-Math.sin(r)*t.targetRadius})),R.each((function(t){"main"!==t.classPosition||angular.isUndefined(c)||(!function(t){var e=t.x+64,r=t.y-1200/18/5.7-5;c.attr("transform","rotate(270, "+t.x+","+t.y+") translate("+e+","+r+")")}(t),function(t){function e(e,r){var a=$.grep(M,(function(t){return t.idx==r})),n=0;r>0&&(n=parseFloat(2*r*(a[0].height/1.4)));var o=t.x,s=t.y-1200/18*2.1-n;e.attr({x:o,y:s}).moveToFront()}_.each((function(t,r){var a=d3.select(this),n=_.size()-g;n<0?e(a,r):(0==r&&!u.collapseEdges&&n>1&&(!function(t,e,r){t.classed("view-more-preds-label",!0).text(r+" predicates more ..."),null!==this.nextSibling&&e.classed("view-more-preds-rect",!0)}(a,d3.select(this.nextSibling),n),e(a,r)),r<g?e(a,r):a.remove())}))}(t),r(t)),t.objectPropClassUri!==w&&d3.select(this).attr("cx",(function(t){return"main"===t.classPosition?function(t){!window.ActiveXObject&&"ActiveXObject"in window&&(Math.log10=function(t){return Math.log(t)/Math.LN10});var e=A.attr("cx")-600,r=.5*Math.log10(Math.abs(e));return t.x+=e>0?-r:r,t.x}(t):t.x})).attr("cy",(function(t){return t.y}))})),T.attr("x",(function(t){return t.x})).attr("y",(function(t){return t.y})).moveToFront(),k.filter((function(t){return t.objectPropNodeClassUri!==w})).attr("x",(function(t){return t.target.x>t.source.x?t.source.x+(t.target.x-t.source.x)/2:t.target.x+(t.source.x-t.target.x)/2})).attr("y",(function(t){return t.target.y>t.source.y?t.source.y+(t.target.y-t.source.y)/2:t.target.y+(t.source.y-t.target.y)/2})).moveToFront(),v.attr("x",(function(t){return t.target.x>t.source.x?t.source.x+(t.target.x-t.source.x)/2:t.target.x+(t.source.x-t.target.x)/2})).attr("y",(function(t){return t.target.y>t.source.y?t.source.y+(t.target.y-t.source.y)/2:t.target.y+(t.source.y-t.target.y)/2})).moveToFront(),C.attr("x",(function(t){return"right"===t.classPosition?t.x+1200/110*1.2:t.x-1200/110*1.2})).attr("y",(function(t){return t.y})).moveToFront()})).linkDistance(1200/3.5).start()}}))}(u)}),50);u.$on("$destroy",(function(){l.cancel(p)}))}}}angular.module("graphdb.framework.graphexplore.directives.domainrange",["graphdb.framework.graphexplore.controllers.domainrange","graphdb.framework.utils.localstorageadapter"]).constant("ONTO_RED","var(--onto-orange)").constant("ONTO_GREEN","var(--onto-green)").constant("ONTO_BLUE","var(--onto-blue)").constant("NON_COLLAPSED_REFLEXIVE_LINK_LIMIT",6).directive("domainRangeGraph",o),o.$inject=["$rootScope","$window","$repositories","GraphDataRestService","$location","LocalStorageAdapter","LSKeys","$timeout","toastr","ONTO_RED","ONTO_GREEN","ONTO_BLUE","NON_COLLAPSED_REFLEXIVE_LINK_LIMIT"]}}]);
2
2
  //# sourceMappingURL=33.fde8076c81c87c25c367.bundle.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["webpack:///./src/js/lib/common/d3-utils.js","webpack:///./src/js/lib/common/svg-export.js","webpack:///./src/js/angular/graphexplore/directives/domain-range-graph.directive.js"],"names":["D3","Text","calcFontSizeRaw","text","radius","minimumSize","isMultiline","textSize","substring","length","match","Math","round","calcFontSize","getTextWithElipsisIfNeeded","str","threshold","Transition","fadeIn","sel","duration","style","transition","fadeOut","Click","delayDblClick","event","d3","dispatch","rebind","selection","down","wait","on","mouse","document","body","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","attr","version","xmlns","node","parentNode","innerHTML","btoa","unescape","encodeURIComponent","domainRangeGraphDirective","$rootScope","$window","$repositories","GraphDataRestService","$location","LocalStorageAdapter","LSKeys","$timeout","toastr","ONTO_RED","ONTO_GREEN","ONTO_BLUE","NON_COLLAPSED_REFLEXIVE_LINK_LIMIT","restrict","template","scope","showPredicatesInfoPanel","selectedPredicate","collapseEdges","link","timer","prototype","moveToFront","this","select","appendChild","moveToBack","firstChild","insertBefore","force","layout","size","charge","drag","classed","selected","svg","append","defs","id","viewBox","refX","refY","markerUnits","markerWidth","markerHeight","orient","fill","class","imgSrc","href","download","getActiveRepository","legendCellGroup","width","height","targetX","legendTextX","cx","cy","r","x","y","classNodeY","objectNodeTextY","x1","y1","datatypeNodeY","x2","y2","absUrl","basicPropertyArrowY","collapsedPropArrowY","g","selectedRdfUri","search","uri","classNodeLabel","name","collapsed","getDomainRangeData","success","response","status","headers","domainRangeGraphData","error","set","DOMAIN_RANGE_WENT_BACK","onpopstate","state","$broadcast","$watch","angular","isUndefined","DOMAIN_RANGE_COLLAPSE_EDGES","get","switchEdgeMode","remove","graph","copy","nodes","links","linkGroup","data","enter","styleArrowsInCollapsedMode","loopLink","loopLinkEdgeCount","objectPropNodeClassUri","propertyType","targetRadius","targetNodeEdgeCount","implicit","previousPropertyNameSelection","disableCollapsedPredicateLabelHightlighting","isEmptyObject","background","onCollapsedPropertyNameClick","previousSibling","stopPropagation","ready","bind","propertyNames","test","open","linkRect","calculatedWidth","getBBox","textPadding","calculatedHeight","translateX","nodeGroup","filter","objectPropClassUri","classPosition","objectPropClassName","call","$apply","rdfClassName","classNode","loopLinkBackgroundSel","loopLinkPropertyName","loopLinkBackgroundProps","i","push","idx","e","k","alpha","positionLoopLinkBackgrounds","loopLinkBackgroundY","loopLinkBackgroundX","allLoopLinkEdges","dd","foundLoopLinkBackgroundProps","grep","obj","parseFloat","transform","reposition","viewMoreTextWidth","target","allEdges","getComputedTextLength","adjustViewMorePredicatesLabel","source","targetY","pushEdgesToLeftAndRight","angle","atan2","cos","sin","loopTranslateX","mainClassSize","loopTranslateY","positionLoopLink","currentBackgroundHeight","loopLinkLabelX","loopLinkLabelY","predicatesLeft","labelSel","backgroundSel","nextSibling","createViewMorePredicatesLabel","positionLoopLinkLabels","log10","log","LN10","absDiff","logOffset","abs","centerClassNode","linkDistance","start","renderDomainRangeGraph","$on","cancel","module","constant","directive","$inject"],"mappings":"2FAAA,IAAIA,EAAKA,GAAM,GAEfA,EAAGC,KAAO,WACN,SAASC,EAAgBC,EAAMC,EAAQC,EAAaC,GAChDD,EAAcA,GAAe,GAE7B,IAAIE,EAAWH,EAAS,EACxB,MAAoB,iBAATD,GAEPI,GAAY,IADFJ,EAAKK,UAAU,EAAGJ,EAAS,GAAGK,OAAS,KAEjDF,GAAY,EAKRJ,EAAKO,MAAM,4DACXH,GAAY,IAGZA,EAAWF,IACXE,EAAWF,GAeRM,KAAKC,MAAML,KAGlBA,EAAWF,IACXE,EAAWF,GAGRM,KAAKC,MAAML,IAgBtB,MAAO,CACHL,gBAAiBA,EACjBW,aAfJ,SAAsBV,EAAMC,EAAQC,EAAaC,GAC7C,OAAOJ,EAAgBC,EAAMC,EAAQC,GAA4B,MAejES,2BAZJ,SAAoCC,EAAKC,GACrC,MAAmB,iBAARD,GACHA,EAAIN,OAASO,EACND,EAAIP,UAAU,EAAGQ,EAAY,GAAK,MAG1CD,IArDL,GA+DVf,EAAGiB,WAeQ,CACHC,OAfJ,SAAgBC,EAAKC,GACjBD,EAAIE,MAAM,UAAW,GAChBC,aACAF,SAASA,GACTC,MAAM,UAAW,IAYtBE,QATJ,SAAiBJ,EAAKC,GAClBD,EAAIE,MAAM,UAAW,GAChBC,aACAF,SAASA,GACTC,MAAM,UAAW,KAS9BrB,EAAGwB,MA0CQ,CACHC,cA1CJ,WACI,IAAIC,EAAQC,GAAGC,SAAS,QAAS,YAqCjC,OAAOD,GAAGE,QAnCV,SAAYC,GACR,IAAIC,EAGAC,EAAO,KAOXF,EAAUG,GAAG,aAAa,WACtBF,EAAOJ,GAAGO,MAAMC,SAASC,MACjB,IAAIC,QAEhBP,EAAUG,GAAG,WAAW,SAAUK,GARlC,IAAcC,EAAGC,EAAHD,EASDR,EATIS,EASEb,GAA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G,GAAKlG,EAAE0M,OAAOxG,EAAIlG,EAAEsM,OAAOpG,GAAK,KAGxDxC,cAGLkH,EACKlJ,KAAK,KAAK,SAAU1B,GACjB,MAAwB,UAApBA,EAAE2K,cACK3K,EAAEiG,EAh1BrB,KAIiB,IA40ByB,IAEvBjG,EAAEiG,EAl1BrB,KAIiB,IA80ByB,OAGrCvE,KAAK,KAAK,SAAU1B,GACjB,OAAOA,EAAEkG,KAEZxC,iBAMJ2K,aA91BD,KA81BsB,KACrBC,YAv3BTC,CAAuBpL,KACxB,IAEHA,EAAMqL,IAAI,YAAY,WAClB7L,EAAS8L,OAAOjL,QA/B5ByE,QACKyG,OAAO,wDAAyD,CAC7D,yDACA,gDAEHC,SAAS,WAAY,sBACrBA,SAAS,aAAc,qBACvBA,SAAS,YAAa,oBACtBA,SAAS,qCAAsC,GAC/CC,UAAU,mBAAoBzM,GAEnCA,EAA0B0M,QAAU,CAAC,aAAc,UAAW,gBAAiB,uBAAwB,YAAa,sBAAuB,SAAU,WAAY,SAAU,WAAY,aAAc,YAAa","file":"33.fde8076c81c87c25c367.bundle.js","sourcesContent":["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","import SVG from 'lib/common/svg-export';\nimport D3 from 'lib/common/d3-utils';\nimport 'angular/utils/local-storage-adapter';\n\nangular\n .module('graphdb.framework.graphexplore.directives.domainrange', [\n 'graphdb.framework.graphexplore.controllers.domainrange',\n 'graphdb.framework.utils.localstorageadapter'\n ])\n .constant('ONTO_RED', 'var(--onto-orange)')\n .constant('ONTO_GREEN', 'var(--onto-green)')\n .constant('ONTO_BLUE', 'var(--onto-blue)')\n .constant('NON_COLLAPSED_REFLEXIVE_LINK_LIMIT', 6)\n .directive('domainRangeGraph', domainRangeGraphDirective);\n\ndomainRangeGraphDirective.$inject = ['$rootScope', '$window', '$repositories', 'GraphDataRestService', '$location', 'LocalStorageAdapter', 'LSKeys', '$timeout', 'toastr', 'ONTO_RED', 'ONTO_GREEN', 'ONTO_BLUE', 'NON_COLLAPSED_REFLEXIVE_LINK_LIMIT'];\n\nfunction domainRangeGraphDirective($rootScope, $window, $repositories, GraphDataRestService, $location, LocalStorageAdapter, LSKeys, $timeout, toastr, ONTO_RED, ONTO_GREEN, ONTO_BLUE, NON_COLLAPSED_REFLEXIVE_LINK_LIMIT) {\n return {\n restrict: 'AE',\n template: '<div id=\"domain-range\"></div>',\n scope: {\n showPredicatesInfoPanel: '=',\n selectedPredicate: '=',\n collapseEdges: '='\n },\n link: linkFunc\n };\n\n function linkFunc(scope) {\n const timer = $timeout(function () {\n renderDomainRangeGraph(scope);\n }, 50);\n\n scope.$on(\"$destroy\", function () {\n $timeout.cancel(timer);\n });\n }\n\n function renderDomainRangeGraph(scope) {\n d3.selection.prototype.moveToFront = function () {\n return this.each(function () {\n d3.select(this.parentNode.appendChild(this));\n });\n };\n\n d3.selection.prototype.moveToBack = function () {\n return this.each(function () {\n const firstChild = this.parentNode.firstChild;\n if (firstChild) {\n this.parentNode.insertBefore(this, firstChild);\n }\n });\n };\n\n var width = 1200,\n height = 600;\n\n var mainClassSize = width / 18,\n otherClassSize = width / 110,\n datatypeSize = otherClassSize / 2,\n labelFontSize = width / 90,\n basicArrowStrokeWidth = width / 1000,\n collapsedArrowStrokeWidth = width / 600;\n\n\n var force = d3.layout.force()\n .size([width, height])\n .charge(-900);\n\n var drag = force.drag()\n .on(\"dragstart\", dragstart);\n\n var svg = d3.select(\"#domain-range\")\n .append(\"svg\")\n .attr(\"viewBox\", \"0 0 \" + width + \" \" + height)\n .attr(\"preserveAspectRatio\", \"xMidYMid meet\")\n .on(\"dblclick.zoom\", null);\n\n var defs = svg.append(\"defs\");\n\n defs.append(\"marker\")\n .attr({\n id: \"arrow\",\n viewBox: \"0 -5 10 10\",\n refX: 10,\n refY: 0,\n markerUnits: \"strokeWidth\",\n markerWidth: 5,\n markerHeight: 5,\n orient: \"auto\",\n fill: ONTO_BLUE\n })\n .append(\"path\")\n .attr({\n d: \"M0,-5L10,0L0,5\",\n class: \"arrowHead\"\n });\n\n defs.append(\"marker\")\n .attr({\n id: \"collapsed-arrow\",\n viewBox: \"0 -5 10 10\",\n refX: 9,\n refY: 0,\n markerUnits: \"strokeWidth\",\n markerWidth: 4,\n markerHeight: 4,\n orient: \"auto\",\n fill: ONTO_BLUE\n })\n .append(\"path\")\n .attr({\n d: \"M0,-5L10,0L0,5\",\n class: \"arrowHead\"\n });\n\n defs.append(\"marker\")\n .attr({\n id: \"arrow-loop\",\n viewBox: \"0 -5 10 10\",\n refX: 7,\n refY: 0,\n markerUnits: \"strokeWidth\",\n markerWidth: 5,\n markerHeight: 5,\n orient: \"auto\",\n fill: ONTO_BLUE\n })\n .append(\"path\")\n .attr({\n d: \"M0,-5L10,0L0,5\",\n class: \"arrowHead\"\n });\n\n /*\n * Prepares SVG document image export by adding xml namespaces and\n * additional style information\n */\n function prepareForSVGImageExport() {\n // get css rules for the diagram\n var cssRules = SVG.Export.getCSSRules(\"css/domain-range-graph.css?v=2.2.3-TR3\");\n\n // inline css rules in a defs tag\n $(\"defs\").append('<style type=\"text/css\"><![CDATA[' + cssRules + ']]></style>');\n\n // convert selected html to base64\n var imgSrc = SVG.Export.generateBase64ImageSource();\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: \"domain-range-graph-\" + $repositories.getActiveRepository() + \".svg\"\n });\n }\n\n d3.select(\"#download-svg\")\n .on(\"mouseover\", prepareForSVGImageExport);\n\n // start of code for legend\n var legendBackgroundWidth = width / 7;\n var legendBackgroundHeight = legendBackgroundWidth * 1.2;\n\n var svgLegend = d3.select(\".legend-container\")\n .append(\"svg\")\n .attr(\"viewBox\", \"0 0 \" + legendBackgroundWidth + \" \" + legendBackgroundHeight)\n .attr(\"preserveAspectRatio\", \"xMidYMid meet\");\n\n var legendCellGroup = svgLegend;\n\n legendCellGroup.append(\"rect\")\n .attr({\n width: legendBackgroundWidth,\n height: legendBackgroundHeight\n })\n .style(\"fill\", \"rgba(235, 235, 235, 0.9)\");\n\n var sourceX = width / 75;\n var sourceY = width / 40;\n var targetX = sourceX + mainClassSize / 2.5;\n var targetY = sourceY;\n\n var legendTextX = targetX + width / 90;\n var legendLabelFontSize = labelFontSize / 1.1;\n\n var classNodeY = sourceY;\n var legendClassNode = legendCellGroup\n .append(\"circle\")\n .attr({\n class: \"legend-class-node\",\n cx: (sourceX + targetX) / 2,\n cy: classNodeY,\n r: mainClassSize / 4.5\n });\n\n var classNodeTextY = targetY + width / 370;\n legendCellGroup\n .append(\"text\")\n .attr({\n x: legendTextX,\n y: classNodeTextY\n })\n .style('font-size', legendLabelFontSize + 'px')\n .text(\"main class node\");\n\n var objectNodeY = classNodeY + width / 30;\n legendCellGroup\n .append(\"circle\")\n .attr({\n class: \"legend-object-node\",\n cx: (sourceX + targetX) / 2,\n cy: objectNodeY,\n r: otherClassSize / 1.25\n });\n\n var objectNodeTextY = classNodeTextY + width / 30;\n legendCellGroup\n .append(\"text\")\n .attr({\n x: legendTextX,\n y: objectNodeTextY\n })\n .style('font-size', legendLabelFontSize + 'px')\n .text(\"class node\");\n\n var datatypeNodeY = objectNodeY + width / 45;\n legendCellGroup\n .append(\"circle\")\n .attr({\n class: \"legend-datatype-node\",\n cx: (sourceX + targetX) / 2,\n cy: datatypeNodeY,\n r: datatypeSize\n });\n\n var datatypeNodeTextY = objectNodeTextY + width / 45;\n legendCellGroup\n .append(\"text\")\n .attr({\n x: legendTextX,\n y: datatypeNodeTextY\n })\n .style('font-size', legendLabelFontSize + 'px')\n .text(\"datatype node\");\n\n var basicPropertyArrowY = datatypeNodeY + width / 45;\n var classNodeSel = d3.select('.legend-class-node');\n legendCellGroup\n .append(\"line\")\n .attr({\n class: \"property-arrow\",\n x1: sourceX,\n y1: basicPropertyArrowY,\n x2: targetX,\n y2: basicPropertyArrowY\n })\n .style(\"stroke-width\", basicArrowStrokeWidth)\n .attr(\"marker-end\", \"url(\" + $location.absUrl() + \"#arrow)\");\n\n legendCellGroup\n .append(\"text\")\n .attr({\n x: legendTextX,\n y: basicPropertyArrowY + (width / 370)\n })\n .style('font-size', legendLabelFontSize + 'px')\n .text(\"explicit property\");\n\n var implicitPropArrowY = basicPropertyArrowY + width / 45;\n legendCellGroup\n .append(\"line\")\n .attr({\n class: \"implicit-property-arrow\",\n x1: sourceX,\n y1: implicitPropArrowY,\n x2: targetX,\n y2: implicitPropArrowY\n })\n .style(\"stroke-width\", basicArrowStrokeWidth)\n .attr(\"marker-end\", \"url(\" + $location.absUrl() + \"#arrow)\");\n\n legendCellGroup\n .append(\"text\")\n .attr({\n x: legendTextX,\n y: implicitPropArrowY + (width / 370)\n })\n .style('font-size', legendLabelFontSize + 'px')\n .text(\"implicit property\");\n\n var collapsedPropArrowY = implicitPropArrowY + width / 45;\n legendCellGroup\n .append(\"line\")\n .attr({\n class: \"collapsed-property-arrow\",\n x1: sourceX,\n y1: collapsedPropArrowY,\n x2: targetX,\n y2: collapsedPropArrowY\n })\n .style(\"stroke-width\", collapsedArrowStrokeWidth)\n .attr(\"marker-end\", \"url(\" + $location.absUrl() + \"#collapsed-arrow)\");\n\n legendCellGroup\n .append(\"text\")\n .attr({\n x: legendTextX,\n y: collapsedPropArrowY + (width / 370)\n })\n .style('font-size', legendLabelFontSize + 'px')\n .text(\"collapsed property\");\n // end of code for legend\n\n // there doesn't seem to be a need for a separate group\n var g = svg; //svg.append(\"g\");\n\n var selectedRdfUri = $location.search().uri;\n var classNodeLabel = $location.search().name;\n var collapsed = $location.search().collapsed;\n\n GraphDataRestService.getDomainRangeData(selectedRdfUri, collapsed)\n .success(function (response, status, headers) {\n scope.domainRangeGraphData = response;\n }).error(function (response) {\n toastr.error(\"Request for \" + classNodeLabel + \" failed!\");\n });\n\n function switchEdgeMode(collapsed) {\n $rootScope.$broadcast('switchEdgeMode', {\n uri: selectedRdfUri,\n name: classNodeLabel,\n collapsed: collapsed\n });\n }\n\n // intercept back button press and set action to local storage\n $(window).on('popstate', function () {\n LocalStorageAdapter.set(LSKeys.DOMAIN_RANGE_WENT_BACK, true);\n });\n\n $window.onpopstate = function (event) {\n if (event.state) {\n $rootScope.$broadcast(\"changeCollapsedEdgesState\", event.state.collapsed);\n }\n };\n\n scope.$watch('collapseEdges', function () {\n if (!angular.isUndefined(scope.collapseEdges)) {\n LocalStorageAdapter.set(LSKeys.DOMAIN_RANGE_COLLAPSE_EDGES, scope.collapseEdges);\n\n // if the back button has not been pressed, then switch to collapsed or non collapsed mode\n // otherwise skip, because back button will not function properly and will not pop the entire\n // history stack\n if (LocalStorageAdapter.get(LSKeys.DOMAIN_RANGE_WENT_BACK) !== \"true\") {\n switchEdgeMode(scope.collapseEdges);\n }\n\n // after back button status has been checked, remove the action from local storage in order\n // to be clean for next check\n LocalStorageAdapter.remove(LSKeys.DOMAIN_RANGE_WENT_BACK);\n }\n });\n\n scope.$watch('domainRangeGraphData', function () {\n if (scope.domainRangeGraphData) {\n var graph = angular.copy(scope.domainRangeGraphData);\n\n force\n .nodes(graph.nodes)\n .links(graph.links);\n\n var linkGroup = g.selectAll(\".link\")\n .data(graph.links)\n .enter()\n .append(\"g\");\n\n function styleArrowsInCollapsedMode(sel) {\n sel.style(\"stroke\", ONTO_BLUE);\n sel.style(\"stroke-width\", collapsedArrowStrokeWidth);\n sel.attr(\"marker-end\", \"url(\" + $location.absUrl() + \"#collapsed-arrow)\");\n }\n\n var link,\n loopLink,\n loopLinkEdgeCount = 0;\n\n\n linkGroup\n .each(function (d) {\n if (d.objectPropNodeClassUri !== selectedRdfUri) {\n link = linkGroup\n .append(\"line\")\n .attr({\n class: \"link\",\n // absolute url needed because angular inserts a <base> tag\n \"marker-end\": \"url(\" + $location.absUrl() + \"#arrow)\"\n })\n .style(\"stroke-width\", basicArrowStrokeWidth)\n .each(function (d) {\n switch (d.propertyType) {\n case \"objectLeft\":\n d.targetRadius = mainClassSize;\n break;\n case \"objectRight\":\n d.targetRadius = otherClassSize;\n break;\n case \"datatype\":\n d.targetRadius = datatypeSize;\n break;\n default:\n d.targetRadius = 0;\n }\n var sel = d3.select(this);\n if (d.targetNodeEdgeCount > 1) {\n styleArrowsInCollapsedMode(sel);\n } else if (d.implicit) {\n sel.style(\"stroke-dasharray\", \"3, 3\");\n }\n });\n } else {\n if (angular.isUndefined(loopLink)) {\n var loopLinkSize = mainClassSize / 2;\n loopLink = d3.select(this)\n .append(\"path\")\n .attr({\n d: \"M 0 0 A \" + loopLinkSize + \" \" + loopLinkSize + \" 0 1 1 0 \" + loopLinkSize,\n class: \"loop-link\",\n fill: \"none\",\n \"marker-end\": \"url(\" + $location.absUrl() + \"#arrow-loop)\"\n })\n .style(\"stroke-width\", basicArrowStrokeWidth);\n }\n\n loopLinkEdgeCount += d.targetNodeEdgeCount;\n if (loopLinkEdgeCount > 1) {\n styleArrowsInCollapsedMode(d3.select(\".loop-link\"));\n }\n }\n });\n\n var previousPropertyNameSelection = {};\n\n function disableCollapsedPredicateLabelHightlighting() {\n if (!$.isEmptyObject(previousPropertyNameSelection)) {\n previousPropertyNameSelection.text.style(\"fill\", \"black\");\n previousPropertyNameSelection.background.style(\"fill\", \"#f0f0f0\");\n }\n }\n\n // when clicking anywhere else but the collapsed labels disable highlighting\n // of the currently selected one\n $(\"document\").ready(function () {\n $(\"#domain-range\").bind(\"click\", disableCollapsedPredicateLabelHightlighting);\n });\n\n function onCollapsedPropertyNameClick(d) {\n disableCollapsedPredicateLabelHightlighting();\n previousPropertyNameSelection.text = d3.select(this);\n\n previousPropertyNameSelection.background = d3.select(this.previousSibling);\n previousPropertyNameSelection.text.style(\"fill\", \"white\");\n\n previousPropertyNameSelection.background.style(\"fill\", ONTO_BLUE);\n $timeout(function () {\n scope.showPredicatesInfoPanel = true;\n scope.selectedPredicate = d;\n });\n d3.event.stopPropagation();\n }\n\n\n var propertyNames = linkGroup\n .append(\"text\")\n .attr(\"class\", function (d) {\n return d.objectPropNodeClassUri === selectedRdfUri ? \"loop-link-property-name\" : \"property-name\";\n })\n .attr(\"dx\", function (d) {\n // offset text more towards the main class\n return mainClassSize / 2 * (d.propertyType === \"objectLeft\" ? 1 : -1);\n })\n .style(\"text-anchor\", function (d) {\n return d.propertyType === \"objectLeft\" ? \"end\" : \"start\";\n })\n .style(\"font-size\", labelFontSize)\n .text(function (d) {\n return d.targetNodeEdgeCount > 1 ? d.targetNodeEdgeCount + \" predicates\" : d.name;\n });\n\n\n propertyNames\n .each(function (d) {\n var sel = d3.select(this);\n var isCompoundEdge = /\\d\\spredicates/.test(sel.text());\n\n // handle collapsed predicates by making their font bold, make them highlight when clicked\n // and make them trigger the side panel to display the collapsed edges\n if (isCompoundEdge) {\n sel\n .style(\"font-weight\", \"bold\")\n .on(\"click\", onCollapsedPropertyNameClick);\n } else {\n // for regular predicate labels just attach a link to the \"Resources\" view\n // for more helpful information regarding them\n sel.on(\"click\", function (d) {\n $window.open(\"resource?uri=\" + encodeURIComponent(d.uri), \"_blank\");\n });\n }\n });\n var textPadding = width / 600;\n\n\n var linkRect = linkGroup\n .append(\"rect\")\n .attr(\"class\", function (d) {\n return d.objectPropNodeClassUri !== selectedRdfUri ? \"link-background\" : \"loop-link-background\"\n })\n .attr(\"width\", function (d) {\n d.calculatedWidth = this.previousSibling.getBBox().width;\n return d.calculatedWidth + textPadding * 2;\n })\n .attr(\"height\", function (d) {\n d.calculatedHeight = this.previousSibling.getBBox().height;\n return d.calculatedHeight + textPadding;\n })\n .attr(\"transform\", function (d) {\n // offset rect by the same amount as text (besides the padding)\n var translateX = textPadding - mainClassSize / 2 * (d.propertyType === \"objectLeft\" ? 1 : -1);\n if (d.propertyType === \"objectLeft\") {\n translateX += d.calculatedWidth;\n }\n return \"translate(-\" + translateX + \",-\" + (textPadding + d.calculatedHeight / 2) + \")\";\n })\n .on(\"click\", function (d) {\n d3.event.stopPropagation();\n });\n\n\n var nodeGroup = g.selectAll(\".node\")\n .data(graph.nodes)\n .enter()\n .append(\"g\");\n\n var node = nodeGroup\n .filter(function (d) {\n return d.objectPropClassUri !== selectedRdfUri;\n })\n .append(\"circle\")\n .each(function (d) {\n var sel = d3.select(this);\n if (d.classPosition === \"main\") {\n sel.attr({\n class: \"class-node\",\n r: mainClassSize\n })\n .attr(\"marker-end\", \"url(\" + $location.absUrl() + \"#loop-link)\");\n } else if (d.objectPropClassName === null) {\n sel.attr({\n class: \"datatype-node\",\n r: datatypeSize\n });\n } else {\n sel.attr({\n class: \"object-prop-node\",\n r: otherClassSize\n });\n }\n })\n .call(drag);\n\n\n function reloadDomainRangeGraphView(d, collapsed) {\n scope.$apply(function () {\n $rootScope.$broadcast('reloadDomainRangeGraphView', d, collapsed);\n });\n }\n\n d3.selectAll(\".object-prop-node\")\n .on(\"dblclick\", reloadDomainRangeGraphView);\n\n\n nodeGroup\n .filter(function (d) {\n return d.objectPropClassName && d.objectPropClassUri !== selectedRdfUri;\n })\n .append(\"text\")\n .attr(\"class\", function (d) {\n return d.classPosition + \"-class-label\";\n })\n .style(\"font-size\", labelFontSize)\n .text(function (d) {\n return d.objectPropClassName;\n })\n .on(\"click\", function (d) {\n $window.open(\"resource?uri=\" + encodeURIComponent(d.objectPropClassUri), \"_blank\");\n });\n\n var objectPropClassName = nodeGroup.select(\"text\");\n\n g.select(\".class-node\")\n .each(function () {\n d3.select(this.parentNode)\n .append(\"text\")\n .attr(\"class\", \"rdf-class-label\")\n .style(\"font-size\", function (d) {\n return D3.Text.calcFontSize(classNodeLabel, mainClassSize)\n })\n .text(classNodeLabel)\n .on(\"click\", function (d) {\n $window.open(\"resource?uri=\" + encodeURIComponent(selectedRdfUri), \"_blank\");\n });\n });\n\n\n var rdfClassName = g.select(\".class-node + text\"),\n classNode = d3.select(\".class-node\"),\n loopLinkBackgroundSel = d3.selectAll(\".loop-link-background\"),\n loopLinkPropertyName = d3.selectAll(\".loop-link-property-name\");\n\n propertyNames = d3.selectAll(\".property-name\");\n\n if (!angular.isUndefined(loopLink)) {\n var loopLinkBackgroundProps = [];\n\n loopLinkBackgroundSel.each(function (d, i) {\n var sel = d3.select(this);\n loopLinkBackgroundProps.push({\n idx: i,\n width: d.calculatedWidth,\n height: d.calculatedHeight\n });\n });\n }\n\n function tick(e) {\n var k = 8 * e.alpha;\n\n function pushEdgesToLeftAndRight(d) {\n if (d.propertyType === \"objectLeft\") {\n d.source.x -= 8 * k;\n d.source.y -= k / 9;\n } else {\n d.target.x += 8 * k;\n d.target.y -= k / 9;\n }\n }\n\n link\n .filter(function (d) {\n return d.objectPropNodeClassUri !== selectedRdfUri;\n })\n .attr(\"x1\", function (d) {\n return d.source.x;\n })\n .attr(\"y1\", function (d) {\n return d.source.y;\n })\n .attr(\"x2\", function (d) {\n return d.targetX;\n })\n .attr(\"y2\", function (d) {\n return d.targetY;\n })\n .each(function (d) {\n pushEdgesToLeftAndRight(d);\n\n // shortens the line to compensate for the circle at the target\n var angle = Math.atan2(d.target.y - d.source.y, d.target.x - d.source.x);\n d.targetX = d.target.x - Math.cos(angle) * d.targetRadius;\n d.targetY = d.target.y - Math.sin(angle) * d.targetRadius;\n });\n\n function positionLoopLink(d) {\n var loopTranslateX = d.x + mainClassSize * 0.96,\n loopTranslateY = d.y - mainClassSize / 5.7 - 5;\n loopLink.attr(\"transform\", \"rotate(270, \" + d.x + \",\" + d.y + \") translate(\" + loopTranslateX + \",\" + loopTranslateY + \")\");\n }\n\n function positionLoopLinkLabels(d) {\n function reposition(sel, i) {\n var foundLoopLinkBackgroundProps =\n $.grep(loopLinkBackgroundProps, function (obj) {\n return obj.idx == i;\n });\n var currentBackgroundHeight = 0;\n if (i > 0) {\n currentBackgroundHeight = parseFloat(2 * i * (foundLoopLinkBackgroundProps[0].height / 1.4));\n }\n\n var loopLinkLabelX = d.x,\n loopLinkLabelY = d.y - mainClassSize * 2.1 - currentBackgroundHeight;\n\n sel\n .attr({\n x: loopLinkLabelX,\n y: loopLinkLabelY\n })\n .moveToFront();\n }\n\n /**\n * Create a \"View more\" label to depict that the are more reflexive link labels\n * left that could be seen in the side panel when clicking this label.\n *\n * @param labelSel\n * d3 selection of the text label\n * @param backgroundSel\n * d3 selection of the rectangle element background\n * @param predicatesLeft\n * number of predicates left that are collapsed\n */\n function createViewMorePredicatesLabel(labelSel, backgroundSel, predicatesLeft) {\n labelSel\n .classed(\"view-more-preds-label\", true)\n .text(predicatesLeft + \" predicates more ...\");\n if (this.nextSibling !== null) {\n backgroundSel\n .classed(\"view-more-preds-rect\", true);\n }\n }\n\n loopLinkPropertyName.each(function (dd, i) {\n var sel = d3.select(this);\n\n var predicatesLeft = loopLinkPropertyName.size() - NON_COLLAPSED_REFLEXIVE_LINK_LIMIT;\n if (predicatesLeft < 0) {\n reposition(sel, i);\n } else {\n if (i == 0 && !scope.collapseEdges && predicatesLeft > 1) {\n createViewMorePredicatesLabel(sel, d3.select(this.nextSibling), predicatesLeft);\n reposition(sel, i);\n }\n\n if (i < NON_COLLAPSED_REFLEXIVE_LINK_LIMIT) {\n reposition(sel, i);\n } else {\n sel.remove();\n }\n }\n });\n // loopLinkPropertyName.each(function (dd, i) {\n // var sel = d3.select(this);\n // if (i < NON_COLLAPSED_REFLEXIVE_LINK_LIMIT) {\n // reposition(sel, i);\n // } else if (i == NON_COLLAPSED_REFLEXIVE_LINK_LIMIT) {\n // createViewMorePredicatesLabel(sel, d3.select(this.nextSibling));\n // reposition(sel, i);\n // } else {\n // sel.remove();\n // }\n // });\n }\n\n function positionLoopLinkBackgrounds(d) {\n var loopLinkBackgroundY = d.x + mainClassSize * 2,\n loopLinkBackgroundX = d.y - mainClassSize / 1.9;\n\n function reposition(sel, i) {\n var foundLoopLinkBackgroundProps =\n $.grep(loopLinkBackgroundProps, function (obj) {\n return obj.idx == i;\n });\n if (i > 0) {\n loopLinkBackgroundY += parseFloat(i * (foundLoopLinkBackgroundProps[0].height / (i / 1.4)));\n }\n\n sel\n .attr({\n transform: \"rotate(270, \" + d.x + \",\" + d.y + \") translate(\" + loopLinkBackgroundY + \",\" + loopLinkBackgroundX + \")\",\n width: foundLoopLinkBackgroundProps[0].height,\n height: foundLoopLinkBackgroundProps[0].width\n });\n }\n\n /**\n * Adjust new width of \"View more\" label background and add all reflexive link metadata the this\n * label in order to render them in the side panel.\n *\n * @param allLoopLinkEdges\n * all reflexive links to the current class\n */\n function adjustViewMorePredicatesLabel(allLoopLinkEdges) {\n var viewMoreTextWidth;\n d3.select(\".view-more-preds-label\")\n // make label bold to resemble a collapsed label\n .style(\"font-weight\", \"bold\")\n .each(function (d) {\n // attach all reflexive links to the \"view more\" collapsed predicate\n // because in non collapsed mode the backend does not provide them\n d.target.allEdges = allLoopLinkEdges;\n\n // calculate text width in pixels in order to adjust background width accordingly\n viewMoreTextWidth = this.getComputedTextLength();\n })\n .on(\"click\", onCollapsedPropertyNameClick);\n\n d3.select(\".view-more-preds-rect\")\n // we modify height property instead of width because they are reversed\n // when we repositioned loop link labels\n .attr(\"height\", viewMoreTextWidth + 2 * textPadding);\n }\n\n var allLoopLinkEdges = [];\n loopLinkBackgroundSel.each(function (dd, i) {\n allLoopLinkEdges.push(dd);\n if (i < NON_COLLAPSED_REFLEXIVE_LINK_LIMIT) {\n reposition(d3.select(this), i);\n } else {\n d3.select(this).remove();\n }\n });\n\n adjustViewMorePredicatesLabel(allLoopLinkEdges);\n }\n\n\n function centerClassNode(d) {\n if (!(window.ActiveXObject) && \"ActiveXObject\" in window) {\n Math.log10 = function (x) {\n return Math.log(x) / Math.LN10;\n };\n }\n var absDiff = classNode.attr(\"cx\") - width / 2,\n logOffset = Math.log10(Math.abs(absDiff)) * 0.5;\n d.x += absDiff > 0 ? -logOffset : logOffset;\n return d.x;\n }\n\n node\n .each(function (d) {\n if (d.classPosition === \"main\" && !angular.isUndefined(loopLink)) {\n positionLoopLink(d);\n positionLoopLinkLabels(d);\n positionLoopLinkBackgrounds(d);\n }\n\n if (d.objectPropClassUri !== selectedRdfUri) {\n d3.select(this)\n .attr(\"cx\", function (d) {\n // pushes the main class circle to the centre\n if (d.classPosition === \"main\") {\n return centerClassNode(d);\n }\n return d.x;\n })\n .attr(\"cy\", function (d) {\n return d.y;\n });\n }\n });\n\n\n rdfClassName\n .attr(\"x\", function (d) {\n return d.x;\n })\n .attr(\"y\", function (d) {\n return d.y;\n })\n .moveToFront();\n\n\n linkRect\n .filter(function (d) {\n return d.objectPropNodeClassUri !== selectedRdfUri;\n })\n .attr(\"x\", function (d) {\n if (d.target.x > d.source.x) {\n return (d.source.x + (d.target.x - d.source.x) / 2);\n } else {\n return (d.target.x + (d.source.x - d.target.x) / 2);\n }\n })\n .attr(\"y\", function (d) {\n if (d.target.y > d.source.y) {\n return (d.source.y + (d.target.y - d.source.y) / 2);\n } else {\n return (d.target.y + (d.source.y - d.target.y) / 2);\n }\n })\n .moveToFront();\n\n\n propertyNames\n .attr(\"x\", function (d) {\n if (d.target.x > d.source.x) {\n return (d.source.x + (d.target.x - d.source.x) / 2);\n } else {\n return (d.target.x + (d.source.x - d.target.x) / 2);\n }\n })\n .attr(\"y\", function (d) {\n if (d.target.y > d.source.y) {\n return (d.source.y + (d.target.y - d.source.y) / 2);\n } else {\n return (d.target.y + (d.source.y - d.target.y) / 2);\n }\n })\n .moveToFront();\n\n\n objectPropClassName\n .attr(\"x\", function (d) {\n if (d.classPosition === \"right\") {\n return d.x + otherClassSize * 1.2;\n } else {\n return d.x - otherClassSize * 1.2;\n }\n })\n .attr(\"y\", function (d) {\n return d.y;\n })\n .moveToFront();\n }\n\n\n force\n .on(\"tick\", tick)\n .linkDistance(width / 3.5)\n .start();\n\n }\n });\n\n function dragstart(d) {\n d3.select(this)\n .classed(\"selected\", d.selected = true);\n }\n }\n}\n"],"sourceRoot":""}
1
+ {"version":3,"sources":["webpack:///./src/js/lib/common/d3-utils.js","webpack:///./src/js/lib/common/svg-export.js","webpack:///./src/js/angular/graphexplore/directives/domain-range-graph.directive.js"],"names":["D3","Text","calcFontSizeRaw","text","radius","minimumSize","isMultiline","textSize","substring","length","match","Math","round","calcFontSize","getTextWithElipsisIfNeeded","str","threshold","Transition","fadeIn","sel","duration","style","transition","fadeOut","Click","delayDblClick","event","d3","dispatch","rebind","selection","down","wait","on","mouse","document","body","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","attr","version","xmlns","node","parentNode","innerHTML","btoa","unescape","encodeURIComponent","domainRangeGraphDirective","$rootScope","$window","$repositories","GraphDataRestService","$location","LocalStorageAdapter","LSKeys","$timeout","toastr","ONTO_RED","ONTO_GREEN","ONTO_BLUE","NON_COLLAPSED_REFLEXIVE_LINK_LIMIT","restrict","template","scope","showPredicatesInfoPanel","selectedPredicate","collapseEdges","link","timer","prototype","moveToFront","this","select","appendChild","moveToBack","firstChild","insertBefore","force","layout","size","charge","drag","classed","selected","svg","append","defs","id","viewBox","refX","refY","markerUnits","markerWidth","markerHeight","orient","fill","class","imgSrc","href","download","getActiveRepository","legendCellGroup","width","height","targetX","legendTextX","cx","cy","r","x","y","classNodeY","objectNodeTextY","x1","y1","datatypeNodeY","x2","y2","absUrl","basicPropertyArrowY","collapsedPropArrowY","g","selectedRdfUri","search","uri","classNodeLabel","name","collapsed","getDomainRangeData","success","response","status","headers","domainRangeGraphData","error","set","DOMAIN_RANGE_WENT_BACK","onpopstate","state","$broadcast","$watch","angular","isUndefined","DOMAIN_RANGE_COLLAPSE_EDGES","get","switchEdgeMode","remove","graph","copy","nodes","links","linkGroup","data","enter","styleArrowsInCollapsedMode","loopLink","loopLinkEdgeCount","objectPropNodeClassUri","propertyType","targetRadius","targetNodeEdgeCount","implicit","previousPropertyNameSelection","disableCollapsedPredicateLabelHightlighting","isEmptyObject","background","onCollapsedPropertyNameClick","previousSibling","stopPropagation","ready","bind","propertyNames","test","open","linkRect","calculatedWidth","getBBox","textPadding","calculatedHeight","translateX","nodeGroup","filter","objectPropClassUri","classPosition","objectPropClassName","call","$apply","rdfClassName","classNode","loopLinkBackgroundSel","loopLinkPropertyName","loopLinkBackgroundProps","i","push","idx","e","k","alpha","positionLoopLinkBackgrounds","loopLinkBackgroundY","loopLinkBackgroundX","allLoopLinkEdges","dd","foundLoopLinkBackgroundProps","grep","obj","parseFloat","transform","reposition","viewMoreTextWidth","target","allEdges","getComputedTextLength","adjustViewMorePredicatesLabel","source","targetY","pushEdgesToLeftAndRight","angle","atan2","cos","sin","loopTranslateX","mainClassSize","loopTranslateY","positionLoopLink","currentBackgroundHeight","loopLinkLabelX","loopLinkLabelY","predicatesLeft","labelSel","backgroundSel","nextSibling","createViewMorePredicatesLabel","positionLoopLinkLabels","log10","log","LN10","absDiff","logOffset","abs","centerClassNode","linkDistance","start","renderDomainRangeG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H,EACKlJ,KAAK,KAAK,SAAU1B,GACjB,MAAwB,UAApBA,EAAE2K,cACK3K,EAAEiG,EAh1BrB,KAIiB,IA40ByB,IAEvBjG,EAAEiG,EAl1BrB,KAIiB,IA80ByB,OAGrCvE,KAAK,KAAK,SAAU1B,GACjB,OAAOA,EAAEkG,KAEZxC,iBAMJ2K,aA91BD,KA81BsB,KACrBC,YAv3BTC,CAAuBpL,KACxB,IAEHA,EAAMqL,IAAI,YAAY,WAClB7L,EAAS8L,OAAOjL,QA/B5ByE,QACKyG,OAAO,wDAAyD,CAC7D,yDACA,gDAEHC,SAAS,WAAY,sBACrBA,SAAS,aAAc,qBACvBA,SAAS,YAAa,oBACtBA,SAAS,qCAAsC,GAC/CC,UAAU,mBAAoBzM,GAEnCA,EAA0B0M,QAAU,CAAC,aAAc,UAAW,gBAAiB,uBAAwB,YAAa,sBAAuB,SAAU,WAAY,SAAU,WAAY,aAAc,YAAa","file":"33.fde8076c81c87c25c367.bundle.js","sourcesContent":["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","import SVG from 'lib/common/svg-export';\nimport D3 from 'lib/common/d3-utils';\nimport 'angular/utils/local-storage-adapter';\n\nangular\n .module('graphdb.framework.graphexplore.directives.domainrange', [\n 'graphdb.framework.graphexplore.controllers.domainrange',\n 'graphdb.framework.utils.localstorageadapter'\n ])\n .constant('ONTO_RED', 'var(--onto-orange)')\n .constant('ONTO_GREEN', 'var(--onto-green)')\n .constant('ONTO_BLUE', 'var(--onto-blue)')\n .constant('NON_COLLAPSED_REFLEXIVE_LINK_LIMIT', 6)\n .directive('domainRangeGraph', domainRangeGraphDirective);\n\ndomainRangeGraphDirective.$inject = ['$rootScope', '$window', '$repositories', 'GraphDataRestService', '$location', 'LocalStorageAdapter', 'LSKeys', '$timeout', 'toastr', 'ONTO_RED', 'ONTO_GREEN', 'ONTO_BLUE', 'NON_COLLAPSED_REFLEXIVE_LINK_LIMIT'];\n\nfunction domainRangeGraphDirective($rootScope, $window, $repositories, GraphDataRestService, $location, LocalStorageAdapter, LSKeys, $timeout, toastr, ONTO_RED, ONTO_GREEN, ONTO_BLUE, NON_COLLAPSED_REFLEXIVE_LINK_LIMIT) {\n return {\n restrict: 'AE',\n template: '<div id=\"domain-range\"></div>',\n scope: {\n showPredicatesInfoPanel: '=',\n selectedPredicate: '=',\n collapseEdges: '='\n },\n link: linkFunc\n };\n\n function linkFunc(scope) {\n const timer = $timeout(function () {\n renderDomainRangeGraph(scope);\n }, 50);\n\n scope.$on(\"$destroy\", function () {\n $timeout.cancel(timer);\n });\n }\n\n function renderDomainRangeGraph(scope) {\n d3.selection.prototype.moveToFront = function () {\n return this.each(function () {\n d3.select(this.parentNode.appendChild(this));\n });\n };\n\n d3.selection.prototype.moveToBack = function () {\n return this.each(function () {\n const firstChild = this.parentNode.firstChild;\n if (firstChild) {\n this.parentNode.insertBefore(this, firstChild);\n }\n });\n };\n\n var width = 1200,\n height = 600;\n\n var mainClassSize = width / 18,\n otherClassSize = width / 110,\n datatypeSize = otherClassSize / 2,\n labelFontSize = width / 90,\n basicArrowStrokeWidth = width / 1000,\n collapsedArrowStrokeWidth = width / 600;\n\n\n var force = d3.layout.force()\n .size([width, height])\n .charge(-900);\n\n var drag = force.drag()\n .on(\"dragstart\", dragstart);\n\n var svg = d3.select(\"#domain-range\")\n .append(\"svg\")\n .attr(\"viewBox\", \"0 0 \" + width + \" \" + height)\n .attr(\"preserveAspectRatio\", \"xMidYMid meet\")\n .on(\"dblclick.zoom\", null);\n\n var defs = svg.append(\"defs\");\n\n defs.append(\"marker\")\n .attr({\n id: \"arrow\",\n viewBox: \"0 -5 10 10\",\n refX: 10,\n refY: 0,\n markerUnits: \"strokeWidth\",\n markerWidth: 5,\n markerHeight: 5,\n orient: \"auto\",\n fill: ONTO_BLUE\n })\n .append(\"path\")\n .attr({\n d: \"M0,-5L10,0L0,5\",\n class: \"arrowHead\"\n });\n\n defs.append(\"marker\")\n .attr({\n id: \"collapsed-arrow\",\n viewBox: \"0 -5 10 10\",\n refX: 9,\n refY: 0,\n markerUnits: \"strokeWidth\",\n markerWidth: 4,\n markerHeight: 4,\n orient: \"auto\",\n fill: ONTO_BLUE\n })\n .append(\"path\")\n .attr({\n d: \"M0,-5L10,0L0,5\",\n class: \"arrowHead\"\n });\n\n defs.append(\"marker\")\n .attr({\n id: \"arrow-loop\",\n viewBox: \"0 -5 10 10\",\n refX: 7,\n refY: 0,\n markerUnits: \"strokeWidth\",\n markerWidth: 5,\n markerHeight: 5,\n orient: \"auto\",\n fill: ONTO_BLUE\n })\n .append(\"path\")\n .attr({\n d: \"M0,-5L10,0L0,5\",\n class: \"arrowHead\"\n });\n\n /*\n * Prepares SVG document image export by adding xml namespaces and\n * additional style information\n */\n function prepareForSVGImageExport() {\n // get css rules for the diagram\n var cssRules = SVG.Export.getCSSRules(\"css/domain-range-graph.css?v=2.2.3\");\n\n // inline css rules in a defs tag\n $(\"defs\").append('<style type=\"text/css\"><![CDATA[' + cssRules + ']]></style>');\n\n // convert selected html to base64\n var imgSrc = SVG.Export.generateBase64ImageSource();\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: \"domain-range-graph-\" + $repositories.getActiveRepository() + \".svg\"\n });\n }\n\n d3.select(\"#download-svg\")\n .on(\"mouseover\", prepareForSVGImageExport);\n\n // start of code for legend\n var legendBackgroundWidth = width / 7;\n var legendBackgroundHeight = legendBackgroundWidth * 1.2;\n\n var svgLegend = d3.select(\".legend-container\")\n .append(\"svg\")\n .attr(\"viewBox\", \"0 0 \" + legendBackgroundWidth + \" \" + legendBackgroundHeight)\n .attr(\"preserveAspectRatio\", \"xMidYMid meet\");\n\n var legendCellGroup = svgLegend;\n\n legendCellGroup.append(\"rect\")\n .attr({\n width: legendBackgroundWidth,\n height: legendBackgroundHeight\n })\n .style(\"fill\", \"rgba(235, 235, 235, 0.9)\");\n\n var sourceX = width / 75;\n var sourceY = width / 40;\n var targetX = sourceX + mainClassSize / 2.5;\n var targetY = sourceY;\n\n var legendTextX = targetX + width / 90;\n var legendLabelFontSize = labelFontSize / 1.1;\n\n var classNodeY = sourceY;\n var legendClassNode = legendCellGroup\n .append(\"circle\")\n .attr({\n class: \"legend-class-node\",\n cx: (sourceX + targetX) / 2,\n cy: classNodeY,\n r: mainClassSize / 4.5\n });\n\n var classNodeTextY = targetY + width / 370;\n legendCellGroup\n .append(\"text\")\n .attr({\n x: legendTextX,\n y: classNodeTextY\n })\n .style('font-size', legendLabelFontSize + 'px')\n .text(\"main class node\");\n\n var objectNodeY = classNodeY + width / 30;\n legendCellGroup\n .append(\"circle\")\n .attr({\n class: \"legend-object-node\",\n cx: (sourceX + targetX) / 2,\n cy: objectNodeY,\n r: otherClassSize / 1.25\n });\n\n var objectNodeTextY = classNodeTextY + width / 30;\n legendCellGroup\n .append(\"text\")\n .attr({\n x: legendTextX,\n y: objectNodeTextY\n })\n .style('font-size', legendLabelFontSize + 'px')\n .text(\"class node\");\n\n var datatypeNodeY = objectNodeY + width / 45;\n legendCellGroup\n .append(\"circle\")\n .attr({\n class: \"legend-datatype-node\",\n cx: (sourceX + targetX) / 2,\n cy: datatypeNodeY,\n r: datatypeSize\n });\n\n var datatypeNodeTextY = objectNodeTextY + width / 45;\n legendCellGroup\n .append(\"text\")\n .attr({\n x: legendTextX,\n y: datatypeNodeTextY\n })\n .style('font-size', legendLabelFontSize + 'px')\n .text(\"datatype node\");\n\n var basicPropertyArrowY = datatypeNodeY + width / 45;\n var classNodeSel = d3.select('.legend-class-node');\n legendCellGroup\n .append(\"line\")\n .attr({\n class: \"property-arrow\",\n x1: sourceX,\n y1: basicPropertyArrowY,\n x2: targetX,\n y2: basicPropertyArrowY\n })\n .style(\"stroke-width\", basicArrowStrokeWidth)\n .attr(\"marker-end\", \"url(\" + $location.absUrl() + \"#arrow)\");\n\n legendCellGroup\n .append(\"text\")\n .attr({\n x: legendTextX,\n y: basicPropertyArrowY + (width / 370)\n })\n .style('font-size', legendLabelFontSize + 'px')\n .text(\"explicit property\");\n\n var implicitPropArrowY = basicPropertyArrowY + width / 45;\n legendCellGroup\n .append(\"line\")\n .attr({\n class: \"implicit-property-arrow\",\n x1: sourceX,\n y1: implicitPropArrowY,\n x2: targetX,\n y2: implicitPropArrowY\n })\n .style(\"stroke-width\", basicArrowStrokeWidth)\n .attr(\"marker-end\", \"url(\" + $location.absUrl() + \"#arrow)\");\n\n legendCellGroup\n .append(\"text\")\n .attr({\n x: legendTextX,\n y: implicitPropArrowY + (width / 370)\n })\n .style('font-size', legendLabelFontSize + 'px')\n .text(\"implicit property\");\n\n var collapsedPropArrowY = implicitPropArrowY + width / 45;\n legendCellGroup\n .append(\"line\")\n .attr({\n class: \"collapsed-property-arrow\",\n x1: sourceX,\n y1: collapsedPropArrowY,\n x2: targetX,\n y2: collapsedPropArrowY\n })\n .style(\"stroke-width\", collapsedArrowStrokeWidth)\n .attr(\"marker-end\", \"url(\" + $location.absUrl() + \"#collapsed-arrow)\");\n\n legendCellGroup\n .append(\"text\")\n .attr({\n x: legendTextX,\n y: collapsedPropArrowY + (width / 370)\n })\n .style('font-size', legendLabelFontSize + 'px')\n .text(\"collapsed property\");\n // end of code for legend\n\n // there doesn't seem to be a need for a separate group\n var g = svg; //svg.append(\"g\");\n\n var selectedRdfUri = $location.search().uri;\n var classNodeLabel = $location.search().name;\n var collapsed = $location.search().collapsed;\n\n GraphDataRestService.getDomainRangeData(selectedRdfUri, collapsed)\n .success(function (response, status, headers) {\n scope.domainRangeGraphData = response;\n }).error(function (response) {\n toastr.error(\"Request for \" + classNodeLabel + \" failed!\");\n });\n\n function switchEdgeMode(collapsed) {\n $rootScope.$broadcast('switchEdgeMode', {\n uri: selectedRdfUri,\n name: classNodeLabel,\n collapsed: collapsed\n });\n }\n\n // intercept back button press and set action to local storage\n $(window).on('popstate', function () {\n LocalStorageAdapter.set(LSKeys.DOMAIN_RANGE_WENT_BACK, true);\n });\n\n $window.onpopstate = function (event) {\n if (event.state) {\n $rootScope.$broadcast(\"changeCollapsedEdgesState\", event.state.collapsed);\n }\n };\n\n scope.$watch('collapseEdges', function () {\n if (!angular.isUndefined(scope.collapseEdges)) {\n LocalStorageAdapter.set(LSKeys.DOMAIN_RANGE_COLLAPSE_EDGES, scope.collapseEdges);\n\n // if the back button has not been pressed, then switch to collapsed or non collapsed mode\n // otherwise skip, because back button will not function properly and will not pop the entire\n // history stack\n if (LocalStorageAdapter.get(LSKeys.DOMAIN_RANGE_WENT_BACK) !== \"true\") {\n switchEdgeMode(scope.collapseEdges);\n }\n\n // after back button status has been checked, remove the action from local storage in order\n // to be clean for next check\n LocalStorageAdapter.remove(LSKeys.DOMAIN_RANGE_WENT_BACK);\n }\n });\n\n scope.$watch('domainRangeGraphData', function () {\n if (scope.domainRangeGraphData) {\n var graph = angular.copy(scope.domainRangeGraphData);\n\n force\n .nodes(graph.nodes)\n .links(graph.links);\n\n var linkGroup = g.selectAll(\".link\")\n .data(graph.links)\n .enter()\n .append(\"g\");\n\n function styleArrowsInCollapsedMode(sel) {\n sel.style(\"stroke\", ONTO_BLUE);\n sel.style(\"stroke-width\", collapsedArrowStrokeWidth);\n sel.attr(\"marker-end\", \"url(\" + $location.absUrl() + \"#collapsed-arrow)\");\n }\n\n var link,\n loopLink,\n loopLinkEdgeCount = 0;\n\n\n linkGroup\n .each(function (d) {\n if (d.objectPropNodeClassUri !== selectedRdfUri) {\n link = linkGroup\n .append(\"line\")\n .attr({\n class: \"link\",\n // absolute url needed because angular inserts a <base> tag\n \"marker-end\": \"url(\" + $location.absUrl() + \"#arrow)\"\n })\n .style(\"stroke-width\", basicArrowStrokeWidth)\n .each(function (d) {\n switch (d.propertyType) {\n case \"objectLeft\":\n d.targetRadius = mainClassSize;\n break;\n case \"objectRight\":\n d.targetRadius = otherClassSize;\n break;\n case \"datatype\":\n d.targetRadius = datatypeSize;\n break;\n default:\n d.targetRadius = 0;\n }\n var sel = d3.select(this);\n if (d.targetNodeEdgeCount > 1) {\n styleArrowsInCollapsedMode(sel);\n } else if (d.implicit) {\n sel.style(\"stroke-dasharray\", \"3, 3\");\n }\n });\n } else {\n if (angular.isUndefined(loopLink)) {\n var loopLinkSize = mainClassSize / 2;\n loopLink = d3.select(this)\n .append(\"path\")\n .attr({\n d: \"M 0 0 A \" + loopLinkSize + \" \" + loopLinkSize + \" 0 1 1 0 \" + loopLinkSize,\n class: \"loop-link\",\n fill: \"none\",\n \"marker-end\": \"url(\" + $location.absUrl() + \"#arrow-loop)\"\n })\n .style(\"stroke-width\", basicArrowStrokeWidth);\n }\n\n loopLinkEdgeCount += d.targetNodeEdgeCount;\n if (loopLinkEdgeCount > 1) {\n styleArrowsInCollapsedMode(d3.select(\".loop-link\"));\n }\n }\n });\n\n var previousPropertyNameSelection = {};\n\n function disableCollapsedPredicateLabelHightlighting() {\n if (!$.isEmptyObject(previousPropertyNameSelection)) {\n previousPropertyNameSelection.text.style(\"fill\", \"black\");\n previousPropertyNameSelection.background.style(\"fill\", \"#f0f0f0\");\n }\n }\n\n // when clicking anywhere else but the collapsed labels disable highlighting\n // of the currently selected one\n $(\"document\").ready(function () {\n $(\"#domain-range\").bind(\"click\", disableCollapsedPredicateLabelHightlighting);\n });\n\n function onCollapsedPropertyNameClick(d) {\n disableCollapsedPredicateLabelHightlighting();\n previousPropertyNameSelection.text = d3.select(this);\n\n previousPropertyNameSelection.background = d3.select(this.previousSibling);\n previousPropertyNameSelection.text.style(\"fill\", \"white\");\n\n previousPropertyNameSelection.background.style(\"fill\", ONTO_BLUE);\n $timeout(function () {\n scope.showPredicatesInfoPanel = true;\n scope.selectedPredicate = d;\n });\n d3.event.stopPropagation();\n }\n\n\n var propertyNames = linkGroup\n .append(\"text\")\n .attr(\"class\", function (d) {\n return d.objectPropNodeClassUri === selectedRdfUri ? \"loop-link-property-name\" : \"property-name\";\n })\n .attr(\"dx\", function (d) {\n // offset text more towards the main class\n return mainClassSize / 2 * (d.propertyType === \"objectLeft\" ? 1 : -1);\n })\n .style(\"text-anchor\", function (d) {\n return d.propertyType === \"objectLeft\" ? \"end\" : \"start\";\n })\n .style(\"font-size\", labelFontSize)\n .text(function (d) {\n return d.targetNodeEdgeCount > 1 ? d.targetNodeEdgeCount + \" predicates\" : d.name;\n });\n\n\n propertyNames\n .each(function (d) {\n var sel = d3.select(this);\n var isCompoundEdge = /\\d\\spredicates/.test(sel.text());\n\n // handle collapsed predicates by making their font bold, make them highlight when clicked\n // and make them trigger the side panel to display the collapsed edges\n if (isCompoundEdge) {\n sel\n .style(\"font-weight\", \"bold\")\n .on(\"click\", onCollapsedPropertyNameClick);\n } else {\n // for regular predicate labels just attach a link to the \"Resources\" view\n // for more helpful information regarding them\n sel.on(\"click\", function (d) {\n $window.open(\"resource?uri=\" + encodeURIComponent(d.uri), \"_blank\");\n });\n }\n });\n var textPadding = width / 600;\n\n\n var linkRect = linkGroup\n .append(\"rect\")\n .attr(\"class\", function (d) {\n return d.objectPropNodeClassUri !== selectedRdfUri ? \"link-background\" : \"loop-link-background\"\n })\n .attr(\"width\", function (d) {\n d.calculatedWidth = this.previousSibling.getBBox().width;\n return d.calculatedWidth + textPadding * 2;\n })\n .attr(\"height\", function (d) {\n d.calculatedHeight = this.previousSibling.getBBox().height;\n return d.calculatedHeight + textPadding;\n })\n .attr(\"transform\", function (d) {\n // offset rect by the same amount as text (besides the padding)\n var translateX = textPadding - mainClassSize / 2 * (d.propertyType === \"objectLeft\" ? 1 : -1);\n if (d.propertyType === \"objectLeft\") {\n translateX += d.calculatedWidth;\n }\n return \"translate(-\" + translateX + \",-\" + (textPadding + d.calculatedHeight / 2) + \")\";\n })\n .on(\"click\", function (d) {\n d3.event.stopPropagation();\n });\n\n\n var nodeGroup = g.selectAll(\".node\")\n .data(graph.nodes)\n .enter()\n .append(\"g\");\n\n var node = nodeGroup\n .filter(function (d) {\n return d.objectPropClassUri !== selectedRdfUri;\n })\n .append(\"circle\")\n .each(function (d) {\n var sel = d3.select(this);\n if (d.classPosition === \"main\") {\n sel.attr({\n class: \"class-node\",\n r: mainClassSize\n })\n .attr(\"marker-end\", \"url(\" + $location.absUrl() + \"#loop-link)\");\n } else if (d.objectPropClassName === null) {\n sel.attr({\n class: \"datatype-node\",\n r: datatypeSize\n });\n } else {\n sel.attr({\n class: \"object-prop-node\",\n r: otherClassSize\n });\n }\n })\n .call(drag);\n\n\n function reloadDomainRangeGraphView(d, collapsed) {\n scope.$apply(function () {\n $rootScope.$broadcast('reloadDomainRangeGraphView', d, collapsed);\n });\n }\n\n d3.selectAll(\".object-prop-node\")\n .on(\"dblclick\", reloadDomainRangeGraphView);\n\n\n nodeGroup\n .filter(function (d) {\n return d.objectPropClassName && d.objectPropClassUri !== selectedRdfUri;\n })\n .append(\"text\")\n .attr(\"class\", function (d) {\n return d.classPosition + \"-class-label\";\n })\n .style(\"font-size\", labelFontSize)\n .text(function (d) {\n return d.objectPropClassName;\n })\n .on(\"click\", function (d) {\n $window.open(\"resource?uri=\" + encodeURIComponent(d.objectPropClassUri), \"_blank\");\n });\n\n var objectPropClassName = nodeGroup.select(\"text\");\n\n g.select(\".class-node\")\n .each(function () {\n d3.select(this.parentNode)\n .append(\"text\")\n .attr(\"class\", \"rdf-class-label\")\n .style(\"font-size\", function (d) {\n return D3.Text.calcFontSize(classNodeLabel, mainClassSize)\n })\n .text(classNodeLabel)\n .on(\"click\", function (d) {\n $window.open(\"resource?uri=\" + encodeURIComponent(selectedRdfUri), \"_blank\");\n });\n });\n\n\n var rdfClassName = g.select(\".class-node + text\"),\n classNode = d3.select(\".class-node\"),\n loopLinkBackgroundSel = d3.selectAll(\".loop-link-background\"),\n loopLinkPropertyName = d3.selectAll(\".loop-link-property-name\");\n\n propertyNames = d3.selectAll(\".property-name\");\n\n if (!angular.isUndefined(loopLink)) {\n var loopLinkBackgroundProps = [];\n\n loopLinkBackgroundSel.each(function (d, i) {\n var sel = d3.select(this);\n loopLinkBackgroundProps.push({\n idx: i,\n width: d.calculatedWidth,\n height: d.calculatedHeight\n });\n });\n }\n\n function tick(e) {\n var k = 8 * e.alpha;\n\n function pushEdgesToLeftAndRight(d) {\n if (d.propertyType === \"objectLeft\") {\n d.source.x -= 8 * k;\n d.source.y -= k / 9;\n } else {\n d.target.x += 8 * k;\n d.target.y -= k / 9;\n }\n }\n\n link\n .filter(function (d) {\n return d.objectPropNodeClassUri !== selectedRdfUri;\n })\n .attr(\"x1\", function (d) {\n return d.source.x;\n })\n .attr(\"y1\", function (d) {\n return d.source.y;\n })\n .attr(\"x2\", function (d) {\n return d.targetX;\n })\n .attr(\"y2\", function (d) {\n return d.targetY;\n })\n .each(function (d) {\n pushEdgesToLeftAndRight(d);\n\n // shortens the line to compensate for the circle at the target\n var angle = Math.atan2(d.target.y - d.source.y, d.target.x - d.source.x);\n d.targetX = d.target.x - Math.cos(angle) * d.targetRadius;\n d.targetY = d.target.y - Math.sin(angle) * d.targetRadius;\n });\n\n function positionLoopLink(d) {\n var loopTranslateX = d.x + mainClassSize * 0.96,\n loopTranslateY = d.y - mainClassSize / 5.7 - 5;\n loopLink.attr(\"transform\", \"rotate(270, \" + d.x + \",\" + d.y + \") translate(\" + loopTranslateX + \",\" + loopTranslateY + \")\");\n }\n\n function positionLoopLinkLabels(d) {\n function reposition(sel, i) {\n var foundLoopLinkBackgroundProps =\n $.grep(loopLinkBackgroundProps, function (obj) {\n return obj.idx == i;\n });\n var currentBackgroundHeight = 0;\n if (i > 0) {\n currentBackgroundHeight = parseFloat(2 * i * (foundLoopLinkBackgroundProps[0].height / 1.4));\n }\n\n var loopLinkLabelX = d.x,\n loopLinkLabelY = d.y - mainClassSize * 2.1 - currentBackgroundHeight;\n\n sel\n .attr({\n x: loopLinkLabelX,\n y: loopLinkLabelY\n })\n .moveToFront();\n }\n\n /**\n * Create a \"View more\" label to depict that the are more reflexive link labels\n * left that could be seen in the side panel when clicking this label.\n *\n * @param labelSel\n * d3 selection of the text label\n * @param backgroundSel\n * d3 selection of the rectangle element background\n * @param predicatesLeft\n * number of predicates left that are collapsed\n */\n function createViewMorePredicatesLabel(labelSel, backgroundSel, predicatesLeft) {\n labelSel\n .classed(\"view-more-preds-label\", true)\n .text(predicatesLeft + \" predicates more ...\");\n if (this.nextSibling !== null) {\n backgroundSel\n .classed(\"view-more-preds-rect\", true);\n }\n }\n\n loopLinkPropertyName.each(function (dd, i) {\n var sel = d3.select(this);\n\n var predicatesLeft = loopLinkPropertyName.size() - NON_COLLAPSED_REFLEXIVE_LINK_LIMIT;\n if (predicatesLeft < 0) {\n reposition(sel, i);\n } else {\n if (i == 0 && !scope.collapseEdges && predicatesLeft > 1) {\n createViewMorePredicatesLabel(sel, d3.select(this.nextSibling), predicatesLeft);\n reposition(sel, i);\n }\n\n if (i < NON_COLLAPSED_REFLEXIVE_LINK_LIMIT) {\n reposition(sel, i);\n } else {\n sel.remove();\n }\n }\n });\n // loopLinkPropertyName.each(function (dd, i) {\n // var sel = d3.select(this);\n // if (i < NON_COLLAPSED_REFLEXIVE_LINK_LIMIT) {\n // reposition(sel, i);\n // } else if (i == NON_COLLAPSED_REFLEXIVE_LINK_LIMIT) {\n // createViewMorePredicatesLabel(sel, d3.select(this.nextSibling));\n // reposition(sel, i);\n // } else {\n // sel.remove();\n // }\n // });\n }\n\n function positionLoopLinkBackgrounds(d) {\n var loopLinkBackgroundY = d.x + mainClassSize * 2,\n loopLinkBackgroundX = d.y - mainClassSize / 1.9;\n\n function reposition(sel, i) {\n var foundLoopLinkBackgroundProps =\n $.grep(loopLinkBackgroundProps, function (obj) {\n return obj.idx == i;\n });\n if (i > 0) {\n loopLinkBackgroundY += parseFloat(i * (foundLoopLinkBackgroundProps[0].height / (i / 1.4)));\n }\n\n sel\n .attr({\n transform: \"rotate(270, \" + d.x + \",\" + d.y + \") translate(\" + loopLinkBackgroundY + \",\" + loopLinkBackgroundX + \")\",\n width: foundLoopLinkBackgroundProps[0].height,\n height: foundLoopLinkBackgroundProps[0].width\n });\n }\n\n /**\n * Adjust new width of \"View more\" label background and add all reflexive link metadata the this\n * label in order to render them in the side panel.\n *\n * @param allLoopLinkEdges\n * all reflexive links to the current class\n */\n function adjustViewMorePredicatesLabel(allLoopLinkEdges) {\n var viewMoreTextWidth;\n d3.select(\".view-more-preds-label\")\n // make label bold to resemble a collapsed label\n .style(\"font-weight\", \"bold\")\n .each(function (d) {\n // attach all reflexive links to the \"view more\" collapsed predicate\n // because in non collapsed mode the backend does not provide them\n d.target.allEdges = allLoopLinkEdges;\n\n // calculate text width in pixels in order to adjust background width accordingly\n viewMoreTextWidth = this.getComputedTextLength();\n })\n .on(\"click\", onCollapsedPropertyNameClick);\n\n d3.select(\".view-more-preds-rect\")\n // we modify height property instead of width because they are reversed\n // when we repositioned loop link labels\n .attr(\"height\", viewMoreTextWidth + 2 * textPadding);\n }\n\n var allLoopLinkEdges = [];\n loopLinkBackgroundSel.each(function (dd, i) {\n allLoopLinkEdges.push(dd);\n if (i < NON_COLLAPSED_REFLEXIVE_LINK_LIMIT) {\n reposition(d3.select(this), i);\n } else {\n d3.select(this).remove();\n }\n });\n\n adjustViewMorePredicatesLabel(allLoopLinkEdges);\n }\n\n\n function centerClassNode(d) {\n if (!(window.ActiveXObject) && \"ActiveXObject\" in window) {\n Math.log10 = function (x) {\n return Math.log(x) / Math.LN10;\n };\n }\n var absDiff = classNode.attr(\"cx\") - width / 2,\n logOffset = Math.log10(Math.abs(absDiff)) * 0.5;\n d.x += absDiff > 0 ? -logOffset : logOffset;\n return d.x;\n }\n\n node\n .each(function (d) {\n if (d.classPosition === \"main\" && !angular.isUndefined(loopLink)) {\n positionLoopLink(d);\n positionLoopLinkLabels(d);\n positionLoopLinkBackgrounds(d);\n }\n\n if (d.objectPropClassUri !== selectedRdfUri) {\n d3.select(this)\n .attr(\"cx\", function (d) {\n // pushes the main class circle to the centre\n if (d.classPosition === \"main\") {\n return centerClassNode(d);\n }\n return d.x;\n })\n .attr(\"cy\", function (d) {\n return d.y;\n });\n }\n });\n\n\n rdfClassName\n .attr(\"x\", function (d) {\n return d.x;\n })\n .attr(\"y\", function (d) {\n return d.y;\n })\n .moveToFront();\n\n\n linkRect\n .filter(function (d) {\n return d.objectPropNodeClassUri !== selectedRdfUri;\n })\n .attr(\"x\", function (d) {\n if (d.target.x > d.source.x) {\n return (d.source.x + (d.target.x - d.source.x) / 2);\n } else {\n return (d.target.x + (d.source.x - d.target.x) / 2);\n }\n })\n .attr(\"y\", function (d) {\n if (d.target.y > d.source.y) {\n return (d.source.y + (d.target.y - d.source.y) / 2);\n } else {\n return (d.target.y + (d.source.y - d.target.y) / 2);\n }\n })\n .moveToFront();\n\n\n propertyNames\n .attr(\"x\", function (d) {\n if (d.target.x > d.source.x) {\n return (d.source.x + (d.target.x - d.source.x) / 2);\n } else {\n return (d.target.x + (d.source.x - d.target.x) / 2);\n }\n })\n .attr(\"y\", function (d) {\n if (d.target.y > d.source.y) {\n return (d.source.y + (d.target.y - d.source.y) / 2);\n } else {\n return (d.target.y + (d.source.y - d.target.y) / 2);\n }\n })\n .moveToFront();\n\n\n objectPropClassName\n .attr(\"x\", function (d) {\n if (d.classPosition === \"right\") {\n return d.x + otherClassSize * 1.2;\n } else {\n return d.x - otherClassSize * 1.2;\n }\n })\n .attr(\"y\", function (d) {\n return d.y;\n })\n .moveToFront();\n }\n\n\n force\n .on(\"tick\", tick)\n .linkDistance(width / 3.5)\n .start();\n\n }\n });\n\n function dragstart(d) {\n d3.select(this)\n .classed(\"selected\", d.selected = true);\n }\n }\n}\n"],"sourceRoot":""}
@@ -0,0 +1,2 @@
1
+ (window.webpackJsonp=window.webpackJsonp||[]).push([[4,113],{43:function(e,t){angular.module("graphdb.framework.rest.cluster.service",[]).factory("ClusterRestService",n),n.$inject=["$http"];function n(e){return{getClusterConfig:function(){return e.get("rest/cluster/config")},createCluster:function(t){return e.post("rest/cluster/config",t)},updateCluster:function(t){t.nodes&&delete t.nodes;return e.patch("rest/cluster/config",t)},deleteCluster:function(t){const n=$.param({force:t});return e.delete("rest/cluster/config?"+n)},addNodesToCluster:function(t){return e.post("rest/cluster/config/node",{nodes:t})},removeNodesFromCluster:function(t){return e.delete("rest/cluster/config/node",{data:{nodes:t},headers:{"Content-Type":"application/json"}})},getClusterStatus:function(){return e.get("rest/cluster/group/status")},getNodeStatus:function(){return e.get("rest/cluster/node/status")}}}},59:function(e,t,n){"use strict";n.r(t),n.d(t,"NodeState",(function(){return o})),n.d(t,"LinkState",(function(){return r}));n(4),n(43);angular.module("graphdb.framework.clustermanagement.controllers",["ui.bootstrap","graphdb.framework.core.services.repositories","graphdb.framework.rest.repositories.service","graphdb.framework.rest.cluster.service","toastr","pageslide-directive"]).controller("ClusterManagementCtrl",s).controller("CreateClusterCtrl",l).controller("DeleteClusterCtrl",c).controller("EditClusterCtrl",d).controller("AddLocationFromClusterCtrl",u).controller("AddNodesDialogCtrl",f).controller("RemoveNodesDialogCtrl",m).factory("RemoteLocationsService",i);const o={LEADER:"LEADER",FOLLOWER:"FOLLOWER",CANDIDATE:"CANDIDATE",OUT_OF_SYNC:"OUT_OF_SYNC",NO_CONNECTION:"NO_CONNECTION",READ_ONLY:"READ_ONLY",RESTRICTED:"RESTRICTED",NO_CLUSTER:"NO_CLUSTER"},r={IN_SYNC:"IN_SYNC",OUT_OF_SYNC:"OUT_OF_SYNC",SYNCING:"SYNCING",NO_CONNECTION:"NO_CONNECTION"};function s(e,t,n,s,a,l,c,i,u,d,g,f,m,p,C,h){e.loader=!0,e.isLeader=!1,e.currentNode=null,e.clusterModel={},e.NodeState=o,e.leaderChanged=!1,e.currentLeader=null,e.childContext={},e.shouldShowClusterSettingsPanel=!1;let _;function N(t){_||(_=e.getClusterStatus().then(()=>{if(t||!e.clusterConfiguration)return e.getClusterConfiguration()}).then(()=>{if(!e.currentNode||e.leaderChanged)return e.getCurrentNodeStatus()}).finally(()=>{_=null,e.childContext.redraw()}))}function L(){return C.getLocationsWithRpcAddresses().then(t=>{const n=t.find(e=>e.isLocal);n&&(n.endpoint=e.currentNode.endpoint,n.rpcAddress=e.currentNode.address),e.clusterModel.locations=t})}function $(t){s.success(t),e.getClusterConfiguration()}function v(e,t,n){let o=e.message||e;400===t&&Array.isArray(e)?o=e.reduce((e,t)=>e+`<div>${t}</div>`,""):412===t&&(o=Object.keys(e).reduce((t,n)=>t+`<div>${n} - ${e[n]}</div>`,"")),s.error(o,n,{allowHtml:!0})}e.onopen=e.onclose=()=>angular.noop(),e.toggleSidePanel=()=>{e.shouldShowClusterSettingsPanel=!e.shouldShowClusterSettingsPanel},e.toggleLegend=()=>{e.childContext.toggleLegend&&e.childContext.toggleLegend()},e.setLoader=function(t,n){g.cancel(e.loaderTimeout),t?(e.loaderMessage=n,e.loaderTimeout=g((function(){e.loader=t}),50)):e.loader=!1},e.childContext.selectNode=function(t){e.selectedNode!==t?e.selectedNode=t:e.selectedNode=null,e.$apply()},e.getLoaderMessage=function(){return e.loaderMessage||p.instant("common.loading")},e.getClusterConfiguration=()=>f.getClusterConfig().then(t=>{if(e.clusterConfiguration=t.data,!e.currentNode)return e.getCurrentNodeStatus()}).catch(()=>{e.clusterConfiguration=null}),e.getClusterStatus=function(){return f.getClusterStatus().then((function(t){const n=t.data.slice(),s=n.find(e=>e.nodeState===o.LEADER);var a,l;a=e.currentLeader,(l=s)&&a&&a.address===l.address||(e.currentLeader=s,e.leaderChanged=!0),e.currentNode=n.find(t=>t.address===e.currentNode.address);const c=[];s&&Object.keys(s.syncStatus).forEach(e=>{const t=s.syncStatus[e];t!==r.NO_CONNECTION&&c.push({id:`${s.address}-${e}`,source:s.address,target:e,status:t})}),e.clusterModel.hasCluster=!0,e.clusterModel.nodes=n,e.clusterModel.links=c})).catch((function(t){404===t.status&&(e.clusterModel.hasCluster=!1,e.clusterModel.nodes=[],e.clusterModel.links=[],e.clusterConfiguration=null)}))},e.showCreateClusterDialog=function(){l.open({templateUrl:"js/angular/clustermanagement/templates/modal/cluster-create-dialog.html",controller:"CreateClusterCtrl",size:"lg",resolve:{data:function(){return{clusterModel:e.clusterModel}}}}).result.finally((function(){L(),N(!0)}))},e.showDeleteDialog=()=>{l.open({templateUrl:"js/angular/clustermanagement/templates/modal/cluster-delete-dialog.html",controller:"DeleteClusterCtrl"}).result.then((function(t){const n=p.instant("cluster_management.delete_cluster_dialog.loader_message");e.setLoader(!0,n),f.deleteCluster(t).then(t=>{if(Object.values(t.data).every(e=>"Cluster was deleted on this node."===e)){const e=p.instant("cluster_management.delete_cluster_dialog.notifications.success_delete");s.success(e)}else{const e=p.instant("cluster_management.delete_cluster_dialog.notifications.success_delete_partial"),n=Object.keys(t.data).reduce((e,n)=>e+`<div>${n} - ${t.data[n]}</div>`,"");s.warning(n,e,{allowHtml:!0})}e.getClusterConfiguration()}).catch(e=>{const t=p.instant("cluster_management.delete_cluster_dialog.notifications.fail_delete"),n=Object.keys(e.data).reduce((t,n)=>t+`<div>${n} - ${e.data[n]}</div>`,"");s.error(n,t,{allowHtml:!0})}).finally(()=>{e.setLoader(!1),N(!0),h.$broadcast("reloadLocations")})}))},e.showEditConfigurationDialog=()=>{l.open({templateUrl:"js/angular/clustermanagement/templates/modal/cluster-edit-dialog.html",controller:"EditClusterCtrl",size:"lg",resolve:{data:function(){return{clusterConfiguration:e.clusterConfiguration}}}}).result.finally((function(){N(!0)}))},e.getCurrentNodeStatus=()=>f.getNodeStatus().then(t=>{e.leaderChanged=!1,e.currentNode=t.data}).catch(t=>{e.currentNode=t.data,e.clusterModel.hasCluster=!1}).then(()=>L()),e.showAddNodeToClusterDialog=()=>{l.open({templateUrl:"js/angular/clustermanagement/templates/modal/add-nodes-dialog.html",controller:"AddNodesDialogCtrl",size:"lg",resolve:{data:function(){return{clusterModel:e.clusterModel,clusterConfiguration:e.clusterConfiguration}}}}).result.then((function(t){const n=p.instant("cluster_management.cluster_page.add_nodes_loader");e.setLoader(!0,n);const o=t.map(e=>e.rpcAddress);f.addNodesToCluster(o).then(()=>{$(p.instant("cluster_management.cluster_page.notifications.add_nodes_success"))}).catch(e=>{const t=p.instant("cluster_management.cluster_page.notifications.add_nodes_fail");v(e.data,e.status,t)}).finally(()=>{e.setLoader(!1),N(!0)})})).finally(()=>L())},e.showRemoveNodesFromClusterDialog=()=>{l.open({templateUrl:"js/angular/clustermanagement/templates/modal/remove-nodes-dialog.html",controller:"RemoveNodesDialogCtrl",size:"lg",resolve:{data:function(){return{clusterModel:e.clusterModel}}}}).result.then((function(t){const n=p.instant("cluster_management.cluster_page.remove_nodes_loader");e.setLoader(!0,n);const o=t.map(e=>e.address);f.removeNodesFromCluster(o).then(()=>{$(p.instant("cluster_management.cluster_page.notifications.remove_nodes_success"))}).catch(e=>{const t=p.instant("cluster_management.cluster_page.notifications.remove_nodes_fail");v(e.data,e.status,t)}).finally(()=>{e.setLoader(!1),N(!0)})}))},(e.loader=!0,e.getCurrentNodeStatus().then(()=>e.getClusterConfiguration()).then(()=>e.getClusterStatus()).finally(()=>{e.setLoader(!1)})).finally(()=>{const t=u((function(){N()}),1e3);e.$on("$destroy",(function(){u.cancel(t)}))});const S=angular.element(i),w=function(){e.childContext.resize()};S.bind("resize",w);const T=function(t){const n=t.target,o=document.getElementById("nodeTooltip");e.selectedNode&&o!==n&&!o.contains(n)&&e.childContext.selectNode(null)};S.bind("mousedown",T),e.$on("$destroy",(function(){S.unbind("resize",w),S.unbind("mousedown",T)}))}s.$inject=["$scope","$http","$q","toastr","$repositories","$uibModal","$sce","$window","$interval","ModalService","$timeout","ClusterRestService","$location","$translate","RemoteLocationsService","$rootScope"];const a=function(){const e=document.getElementById("advancedOptions");if(e){const t=e.getAttribute("aria-expanded");if(t&&"true"===t)return"fa fa-angle-down"}return"fa fa-angle-right"};function l(e,t,n,o,r,s,l,c,i,u){e.pageTitle=s.instant("cluster_management.cluster_page.create_page_title"),e.autofocusId="autofocus",e.errors=[],e.clusterConfiguration={electionMinTimeout:8e3,electionRangeTimeout:6e3,heartbeatInterval:2e3,messageSizeKB:64,verificationTimeout:1500,nodes:[]},e.locations=l.clusterModel.locations.filter(e=>!e.isLocal),e.selectedLocations=l.clusterModel.locations.filter(e=>e.isLocal),e.loader=!1,e.getAdvancedOptionsClass=a,e.createCluster=function(){return e.setLoader(!0,s.instant("cluster_management.cluster_page.creating_cluster_loader")),e.clusterConfiguration.nodes=e.selectedLocations.map(e=>e.rpcAddress),o.createCluster(e.clusterConfiguration).then(()=>{r.success(s.instant("cluster_management.cluster_page.notifications.create_success")),t.close()}).catch((function(t){!function(t,n){delete e.preconditionErrors,r.error(s.instant("cluster_management.cluster_page.notifications.create_failed")),e.errors.splice(0),412===n?e.preconditionErrors=Object.keys(t).map(e=>`${e} - ${t[e]}`):400===n?e.errors.push(...t):409===n&&e.errors.push(t)}(t.data,t.status)})).finally(()=>{e.setLoader(!1),u.$broadcast("reloadLocations")})},e.isClusterConfigurationValid=()=>{const t=!e.clusterConfigurationForm.$invalid,n=e.selectedLocations&&e.selectedLocations.length>=2;return t&&n},e.setLoader=function(t,o){n.cancel(e.loaderTimeout),t?e.loaderTimeout=n((function(){e.loader=t,e.loaderMessage=o}),300):e.loader=!1},e.addNodeToList=function(t){t.rpcAddress&&(e.selectedLocations.push(t),e.locations=e.locations.filter(e=>e.endpoint!==t.endpoint))},e.removeNodeFromList=function(t,n){n.isLocal||(e.selectedLocations.splice(t,1),e.locations.push(n))},e.addLocation=function(){i.addLocation().then(t=>{t&&e.locations.push(t)})},e.ok=function(){e.isClusterConfigurationValid()?e.createCluster():r.warning(s.instant("cluster_management.cluster_page.notifications.form_invalid"))},e.cancel=function(){t.dismiss("cancel")}}function c(e,t){e.forceDelete=!1,e.ok=function(){t.close(e.forceDelete)},e.cancel=function(){t.dismiss("cancel")}}function i(e,t,n,o,r){return{addLocation:function(){let e;return n.open({templateUrl:"js/angular/templates/modal/add-location.html",windowClass:"addLocationDialog",controller:"AddLocationFromClusterCtrl"}).result.then(n=>(e=n,e.isLocal=!1,e.endpoint=e.uri,function(e){let n;return o.addLocation(e).catch(e=>{const n=getError(e.data,e.status);return t.error(n,r.instant("common.error")),!1}).then(e=>!!e&&s()).then(t=>{if(!1!==t)return n=t.find(t=>t.endpoint===e.uri),n})}(e)))},getLocationsWithRpcAddresses:s};function s(){return o.getLocations().then((function(e){return e.data.map(e=>({isLocal:e.local,endpoint:e.uri,rpcAddress:e.rpcAddress||"",error:e.errorMsg}))})).catch((function(e){const n=getError(e.data,e.status);t.error(n,r.instant("common.error"))})).then(e=>{if(e)return function(e){const t=e.filter(e=>!e.isLocal&&!e.error).map(e=>function(e){return o.getLocationRpcAddress(e.endpoint)}(e).then(t=>(e.rpcAddress=t.data,e.isAvailable=!0,e)).catch(t=>{e.isAvailable=!1,e.error=getError(t.data,t.status)}));return Promise.allSettled(t).then(()=>e)}(e)})}}function u(e,t,n,o,r){e.newLocation={uri:"",authType:"signature",username:"",password:"",active:!1},e.docBase=g(o),e.isValidLocation=function(){return(e.newLocation.uri.length<6||0===e.newLocation.uri.indexOf("http:")||0===e.newLocation.uri.indexOf("https:"))&&e.newLocation.uri.indexOf("/repositories")<=-1},e.ok=function(){e.newLocation?t.close(e.newLocation):n.error(r.instant("location.cannot.be.empty.error"))},e.cancel=function(){t.dismiss("cancel")}}function d(e,t,n,o,r,s,a){e.pageTitle=s.instant("cluster_management.cluster_page.edit_page_title"),e.errors=[],e.clusterConfiguration=angular.copy(a.clusterConfiguration),e.loader=!1,e.updateCluster=function(){return e.setLoader(!0,s.instant("cluster_management.cluster_page.updating_cluster_loader")),o.updateCluster(e.clusterConfiguration).then(()=>{r.success(s.instant("cluster_management.cluster_page.notifications.update_success")),t.close()}).catch((function(t){!function(t,n){delete e.preconditionErrors,r.error(s.instant("cluster_management.cluster_page.notifications.update_failed")),e.errors.splice(0),409===n||"string"==typeof t?e.errors.push(t):412===n?e.preconditionErrors=Object.keys(t).map(e=>`${e} - ${t[e]}`):400===n&&e.errors.push(...t)}(t.data,t.status)})).finally(()=>e.setLoader(!1))},e.isClusterConfigurationValid=()=>!e.clusterConfigurationForm.$invalid,e.setLoader=function(t,o){n.cancel(e.loaderTimeout),t?e.loaderTimeout=n((function(){e.loader=t,e.loaderMessage=o}),300):e.loader=!1},e.ok=function(){e.isClusterConfigurationValid()?e.updateCluster():r.warning(s.instant("cluster_management.cluster_page.notifications.form_invalid"))},e.cancel=function(){t.dismiss("cancel")}}l.$inject=["$scope","$uibModalInstance","$timeout","ClusterRestService","toastr","$translate","data","$uibModal","RemoteLocationsService","$rootScope"],c.$inject=["$scope","$uibModalInstance"],i.$inject=["$http","toastr","$uibModal","LocationsRestService","$translate"],u.$inject=["$scope","$uibModalInstance","toastr","productInfo","$translate"],d.$inject=["$scope","$uibModalInstance","$timeout","ClusterRestService","toastr","$translate","data"];const g=function(e){return"https://graphdb.ontotext.com/documentation/"+e.productShortVersion};function f(e,t,n,o,r){const s=angular.copy(n.clusterConfiguration),a=angular.copy(n.clusterModel);e.nodes=[],e.clusterNodes=a.nodes.map(e=>({rpcAddress:e.address,endpoint:e.endpoint})),e.locations=a.locations.filter(e=>!s.nodes.includes(e.rpcAddress)),e.locations.forEach(e=>e.isNew=!0),e.addNodeToList=function(t){t.rpcAddress&&(e.nodes.push(t),e.locations=e.locations.filter(e=>e.endpoint!==t.endpoint))},e.removeNodeFromList=function(t,n){e.nodes.splice(t,1),e.locations.push(n)},e.addLocation=function(){r.addLocation().then(t=>{t&&e.locations.push(t)})},e.ok=function(){t.close(e.nodes)},e.cancel=function(){t.dismiss("cancel")}}function m(e,t,n){const o=angular.copy(n.clusterModel);e.clusterNodes=o.nodes,e.clusterNodes.forEach(e=>e.shouldRemove=!1),e.nodesToRemoveCount=0,e.leftNodesLessThanTwo=!1,e.toggleNode=function(t,n){n.shouldRemove=!n.shouldRemove,n.shouldRemove?e.nodesToRemoveCount++:e.nodesToRemoveCount--,e.leftNodesLessThanTwo=e.clusterNodes.length-e.nodesToRemoveCount<2},e.ok=function(){const n=e.clusterNodes.filter(e=>e.shouldRemove);t.close(n)},e.cancel=function(){t.dismiss("cancel")}}f.$inject=["$scope","$uibModalInstance","data","$uibModal","RemoteLocationsService"],m.$inject=["$scope","$uibModalInstance","data"]}}]);
2
+ //# sourceMappingURL=4.ca3eb6b5da0890c0abe0.bundle.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["webpack:///./src/js/angular/rest/cluster.rest.service.js","webpack:///./src/js/angular/clustermanagement/controllers.js"],"names":["angular","module","factory","ClusterRestService","$inject","$http","getClusterConfig","get","createCluster","groupConfiguration","post","updateCluster","nodes","patch","deleteCluster","forceDelete","data","$","param","force","delete","addNodesToCluster","nodesArray","removeNodesFromCluster","headers","getClusterStatus","getNodeStatus","controller","ClusterManagementCtrl","CreateClusterCtrl","DeleteClusterCtrl","EditClusterCtrl","AddLocationFromClusterCtrl","AddNodesDialogCtrl","RemoveNodesDialogCtrl","RemoteLocationsService","NodeState","LEADER","FOLLOWER","CANDIDATE","OUT_OF_SYNC","NO_CONNECTION","READ_ONLY","RESTRICTED","NO_CLUSTER","LinkState","IN_SYNC","SYNCING","$scope","$q","toastr","$repositories","$uibModal","$sce","$window","$interval","ModalService","$timeout","$location","$translate","$rootScope","loader","isLeader","currentNode","clusterModel","leaderChanged","currentLeader","childContext","shouldShowClusterSettingsPanel","updateRequest","then","clusterConfiguration","getClusterConfiguration","getCurrentNodeStatus","finally","redraw","getLocationsWithRpcAddresses","locations","localNode","find","location","isLocal","endpoint","rpcAddress","address","onAddRemoveSuccess","message","success","handleAddRemoveErrors","status","title","failMessage","Array","isArray","reduce","acc","error","Object","keys","key","allowHtml","onopen","onclose","noop","toggleSidePanel","toggleLegend","setLoader","cancel","loaderTimeout","loaderMessage","selectNode","node","selectedNode","$apply","getLoaderMessage","instant","response","catch","slice","leader","nodeState","newLeader","links","syncStatus","forEach","push","id","source","target","hasCluster","showCreateClusterDialog","open","templateUrl","size","resolve","result","showDeleteDialog","values","every","resultMsg","successMessage","failedNodesList","warning","$broadcast","showEditConfigurationDialog","showAddNodeToClusterDialog","nodesRpcAddress","map","failMessageTitle","showRemoveNodesFromClusterDialog","timer","$on","w","element","resize","bind","mousedown","event","nodeTooltipElement","document","getElementById","contains","unbind","getAdvancedOptionsClass","optionsModule","isAriaExpanded","getAttribute","$uibModalInstance","pageTitle","autofocusId","errors","electionMinTimeout","electionRangeTimeout","heartbeatInterval","messageSizeKB","verificationTimeout","filter","selectedLocations","close","preconditionErrors","splice","handleErrors","isClusterConfigurationValid","isFormValid","clusterConfigurationForm","$invalid","nodesListValid","length","addNodeToList","loc","removeNodeFromList","index","addLocation","newLocation","ok","dismiss","LocationsRestService","windowClass","dataAddLocation","uri","locationData","msg","getError","locationAdded","addLocationHttp","getLocations","local","errorMsg","locationsArray","rpcAddressFetchers","getLocationRpcAddress","isAvailable","Promise","allSettled","getRemoteLocationsRpcAddresses","productInfo","docBase","getDocBase","isValidLocation","indexOf","copy","productShortVersion","clusterNodes","includes","isNew","shouldRemove","nodesToRemoveCount","leftNodesLessThanTwo","toggleNode","nodesToRemove"],"mappings":"8EAAAA,QACKC,OAAO,yCAA0C,IACjDC,QAAQ,qBAAsBC,GAEnCA,EAAmBC,QAAU,CAAC,SAI9B,SAASD,EAAmBE,GACxB,MAAO,CACHC,iBAUJ,WACI,OAAOD,EAAME,IAAI,wBAVjBC,cAaJ,SAAuBC,GACnB,OAAOJ,EAAMK,KAAK,sBAAoCD,IAbtDE,cAgBJ,SAAuBF,GACfA,EAAmBG,cACZH,EAAmBG,MAE9B,OAAOP,EAAMQ,MAAM,sBAAoCJ,IAnBvDK,cAsBJ,SAAuBC,GACnB,MAAMC,EAAOC,EAAEC,MAAM,CACjBC,MAAOJ,IAEX,OAAOV,EAAMe,OAAO,uBAAoCJ,IAzBxDK,kBA4BJ,SAA2BC,GACvB,OAAOjB,EAAMK,KAAK,2BAAyC,CAACE,MAAOU,KA5BnEC,uBA+BJ,SAAgCD,GAC5B,OAAOjB,EAAMe,OAAO,2BAAyC,CAACJ,KAAM,CAACJ,MAAOU,GAAaE,QAAS,CAAC,eAAgB,uBA/BnHC,iBAkCJ,WACI,OAAOpB,EAAME,IAAI,8BAlCjBmB,cAqCJ,WACI,OAAOrB,EAAME,IAAI,gC,gCCvDzB,sGAYAP,QACKC,OAAO,kDAVI,CACZ,eACA,+CACA,8CACA,yCACA,SACA,wBAKC0B,WAAW,wBAAyBC,GACpCD,WAAW,oBAAqBE,GAChCF,WAAW,oBAAqBG,GAChCH,WAAW,kBAAmBI,GAC9BJ,WAAW,6BAA8BK,GACzCL,WAAW,qBAAsBM,GACjCN,WAAW,wBAAyBO,GACpChC,QAAQ,yBAA0BiC,GAEhC,MAAMC,EAAY,CACrBC,OAAQ,SACRC,SAAU,WACVC,UAAW,YACXC,YAAa,cACbC,cAAe,gBACfC,UAAW,YACXC,WAAY,aACZC,WAAY,cAEHC,EAAY,CACrBC,QAA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nL,EAAOoL,WAAa,SAAUrC,EAAOhF,GACjCA,EAAKkH,cAAgBlH,EAAKkH,aACtBlH,EAAKkH,aACLjL,EAAOkL,qBAEPlL,EAAOkL,qBAEXlL,EAAOmL,qBAAuBnL,EAAO8K,aAAanC,OAAS3I,EAAOkL,mBAAqB,GAG3FlL,EAAOkJ,GAAK,WACR,MAAMmC,EAAgBrL,EAAO8K,aAAa9C,OAAQjE,GAASA,EAAKkH,cAChE1D,EAAkBW,MAAMmD,IAG5BrL,EAAO2D,OAAS,WACZ4D,EAAkB4B,QAAQ,WApElClK,EAAmB7B,QAAU,CAAC,SAAU,oBAAqB,OAAQ,YAAa,0BA0ClF8B,EAAsB9B,QAAU,CAAC,SAAU,oBAAqB","file":"4.ca3eb6b5da0890c0abe0.bundle.js","sourcesContent":["angular\n .module('graphdb.framework.rest.cluster.service', [])\n .factory('ClusterRestService', ClusterRestService);\n\nClusterRestService.$inject = ['$http'];\n\nconst CLUSTER_GROUP_ENDPOINT = 'rest/cluster';\n\nfunction ClusterRestService($http) {\n return {\n getClusterConfig,\n createCluster,\n updateCluster,\n deleteCluster,\n addNodesToCluster,\n removeNodesFromCluster,\n getClusterStatus,\n getNodeStatus\n };\n\n function getClusterConfig() {\n return $http.get(`${CLUSTER_GROUP_ENDPOINT}/config`);\n }\n\n function createCluster(groupConfiguration) {\n return $http.post(`${CLUSTER_GROUP_ENDPOINT}/config`, groupConfiguration);\n }\n\n function updateCluster(groupConfiguration) {\n if (groupConfiguration.nodes) {\n delete groupConfiguration.nodes;\n }\n return $http.patch(`${CLUSTER_GROUP_ENDPOINT}/config`, groupConfiguration);\n }\n\n function deleteCluster(forceDelete) {\n const data = $.param({\n force: forceDelete\n });\n return $http.delete(`${CLUSTER_GROUP_ENDPOINT}/config?${data}`);\n }\n\n function addNodesToCluster(nodesArray) {\n return $http.post(`${CLUSTER_GROUP_ENDPOINT}/config/node`, {nodes: nodesArray});\n }\n\n function removeNodesFromCluster(nodesArray) {\n return $http.delete(`${CLUSTER_GROUP_ENDPOINT}/config/node`, {data: {nodes: nodesArray}, headers: {'Content-Type': 'application/json'}});\n }\n\n function getClusterStatus() {\n return $http.get(`${CLUSTER_GROUP_ENDPOINT}/group/status`);\n }\n\n function getNodeStatus() {\n return $http.get(`${CLUSTER_GROUP_ENDPOINT}/node/status`);\n }\n}\n","import 'angular/core/services';\nimport 'angular/rest/cluster.rest.service';\n\nconst modules = [\n 'ui.bootstrap',\n 'graphdb.framework.core.services.repositories',\n 'graphdb.framework.rest.repositories.service',\n 'graphdb.framework.rest.cluster.service',\n 'toastr',\n 'pageslide-directive'\n];\n\nangular\n .module('graphdb.framework.clustermanagement.controllers', modules)\n .controller('ClusterManagementCtrl', ClusterManagementCtrl)\n .controller('CreateClusterCtrl', CreateClusterCtrl)\n .controller('DeleteClusterCtrl', DeleteClusterCtrl)\n .controller('EditClusterCtrl', EditClusterCtrl)\n .controller('AddLocationFromClusterCtrl', AddLocationFromClusterCtrl)\n .controller('AddNodesDialogCtrl', AddNodesDialogCtrl)\n .controller('RemoveNodesDialogCtrl', RemoveNodesDialogCtrl)\n .factory('RemoteLocationsService', RemoteLocationsService);\n\nexport const NodeState = {\n LEADER: 'LEADER',\n FOLLOWER: 'FOLLOWER',\n CANDIDATE: 'CANDIDATE',\n OUT_OF_SYNC: 'OUT_OF_SYNC',\n NO_CONNECTION: 'NO_CONNECTION',\n READ_ONLY: 'READ_ONLY',\n RESTRICTED: 'RESTRICTED',\n NO_CLUSTER: 'NO_CLUSTER'\n};\nexport const LinkState = {\n IN_SYNC: 'IN_SYNC',\n OUT_OF_SYNC: 'OUT_OF_SYNC',\n SYNCING: 'SYNCING',\n NO_CONNECTION: 'NO_CONNECTION'\n};\n\nClusterManagementCtrl.$inject = ['$scope', '$http', '$q', 'toastr', '$repositories', '$uibModal', '$sce',\n '$window', '$interval', 'ModalService', '$timeout', 'ClusterRestService', '$location', '$translate', 'RemoteLocationsService', '$rootScope'];\n\nfunction ClusterManagementCtrl($scope, $http, $q, toastr, $repositories, $uibModal, $sce,\n $window, $interval, ModalService, $timeout, ClusterRestService, $location, $translate, RemoteLocationsService, $rootScope) {\n $scope.loader = true;\n $scope.isLeader = false;\n $scope.currentNode = null;\n $scope.clusterModel = {};\n $scope.NodeState = NodeState;\n $scope.leaderChanged = false;\n $scope.currentLeader = null;\n\n // Holds child context\n $scope.childContext = {};\n\n $scope.shouldShowClusterSettingsPanel = false;\n const DELETED_ON_NODE_MESSAGE = 'Cluster was deleted on this node.';\n $scope.onopen = $scope.onclose = () => angular.noop();\n\n $scope.toggleSidePanel = () => {\n $scope.shouldShowClusterSettingsPanel = !$scope.shouldShowClusterSettingsPanel;\n };\n\n $scope.toggleLegend = () => {\n if ($scope.childContext.toggleLegend) {\n $scope.childContext.toggleLegend();\n }\n };\n\n // TODO: Similar function is declared multiple times in different components. Find out how to avoid it!\n $scope.setLoader = function (loader, message) {\n $timeout.cancel($scope.loaderTimeout);\n if (loader) {\n $scope.loaderMessage = message;\n $scope.loaderTimeout = $timeout(function () {\n $scope.loader = loader;\n }, 50);\n } else {\n $scope.loader = false;\n }\n };\n\n function selectNode(node) {\n if ($scope.selectedNode !== node) {\n $scope.selectedNode = node;\n } else {\n $scope.selectedNode = null;\n }\n $scope.$apply();\n }\n\n $scope.childContext.selectNode = selectNode;\n\n function initialize() {\n $scope.loader = true;\n\n return $scope.getCurrentNodeStatus()\n .then(() => {\n return $scope.getClusterConfiguration();\n })\n .then(() => {\n return $scope.getClusterStatus();\n })\n .finally(() => {\n $scope.setLoader(false);\n });\n }\n\n let updateRequest;\n function updateCluster(force) {\n if (updateRequest) {\n return;\n }\n\n updateRequest = $scope.getClusterStatus()\n .then(() => {\n if (force || !$scope.clusterConfiguration) {\n return $scope.getClusterConfiguration();\n }\n })\n .then(() => {\n if (!$scope.currentNode || $scope.leaderChanged) {\n return $scope.getCurrentNodeStatus();\n }\n })\n .finally(() => {\n updateRequest = null;\n $scope.childContext.redraw();\n });\n }\n\n $scope.getLoaderMessage = function () {\n return $scope.loaderMessage || $translate.instant('common.loading');\n };\n\n $scope.getClusterConfiguration = () => {\n return ClusterRestService.getClusterConfig()\n .then((response) => {\n $scope.clusterConfiguration = response.data;\n if (!$scope.currentNode) {\n return $scope.getCurrentNodeStatus();\n }\n })\n .catch(() => {\n $scope.clusterConfiguration = null;\n });\n };\n\n function isLeaderChanged(currentLeader, newLeader) {\n if (!newLeader) {\n // If election is in place and there is no leader yet, consider it as leader change\n return true;\n }\n return !currentLeader || currentLeader.address !== newLeader.address;\n }\n\n $scope.getClusterStatus = function () {\n return ClusterRestService.getClusterStatus()\n .then(function (response) {\n const nodes = response.data.slice();\n const leader = nodes.find((node) => node.nodeState === NodeState.LEADER);\n\n if (isLeaderChanged($scope.currentLeader, leader)) {\n $scope.currentLeader = leader;\n $scope.leaderChanged = true;\n }\n $scope.currentNode = nodes.find((node) => node.address === $scope.currentNode.address);\n\n const links = [];\n if (leader) {\n Object.keys(leader.syncStatus).forEach((node) => {\n const status = leader.syncStatus[node];\n if (status !== LinkState.NO_CONNECTION) {\n links.push({\n id: `${leader.address}-${node}`,\n source: leader.address,\n target: node,\n status\n });\n }\n });\n }\n $scope.clusterModel.hasCluster = true;\n $scope.clusterModel.nodes = nodes;\n $scope.clusterModel.links = links;\n })\n .catch(function (error) {\n if (error.status === 404) {\n $scope.clusterModel.hasCluster = false;\n $scope.clusterModel.nodes = [];\n $scope.clusterModel.links = [];\n $scope.clusterConfiguration = null;\n }\n });\n };\n\n $scope.showCreateClusterDialog = function () {\n const modalInstance = $uibModal.open({\n templateUrl: 'js/angular/clustermanagement/templates/modal/cluster-create-dialog.html',\n controller: 'CreateClusterCtrl',\n size: 'lg',\n resolve: {\n data: function () {\n return {\n clusterModel: $scope.clusterModel\n };\n }\n }\n });\n\n modalInstance.result.finally(function () {\n getLocationsWithRpcAddresses();\n updateCluster(true);\n });\n };\n\n $scope.showDeleteDialog = () => {\n const modalInstance = $uibModal.open({\n templateUrl: 'js/angular/clustermanagement/templates/modal/cluster-delete-dialog.html',\n controller: 'DeleteClusterCtrl'\n });\n\n modalInstance.result.then(function (forceDelete) {\n const loaderMessage = $translate.instant('cluster_management.delete_cluster_dialog.loader_message');\n $scope.setLoader(true, loaderMessage);\n ClusterRestService.deleteCluster(forceDelete)\n .then((response) => {\n const allNodesDeleted = Object.values(response.data).every((resultMsg) => resultMsg === DELETED_ON_NODE_MESSAGE);\n if (allNodesDeleted) {\n const successMessage = $translate.instant('cluster_management.delete_cluster_dialog.notifications.success_delete');\n toastr.success(successMessage);\n } else {\n const successMessage = $translate.instant(\n 'cluster_management.delete_cluster_dialog.notifications.success_delete_partial');\n const failedNodesList = Object.keys(response.data)\n .reduce((message, key) => message += `<div>${key} - ${response.data[key]}</div>`, '');\n toastr.warning(failedNodesList, successMessage, {allowHtml: true});\n }\n $scope.getClusterConfiguration();\n })\n .catch((error) => {\n const failMessage = $translate.instant('cluster_management.delete_cluster_dialog.notifications.fail_delete');\n const failedNodesList = Object.keys(error.data)\n .reduce((message, key) => message += `<div>${key} - ${error.data[key]}</div>`, '');\n toastr.error(failedNodesList, failMessage, {allowHtml: true});\n })\n .finally(() => {\n $scope.setLoader(false);\n updateCluster(true);\n $rootScope.$broadcast('reloadLocations');\n });\n });\n };\n\n $scope.showEditConfigurationDialog = () => {\n const modalInstance = $uibModal.open({\n templateUrl: 'js/angular/clustermanagement/templates/modal/cluster-edit-dialog.html',\n controller: 'EditClusterCtrl',\n size: 'lg',\n resolve: {\n data: function () {\n return {\n clusterConfiguration: $scope.clusterConfiguration\n };\n }\n }\n });\n\n modalInstance.result.finally(function () {\n updateCluster(true);\n });\n };\n\n $scope.getCurrentNodeStatus = () => {\n return ClusterRestService.getNodeStatus()\n .then((response) => {\n $scope.leaderChanged = false;\n $scope.currentNode = response.data;\n })\n .catch((error) => {\n $scope.currentNode = error.data;\n $scope.clusterModel.hasCluster = false;\n })\n .then(() => getLocationsWithRpcAddresses());\n };\n\n function getLocationsWithRpcAddresses() {\n return RemoteLocationsService.getLocationsWithRpcAddresses()\n .then((locations) => {\n const localNode = locations.find((location) => location.isLocal);\n if (localNode) {\n localNode.endpoint = $scope.currentNode.endpoint;\n localNode.rpcAddress = $scope.currentNode.address;\n }\n $scope.clusterModel.locations = locations;\n });\n }\n\n $scope.showAddNodeToClusterDialog = () => {\n const modalInstance = $uibModal.open({\n templateUrl: 'js/angular/clustermanagement/templates/modal/add-nodes-dialog.html',\n controller: 'AddNodesDialogCtrl',\n size: 'lg',\n resolve: {\n data: function () {\n return {\n clusterModel: $scope.clusterModel,\n clusterConfiguration: $scope.clusterConfiguration\n };\n }\n }\n });\n\n modalInstance.result.then(function (nodes) {\n const loaderMessage = $translate.instant('cluster_management.cluster_page.add_nodes_loader');\n $scope.setLoader(true, loaderMessage);\n\n const nodesRpcAddress = nodes.map((node) => node.rpcAddress);\n ClusterRestService.addNodesToCluster(nodesRpcAddress)\n .then(() => {\n const successMessage = $translate.instant(\n 'cluster_management.cluster_page.notifications.add_nodes_success');\n onAddRemoveSuccess(successMessage);\n })\n .catch((error) => {\n const failMessageTitle = $translate.instant('cluster_management.cluster_page.notifications.add_nodes_fail');\n handleAddRemoveErrors(error.data, error.status, failMessageTitle);\n })\n .finally(() => {\n $scope.setLoader(false);\n updateCluster(true);\n });\n })\n .finally(() => getLocationsWithRpcAddresses());\n };\n\n $scope.showRemoveNodesFromClusterDialog = () => {\n const modalInstance = $uibModal.open({\n templateUrl: 'js/angular/clustermanagement/templates/modal/remove-nodes-dialog.html',\n controller: 'RemoveNodesDialogCtrl',\n size: 'lg',\n resolve: {\n data: function () {\n return {\n clusterModel: $scope.clusterModel\n };\n }\n }\n });\n\n modalInstance.result.then(function (nodes) {\n const loaderMessage = $translate.instant('cluster_management.cluster_page.remove_nodes_loader');\n $scope.setLoader(true, loaderMessage);\n\n const nodesRpcAddress = nodes.map((node) => node.address);\n ClusterRestService.removeNodesFromCluster(nodesRpcAddress)\n .then(() => {\n const successMessage = $translate.instant('cluster_management.cluster_page.notifications.remove_nodes_success');\n onAddRemoveSuccess(successMessage);\n })\n .catch((error) => {\n const failMessageTitle = $translate.instant('cluster_management.cluster_page.notifications.remove_nodes_fail');\n handleAddRemoveErrors(error.data, error.status, failMessageTitle);\n })\n .finally(() => {\n $scope.setLoader(false);\n updateCluster(true);\n });\n });\n };\n\n function onAddRemoveSuccess(message) {\n toastr.success(message);\n $scope.getClusterConfiguration();\n }\n\n function handleAddRemoveErrors(data, status, title) {\n let failMessage = data.message || data;\n\n if (status === 400 && Array.isArray(data)) {\n failMessage = data.reduce((acc, error) => acc += `<div>${error}</div>`, '');\n } else if (status === 412) {\n failMessage = Object.keys(data)\n .reduce((message, key) => message += `<div>${key} - ${data[key]}</div>`, '');\n }\n toastr.error(failMessage, title, {allowHtml: true});\n }\n\n initialize()\n .finally(() => {\n const timer = $interval(function () {\n updateCluster();\n }, 1000);\n\n $scope.$on(\"$destroy\", function () {\n $interval.cancel(timer);\n });\n });\n\n // track window resizing and window mousedown\n const w = angular.element($window);\n const resize = function () {\n $scope.childContext.resize();\n };\n w.bind('resize', resize);\n\n const mousedown = function (event) {\n const target = event.target;\n const nodeTooltipElement = document.getElementById('nodeTooltip');\n if ($scope.selectedNode && nodeTooltipElement !== target && !nodeTooltipElement.contains(target)) {\n $scope.childContext.selectNode(null);\n }\n };\n w.bind('mousedown', mousedown);\n $scope.$on('$destroy', function () {\n w.unbind('resize', resize);\n w.unbind('mousedown', mousedown);\n });\n}\n\nconst getAdvancedOptionsClass = function () {\n const optionsModule = document.getElementById('advancedOptions');\n\n if (optionsModule) {\n const isAriaExpanded = optionsModule.getAttribute('aria-expanded');\n if (isAriaExpanded && isAriaExpanded === 'true') {\n return 'fa fa-angle-down';\n }\n }\n return 'fa fa-angle-right';\n};\n\nCreateClusterCtrl.$inject = ['$scope', '$uibModalInstance', '$timeout', 'ClusterRestService', 'toastr', '$translate', 'data', '$uibModal',\n 'RemoteLocationsService', '$rootScope'];\n\nfunction CreateClusterCtrl($scope, $uibModalInstance, $timeout, ClusterRestService, toastr, $translate, data, $uibModal, RemoteLocationsService, $rootScope) {\n $scope.pageTitle = $translate.instant('cluster_management.cluster_page.create_page_title');\n $scope.autofocusId = 'autofocus';\n $scope.errors = [];\n $scope.clusterConfiguration = {\n electionMinTimeout: 8000,\n electionRangeTimeout: 6000,\n heartbeatInterval: 2000,\n messageSizeKB: 64,\n verificationTimeout: 1500,\n nodes: []\n };\n\n $scope.locations = data.clusterModel.locations.filter((location) => !location.isLocal);\n $scope.selectedLocations = data.clusterModel.locations.filter((location) => location.isLocal);\n\n $scope.loader = false;\n\n $scope.getAdvancedOptionsClass = getAdvancedOptionsClass;\n\n $scope.createCluster = function () {\n $scope.setLoader(true, $translate.instant('cluster_management.cluster_page.creating_cluster_loader'));\n $scope.clusterConfiguration.nodes = $scope.selectedLocations.map((node) => node.rpcAddress);\n return ClusterRestService.createCluster($scope.clusterConfiguration)\n .then(() => {\n toastr.success($translate.instant('cluster_management.cluster_page.notifications.create_success'));\n $uibModalInstance.close();\n })\n .catch(function (error) {\n handleErrors(error.data, error.status);\n })\n .finally(() => {\n $scope.setLoader(false);\n $rootScope.$broadcast('reloadLocations');\n });\n };\n\n function handleErrors(data, status) {\n delete $scope.preconditionErrors;\n toastr.error($translate.instant('cluster_management.cluster_page.notifications.create_failed'));\n $scope.errors.splice(0);\n if (status === 412) {\n $scope.preconditionErrors = Object.keys(data).map((key) => `${key} - ${data[key]}`);\n } else if (status === 400) {\n $scope.errors.push(...data);\n } else if (status === 409) {\n $scope.errors.push(data);\n }\n }\n\n $scope.isClusterConfigurationValid = () => {\n const isFormValid = !$scope.clusterConfigurationForm.$invalid;\n const nodesListValid = $scope.selectedLocations && $scope.selectedLocations.length >= 2;\n return isFormValid && nodesListValid;\n };\n\n $scope.setLoader = function (loader, message) {\n $timeout.cancel($scope.loaderTimeout);\n if (loader) {\n $scope.loaderTimeout = $timeout(function () {\n $scope.loader = loader;\n $scope.loaderMessage = message;\n }, 300);\n } else {\n $scope.loader = false;\n }\n };\n\n $scope.addNodeToList = function (location) {\n if (!location.rpcAddress) {\n return;\n }\n $scope.selectedLocations.push(location);\n $scope.locations = $scope.locations.filter((loc) => loc.endpoint !== location.endpoint);\n };\n\n $scope.removeNodeFromList = function (index, node) {\n if (node.isLocal) {\n return;\n }\n $scope.selectedLocations.splice(index, 1);\n $scope.locations.push(node);\n };\n\n $scope.addLocation = function () {\n RemoteLocationsService.addLocation()\n .then((newLocation) => {\n if (newLocation) {\n $scope.locations.push(newLocation);\n }\n });\n };\n\n $scope.ok = function () {\n if (!$scope.isClusterConfigurationValid()) {\n toastr.warning($translate.instant('cluster_management.cluster_page.notifications.form_invalid'));\n return;\n }\n $scope.createCluster();\n };\n\n $scope.cancel = function () {\n $uibModalInstance.dismiss('cancel');\n };\n}\n\nDeleteClusterCtrl.$inject = ['$scope', '$uibModalInstance'];\n\nfunction DeleteClusterCtrl($scope, $uibModalInstance) {\n $scope.forceDelete = false;\n\n $scope.ok = function () {\n $uibModalInstance.close($scope.forceDelete);\n };\n\n $scope.cancel = function () {\n $uibModalInstance.dismiss('cancel');\n };\n}\n\nRemoteLocationsService.$inject = ['$http', 'toastr', '$uibModal', 'LocationsRestService', '$translate'];\n\nfunction RemoteLocationsService($http, toastr, $uibModal, LocationsRestService, $translate) {\n return {\n addLocation: addLocation,\n getLocationsWithRpcAddresses: getLocationsWithRpcAddresses\n };\n\n function getLocationsWithRpcAddresses() {\n return getLocations()\n .then((locations) => {\n if (locations) {\n return getRemoteLocationsRpcAddresses(locations);\n }\n });\n }\n\n /**\n * Sets multiple remote locations' rpc addresses. Skips local location and locations with errors\n * @param {any[]} locationsArray\n * @return {Promise<[]>} locationArray with filled rpc addresses\n */\n function getRemoteLocationsRpcAddresses(locationsArray) {\n const rpcAddressFetchers = locationsArray.filter((location) => !location.isLocal && !location.error).map((location) => {\n return getLocationRpcAddress(location)\n .then((response) => {\n location.rpcAddress = response.data;\n location.isAvailable = true;\n return location;\n })\n .catch((error) => {\n location.isAvailable = false;\n location.error = getError(error.data, error.status);\n });\n });\n return Promise.allSettled(rpcAddressFetchers).then(() => locationsArray);\n }\n\n /**\n * Fetch locations and map them to a location model\n *\n * @return {*} all remote locations mapped to a location model\n */\n function getLocations() {\n return LocationsRestService.getLocations()\n .then(function (response) {\n return response.data.map((loc) => {\n return {\n isLocal: loc.local,\n endpoint: loc.uri,\n rpcAddress: loc.rpcAddress || '',\n error: loc.errorMsg\n };\n });\n })\n .catch(function (error) {\n const msg = getError(error.data, error.status);\n toastr.error(msg, $translate.instant('common.error'));\n });\n }\n\n /**\n * Fetch rpc address of a remote location\n * @param {*} location the remote location\n * @return {Promise<String>} the rpc address of the location\n */\n function getLocationRpcAddress(location) {\n return LocationsRestService.getLocationRpcAddress(location.endpoint);\n\n }\n\n function addLocation() {\n let newLocation;\n return $uibModal.open({\n templateUrl: 'js/angular/templates/modal/add-location.html',\n windowClass: 'addLocationDialog',\n controller: 'AddLocationFromClusterCtrl'\n }).result\n .then((dataAddLocation) => {\n newLocation = dataAddLocation;\n newLocation.isLocal = false;\n newLocation.endpoint = newLocation.uri;\n return addLocationHttp(newLocation);\n });\n }\n\n function addLocationHttp(locationData) {\n let newLocation;\n return LocationsRestService.addLocation(locationData)\n .catch((error) => {\n const msg = getError(error.data, error.status);\n toastr.error(msg, $translate.instant('common.error'));\n return false;\n })\n .then((locationAdded) => {\n if (locationAdded) {\n return getLocationsWithRpcAddresses();\n }\n return false;\n })\n .then((locations) => {\n if (locations === false) {\n return;\n }\n newLocation = locations.find((location) => location.endpoint === locationData.uri);\n return newLocation;\n });\n }\n}\n\nAddLocationFromClusterCtrl.$inject = ['$scope', '$uibModalInstance', 'toastr', 'productInfo', '$translate'];\n\nfunction AddLocationFromClusterCtrl($scope, $uibModalInstance, toastr, productInfo, $translate) {\n //TODO: This, along with the view are duplicated from repositories page. Must be extracted for re-usability.\n $scope.newLocation = {\n 'uri': '',\n 'authType': 'signature',\n 'username': '',\n 'password': '',\n 'active': false\n };\n $scope.docBase = getDocBase(productInfo);\n\n $scope.isValidLocation = function () {\n return ($scope.newLocation.uri.length < 6 ||\n $scope.newLocation.uri.indexOf('http:') === 0 || $scope.newLocation.uri.indexOf('https:') === 0)\n && $scope.newLocation.uri.indexOf('/repositories') <= -1;\n };\n\n $scope.ok = function () {\n if (!$scope.newLocation) {\n toastr.error($translate.instant('location.cannot.be.empty.error'));\n return;\n }\n $uibModalInstance.close($scope.newLocation);\n };\n\n $scope.cancel = function () {\n $uibModalInstance.dismiss('cancel');\n };\n}\n\nEditClusterCtrl.$inject = ['$scope', '$uibModalInstance', '$timeout', 'ClusterRestService', 'toastr', '$translate', 'data'];\n\nfunction EditClusterCtrl($scope, $uibModalInstance, $timeout, ClusterRestService, toastr, $translate, data) {\n $scope.pageTitle = $translate.instant('cluster_management.cluster_page.edit_page_title');\n $scope.errors = [];\n $scope.clusterConfiguration = angular.copy(data.clusterConfiguration);\n $scope.loader = false;\n\n $scope.updateCluster = function () {\n $scope.setLoader(true, $translate.instant('cluster_management.cluster_page.updating_cluster_loader'));\n return ClusterRestService.updateCluster($scope.clusterConfiguration)\n .then(() => {\n toastr.success($translate.instant('cluster_management.cluster_page.notifications.update_success'));\n $uibModalInstance.close();\n })\n .catch(function (response) {\n handleErrors(response.data, response.status);\n })\n .finally(() => $scope.setLoader(false));\n };\n\n function handleErrors(data, status) {\n delete $scope.preconditionErrors;\n toastr.error($translate.instant('cluster_management.cluster_page.notifications.update_failed'));\n $scope.errors.splice(0);\n\n if (status === 409 || typeof data === 'string') {\n $scope.errors.push(data);\n } else if (status === 412) {\n $scope.preconditionErrors = Object.keys(data).map((key) => `${key} - ${data[key]}`);\n } else if (status === 400) {\n $scope.errors.push(...data);\n }\n }\n\n $scope.isClusterConfigurationValid = () => {\n return !$scope.clusterConfigurationForm.$invalid;\n };\n\n $scope.setLoader = function (loader, message) {\n $timeout.cancel($scope.loaderTimeout);\n if (loader) {\n $scope.loaderTimeout = $timeout(function () {\n $scope.loader = loader;\n $scope.loaderMessage = message;\n }, 300);\n } else {\n $scope.loader = false;\n }\n };\n\n $scope.ok = function () {\n if (!$scope.isClusterConfigurationValid()) {\n toastr.warning($translate.instant('cluster_management.cluster_page.notifications.form_invalid'));\n return;\n }\n $scope.updateCluster();\n };\n\n $scope.cancel = function () {\n $uibModalInstance.dismiss('cancel');\n };\n}\n\nconst getDocBase = function (productInfo) {\n return `https://graphdb.ontotext.com/documentation/${productInfo.productShortVersion}`;\n};\n\nAddNodesDialogCtrl.$inject = ['$scope', '$uibModalInstance', 'data', '$uibModal', 'RemoteLocationsService'];\n\nfunction AddNodesDialogCtrl($scope, $uibModalInstance, data, $uibModal, RemoteLocationsService) {\n const clusterConfiguration = angular.copy(data.clusterConfiguration);\n const clusterModel = angular.copy(data.clusterModel);\n $scope.nodes = [];\n\n $scope.clusterNodes = clusterModel.nodes.map((node) => ({rpcAddress: node.address, endpoint: node.endpoint}));\n $scope.locations = clusterModel.locations.filter((location) => !clusterConfiguration.nodes.includes(location.rpcAddress));\n $scope.locations.forEach((location) => location.isNew = true);\n\n $scope.addNodeToList = function (location) {\n if (!location.rpcAddress) {\n return;\n }\n $scope.nodes.push(location);\n $scope.locations = $scope.locations.filter((loc) => loc.endpoint !== location.endpoint);\n };\n\n $scope.removeNodeFromList = function (index, node) {\n $scope.nodes.splice(index, 1);\n $scope.locations.push(node);\n };\n\n $scope.addLocation = function () {\n RemoteLocationsService.addLocation()\n .then((newLocation) => {\n if (newLocation) {\n $scope.locations.push(newLocation);\n }\n });\n };\n\n $scope.ok = function () {\n $uibModalInstance.close($scope.nodes);\n };\n\n $scope.cancel = function () {\n $uibModalInstance.dismiss('cancel');\n };\n}\n\nRemoveNodesDialogCtrl.$inject = ['$scope', '$uibModalInstance', 'data'];\n\nfunction RemoveNodesDialogCtrl($scope, $uibModalInstance, data) {\n const clusterModel = angular.copy(data.clusterModel);\n\n $scope.clusterNodes = clusterModel.nodes;\n $scope.clusterNodes.forEach((node) => node.shouldRemove = false);\n $scope.nodesToRemoveCount = 0;\n $scope.leftNodesLessThanTwo = false;\n\n $scope.toggleNode = function (index, node) {\n node.shouldRemove = !node.shouldRemove;\n if (node.shouldRemove) {\n $scope.nodesToRemoveCount++;\n } else {\n $scope.nodesToRemoveCount--;\n }\n $scope.leftNodesLessThanTwo = $scope.clusterNodes.length - $scope.nodesToRemoveCount < 2;\n };\n\n $scope.ok = function () {\n const nodesToRemove = $scope.clusterNodes.filter((node) => node.shouldRemove);\n $uibModalInstance.close(nodesToRemove);\n };\n\n $scope.cancel = function () {\n $uibModalInstance.dismiss('cancel');\n };\n}\n"],"sourceRoot":""}