graphdb-workbench 2.3.0-TR6 → 2.3.0-TR7

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 (81) hide show
  1. package/dist/{0.15196c70676b993db356.bundle.js → 0.48f0a08c129cab95f345.bundle.js} +3 -3
  2. package/dist/0.48f0a08c129cab95f345.bundle.js.map +1 -0
  3. package/dist/108.112426f55d9e34a78ab3.bundle.js +2 -0
  4. package/dist/108.112426f55d9e34a78ab3.bundle.js.map +1 -0
  5. package/dist/{11.e3c940aa59365084050b.bundle.js → 11.4928d8d13ff46f3872bb.bundle.js} +2 -2
  6. package/dist/11.4928d8d13ff46f3872bb.bundle.js.map +1 -0
  7. package/dist/129.c42b901c27e8de081b82.bundle.js +2 -0
  8. package/dist/129.c42b901c27e8de081b82.bundle.js.map +1 -0
  9. package/dist/148.45985ae23de642595544.bundle.js +1 -1
  10. package/dist/148.45985ae23de642595544.bundle.js.map +1 -1
  11. package/dist/20.4eb25ede434dc329ecf1.bundle.js +1 -1
  12. package/dist/20.4eb25ede434dc329ecf1.bundle.js.map +1 -1
  13. package/dist/{21.dd1a8782fa1bea210dc2.bundle.js → 21.62777310f384dd7b71a4.bundle.js} +2 -2
  14. package/dist/21.62777310f384dd7b71a4.bundle.js.map +1 -0
  15. package/dist/{25.c2d2c79cbb29e36a4cce.bundle.js → 25.dad934ee482c9b825245.bundle.js} +2 -2
  16. package/dist/25.dad934ee482c9b825245.bundle.js.map +1 -0
  17. package/dist/27.fef157d9275358c9f1a0.bundle.js +1 -1
  18. package/dist/27.fef157d9275358c9f1a0.bundle.js.map +1 -1
  19. package/dist/{3.d06a0ca122c78522c911.bundle.js → 3.d4e2ee6def5774b8b495.bundle.js} +2 -2
  20. package/dist/3.d4e2ee6def5774b8b495.bundle.js.map +1 -0
  21. package/dist/33.fde8076c81c87c25c367.bundle.js +1 -1
  22. package/dist/33.fde8076c81c87c25c367.bundle.js.map +1 -1
  23. package/dist/{39.0eebc4b972cff879c1c9.bundle.js → 39.ecdfa8a15c661473c246.bundle.js} +2 -2
  24. package/dist/39.ecdfa8a15c661473c246.bundle.js.map +1 -0
  25. package/dist/40.10f42e3f6d8d87bd3221.bundle.js +1 -1
  26. package/dist/40.10f42e3f6d8d87bd3221.bundle.js.map +1 -1
  27. package/dist/62.eff529f903ab72e57c23.bundle.js +2 -0
  28. package/dist/62.eff529f903ab72e57c23.bundle.js.map +1 -0
  29. package/dist/94.94158487a9024ff3a623.bundle.js +1 -1
  30. package/dist/94.94158487a9024ff3a623.bundle.js.map +1 -1
  31. package/dist/{bundle.00cc9035be8b524d4240.bundle.js → bundle.896281e5e7a26024597b.bundle.js} +3 -3
  32. package/dist/bundle.896281e5e7a26024597b.bundle.js.map +1 -0
  33. package/dist/css/yasr.custom.css +9 -7
  34. package/dist/i18n/locale-en.json +2 -1
  35. package/dist/i18n/locale-fr.json +2 -1
  36. package/dist/index.html +4 -4
  37. package/dist/js/angular/core/directives/rdfresourcesearch/templates/rdfResourceSearchTemplate.html +1 -1
  38. package/dist/{main.59e407d8a8b46a1a9bad.css → main.c29920c7f6f6ecb00cae.css} +1 -1
  39. package/dist/pages/autocomplete.html +1 -1
  40. package/dist/pages/choose-repository-type.html +1 -1
  41. package/dist/pages/cluster-management/clusterInfo.html +3 -3
  42. package/dist/pages/create-index.html +4 -4
  43. package/dist/pages/dependencies.html +1 -1
  44. package/dist/pages/domainRangeInfo.html +2 -2
  45. package/dist/pages/edit.html +1 -1
  46. package/dist/pages/explore.html +1 -1
  47. package/dist/pages/export.html +1 -1
  48. package/dist/pages/find.html +1 -1
  49. package/dist/pages/graph-config/saveGraphConfig.html +11 -11
  50. package/dist/pages/graphs-visualizations.html +7 -7
  51. package/dist/pages/guides.html +1 -1
  52. package/dist/pages/import.html +1 -1
  53. package/dist/pages/jdbc-create.html +5 -5
  54. package/dist/pages/monitor/queries.html +1 -1
  55. package/dist/pages/monitor/resources.html +2 -2
  56. package/dist/pages/namespaces.html +2 -2
  57. package/dist/pages/plugins.html +1 -1
  58. package/dist/pages/rdfClassHierarchyInfo.html +7 -7
  59. package/dist/pages/rdfrank.html +2 -2
  60. package/dist/pages/repositories.html +2 -2
  61. package/dist/pages/repository.html +2 -2
  62. package/dist/pages/similarity-indexes.html +1 -1
  63. package/dist/pages/sparql-template-create.html +5 -5
  64. package/dist/pages/sparql.html +3 -3
  65. package/dist/pages/webapi.html +2 -2
  66. package/dist/plugins.js +2 -1
  67. package/dist/res/swagger/index.html +27 -27
  68. package/package.json +1 -1
  69. package/dist/0.15196c70676b993db356.bundle.js.map +0 -1
  70. package/dist/108.d415d719be3fc3a428f4.bundle.js +0 -2
  71. package/dist/108.d415d719be3fc3a428f4.bundle.js.map +0 -1
  72. package/dist/11.e3c940aa59365084050b.bundle.js.map +0 -1
  73. package/dist/129.02e23389a50348366a13.bundle.js +0 -2
  74. package/dist/129.02e23389a50348366a13.bundle.js.map +0 -1
  75. package/dist/21.dd1a8782fa1bea210dc2.bundle.js.map +0 -1
  76. package/dist/25.c2d2c79cbb29e36a4cce.bundle.js.map +0 -1
  77. package/dist/3.d06a0ca122c78522c911.bundle.js.map +0 -1
  78. package/dist/39.0eebc4b972cff879c1c9.bundle.js.map +0 -1
  79. package/dist/62.35e111a570b5e038fdea.bundle.js +0 -2
  80. package/dist/62.35e111a570b5e038fdea.bundle.js.map +0 -1
  81. package/dist/bundle.00cc9035be8b524d4240.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.3.0-TR6");$("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.3.0-TR7");$("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,I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M,OAAOxG,GAAKlG,EAAEsM,OAAOpG,EAAIlG,EAAE0M,OAAOxG,GAAK,EAEzClG,EAAEsM,OAAOpG,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.3.0-TR6\");\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","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,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,EAAEsM,OAAOpG,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.3.0-TR7\");\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,2 +1,2 @@
1
- (window.webpackJsonp=window.webpackJsonp||[]).push([[39,134],{40:function(e,n){function t(e,n){return{showToastMessageWithDelay:function(t){return new Promise(r=>{e.success(n.instant(t)),setTimeout(r,200)})}}}angular.module("graphdb.framework.utils.notifications",[]).factory("Notifications",t),t.$inject=["toastr","$translate"]},82:function(e,n,t){"use strict";t.r(n);t(40),t(5);function r(e,n,t,r,o,i,a,u,s,c,d,g,f,l,p){var w;e.page=1,e.totalPages=5,e.helpHidden=1===f.get(l.HIDE_GRAPH_CONFIG_HELP),e.toggleHelp=function(n){void 0===n&&(n=f.get(l.HIDE_GRAPH_CONFIG_HELP)),1!==n?(f.set(l.HIDE_GRAPH_CONFIG_HELP,1),e.helpHidden=!0):(f.set(l.HIDE_GRAPH_CONFIG_HELP,0),e.helpHidden=!1)},e.fixedVisualCallback=function(n,t){e.newConfig.startIRI=n,e.newConfig.startIRILabel=t,w=!0},e.isDefaultGraph=function(e){return"Minimal"===e.name||"Advanced"===e.name},e.isUserGraph=function(n){return!e.isDefaultGraph(n)},e.getSampleName=function(e,n){const t=e[n+"Description"];return t||(e.id?"Copy of "+e.name:e.name)};const y=c.configName;function m(e){r.warning(e)}function C(n){let t;return"query"===n.startMode&&1===e.page?t=n.startGraphQuery:2===e.page?t=n.expandQuery:3===e.page?t=n.resourceQuery:4===e.page?t=n.predicateLabelQuery:5===e.page&&(t=n.resourcePropertiesQuery),angular.isDefined(t)?t:""}function h(){function i(){e.getAutocompletePromise=s.checkAutocompleteStatus()}u.getGraphConfigSamples().success((function(n){e.samples=_.filter(n,(function(n){return!n.id||e.newConfig.id!==n.id||(e.revertConfig=n,!1)}))})).error((function(e){r.error(getError(e),p.instant("graphexplore.error.graph.configs"))})),e.createGraphConfig=function(){u.createGraphConfig(e.newConfig).success((async function(){await d.showToastMessageWithDelay("graphexplore.saved.new.config"),t.url("graphs-visualizations")})).error((function(e){r.error(getError(e),p.instant("graphexplore.error.could.not.create"))}))},e.updateGraphConfig=function(){u.updateGraphConfig(e.newConfig).success((async function(){await d.showToastMessageWithDelay("graphexplore.saved.config"),t.url("graphs-visualizations")})).error((function(e){r.error(getError(e),p.instant("graphexplore.error.could.not.save"))}))},e.$on("autocompleteStatus",(function(){i()})),i(),e.getNamespacesPromise=g.getNamespaces(e.getActiveRepository());const a=function(e,n,t,r,o,i){n?u.validateQuery(n,t,r,o,i).success((function(){e()})).error((function(e){m(getError(e))})):e()};function c(){f()&&e.$broadcast("addStartFixedNodeAutomatically",{startIRI:e.newConfig.startIRI})}function f(){return 1===e.page&&"node"===e.newConfig.startMode}e.validateCurrentPage=function(n){e.updateModel(),1===e.page?"node"!==e.newConfig.startMode||e.newConfig.startIRI?"query"!==e.newConfig.startMode||e.newConfig.startGraphQuery?"query"===e.newConfig.startMode?a(n,e.newConfig.startGraphQuery,"graph"):n():m(p.instant("graphexplore.provide.query")):m(p.instant("graphexplore.select.start.node")):2===e.page?a(n,e.newConfig.expandQuery,"construct",["node"]):3===e.page?a(n,e.newConfig.resourceQuery,"tuple",["node"],[],["type","label","comment","rank"]):4===e.page?a(n,e.newConfig.predicateLabelQuery,"tuple",["edge"],["label"]):5===e.page&&a(n,e.newConfig.resourcePropertiesQuery,"tuple",["node"],["property","value"])},e.goToPage=function(n){e.page!==n&&e.validateCurrentPage((function(){e.showEditor(),e.page=n,e.notoolbar=1!==e.page}))},e.goToPreviousPage=function(){e.page>1&&e.goToPage(e.page-1),f()&&(w=!1)},e.goToNextPage=function(){c(),("node"!==e.newConfig.startMode||w)&&e.goToPage(e.page+1)},e.saveGraphConfig=function(){c(),f()&&!w||(e.newConfig.startQueryIncludeInferred=e.currentQuery.inference,e.newConfig.startQuerySameAs=e.currentQuery.sameAs,e.validateCurrentPage((function(){e.newConfig.name?e.isUpdate?e.updateGraphConfig(e.newConfig):e.createGraphConfig(e.newConfig):m(p.instant("graphexplore.provide.config.name"))})))},e.updateModel=function(){const n=window.editor.getValue().trim();"query"===e.newConfig.startMode&&1===e.page?e.newConfig.startGraphQuery=n:2===e.page?e.newConfig.expandQuery=n:3===e.page?e.newConfig.resourceQuery=n:4===e.page?e.newConfig.predicateLabelQuery=n:5===e.page&&(e.newConfig.resourcePropertiesQuery=n)},e.setQuery=function(e){window.editor.setValue(e||" ")},e.updateDirty=function(){if(e.revertConfig){const n=C(e.revertConfig),t=window.editor.getValue().trim();e.queryEditorIsDirty=n!==t}},e.updateEditor=function(){n((function(){e.currentQuery.query=C(e.newConfig),o.isActiveRepoOntopType()&&(e.nocount=!0),e.currentQuery.inference=e.newConfig.startQueryIncludeInferred,e.currentQuery.sameAs=e.newConfig.startQuerySameAs,R(),S(e.currentQuery.id)}),100)},e.showEditor=function(){window.editor&&window.editor.xhr&&window.editor.xhr.abort(),e.viewMode="yasr"},e.showPreview=function(){e.currentQuery.outputType="table",e.runQuery()},e.revertEditor=function(){e.setQuery(C(e.revertConfig))},e.$watch("newConfig.startMode",(function(t){"query"===t&&n((function(){e.updateEditor()}),0)})),e.$watch("page",(function(t){("query"===e.newConfig.startMode||t>1)&&n((function(){e.showEditor(),e.updateEditor()}),0)}))}e.newConfig={startQueryIncludeInferred:!0,startQuerySameAs:!0},e.newConfig.startMode="search",e.isUpdate=!1,e.shared=!1,e.encodeQuery=function(e){return encodeURIComponent(e)},y?(e.isUpdate=!0,u.getConfig(y).success((function(n){e.newConfig=n,h()})).error((function(e){r.error(getError(e),p.instant("created.connector",{name:y}))}))):(e.isUpdate=!1,h());const b={id:"1",name:"",query:"select * where { \n\t?s ?p ?o .\n} limit 100 \n",inference:e.newConfig.startQueryIncludeInferred,sameAs:e.newConfig.startQuerySameAs};function Q(e){}function T(n,t,r){const o=angular.element(document.getElementById("yasr-inner"));e.queryIsRunning=n,n?(e.queryStartTime=Date.now(),e.countTimeouted=!1,e.progressMessage=t,e.extraMessage=r,o.addClass("hide")):(e.progressMessage="",e.extraMessage="",o.removeClass("hide")),null===e.$$phase&&e.$apply()}function M(t){function r(){return window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight||0}const o=t;if(e.orientationViewMode){if("yasr"===e.viewMode){let e=r()-document.querySelector(".CodeMirror-wrap").getBoundingClientRect().top;e-=40,document.querySelector(".CodeMirror-wrap").style.height=e+"px"}else e.noPadding={},document.querySelector(".CodeMirror-wrap").style.height="";document.getElementById("yasr").style.minHeight=""}else if(e.noPadding={paddingRight:15,paddingLeft:0},window.editor&&document.querySelector(".CodeMirror-wrap")){let e=r()-document.querySelector(".CodeMirror-wrap").getBoundingClientRect().top;e-=40,document.querySelector(".CodeMirror-wrap").style.height=e+"px",document.getElementById("yasr").style.minHeight=e+"px"}else{let t;t=n(o?function(){e.fixSizesOnHorizontalViewModeSwitch(o)}:e.fixSizesOnHorizontalViewModeSwitch,100),e.$on("$destroy",(function(){n.cancel(t)}))}window.yasr&&window.yasr.container&&n((function(){window.yasr.container.resize()}),100)}function v(){M(!0)}function S(e){n((function(){$('a[data-id = "'+e+'"]').tab("show")}),0)}function x(n,t){e.executedQueryTab=e.currentQuery,t&&"SELECT"!==window.editor.getQueryType()&&"CONSTRUCT"!==window.editor.getQueryType()?r.warning(p.instant("query.editor.warning.msg")):"update"!==window.editor.getQueryMode()?(e.explainRequested=t,e.queryIsRunning||(n?e.currentTabConfig.resultsCount=0:e.resetCurrentTabConfig(),e.viewMode="editor",e.orientationViewMode&&e.fixSizesOnHorizontalViewModeSwitch(),T(!0,p.instant("evaluating.query.msg")),window.editor.query())):r.warning(p.instant("cannot.execute.update.error"))}function E(){T(!0,p.instant("common.refreshing.namespaces"),p.instant("common.extra.message")),g.getRepositoryNamespaces().success((function(n){const t={};n.results.bindings.forEach((function(e){t[e.prefix.value]=e.namespace.value})),e.namespaces=t})).error((function(n){e.repositoryError=getError(n)})).finally((function(){T(!1)}))}function q(){i.addKnownPrefixes(JSON.stringify(window.editor.getValue())).success((function(e){angular.isDefined(window.editor)&&angular.isDefined(e)&&e!==window.editor.getValue()&&window.editor.setValue(e)})).error((function(e){let n=getError(e);return r.error(n,p.instant("common.add.known.prefixes.error")),!0}))}function I(n){let t=void 0;return angular.forEach(e.tabsData,(function(e){if(e.name===n.name&&e.query===n.body)return t=e.id,e})),t}function R(){e.tabsData=[e.currentQuery];let t=e.currentQuery;null==e.currentQuery.query||""===e.currentQuery.query?window.editor.setValue(" "):window.editor.setValue(e.currentQuery.query),n((function(){e.currentTabConfig={},e.currentTabConfig.queryType=t.queryType,e.currentTabConfig.resultsCount=t.resultsCount,e.currentTabConfig.offset=t.offset,e.currentTabConfig.allResultsCount=t.allResultsCount,e.currentTabConfig.page=t.page,e.currentTabConfig.pageSize=t.pageSize,e.currentTabConfig.timeFinished=t.timeFinished,e.currentTabConfig.timeTook=t.timeTook,e.currentTabConfig.sizeDelta=t.sizeDelta,e.$apply()}),0),$("#yasr").css("padding","0")}function P(e){return $(e).attr("data-id")}e.resetCurrentTabConfig=function(){e.currentTabConfig={pageSize:100,page:1,allResultsCount:0,resultsCount:0}},e.queryExists=!1,e.resetCurrentTabConfig(),e.tabsData=e.tabs=[b],e.saveTab=function(n){const t=function(n){for(let t=0;t<e.tabsData.length;t++){if(e.tabsData[t].id===n)return t}}(n);if(void 0===t)return{};const r=e.tabsData[t];return e.saveQueryToLocal(r),r},e.loadTab=R,e.addNewTab=function(e,n,t){},e.runQuery=x,e.getNamespaces=E,e.changePagination=function(){x(!0,e.explainRequested)},e.toggleSampleQueries=function(){},e.addKnownPrefixes=q,e.getExistingTabId=I,e.querySelected=function(n){const t=I(n);e.toggleSampleQueries(),angular.isDefined(t)?S(t):e.addNewTab(null,n.name,n.body)},e.saveQueryToLocal=Q,e.setLoader=T,e.getLoaderMessage=function(){const n=(Date.now()-e.queryStartTime)/1e3,t=e.getHumanReadableSeconds(n);let r;r=e.progressMessage?e.progressMessage+"... "+t:p.instant("common.running.operation",{timeHuman:t});e.extraMessage&&n>10&&(r+="\n"+e.extraMessage);return r},e.fixSizesOnHorizontalViewModeSwitch=M,e.changeViewMode=function(t){e.viewMode="none",e.orientationViewMode=!e.orientationViewMode,M(),$(".dataTables_filter").remove(),$(".resultsTable").remove(),n((function(){R(),S(t)}),100)},e.showHideEditor=v,e.focusQueryEditor=function(){angular.element(document).find(".editable-input").is(":focus")||angular.element(document).find(".CodeMirror textarea:first-child").focus()},e.orientationViewMode=!0,e.orientationViewMode||v(),e.getActiveRepository()&&E(),e.$on("$destroy",(function(){window.editor=null,window.yasr=null})),$("textarea").on("paste",(function(){n((function(){q()}),0)})),e.$watchCollection("[currentQuery.inference, currentQuery.sameAs]",(function(){e.currentQuery})),e.$on("tabAction",(function(n,t){t.relatedTarget&&e.saveTab(P(t.relatedTarget)),e.loadTab(P(t.target))})),e.$on("deleteAllexeptSelected",(function(n,t){e.tabsData=t,e.tabs=t})),e.currentQuery=angular.copy(b),e.showSampleQueries=!1,e.savedQuery={},e.sampleQueries={},e.getResultsDescription=function(){},e.getUpdateDescription=function(){},e.getStaleWarningMessage=function(){}}angular.module("graphdb.framework.graphexplore.controllers.graphviz.config",["graphdb.framework.utils.notifications","graphdb.framework.utils.localstorageadapter"]).controller("GraphConfigCtrl",r),r.$inject=["$scope","$timeout","$location","toastr","$repositories","SparqlRestService","$filter","GraphConfigRestService","AutocompleteRestService","$routeParams","Notifications","RDF4JRepositoriesRestService","LocalStorageAdapter","LSKeys","$translate"]}}]);
2
- //# sourceMappingURL=39.0eebc4b972cff879c1c9.bundle.js.map
1
+ (window.webpackJsonp=window.webpackJsonp||[]).push([[39,134],{40:function(e,n){function t(e,n){return{showToastMessageWithDelay:function(t){return new Promise(r=>{e.success(n.instant(t)),setTimeout(r,200)})}}}angular.module("graphdb.framework.utils.notifications",[]).factory("Notifications",t),t.$inject=["toastr","$translate"]},82:function(e,n,t){"use strict";t.r(n);t(40),t(5);function r(e,n,t,r,o,i,a,u,s,c,d,g,f,l,p){var w;e.page=1,e.totalPages=5,e.helpHidden=1===f.get(l.HIDE_GRAPH_CONFIG_HELP),e.toggleHelp=function(n){void 0===n&&(n=f.get(l.HIDE_GRAPH_CONFIG_HELP)),1!==n?(f.set(l.HIDE_GRAPH_CONFIG_HELP,1),e.helpHidden=!0):(f.set(l.HIDE_GRAPH_CONFIG_HELP,0),e.helpHidden=!1)},e.fixedVisualCallback=function(n,t){e.newConfig.startIRI=n,e.newConfig.startIRILabel=t,w=!0},e.isDefaultGraph=function(e){return"Minimal"===e.name||"Advanced"===e.name},e.isUserGraph=function(n){return!e.isDefaultGraph(n)},e.getSampleName=function(e,n){const t=e[n+"Description"];return t||(e.id?"Copy of "+e.name:e.name)};const y=c.configName;function m(e){r.warning(e)}function C(n){let t;return"query"===n.startMode&&1===e.page?t=n.startGraphQuery:2===e.page?t=n.expandQuery:3===e.page?t=n.resourceQuery:4===e.page?t=n.predicateLabelQuery:5===e.page&&(t=n.resourcePropertiesQuery),angular.isDefined(t)?t:""}function h(){function i(){e.getAutocompletePromise=s.checkAutocompleteStatus()}u.getGraphConfigSamples().success((function(n){e.samples=_.filter(n,(function(n){return!n.id||e.newConfig.id!==n.id||(e.revertConfig=n,!1)}))})).error((function(e){r.error(getError(e),p.instant("graphexplore.error.graph.configs"))})),e.createGraphConfig=function(){u.createGraphConfig(e.newConfig).success((async function(){await d.showToastMessageWithDelay("graphexplore.saved.new.config"),t.url("graphs-visualizations")})).error((function(e){r.error(getError(e),p.instant("graphexplore.error.could.not.create"))}))},e.updateGraphConfig=function(){u.updateGraphConfig(e.newConfig).success((async function(){await d.showToastMessageWithDelay("graphexplore.saved.config"),t.url("graphs-visualizations")})).error((function(e){r.error(getError(e),p.instant("graphexplore.error.could.not.save"))}))},e.$on("autocompleteStatus",(function(){i()})),i(),e.getNamespacesPromise=g.getNamespaces(e.getActiveRepository());const a=function(e,n,t,r,o,i){n?u.validateQuery(n,t,r,o,i).success((function(){e()})).error((function(e){m(getError(e))})):e()};function c(){f()&&e.$broadcast("addStartFixedNodeAutomatically",{startIRI:e.newConfig.startIRI})}function f(){return 1===e.page&&"node"===e.newConfig.startMode}e.validateCurrentPage=function(n){e.updateModel(),1===e.page?"node"!==e.newConfig.startMode||e.newConfig.startIRI?"query"!==e.newConfig.startMode||e.newConfig.startGraphQuery?"query"===e.newConfig.startMode?a(n,e.newConfig.startGraphQuery,"graph"):n():m(p.instant("graphexplore.provide.query")):m(p.instant("graphexplore.select.start.node")):2===e.page?a(n,e.newConfig.expandQuery,"construct",["node"]):3===e.page?a(n,e.newConfig.resourceQuery,"tuple",["node"],[],["type","label","comment","rank"]):4===e.page?a(n,e.newConfig.predicateLabelQuery,"tuple",["edge"],["label"]):5===e.page&&a(n,e.newConfig.resourcePropertiesQuery,"tuple",["node"],["property","value"])},e.goToPage=function(n){e.page!==n&&e.validateCurrentPage((function(){e.showEditor(),e.page=n,e.notoolbar=1!==e.page}))},e.goToPreviousPage=function(){e.page>1&&e.goToPage(e.page-1),f()&&(w=!1)},e.goToNextPage=function(){c(),("node"!==e.newConfig.startMode||w)&&e.goToPage(e.page+1)},e.saveGraphConfig=function(){c(),f()&&!w||(e.newConfig.startQueryIncludeInferred=e.currentQuery.inference,e.newConfig.startQuerySameAs=e.currentQuery.sameAs,e.validateCurrentPage((function(){e.newConfig.name?e.isUpdate?e.updateGraphConfig(e.newConfig):e.createGraphConfig(e.newConfig):m(p.instant("graphexplore.provide.config.name"))})))},e.updateModel=function(){const n=window.editor.getValue().trim();"query"===e.newConfig.startMode&&1===e.page?e.newConfig.startGraphQuery=n:2===e.page?e.newConfig.expandQuery=n:3===e.page?e.newConfig.resourceQuery=n:4===e.page?e.newConfig.predicateLabelQuery=n:5===e.page&&(e.newConfig.resourcePropertiesQuery=n)},e.setQuery=function(e){window.editor.setValue(e||" ")},e.updateDirty=function(){if(e.revertConfig){const n=C(e.revertConfig),t=window.editor.getValue().trim();e.queryEditorIsDirty=n!==t}},e.updateEditor=function(){n((function(){e.currentQuery.query=C(e.newConfig),o.isActiveRepoOntopType()&&(e.nocount=!0),e.currentQuery.inference=e.newConfig.startQueryIncludeInferred,e.currentQuery.sameAs=e.newConfig.startQuerySameAs,R(),S(e.currentQuery.id)}),100)},e.showEditor=function(){window.editor&&window.editor.xhr&&window.editor.xhr.abort(),e.viewMode="yasr"},e.showPreview=function(){e.currentQuery.outputType="table",e.runQuery()},e.revertEditor=function(){e.setQuery(C(e.revertConfig))},e.$watch("newConfig.startMode",(function(t){"query"===t&&n((function(){e.updateEditor()}),0)})),e.$watch("page",(function(t){("query"===e.newConfig.startMode||t>1)&&n((function(){e.showEditor(),e.updateEditor()}),0)}))}e.newConfig={startQueryIncludeInferred:!0,startQuerySameAs:!0},e.newConfig.startMode="search",e.isUpdate=!1,e.shared=!1,e.encodeQuery=function(e){return encodeURIComponent(e)},y?(e.isUpdate=!0,u.getConfig(y).success((function(n){e.newConfig=n,h()})).error((function(e){r.error(getError(e),p.instant("created.connector",{name:y}))}))):(e.isUpdate=!1,h());const Q={id:"1",name:"",query:"select * where { \n\t?s ?p ?o .\n} limit 100 \n",inference:e.newConfig.startQueryIncludeInferred,sameAs:e.newConfig.startQuerySameAs};function b(e){}function T(n,t,r){const o=angular.element(document.getElementById("yasr-inner"));e.queryIsRunning=n,n?(e.queryStartTime=Date.now(),e.countTimeouted=!1,e.progressMessage=t,e.extraMessage=r,o.addClass("hide")):(e.progressMessage="",e.extraMessage="",o.removeClass("hide")),null===e.$$phase&&e.$apply()}function M(t){function r(){return window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight||0}const o=t;if(e.orientationViewMode){if("yasr"===e.viewMode){let e=r()-document.querySelector(".CodeMirror-wrap").getBoundingClientRect().top;e-=40,document.querySelector(".CodeMirror-wrap").style.height=e+"px"}else e.noPadding={},document.querySelector(".CodeMirror-wrap").style.height="";document.getElementById("yasr").style.minHeight=""}else if(e.noPadding={paddingRight:15,paddingLeft:0},window.editor&&document.querySelector(".CodeMirror-wrap")){let e=r()-document.querySelector(".CodeMirror-wrap").getBoundingClientRect().top;e-=40,document.querySelector(".CodeMirror-wrap").style.height=e+"px",document.getElementById("yasr").style.minHeight=e+"px"}else{let t;t=n(o?function(){e.fixSizesOnHorizontalViewModeSwitch(o)}:e.fixSizesOnHorizontalViewModeSwitch,100),e.$on("$destroy",(function(){n.cancel(t)}))}window.yasr&&window.yasr.container&&n((function(){window.yasr.container.resize()}),100)}function v(){M(!0)}function S(e){n((function(){$('a[data-id = "'+e+'"]').tab("show")}),0)}function x(n,t){e.executedQueryTab=e.currentQuery,t&&"SELECT"!==window.editor.getQueryType()&&"CONSTRUCT"!==window.editor.getQueryType()&&"DESCRIBE"!==window.editor.getQueryType()?r.warning(p.instant("query.editor.warning.msg")):"update"!==window.editor.getQueryMode()?(e.explainRequested=t,e.queryIsRunning||(n?e.currentTabConfig.resultsCount=0:e.resetCurrentTabConfig(),e.viewMode="editor",e.orientationViewMode&&e.fixSizesOnHorizontalViewModeSwitch(),T(!0,p.instant("evaluating.query.msg")),window.editor.query())):r.warning(p.instant("cannot.execute.update.error"))}function E(){T(!0,p.instant("common.refreshing.namespaces"),p.instant("common.extra.message")),g.getRepositoryNamespaces().success((function(n){const t={};n.results.bindings.forEach((function(e){t[e.prefix.value]=e.namespace.value})),e.namespaces=t})).error((function(n){e.repositoryError=getError(n)})).finally((function(){T(!1)}))}function I(){i.addKnownPrefixes(JSON.stringify(window.editor.getValue())).success((function(e){angular.isDefined(window.editor)&&angular.isDefined(e)&&e!==window.editor.getValue()&&window.editor.setValue(e)})).error((function(e){let n=getError(e);return r.error(n,p.instant("common.add.known.prefixes.error")),!0}))}function q(n){let t=void 0;return angular.forEach(e.tabsData,(function(e){if(e.name===n.name&&e.query===n.body)return t=e.id,e})),t}function R(){e.tabsData=[e.currentQuery];let t=e.currentQuery;null==e.currentQuery.query||""===e.currentQuery.query?window.editor.setValue(" "):window.editor.setValue(e.currentQuery.query),n((function(){e.currentTabConfig={},e.currentTabConfig.queryType=t.queryType,e.currentTabConfig.resultsCount=t.resultsCount,e.currentTabConfig.offset=t.offset,e.currentTabConfig.allResultsCount=t.allResultsCount,e.currentTabConfig.page=t.page,e.currentTabConfig.pageSize=t.pageSize,e.currentTabConfig.timeFinished=t.timeFinished,e.currentTabConfig.timeTook=t.timeTook,e.currentTabConfig.sizeDelta=t.sizeDelta,e.$apply()}),0),$("#yasr").css("padding","0")}function D(e){return $(e).attr("data-id")}e.resetCurrentTabConfig=function(){e.currentTabConfig={pageSize:100,page:1,allResultsCount:0,resultsCount:0}},e.queryExists=!1,e.resetCurrentTabConfig(),e.tabsData=e.tabs=[Q],e.saveTab=function(n){const t=function(n){for(let t=0;t<e.tabsData.length;t++){if(e.tabsData[t].id===n)return t}}(n);if(void 0===t)return{};const r=e.tabsData[t];return e.saveQueryToLocal(r),r},e.loadTab=R,e.addNewTab=function(e,n,t){},e.runQuery=x,e.getNamespaces=E,e.changePagination=function(){x(!0,e.explainRequested)},e.toggleSampleQueries=function(){},e.addKnownPrefixes=I,e.getExistingTabId=q,e.querySelected=function(n){const t=q(n);e.toggleSampleQueries(),angular.isDefined(t)?S(t):e.addNewTab(null,n.name,n.body)},e.saveQueryToLocal=b,e.setLoader=T,e.getLoaderMessage=function(){const n=(Date.now()-e.queryStartTime)/1e3,t=e.getHumanReadableSeconds(n);let r;r=e.progressMessage?e.progressMessage+"... "+t:p.instant("common.running.operation",{timeHuman:t});e.extraMessage&&n>10&&(r+="\n"+e.extraMessage);return r},e.fixSizesOnHorizontalViewModeSwitch=M,e.changeViewMode=function(t){e.viewMode="none",e.orientationViewMode=!e.orientationViewMode,M(),$(".dataTables_filter").remove(),$(".resultsTable").remove(),n((function(){R(),S(t)}),100)},e.showHideEditor=v,e.focusQueryEditor=function(){angular.element(document).find(".editable-input").is(":focus")||angular.element(document).find(".CodeMirror textarea:first-child").focus()},e.orientationViewMode=!0,e.orientationViewMode||v(),e.getActiveRepository()&&E(),e.$on("$destroy",(function(){window.editor=null,window.yasr=null})),$("textarea").on("paste",(function(){n((function(){I()}),0)})),e.$watchCollection("[currentQuery.inference, currentQuery.sameAs]",(function(){e.currentQuery})),e.$on("tabAction",(function(n,t){t.relatedTarget&&e.saveTab(D(t.relatedTarget)),e.loadTab(D(t.target))})),e.$on("deleteAllexeptSelected",(function(n,t){e.tabsData=t,e.tabs=t})),e.currentQuery=angular.copy(Q),e.showSampleQueries=!1,e.savedQuery={},e.sampleQueries={},e.getResultsDescription=function(){},e.getUpdateDescription=function(){},e.getStaleWarningMessage=function(){}}angular.module("graphdb.framework.graphexplore.controllers.graphviz.config",["graphdb.framework.utils.notifications","graphdb.framework.utils.localstorageadapter"]).controller("GraphConfigCtrl",r),r.$inject=["$scope","$timeout","$location","toastr","$repositories","SparqlRestService","$filter","GraphConfigRestService","AutocompleteRestService","$routeParams","Notifications","RDF4JRepositoriesRestService","LocalStorageAdapter","LSKeys","$translate"]}}]);
2
+ //# sourceMappingURL=39.ecdfa8a15c661473c246.bundle.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["webpack:///./src/js/angular/utils/notifications.js","webpack:///./src/js/angular/graphexplore/controllers/graphs-config.controller.js"],"names":["Notifications","toastr","$translate","showToastMessageWithDelay","message","Promise","r","success","instant","setTimeout","angular","module","factory","$inject","GraphConfigCtrl","$scope","$timeout","$location","$repositories","SparqlRestService","$filter","GraphConfigRestService","AutocompleteRestService","$routeParams","RDF4JRepositoriesRestService","LocalStorageAdapter","LSKeys","selectedFixedNodeChanged","page","totalPages","helpHidden","get","HIDE_GRAPH_CONFIG_HELP","toggleHelp","value","undefined","set","fixedVisualCallback","uri","label","newConfig","startIRI","startIRILabel","isDefaultGraph","sample","name","isUserGraph","getSampleName","property","extra","id","configName","showInvalidMsg","warning","getQueryForCurrentPage","config","query","startMode","startGraphQuery","expandQuery","resourceQuery","predicateLabelQuery","resourcePropertiesQuery","isDefined","initForConfig","checkAutocompleteStatus","getAutocompletePromise","getGraphConfigSamples","data","samples","_","filter","s","revertConfig","error","getError","createGraphConfig","async","url","updateGraphConfig","$on","getNamespacesPromise","getNamespaces","getActiveRepository","validateQueryWithCallback","successCallback","queryType","params","all","oneOf","validateQuery","broadcastAddStartFixedNodeEvent","checkPageAndMode","$broadcast","validateCurrentPage","updateModel","goToPage","nextPage","showEditor","notoolbar","goToPreviousPage","goToNextPage","saveGraphConfig","startQueryIncludeInferred","currentQuery","inference","startQuerySameAs","sameAs","isUpdate","window","editor","getValue","trim","setQuery","setValue","updateDirty","q1","q2","queryEditorIsDirty","updateEditor","isActiveRepoOntopType","nocount","loadTab","selectTab","xhr","abort","viewMode","showPreview","outputType","runQuery","revertEditor","$watch","shared","encodeQuery","encodeURIComponent","getConfig","defaultTabConfig","saveQueryToLocal","currentQueryTab","setLoader","isRunning","progressMessage","extraMessage","yasrInnerContainer","element","document","getElementById","queryIsRunning","queryStartTime","Date","now","countTimeouted","addClass","removeClass","$$phase","$apply","fixSizesOnHorizontalViewModeSwitch","verticalViewParam","visibleWindowHeight","innerHeight","documentElement","clientHeight","body","verticalView","orientationViewMode","newHeight","querySelector","getBoundingClientRect","style","height","noPadding","minHeight","paddingRight","paddingLeft","timer","cancel","yasr","container","resize","showHideEditor","$","tab","changePage","explain","executedQueryTab","getQueryType","getQueryMode","explainRequested","currentTabConfig","resultsCount","resetCurrentTabConfig","getRepositoryNamespaces","usedPrefixes","results","bindings","forEach","e","prefix","namespace","namespaces","repositoryError","finally","addKnownPrefixes","JSON","stringify","msg","getExistingTabId","existingTabId","tabsData","item","offset","allResultsCount","pageSize","timeFinished","timeTook","sizeDelta","css","getQueryID","attr","queryExists","tabs","saveTab","idx","i","length","findTabIndexByID","addNewTab","callback","tabName","savedQuery","changePagination","toggleSampleQueries","querySelected","tabId","getLoaderMessage","timeSeconds","timeHuman","getHumanReadableSeconds","changeViewMode","tabID","remove","focusQueryEditor","find","is","focus","on","$watchCollection","tabEvent","relatedTarget","target","copy","showSampleQueries","sampleQueries","getResultsDescription","getUpdateDescription","getStaleWarningMessage","controller"],"mappings":"+EAMA,SAASA,EAAcC,EAAQC,GAC3B,MAAO,CACHC,0BASJ,SAAmCC,GAC/B,OAAO,IAAIC,QAASC,IAChBL,EAAOM,QAAQL,EAAWM,QAAQJ,IAClCK,WAAWH,EAAG,SApB1BI,QACKC,OAAO,wCAAyC,IAChDC,QAAQ,gBAAiBZ,GAE9BA,EAAca,QAAU,CAAC,SAAU,e,gCCJnC,kBAYA,SAASC,EAAgBC,EAAQC,EAAUC,EAAWhB,EAAQiB,EAAeC,EAAmBC,EAASC,EAAwBC,EAAyBC,EAAcvB,EAAewB,EAA8BC,EAAqBC,EAAQxB,GAoB9O,IAAIyB,EAlBJZ,EAAOa,KAAO,EACdb,EAAOc,WAAa,EAEpBd,EAAOe,WAAwE,IAA3DL,EAAoBM,IAAIL,EAAOM,wBAEnDjB,EAAOkB,WAAa,SAAUC,QACZC,IAAVD,IACAA,EAAQT,EAAoBM,IAAIL,EAAOM,yBAE7B,IAAVE,GACAT,EAAoBW,IAAIV,EAAOM,uBAAwB,GACvDjB,EAAOe,YAAa,IAEpBL,EAAoBW,IAAIV,EAAOM,uBAAwB,GACvDjB,EAAOe,YAAa,IAK5Bf,EAAOsB,oBAAsB,SAAUC,EAAKC,GACxCxB,EAAOyB,UAAUC,SAAWH,EAC5BvB,E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+F,EAAW8B,EAASE,YAGvC1O,EAAOiE,IAAI,0BAA0B,SAAUoH,EAAGwB,GAC9C7M,EAAOiM,SAAWY,EAClB7M,EAAO6M,KAAOA,KAIlB7M,EAAOyF,aAAe9F,QAAQgP,KAAKlH,GAEnCzH,EAAO4O,mBAAoB,EAC3B5O,EAAOsN,WAAa,GACpBtN,EAAO6O,cAAgB,GAEvB7O,EAAO8O,sBAAwB,aAG/B9O,EAAO+O,qBAAuB,aAG9B/O,EAAOgP,uBAAyB,aAxsBpCrP,QACKC,OAAO,6DAA8D,CAClE,wCACA,gDAEHqP,WAAW,kBAAmBlP,GAEnCA,EAAgBD,QAAU,CAAC,SAAU,WAAY,YAAa,SAAU,gBAAiB,oBAAqB,UAAW,yBAA0B,0BAA2B,eAAgB,gBAAiB,+BAAgC,sBAAuB,SAAU","file":"39.ecdfa8a15c661473c246.bundle.js","sourcesContent":["angular\n .module('graphdb.framework.utils.notifications', [])\n .factory('Notifications', Notifications);\n\nNotifications.$inject = ['toastr', '$translate'];\n\nfunction Notifications(toastr, $translate) {\n return {\n showToastMessageWithDelay\n };\n\n /**\n * This method will show message with tiny delay and only after completion\n * of latter redirection to \"graphs-visualizations\" page will happen.\n * @param {string} message The message to be displayed.\n * @return {Promise<any>}\n */\n function showToastMessageWithDelay(message) {\n return new Promise((r) => {\n toastr.success($translate.instant(message));\n setTimeout(r, 200);\n });\n }\n}\n","import 'angular/utils/notifications';\nimport 'angular/utils/local-storage-adapter';\n\nangular\n .module('graphdb.framework.graphexplore.controllers.graphviz.config', [\n 'graphdb.framework.utils.notifications',\n 'graphdb.framework.utils.localstorageadapter'\n ])\n .controller('GraphConfigCtrl', GraphConfigCtrl);\n\nGraphConfigCtrl.$inject = ['$scope', '$timeout', '$location', 'toastr', '$repositories', 'SparqlRestService', '$filter', 'GraphConfigRestService', 'AutocompleteRestService', '$routeParams', 'Notifications', 'RDF4JRepositoriesRestService', 'LocalStorageAdapter', 'LSKeys', '$translate'];\n\nfunction GraphConfigCtrl($scope, $timeout, $location, toastr, $repositories, SparqlRestService, $filter, GraphConfigRestService, AutocompleteRestService, $routeParams, Notifications, RDF4JRepositoriesRestService, LocalStorageAdapter, LSKeys, $translate) {\n\n $scope.page = 1;\n $scope.totalPages = 5;\n\n $scope.helpHidden = LocalStorageAdapter.get(LSKeys.HIDE_GRAPH_CONFIG_HELP) === 1;\n\n $scope.toggleHelp = function (value) {\n if (value === undefined) {\n value = LocalStorageAdapter.get(LSKeys.HIDE_GRAPH_CONFIG_HELP);\n }\n if (value !== 1) {\n LocalStorageAdapter.set(LSKeys.HIDE_GRAPH_CONFIG_HELP, 1);\n $scope.helpHidden = true;\n } else {\n LocalStorageAdapter.set(LSKeys.HIDE_GRAPH_CONFIG_HELP, 0);\n $scope.helpHidden = false;\n }\n };\n\n var selectedFixedNodeChanged;\n $scope.fixedVisualCallback = function (uri, label) {\n $scope.newConfig.startIRI = uri;\n $scope.newConfig.startIRILabel = label;\n selectedFixedNodeChanged = true;\n };\n\n $scope.isDefaultGraph = function (sample) {\n return (sample.name === 'Minimal' || sample.name === 'Advanced');\n };\n\n $scope.isUserGraph = function (sample) {\n return !$scope.isDefaultGraph(sample);\n };\n\n $scope.getSampleName = function (sample, property) {\n const extra = sample[property + 'Description'];\n if (extra) {\n // Sample has description, use it\n return extra;\n } else {\n // Sample is a copy of existing config, prepend Copy of to name\n return sample.id ? 'Copy of ' + sample.name : sample.name;\n }\n };\n\n const getGraphConfigSamples = function () {\n GraphConfigRestService.getGraphConfigSamples()\n .success(function (data) {\n $scope.samples = _.filter(data, function (s) {\n // Skip the currently edited config from samples and store it into a revert variable\n if (!s.id || $scope.newConfig.id !== s.id) {\n return true;\n } else {\n $scope.revertConfig = s;\n return false;\n }\n });\n }).error(function (data) {\n toastr.error(getError(data), $translate.instant('graphexplore.error.graph.configs'));\n });\n };\n\n const configName = $routeParams.configName;\n $scope.newConfig = {startQueryIncludeInferred: true, startQuerySameAs: true};\n $scope.newConfig.startMode = 'search';\n $scope.isUpdate = false;\n $scope.shared = false;\n\n $scope.encodeQuery = function (query) {\n return encodeURIComponent(query);\n };\n\n function showInvalidMsg(message) {\n toastr.warning(message);\n }\n\n if (configName) {\n $scope.isUpdate = true;\n GraphConfigRestService.getConfig(configName)\n .success(function (data) {\n $scope.newConfig = data;\n initForConfig();\n })\n .error(function (data) {\n toastr.error(getError(data), $translate.instant('created.connector', {name: configName}));\n });\n } else {\n $scope.isUpdate = false;\n initForConfig();\n }\n\n function getQueryForCurrentPage(config) {\n let query;\n\n if (config.startMode === 'query' && $scope.page === 1) {\n query = config.startGraphQuery;\n } else if ($scope.page === 2) {\n query = config.expandQuery;\n } else if ($scope.page === 3) {\n query = config.resourceQuery;\n } else if ($scope.page === 4) {\n query = config.predicateLabelQuery;\n } else if ($scope.page === 5) {\n query = config.resourcePropertiesQuery;\n }\n\n return angular.isDefined(query) ? query : '';\n }\n\n function initForConfig() {\n getGraphConfigSamples();\n $scope.createGraphConfig = function () {\n GraphConfigRestService.createGraphConfig($scope.newConfig)\n .success(async function () {\n await Notifications.showToastMessageWithDelay('graphexplore.saved.new.config');\n $location.url('graphs-visualizations');\n }).error(function (data) {\n toastr.error(getError(data), $translate.instant('graphexplore.error.could.not.create'));\n });\n };\n\n $scope.updateGraphConfig = function () {\n GraphConfigRestService.updateGraphConfig($scope.newConfig)\n .success(async function () {\n await Notifications.showToastMessageWithDelay('graphexplore.saved.config');\n $location.url('graphs-visualizations');\n }).error(function (data) {\n toastr.error(getError(data), $translate.instant('graphexplore.error.could.not.save'));\n });\n };\n\n function checkAutocompleteStatus() {\n $scope.getAutocompletePromise = AutocompleteRestService.checkAutocompleteStatus();\n }\n\n $scope.$on('autocompleteStatus', function() {\n checkAutocompleteStatus();\n });\n\n checkAutocompleteStatus();\n $scope.getNamespacesPromise = RDF4JRepositoriesRestService.getNamespaces($scope.getActiveRepository());\n\n const validateQueryWithCallback = function (successCallback, query, queryType, params, all, oneOf) {\n if (!query) {\n successCallback();\n } else {\n GraphConfigRestService.validateQuery(query, queryType, params, all, oneOf)\n .success(function () {\n successCallback();\n }).error(function (data) {\n showInvalidMsg(getError(data));\n });\n }\n };\n\n $scope.validateCurrentPage = function (successCallback) {\n $scope.updateModel();\n\n if ($scope.page === 1) {\n if ($scope.newConfig.startMode === 'node' && !$scope.newConfig.startIRI) {\n showInvalidMsg($translate.instant('graphexplore.select.start.node'));\n } else if ($scope.newConfig.startMode === 'query' && !$scope.newConfig.startGraphQuery) {\n showInvalidMsg($translate.instant('graphexplore.provide.query'));\n } else if ($scope.newConfig.startMode === 'query') {\n validateQueryWithCallback(successCallback, $scope.newConfig.startGraphQuery, 'graph')\n } else {\n successCallback();\n }\n } else if ($scope.page === 2) {\n validateQueryWithCallback(successCallback, $scope.newConfig.expandQuery, 'construct', ['node'])\n } else if ($scope.page === 3) {\n validateQueryWithCallback(successCallback, $scope.newConfig.resourceQuery, 'tuple', ['node'], [], ['type', 'label', 'comment', 'rank']);\n } else if ($scope.page === 4) {\n validateQueryWithCallback(successCallback, $scope.newConfig.predicateLabelQuery, 'tuple', ['edge'], ['label']);\n } else if ($scope.page === 5) {\n validateQueryWithCallback(successCallback, $scope.newConfig.resourcePropertiesQuery, 'tuple', ['node'], ['property', 'value']);\n }\n };\n\n $scope.goToPage = function (nextPage) {\n if ($scope.page === nextPage) {\n // already there\n return;\n }\n\n $scope.validateCurrentPage(function () {\n $scope.showEditor();\n $scope.page = nextPage;\n $scope.notoolbar = $scope.page !== 1;\n });\n };\n\n $scope.goToPreviousPage = function () {\n if ($scope.page > 1) {\n $scope.goToPage($scope.page - 1);\n }\n\n if (checkPageAndMode()) {\n selectedFixedNodeChanged = false;\n }\n };\n\n $scope.goToNextPage = function () {\n broadcastAddStartFixedNodeEvent();\n if ($scope.newConfig.startMode !== 'node' || selectedFixedNodeChanged) {\n $scope.goToPage($scope.page + 1);\n }\n };\n\n function broadcastAddStartFixedNodeEvent() {\n if (checkPageAndMode()) {\n $scope.$broadcast('addStartFixedNodeAutomatically', {startIRI: $scope.newConfig.startIRI});\n }\n }\n\n function checkPageAndMode() {\n return $scope.page === 1 && $scope.newConfig.startMode === 'node';\n }\n\n $scope.saveGraphConfig = function () {\n broadcastAddStartFixedNodeEvent();\n\n if (checkPageAndMode() && !selectedFixedNodeChanged) {\n return;\n }\n\n $scope.newConfig.startQueryIncludeInferred = $scope.currentQuery.inference;\n $scope.newConfig.startQuerySameAs = $scope.currentQuery.sameAs;\n\n $scope.validateCurrentPage(function () {\n if (!$scope.newConfig.name) {\n showInvalidMsg($translate.instant('graphexplore.provide.config.name'));\n return;\n }\n $scope.isUpdate ? $scope.updateGraphConfig($scope.newConfig) : $scope.createGraphConfig($scope.newConfig);\n });\n };\n\n $scope.updateModel = function () {\n const query = window.editor.getValue().trim();\n if ($scope.newConfig.startMode === 'query' && $scope.page === 1) {\n $scope.newConfig.startGraphQuery = query;\n } else if ($scope.page === 2) {\n $scope.newConfig.expandQuery = query;\n } else if ($scope.page === 3) {\n $scope.newConfig.resourceQuery = query;\n } else if ($scope.page === 4) {\n $scope.newConfig.predicateLabelQuery = query;\n } else if ($scope.page === 5) {\n $scope.newConfig.resourcePropertiesQuery = query;\n }\n };\n\n // Called when user clicks on a sample query\n $scope.setQuery = function (query) {\n // Hack for YASQE bug\n window.editor.setValue(query ? query : ' ');\n };\n\n $scope.updateDirty = function () {\n if ($scope.revertConfig) {\n const q1 = getQueryForCurrentPage($scope.revertConfig);\n const q2 = window.editor.getValue().trim();\n $scope.queryEditorIsDirty = q1 !== q2;\n }\n };\n\n // Updates the position of the query editor to match the current div placeholder\n // and sets the editor's query to the relevant query from the model.\n $scope.updateEditor = function () {\n $timeout(function () {\n $scope.currentQuery.query = getQueryForCurrentPage($scope.newConfig);\n // // Check for ontop repository and override nocount property (it's default value is false)\n if ($repositories.isActiveRepoOntopType()) {\n $scope.nocount = true;\n }\n $scope.currentQuery.inference = $scope.newConfig.startQueryIncludeInferred;\n $scope.currentQuery.sameAs = $scope.newConfig.startQuerySameAs;\n loadTab();\n selectTab($scope.currentQuery.id);\n }, 100);\n\n };\n\n $scope.showEditor = function () {\n if (window.editor && window.editor.xhr) {\n window.editor.xhr.abort();\n }\n $scope.viewMode = 'yasr';\n };\n\n $scope.showPreview = function () {\n // For some reason YASR gets confused and sets this to rawResponse\n // if we execute a CONSTRUCT and then a SELECT. This makes sure it's always table.\n $scope.currentQuery.outputType = 'table';\n $scope.runQuery();\n };\n\n $scope.revertEditor = function () {\n $scope.setQuery(getQueryForCurrentPage($scope.revertConfig));\n };\n\n // Trigger for showing the editor and moving it to the right position\n $scope.$watch('newConfig.startMode', function (value) {\n if (value === 'query') {\n $timeout(function () {\n $scope.updateEditor();\n }, 0);\n }\n });\n\n // Trigger for showing the editor and moving it to the right position\n $scope.$watch('page', function (value) {\n if ($scope.newConfig.startMode === 'query' || value > 1) {\n $timeout(function () {\n $scope.showEditor();\n $scope.updateEditor();\n }, 0);\n }\n });\n }\n\n // DOWN HERE WE KEEP EVERYTHING PURELY QUERY EDITOR (MOSTLY BORROWED FROM query-editor.controller.js)\n // But Why? Can't we reuse it instead of borrow?\n\n const defaultTabConfig = {\n id: '1',\n name: '',\n query: 'select * where { \\n' +\n '\\t?s ?p ?o .\\n' +\n '} limit 100 \\n',\n inference: $scope.newConfig.startQueryIncludeInferred,\n sameAs: $scope.newConfig.startQuerySameAs\n };\n\n $scope.resetCurrentTabConfig = function () {\n $scope.currentTabConfig = {\n pageSize: 100, // page limit 100 as this is only used for preview\n page: 1,\n allResultsCount: 0,\n resultsCount: 0\n };\n };\n\n $scope.queryExists = false;\n\n $scope.resetCurrentTabConfig();\n\n $scope.tabsData = $scope.tabs = [defaultTabConfig];\n\n // query tab operations\n $scope.saveTab = saveTab;\n $scope.loadTab = loadTab;\n $scope.addNewTab = addNewTab;\n\n // query operations\n $scope.runQuery = runQuery;\n $scope.getNamespaces = getNamespaces;\n $scope.changePagination = changePagination;\n $scope.toggleSampleQueries = toggleSampleQueries;\n $scope.addKnownPrefixes = addKnownPrefixes;\n $scope.getExistingTabId = getExistingTabId;\n $scope.querySelected = querySelected;\n $scope.saveQueryToLocal = saveQueryToLocal;\n\n $scope.setLoader = setLoader;\n $scope.getLoaderMessage = getLoaderMessage;\n\n // query editor and results orientation\n $scope.fixSizesOnHorizontalViewModeSwitch = fixSizesOnHorizontalViewModeSwitch;\n $scope.changeViewMode = changeViewMode;\n $scope.showHideEditor = showHideEditor;\n $scope.focusQueryEditor = focusQueryEditor;\n $scope.orientationViewMode = true;\n\n // start of repository actions\n\n function saveQueryToLocal(currentQueryTab) {\n }\n\n function setLoader(isRunning, progressMessage, extraMessage) {\n const yasrInnerContainer = angular.element(document.getElementById('yasr-inner'));\n $scope.queryIsRunning = isRunning;\n if (isRunning) {\n $scope.queryStartTime = Date.now();\n $scope.countTimeouted = false;\n $scope.progressMessage = progressMessage;\n $scope.extraMessage = extraMessage;\n yasrInnerContainer.addClass('hide');\n } else {\n $scope.progressMessage = '';\n $scope.extraMessage = '';\n yasrInnerContainer.removeClass('hide');\n }\n // We might call this from angular or outside angular so take care of applying the scope.\n if ($scope.$$phase === null) {\n $scope.$apply();\n }\n }\n\n function getLoaderMessage() {\n const timeSeconds = (Date.now() - $scope.queryStartTime) / 1000;\n const timeHuman = $scope.getHumanReadableSeconds(timeSeconds);\n let message;\n\n if ($scope.progressMessage) {\n message = $scope.progressMessage + '... ' + timeHuman;\n } else {\n message = $translate.instant('common.running.operation', {timeHuman: timeHuman});\n }\n if ($scope.extraMessage && timeSeconds > 10) {\n message += '\\n' + $scope.extraMessage;\n }\n\n return message;\n }\n\n\n // start of query editor results orientation operations\n function fixSizesOnHorizontalViewModeSwitch(verticalViewParam) {\n function visibleWindowHeight() {\n return window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight || 0;\n }\n\n const codemirrorWrapperSelector = '.CodeMirror-wrap';\n const verticalView = verticalViewParam;\n if (!$scope.orientationViewMode) {\n $scope.noPadding = {paddingRight: 15, paddingLeft: 0};\n\n // window.editor is undefined if no repo is selected\n if (window.editor && document.querySelector(codemirrorWrapperSelector)) {\n let newHeight = visibleWindowHeight() - (document.querySelector(codemirrorWrapperSelector).getBoundingClientRect().top);\n newHeight -= 40;\n document.querySelector(codemirrorWrapperSelector).style.height = newHeight + 'px';\n document.getElementById('yasr').style.minHeight = newHeight + 'px';\n } else {\n let timer;\n if (verticalView) {\n timer = $timeout(function () {\n $scope.fixSizesOnHorizontalViewModeSwitch(verticalView)\n }, 100);\n } else {\n timer = $timeout($scope.fixSizesOnHorizontalViewModeSwitch, 100);\n }\n\n $scope.$on('$destroy', function () {\n $timeout.cancel(timer);\n });\n }\n } else {\n if ($scope.viewMode === 'yasr') {\n let newHeight = visibleWindowHeight() - (document.querySelector(codemirrorWrapperSelector).getBoundingClientRect().top);\n newHeight -= 40;\n document.querySelector(codemirrorWrapperSelector).style.height = newHeight + 'px';\n } else {\n $scope.noPadding = {};\n document.querySelector(codemirrorWrapperSelector).style.height = '';\n }\n document.getElementById('yasr').style.minHeight = '';\n }\n if (window.yasr && window.yasr.container) {\n $timeout(function () {\n window.yasr.container.resize();\n }, 100);\n }\n }\n\n if (!$scope.orientationViewMode) {\n showHideEditor();\n }\n\n function changeViewMode(tabID) {\n $scope.viewMode = 'none';\n $scope.orientationViewMode = !$scope.orientationViewMode;\n fixSizesOnHorizontalViewModeSwitch();\n $('.dataTables_filter').remove();\n $('.resultsTable').remove();\n $timeout(function () {\n loadTab();\n selectTab(tabID);\n }, 100);\n }\n\n function showHideEditor() {\n fixSizesOnHorizontalViewModeSwitch(true);\n }\n\n function focusQueryEditor() {\n if (!angular.element(document).find('.editable-input').is(':focus')) {\n angular.element(document).find('.CodeMirror textarea:first-child').focus();\n }\n }\n\n function selectTab(id) {\n $timeout(function () {\n $('a[data-id = \"' + id + '\"]').tab('show');\n }, 0);\n }\n\n // start of query operations\n function runQuery(changePage, explain) {\n $scope.executedQueryTab = $scope.currentQuery;\n if (explain && !(window.editor.getQueryType() === 'SELECT' || window.editor.getQueryType() === 'CONSTRUCT'\n || window.editor.getQueryType() === 'DESCRIBE')) {\n toastr.warning($translate.instant('query.editor.warning.msg'));\n return;\n }\n\n if (window.editor.getQueryMode() === 'update') {\n toastr.warning($translate.instant('cannot.execute.update.error'));\n return;\n }\n\n $scope.explainRequested = explain;\n if (!$scope.queryIsRunning) {\n if (changePage) {\n $scope.currentTabConfig.resultsCount = 0;\n } else {\n $scope.resetCurrentTabConfig();\n }\n\n // Hides the editor and shows the yasr results\n $scope.viewMode = 'editor';\n if ($scope.orientationViewMode) {\n $scope.fixSizesOnHorizontalViewModeSwitch()\n }\n\n setLoader(true, $translate.instant('evaluating.query.msg'));\n window.editor.query();\n }\n }\n\n function getNamespaces() {\n // Signals the namespaces are to be fetched => loader will be shown\n setLoader(true, $translate.instant('common.refreshing.namespaces'), $translate.instant('common.extra.message'));\n RDF4JRepositoriesRestService.getRepositoryNamespaces()\n .success(function (data) {\n const usedPrefixes = {};\n data.results.bindings.forEach(function (e) {\n usedPrefixes[e.prefix.value] = e.namespace.value;\n });\n $scope.namespaces = usedPrefixes;\n })\n .error(function (data) {\n $scope.repositoryError = getError(data);\n })\n .finally(function () {\n // Signals namespaces were fetched => loader will be hidden\n setLoader(false);\n });\n }\n\n function changePagination() {\n runQuery(true, $scope.explainRequested);\n }\n\n if ($scope.getActiveRepository()) {\n getNamespaces();\n }\n\n $scope.$on('$destroy', function () {\n window.editor = null;\n window.yasr = null;\n });\n\n function toggleSampleQueries() {\n }\n\n // Add known prefixes\n function addKnownPrefixes() {\n SparqlRestService.addKnownPrefixes(JSON.stringify(window.editor.getValue()))\n .success(function (data) {\n if (angular.isDefined(window.editor) && angular.isDefined(data) && data !== window.editor.getValue()) {\n window.editor.setValue(data);\n }\n })\n .error(function (data) {\n let msg = getError(data);\n toastr.error(msg, $translate.instant('common.add.known.prefixes.error'));\n return true;\n });\n }\n\n $('textarea').on('paste', function () {\n $timeout(function () {\n addKnownPrefixes();\n }, 0);\n });\n\n function querySelected(query) {\n const tabId = getExistingTabId(query);\n $scope.toggleSampleQueries();\n if (!angular.isDefined(tabId)) {\n $scope.addNewTab(null, query.name, query.body);\n } else {\n selectTab(tabId);\n }\n }\n\n function getExistingTabId(query) {\n let existingTabId = undefined;\n angular.forEach($scope.tabsData, function (item) {\n if (item.name === query.name && item.query === query.body) {\n existingTabId = item.id;\n return item;\n }\n });\n\n return existingTabId;\n }\n\n // end of query operations\n\n // start of query tab operations\n function findTabIndexByID(id) {\n for (let i = 0; i < $scope.tabsData.length; i++) {\n const tab = $scope.tabsData[i];\n if (tab.id === id) {\n return i;\n }\n }\n }\n\n $scope.$watchCollection('[currentQuery.inference, currentQuery.sameAs]', function () {\n saveQueryToLocal($scope.currentQuery);\n });\n\n function saveTab(id) {\n const idx = findTabIndexByID(id);\n // Tab was deleted, don't try to save it's state\n if (idx === undefined) {\n return {};\n }\n const tab = $scope.tabsData[idx];\n $scope.saveQueryToLocal(tab);\n return tab;\n }\n\n function addNewTab(callback, tabName, savedQuery) {\n }\n\n function loadTab() {\n $scope.tabsData = [$scope.currentQuery];\n\n let tab = $scope.currentQuery;\n\n if ($scope.currentQuery.query == null || $scope.currentQuery.query === '') {\n // hack for YASQE bug\n window.editor.setValue(' ');\n } else {\n window.editor.setValue($scope.currentQuery.query);\n }\n\n $timeout(function () {\n $scope.currentTabConfig = {};\n $scope.currentTabConfig.queryType = tab.queryType;\n $scope.currentTabConfig.resultsCount = tab.resultsCount;\n\n $scope.currentTabConfig.offset = tab.offset;\n $scope.currentTabConfig.allResultsCount = tab.allResultsCount;\n $scope.currentTabConfig.page = tab.page;\n $scope.currentTabConfig.pageSize = tab.pageSize;\n\n $scope.currentTabConfig.timeFinished = tab.timeFinished;\n $scope.currentTabConfig.timeTook = tab.timeTook;\n $scope.currentTabConfig.sizeDelta = tab.sizeDelta;\n $scope.$apply();\n }, 0);\n\n //Remove padding of yasr so it will be aligned with sparql editor\n $('#yasr').css('padding', '0');\n }\n\n function getQueryID(element) {\n return $(element).attr('data-id');\n }\n\n $scope.$on('tabAction', function (e, tabEvent) {\n if (tabEvent.relatedTarget) {\n $scope.saveTab(getQueryID(tabEvent.relatedTarget));\n }\n $scope.loadTab(getQueryID(tabEvent.target));\n });\n\n $scope.$on('deleteAllexeptSelected', function (e, tabs) {\n $scope.tabsData = tabs;\n $scope.tabs = tabs;\n });\n // end of query tab operations\n\n $scope.currentQuery = angular.copy(defaultTabConfig);\n // $scope.state = {};\n $scope.showSampleQueries = false;\n $scope.savedQuery = {};\n $scope.sampleQueries = {};\n\n $scope.getResultsDescription = function () {\n };\n\n $scope.getUpdateDescription = function () {\n };\n\n $scope.getStaleWarningMessage = function () {\n }\n\n}\n"],"sourceRoot":""}