graphdb-workbench 3.3.2-RC3 → 3.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/38644.0e8652c647a0f341abd7.bundle.js +2 -0
- package/dist/38644.0e8652c647a0f341abd7.bundle.js.map +1 -0
- package/dist/39518.4d72b74fffba395c6b2a.bundle.js +2 -0
- package/dist/{39518.68e0a6bf41cd48ce4e13.bundle.js.map → 39518.4d72b74fffba395c6b2a.bundle.js.map} +1 -1
- package/dist/67888.41803878170b6c7a5ca5.bundle.js +2 -0
- package/dist/67888.41803878170b6c7a5ca5.bundle.js.map +1 -0
- package/dist/{82926.541c9761fdcf4b5433ac.bundle.js → 82926.ce1d6bf65b09288a2b10.bundle.js} +2 -2
- package/dist/{82926.541c9761fdcf4b5433ac.bundle.js.map → 82926.ce1d6bf65b09288a2b10.bundle.js.map} +1 -1
- package/dist/99448.2a87f387a8062617d893.bundle.js +2 -0
- package/dist/99448.2a87f387a8062617d893.bundle.js.map +1 -0
- package/dist/index.html +8 -8
- package/dist/js/angular/clustermanagement/templates/cluster-nodes-configuration.html +1 -1
- package/dist/js/angular/core/directives/autocomplete/templates/autocomplete.html +1 -1
- package/dist/js/angular/core/directives/dynamic-form/templates/dynamic-form.html +1 -1
- package/dist/js/angular/core/directives/operations-statuses-monitor/templates/operations-statuses-monitor.html +1 -1
- package/dist/js/angular/core/directives/rdfresourcesearch/templates/rdfResourceSearchTemplate.html +1 -1
- package/dist/js/angular/core/directives/shuttle-multiselect/templates/shuttle-multiselect.html +1 -1
- package/dist/js/angular/core/directives/yasgui-component/templates/yasgui-component.html +2 -2
- package/dist/js/angular/core/templates/cookie-policy/cookie-consent.html +1 -1
- package/dist/js/angular/core/templates/cookie-policy/cookie-policy.html +1 -1
- package/dist/js/angular/core/templates/editable-content/editable-content.html +1 -1
- package/dist/js/angular/core/templates/markdown-content/markdown-content.html +1 -1
- package/dist/js/angular/core/templates/search-resource-input.html +1 -1
- package/dist/js/angular/graphql/templates/create-graphql-endpoint.html +2 -2
- package/dist/js/angular/graphql/templates/graphql-endpoint-management.html +1 -1
- package/dist/js/angular/graphql/templates/graphql-playground.html +2 -2
- package/dist/js/angular/graphql/templates/modal/endpoint-configuration-modal.html +1 -1
- package/dist/js/angular/graphql/templates/modal/endpoint-generation-failure-result-modal.html +1 -1
- package/dist/js/angular/graphql/templates/modal/import-endpoint-definition-modal.html +1 -1
- package/dist/js/angular/security/templates/user.html +2 -2
- package/dist/js/angular/ttyg/templates/agent-list.html +1 -1
- package/dist/js/angular/ttyg/templates/agent-select-menu.html +1 -1
- package/dist/js/angular/ttyg/templates/chat-item-detail.html +1 -1
- package/dist/js/angular/ttyg/templates/chat-list.html +1 -1
- package/dist/js/angular/ttyg/templates/chat-panel.html +1 -1
- package/dist/js/angular/ttyg/templates/modal/agent-instructions-explain-modal.html +1 -1
- package/dist/js/angular/ttyg/templates/modal/agent-settings-modal.html +3 -3
- package/dist/js/angular/ttyg/templates/modal/external-integration-configuration-modal.html +1 -1
- package/dist/js/angular/ttyg/templates/no-agents-view.html +1 -1
- package/dist/js/angular/ttyg/templates/ttyg.html +1 -1
- package/dist/legacyWorkbench.40eba9e09196e1483221.js +3 -0
- package/dist/{legacyWorkbench.ce5888eb577ad619d1c0.js.map → legacyWorkbench.40eba9e09196e1483221.js.map} +1 -1
- package/dist/pages/aclmanagement.html +1 -1
- package/dist/pages/autocomplete.html +1 -1
- package/dist/pages/choose-repository-type.html +1 -1
- package/dist/pages/cluster-management/clusterInfo.html +3 -3
- package/dist/pages/create-index.html +1 -1
- package/dist/pages/dependencies.html +1 -1
- package/dist/pages/domainRangeInfo.html +2 -2
- package/dist/pages/edit.html +1 -1
- package/dist/pages/explore.html +1 -1
- package/dist/pages/export.html +1 -1
- package/dist/pages/find.html +1 -1
- package/dist/pages/graph-config/saveGraphConfig.html +8 -8
- package/dist/pages/graphs-visualizations.html +7 -7
- package/dist/pages/guides.html +1 -1
- package/dist/pages/home.html +1 -1
- package/dist/pages/import.html +2 -2
- package/dist/pages/jdbc-create.html +1 -1
- package/dist/pages/jdbc.html +1 -1
- package/dist/pages/monitor/backup-and-restore.html +1 -1
- package/dist/pages/monitor/queries.html +1 -1
- package/dist/pages/monitor/resources.html +1 -1
- package/dist/pages/namespaces.html +2 -2
- package/dist/pages/plugins.html +1 -1
- package/dist/pages/rdfClassHierarchyInfo.html +7 -7
- package/dist/pages/rdfrank.html +2 -2
- package/dist/pages/repositories.html +1 -1
- package/dist/pages/repository.html +1 -1
- package/dist/pages/similarity-indexes.html +1 -1
- package/dist/pages/sparql-editor.html +1 -1
- package/dist/pages/sparql-template-create.html +1 -1
- package/dist/pages/sparql-templates.html +1 -1
- package/dist/pages/ux-test1.html +2 -2
- package/dist/pages/webapi.html +2 -2
- package/dist/res/swagger5/index.html +11 -11
- package/package.json +1 -1
- package/dist/38644.50237b1e0bfe500c849a.bundle.js +0 -2
- package/dist/38644.50237b1e0bfe500c849a.bundle.js.map +0 -1
- package/dist/39518.68e0a6bf41cd48ce4e13.bundle.js +0 -2
- package/dist/67888.6250e334540bfa0ca257.bundle.js +0 -2
- package/dist/67888.6250e334540bfa0ca257.bundle.js.map +0 -1
- package/dist/99448.7b61cd00c13a1c47843a.bundle.js +0 -2
- package/dist/99448.7b61cd00c13a1c47843a.bundle.js.map +0 -1
- package/dist/legacyWorkbench.ce5888eb577ad619d1c0.js +0 -3
- /package/dist/{legacyWorkbench.ce5888eb577ad619d1c0.js.LICENSE.txt → legacyWorkbench.40eba9e09196e1483221.js.LICENSE.txt} +0 -0
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
export const __webpack_esm_id__=39518;export const __webpack_esm_ids__=[14319,39518,49342,78618];export const __webpack_esm_modules__={14319(e,t,n){n.d(t,{Ds:()=>r,VH:()=>i,nj:()=>s,vH:()=>o});const r=[{id:"empty",name:"No inference"},{id:"rdfs-optimized",name:"RDFS (Optimized)"},{id:"rdfs",name:"RDFS"},{id:"rdfsplus-optimized",name:"RDFS-Plus (Optimized)"},{id:"owl-horst-optimized",name:"OWL-Horst (Optimized)"},{id:"owl-horst",name:"OWL-Horst"},{id:"owl2-ql-optimized",name:"OWL2-QL (Optimized)"},{id:"owl2-ql",name:"OWL2-QL"},{id:"owl-max-optimized",name:"OWL-Max (Optimized)"},{id:"owl-max",name:"OWL-Max"},{id:"owl2-rl-optimized",name:"OWL2-RL (Optimized)"},{id:"owl2-rl",name:"OWL2-RL"}],i={graphdbRepo:"graphdb",free:"free",eeWorker:"worker",eeMaster:"master",ontop:"ontop",se:"se",fedx:"fedx"},o=new RegExp("^[a-zA-Z0-9-_]+$"),s=new RegExp("^[0-9]+$")},19935(e,t,n){n.d(t,{A:()=>s}),n(62979);var r=n(93462);const i={dispatch:r.dispatch,pointer:r.pointer};var o=o||{};o.Text=function(){function e(e,t,n,r){n=n||10;var i=t/3;return"string"==typeof e?(i*=10/(e.substring(0,t/3).length+1.5),i+=1,e.match(/[\u0900-\u0DFF\u1100-\u11FF\u2E80-\u2EFF\u3000-\u9FFF]/)&&(i*=.6),i<n&&(i=n),Math.round(i)):(i<n&&(i=n),Math.round(i))}return{calcFontSizeRaw:e,calcFontSize:function(t,n,r,i){return e(t,n,r)+"px"},getTextWithElipsisIfNeeded:function(e,t){return"string"==typeof e&&e.length>t?e.substring(0,t-3)+"...":e}}}(),o.Transition={fadeIn:function(e,t){e.style("opacity",0).transition().duration(t).style("opacity",1)},fadeOut:function(e,t){e.style("opacity",1).transition().duration(t).style("opacity",0)}},o.Click=function(){function e(e,t,n){return function(){var r=n.apply(t,arguments);return r===t?e:r}}return{delayDblClick:function(){var t=i.dispatch("click","dblclick");return function(t,n){let r,i=1,o=arguments.length;for(;++i<o;)r=arguments[i],t[r]=e(t,n,n[r]);return t}(function(e){var n,r=null;e.on("mousedown",function(){n=i.pointer(document.body),new Date}),e.on("mouseup",function(e,o){var s,a,c;a=n,c=i.pointer(document.body),Math.sqrt(Math.pow(a[0]-c[0],2),Math.pow(a[1]-c[1],2))>5||(r?(window.clearTimeout(r),r=null,t.call("dblclick",e,e,o)):r=window.setTimeout((s=e,function(){t.call("click",s,s,o),r=null}),250))})},t,"on")}}}();const s=o},39518(e,t,n){n(82493),n(96e3),n(18148);var r=n(19935),i=n(75468),o=n(93462),s=(n(32150),n(14319)),a=n(78618),c=n(6418),l=n(72155),d=n(57154);function p(e,t,n,p,u,f,h,g,m,y,v,x,S,I,w,k,L,C,b,T,N,P){const A=(0,d.service)(d.SecurityContextService),M=(0,d.service)(d.RepositoryContextService);e.languageChanged=!1,e.propertiesObj={},e.propertiesObj.items=[],e.propertiesQueryObj={},e.propertiesQueryObj.query="",e.propertiesSearchPlaceholder=b.instant("visual.search.instance.placeholder"),e.propertiesNotFiltered=[],e.searchVisible=!1,e.nodeSelected=!1,e.queryResultsMode=!1,e.embedded=g.search().embedded,e.openedNodeInfoPanel=void 0,e.invalidLimit=!1,e.INVALID_LINKS_MSG=b.instant("sidepanel.invalid.limit.links.msg"),e.INVALID_LINKS_TOOLTIP=b.instant("sidepanel.invalid.limit.links.tooltip"),e.datasource=void 0,e.adapterContainer={adapter:{remain:!0}},e.hasInitedRepository=!1,e.defaultSettings={linksLimit:20,includeInferred:!0,sameAsState:!0,truncateNodeLabels:!0,languages:["en"],showLinksText:!0,preferredTypes:[],rejectedTypes:[],preferredPredicates:[],rejectedPredicates:["http://dbpedia.org/property/logo","http://dbpedia.org/property/hasPhotoCollection","http://dbpedia.org/property/website","http://dbpedia.org/property/homepage","http://dbpedia.org/ontology/thumbnail","http://xmlns.com/foaf/0.1/depiction","http://xmlns.com/foaf/0.1/homepage","http://xmlns.com/foaf/0.1/mbox","http://dbpedia.org/ontology/wikiPage*","http://dbpedia.org/property/wikiPage*","http://factforge.net/*"],preferredTypesOnly:!1,preferredPredicatesOnly:!1,includeSchema:!0},e.saveSettings=_.cloneDeep(e.defaultSettings),e.defaultGraphConfig={id:"default",name:"Easy graph",startMode:"search"},t.key="",e.onopen=e.onclose=()=>angular.noop(),e.goToHome=()=>{z();const{config:e,...t}=g.search();g.path("/graphs-visualizations").search(t)},e.shouldShowSettings=()=>e.configLoaded&&e.configLoaded.id===e.defaultGraphConfig.id,e.shouldDisableSameAs=()=>{const t=$("#sameAsCheck");return e.settings&&!e.settings.includeInferred&&t.prop("checked")&&(t.prop("checked",!1),e.settings.sameAsState=!1),e.settings&&!e.settings.includeInferred},e.propertiesFilterFunc=t=>t.key.toLowerCase().indexOf(e.propertiesQueryObj.query.toLowerCase())>=0,e.toggleMoreInfo=e=>{angular.element(e.currentTarget).parent().next().toggle(200),angular.element(e.currentTarget).children("span").toggleClass("ri-arrow-down-s-line").toggleClass("ri-arrow-up-s-line")},e.copyToClipboard=e=>{v.openCopyToClipboardModal(e)},e.resetSettings=()=>{e.settings=_.cloneDeep(e.defaultSettings),e.validateLinksLimit(),B()},e.changeLimit=t=>{let n=e.settings.linksLimit+t;n<1&&(n=1),n>1e3&&(n=1e3),e.settings.linksLimit=n},e.validateLinksLimit=()=>{e.invalidLimit=!s.nj.test(e.settings.linksLimit)},e.showSettings=()=>{e.showInfoPanel=!0,e.showFilter=!0,e.showNodeInfo=!1,e.showPredicates=!1,e.saveSettings?e.settings=_.cloneDeep(e.saveSettings):e.settings=_.cloneDeep(e.defaultSettings),B()},e.updateSettings=()=>{e.invalidLimit?p.error(e.INVALID_LINKS_TOOLTIP,e.INVALID_LINKS_MSG):(e.saveSettings=e.settings,e.saveSettings.languages=_.map(e.saveSettings.languagesMap,function(e){return e.text}),e.saveSettings.preferredTypes=_.map(e.saveSettings.preferredTypesMap,function(e){return e.text}),e.saveSettings.rejectedTypes=_.map(e.saveSettings.rejectedTypesMap,function(e){return e.text}),e.saveSettings.preferredPredicates=_.map(e.saveSettings.preferredPredicatesMap,function(e){return e.text}),e.saveSettings.rejectedPredicates=_.map(e.saveSettings.rejectedPredicatesMap,function(e){return e.text}),e.rootNodeIri?U(e.rootNodeIri):e.queryResultsMode&&g.search().query?q(g.search().query,g.search().sameAs,g.search().inference):"query"===e.configLoaded.startMode&&X(e.configLoaded),F(),e.showInfoPanel=!1,e.showFilter=!1,I.set(w.GRAPHS_VIZ,e.saveSettings))},e.getGraphConfigs=t=>{L.getGraphConfigs().success(function(n){e.graphConfigs=n,t&&t()}).error(function(e){p.error(getError(e),b.instant("graphexplore.error.graph.configs.short.msg"))})},e.findConfigById=function(t){return t===e.defaultGraphConfig.id?e.defaultGraphConfig:$.grep(e.graphConfigs,function(e){return e.id===t})[0]},e.easyGraphSearch=t=>{e.configLoaded=e.defaultGraphConfig,e.openUri(t)},e.deleteConfig=t=>{v.openSimpleModal({title:b.instant("common.confirm"),message:b.instant("graphexplore.delete.graph",{configName:t.name}),warning:!0}).result.then(function(){L.deleteGraphConfig(t).success(function(){e.getGraphConfigs(),e.refreshSavedGraphs()}).error(function(e){p.error(getError(e),b.instant("graphexplore.error.cannot.delete.config"))})})},e.goToGraphConfig=e=>{const t={config:e.id,[d.REPOSITORY_ID_PARAM]:M.getSelectedRepository().id};j(t,{config:e}),z(),X(e)},e.replaceIRIWithPrefix=t=>{const n=e.namespaces,r=_.findLast(n,function(e){return 0===t.indexOf(e.uri)});return r?r.prefix+":"+t.substring(r.uri.length):t};const R=[];R.push(t.$on("$translateChangeSuccess",function(){e.INVALID_LINKS_MSG=b.instant("sidepanel.invalid.limit.links.msg"),e.INVALID_LINKS_TOOLTIP=b.instant("sidepanel.invalid.limit.links.tooltip"),e.propertiesSearchPlaceholder=b.instant("visual.search.instance.placeholder")})),R.push(N.onAutocompleteEnabledUpdated(t=>{e.isAutocompleteEnabled=t})),R.push(M.onSelectedRepositoryChanged(t=>{t?P.getNamespaces(t.id).then(t=>{e.repositoryNamespaces=t,e.namespaces=t.namespaces}).catch(e=>{const t=getError(e);p.error(t,b.instant("error.getting.namespaces.for.repo"))}):e.repositoryNamespaces=new c.u})),R.push(e.$on("repositoryIsSet",function(t,n){const r=n||{newRepo:!1};r.newRepo&&(e.hasInitedRepository=!1),me(!!r.newRepo),r.newRepo&&(z(),$(".graph-visualization svg").empty(),g.search().query&&(e.goToHome(),W()))})),R.push(t.$watch(()=>t.key,()=>{te=0,_.each(e.propertiesObj.items,function(e){t.key>e&&te++}),ne++})),R.push(e.$watch("propertiesObj.items",()=>{angular.isDefined(e.propertiesObj.items)&&e.propertiesObj.items.length>0&&u(function(){e.adapterContainer.adapter.reload()},500)}));let O=!1,E=0;function G(e){O&&e.stopPropagation()}document.addEventListener("keydown",G,!0),e.$on("$destroy",()=>{R.forEach(e=>e()),document.removeEventListener("keydown",G,!0),window.onpopstate=null});const j=(t,n)=>{e.embedded&&(t.embedded=!0),g.search(t),n.skipOnPopState=!0,g.state(n)},z=()=>{e.searchVisible=!1,e.nodeSelected=!1,e.configLoaded=null,e.queryResultsMode=!1,e.lastSavedGraphName=null,e.lastSavedGraphId=null,e.shared=!1,e.numberOfPinnedNodes=0,re={},ie=0},D=()=>T.isActive()?e.defaultSettings:e.saveSettings,F=()=>{D().showLinksText?o.selectAll("svg .link-wrapper text").style("display","block"):o.selectAll("svg .link-wrapper text").style("display","none")},B=()=>{e.settings.languagesMap=_.map(e.settings.languages,function(e){return{text:e}}),e.settings.preferredTypesMap=_.map(e.settings.preferredTypes,function(e){return{text:e}}),e.settings.rejectedTypesMap=_.map(e.settings.rejectedTypes,function(e){return{text:e}}),e.settings.preferredPredicatesMap=_.map(e.settings.preferredPredicates,function(e){return{text:e}}),e.settings.rejectedPredicatesMap=_.map(e.settings.rejectedPredicates,function(e){return{text:e}})},U=()=>{e.rootNodeIri&&e.$broadcast("onRootNodeChange",e.rootNodeIri)},W=()=>{g.search().query?(e.searchVisible=!1,e.queryResultsMode=!0,q(g.search().query,g.search().sameAs,g.search().inference)):e.$on("onRootNodeChange",function(t,n){e.loading=!0;const r=D();angular.isDefined(n)&&(e.rootNodeIri=n,C.getInstanceNode({iri:n,config:e.configLoaded?e.configLoaded.id:e.defaultGraphConfig.id,languages:e.shouldShowSettings()?r.languages:[],includeInferred:r.includeInferred,sameAsState:r.sameAsState}).then(function(t){e.nodeSelected=!0,e.searchVisible=!1,null===t.data.types&&(t.data.types="greyColor"),ge=new he;const n=ge.addNode(t.data,de/2,pe/2);le=ce,Ee(n,!0)}).catch(function(t){e.loading=!1,p.error(getError(t),b.instant("graphexplore.error.could.not.load.graph"))}))}),g.search().uri&&e.openUri(g.search().uri,!0),g.search().saved&&k.getSavedGraph(g.search().saved).success(function(t){e.loadSavedGraph(t)}).error(function(e){const t=getError(e);p.error(t,b.instant("graphexplore.error.could.not.open"))})},q=(t,n,r)=>{const i=D(),o=void 0===n?i.sameAsState:!0===n,s=void 0===r?i.includeInferred:!0===r;e.loading=!0,C.updateGraph({query:t,linksLimit:i.linksLimit,languages:e.shouldShowSettings()?i.languages:[],includeInferred:s,sameAsState:o}).then(function(e){Re(e)},function(t){e.loading=!1,p.error(getError(t.data),b.instant("graphexplore.error.cannot.load.graph"))})},K=(e,t)=>{const n=e.split(" ");return t?[n[0],n[1],n[2]].join(">"):[n[0],n[2]].join(">")},V=e=>[e.source.iri,e.target.iri].join(">"),H=e=>{if(e.isTriple){const t=document.getElementById((0,a.hK)(K(e.iri)));if(t&&void 0!==t.__data__.x)return t.__data__.x}return e.x},Z=e=>{if(e.isTriple){const t=document.getElementById((0,a.hK)(K(e.iri)));if(t&&void 0!==t.__data__.y)return t.__data__.y}return e.y},Q=e=>{const t=e.trim().split(" ");return`<<<${t[0]}> <${t[1]}> <${t[2]}>>>`},J=e=>{const t=e.source.isTriple?K(e.source.iri,!0):e.source.iri,n=e.target.isTriple?K(e.target.iri,!0):e.target.iri;return(0,a.hK)(`${t}>${n}>marker`)},Y=(e,t)=>{const n=t.map(t=>t[e]);return t.filter((t,r)=>n.indexOf(t[e])===r)},X=t=>{e.configLoaded=t,"search"===t.startMode?e.searchVisible=!0:"node"===t.startMode&&t.startIRI?u(function(){e.openUri(t.startIRI,!0)},0):"query"===t.startMode&&t.startGraphQuery&&(e.loading=!0,L.loadGraphForConfig(t,t.startQueryIncludeInferred,D().linksLimit,t.startQuerySameAs).then(function(e){Re(e)},function(t){e.loading=!1,p.error(getError(t),b.instant("graphexplore.error.graph.load"))}))},ee=function(){var t,n;g.search().config?(t=g.search().config,n=W,t===e.defaultGraphConfig.id?X(e.defaultGraphConfig):L.getConfig(t).then(e=>{X(e),n()}).catch(e=>{p.error(getError(e),b.instant("graphexplore.error.could.not.load.config",{configId:t}))})):g.search().query||g.search().uri?(X(e.defaultGraphConfig),W()):W()};S.onpopstate=function(t){t.state&&t.state.skipOnPopState||(z(),t.state&&(t.state.config?(X(t.state.config),t.state.uri&&e.openUri(t.state.uri,!0)):t.state.savedGraph&&e.loadSavedGraph(t.state.savedGraph,!0)))},e.embedded&&(g.search().query||g.search().uri||g.search().config||g.search().saved)&&(e.noGoHome=!0);let te=0,ne=0,re={},ie=0;const oe=16,se=o.zoom().scaleExtent([.1,10]);let ae;const ce=o.zoomIdentity.translate(0,-70).scale(1);se.on("zoom",function(e){T.isActive()||(le=e.transform,ae.attr("transform",le))});let le=ce;const de=1e3,pe=1e3;let ue,fe;function he(){this.nodes=[],this.links=[],this.tripleNodes=new Map,this.tripleLinksCopy=new Map,this.addNode=function(e,t,n){return e.x=t,e.y=n,this.nodes.push(e),e},this.computeConnectedness=function(){const e={},t={};_.each(this.links,function(n){const r=n.source.iri,i=n.target.iri,o=_.min([r,i])+"|"+_.max([r,i]);t[o]||(t[o]=1,e[r]=(e[r]||0)+1,e[i]=(e[i]||0)+1)}),_.each(this.links,function(t){e[t.source.iri]>1&&e[t.target.iri]>1?t.connectedness=Math.min(5,Math.max(e[t.source.iri],e[t.target.iri])-1):t.connectedness=0})},this.addAndMatchLinks=function(e){const t=this.nodes;Array.prototype.push.apply(this.links,function(e,t){return _.map(e,function(e){let n,r;n=e.isTripleSource?Fe(e.source):_.find(t,function(t){return t.iri===e.source}),r=e.isTripleTarget?Fe(e.target):_.find(t,function(t){return t.iri===e.target});const i={source:n,target:r,predicates:e.predicates};if(e.isTripleSource||e.isTripleTarget){const e=`${i.source.isTriple?K(i.source.iri):i.source.iri}>${i.target.isTriple?K(i.target.iri):i.target.iri}`;if(ge.tripleLinksCopy.has(e)){const t=ge.tripleLinksCopy.get(e);return t[0].predicates.push(...i.predicates),t.push(i),ge.tripleLinksCopy.set(e,t),null}ge.tripleLinksCopy.set(e,[i])}return i})}(e,t));for(const e of ge.tripleLinksCopy.keys())1===ge.tripleLinksCopy.get(e).length&&ge.tripleLinksCopy.delete(e);this.links=this.links.filter(e=>null!==e),this.computeConnectedness()};const t=function(e,t){return n(e,t).length};function n(e,t){return _.filter(t,function(t){return t.source.iri===e.iri||t.target.iri===e.iri})}this.countLinks=t,this.linksTypes=function(e,t){const r=n(e,t),i=_.map(r,function(t){return t.source.iri===e.iri?t.target.types:t.source.types});return _.uniq(_.flatten(i))},this.linksPredicates=function(e,t){const r=n(e,t),i=_.map(r,function(e){return e.predicates});return _.uniq(_.flatten(i))},this.removeTriples=function(e){const t=[];this.tripleNodes.size>0&&e.forEach(e=>{this.tripleNodes.has(e)&&(this.tripleNodes.delete(e),this.links=_.reject(this.links,function(n){const r=e.split(">"),i=K(n.source.iri),o=K(n.target.iri);if(i===e&&ge.tripleNodes.delete(o)){const e=o.split(">");t.push({source:e[0],target:e[1]})}const s=i===e||o===e||n.source.iri===r[0]&&n.target.iri===r[1];return s&&(ge.tripleLinksCopy.delete(`${i}>${o}`),ge.tripleLinksCopy.delete(`${o}>${i}`)),s}))}),t.forEach(e=>{this.links=_.reject(this.links,function(t){return t.source.iri===e.source&&t.target.iri===e.target})})},this.removeNode=function(n){const r=[];this.links=_.reject(this.links,function(e){const t=e.source.iri===n.iri||e.target.iri===n.iri;return t&&(e.target.isTriple&&r.push(K(e.target.iri)),e.source.isTriple||e.target.isTriple||r.push([e.source.iri,e.target.iri].join(">"))),t}),this.removeTriples(r);const i=this.links;this.nodes=_.reject(this.nodes,function(e){return 0===t(e,i)}),0===this.nodes.length&&(e.nodeSelected=!1),this.computeConnectedness()},this.removeNodeLeafLinks=function(e){const r=[];let i=this.links;this.links=_.reject(this.links,function(o){let s=o.source.iri===e.iri&&1===t(o.target,i)&&!o.target.isTriple||o.target.iri===e.iri&&1===t(o.source,i)&&!o.source.isTriple;if(!s){let r;if(o.source.iri!==e.iri||2!==t(o.target,i)||o.target.isTriple?o.target.iri!==e.iri||2!==t(o.source,i)||o.source.isTriple||(r=n(o.source,i)):r=n(o.target,i),!r)return!1;s=(r[0].source.iri===e.iri||r[0].target.iri)&&(r[1].source.iri===e.iri||r[1].target.iri)}return s&&(o.target.isTriple&&r.push(K(o.target.iri)),o.source.isTriple||o.target.isTriple||r.push([o.source.iri,o.target.iri].join(">"))),s}),this.removeTriples(r),i=this.links,this.nodes=_.reject(this.nodes,function(n){return 0===t(n,i)&&n.iri!==e.iri}),this.computeConnectedness()},this.addTriple=function(e,t,n){e.x=t,e.y=n,e.weight=0;const r=K(e.iri);if(this.tripleNodes.has(r)){const t=this.tripleNodes.get(r);t.push(e),this.tripleNodes.set(r,t)}else e.weight=10,this.tripleNodes.set(r,[e])},this.copyState=function(){const e=_.map(this.nodes,function(e){return{iri:e.iri,isTriple:e.isTriple,size:e.size,labels:_.cloneDeep(e.labels),types:_.cloneDeep(e.types),rdfRank:e.rdfRank,x:e.x,y:e.y,fixed:e.fixed}}),t=JSON.stringify(Array.from(this.tripleNodes.entries())),n=JSON.stringify(Array.from(this.tripleLinksCopy.entries()));return{nodes:e,links:_.map(this.links,function(e){return{source:e.source.iri,isTripleSource:e.source.isTriple,target:e.target.iri,isTripleTarget:e.target.isTriple,predicates:e.predicates}}),tripleNodes:t,tripleLinksCopy:n,colorIndex:ie,type2color:re,transform:le}},this.restoreState=function(t){e.nodeSelected=!0,e.searchVisible=!1,this.nodes=_.cloneDeep(t.nodes),this.tripleNodes=t.tripleNodes?new Map(JSON.parse(t.tripleNodes)):new Map,this.links=[],this.addAndMatchLinks(t.links),this.tripleLinksCopy=t.tripleLinksCopy?new Map(JSON.parse(t.tripleLinksCopy)):new Map,_.each(this.nodes,function(t){t.fixed&&e.numberOfPinnedNodes++}),angular.isDefined(t.colorIndex)&&angular.isDefined(t.type2color)&&(ie=t.colorIndex,re=_.cloneDeep(t.type2color)),angular.isDefined(t.transform)&&(le=o.zoomIdentity.translate(t.transform.x,t.transform.y).scale(t.transform.k)),Te()}}e.datasource={get:function(t,n,r){return y.initLazyList(t,n,r,te,e.propertiesObj.items)},revision:function(){return ne}},e.showInfoPanel=!1;let ge=new he;function me(t){!n.getActiveRepository()||e.hasInitedRepository&&!t||(e.hasInitedRepository=!0,t||e.getGraphConfigs(ee))}e.addedTag=function(t){return t.text.indexOf(":")<0?(p.warning(b.instant("graphexplore.absolute.prefixed.iri")),null):(t.text=function(e,t){if(!/^<?(http|urn).*>?/.test(e)){const n=e.split(":"),r=n[0],i=n[1];if(!angular.isUndefined(i)){const e=f.getNamespaceUriForPrefix(t,r);if(e)return e+i}}return e}(t.text,e.namespaces),e.pageslideExpanded=!0,t)},e.validateTag=function(e,t,n){if(e.text.indexOf(":")<0)return n?p.warning(b.instant("graphexplore.absolute.prefixed.iri.option"),t):p.warning(b.instant("graphexplore.absolute.prefixed.iri"),t),!1;const r=e.text.indexOf("*");if(r>=0){if(!n)return p.warning(b.instant("graphexplore.wildcards.not.allowed"),t),!1;if(r<e.text.length-1)return p.warning(b.instant("graphexplore.wildcards.last.char"),t),!1}return!0},e.getTagClass=function(e){return e.endsWith("*")?"tag-item-wildcard":null},e.getActiveRepository=function(){return n.getActiveRepository()},e.isLicenseValid=function(){return(0,d.service)(d.LicenseContextService).getLicenseSnapshot().valid};const ye=500,ve=1.75,xe=o.scaleLinear().domain([0,9]).range(["hsl(0, 100%, 75%)","hsl(360, 90%, 82%)"]).interpolate(o.interpolateHslLong),Se=o.scaleLinear().domain([0,9]).range(["hsl(180, 50%, 75%)","hsl(540, 40%, 82%)"]).interpolate(o.interpolateHslLong);e.getColor=function(e){angular.isUndefined(re[e])&&(re[e]=ie,ie++);const t=re[e];return t>39?"#c2c2c2":t%2==0?xe(t/2):Se(t/2)};const Ie=o.forceX(de/2).strength(.005),we=o.forceY(pe/2).strength(.005),ke=o.forceSimulation().force("x",Ie).force("y",we),Le=o.select(".main-container .graph-visualization").append("svg").attr("viewBox","0 0 "+de+" "+pe).attr("preserveAspectRatio","xMidYMid meet");let Ce=0,be=0;const _e=new function(){this.state=!1,this.setLoadingState=function(e){this.state=e},this.getLoadingState=function(){return this.state},this.init=function(e,t){o.select(t).append("circle").attr("cx",function(){return e.x}).attr("cy",function(){return e.y}).attr("class","loader-container").attr("r",function(){return e.size}).style("fill","fff").style("opacity","0.7"),o.select(t).append("image").attr("xlink:href","js/angular/templates/loader/ot-loader.svg?v=3.3.2-RC3").attr("x",function(){return e.x-e.size+5}).attr("y",function(){return e.y-e.size}).attr("width",function(){return 2*e.size}).attr("height",function(){return 2*e.size}).attr("class","node-loader")}};function Te(t){o.selectAll("svg g").remove(),o.selectAll(".d3-tip").remove(),o.selectAll(".menu-events").remove(),ae=Le.append("g").attr("class","nodes-container").attr("transform",function(){return angular.isDefined(le)&&!t?le:""});const n=(0,i.A)().attr("class","d3-tip").customPosition(function(){const e=ue.getBoundingClientRect();return{top:e.bottom+10+"px",left:e.left-30+"px"}}).html(function(t){let n="";return t.fixed&&(n+='<i class="ri-pushpin-line"></i> '),t.types.length>0?n+=t.types.map(t=>`<div> · ${e.replaceIRIWithPrefix(t)}</div>`).join(""):n+=`<i>${b.instant("visual.node.tooltip.no_types")}</i>`,n}),s=function(e){let t="";return t+=_.join(_.map(e.predicates,function(t,n){if(0===n)return Ue(t);if(n<10)return" · "+Ue(t);if(10===n){const t=function(e){return e.predicates.length-10}(e),n=t>1?t+" predicates":t+" predicate";return" · "+b.instant("graphexplore.tip.text",{textToShow:n})}}),""),t};let c,d;const f=(0,i.A)().attr("class","d3-tip").customPosition(function(e){const t=c.getBoundingClientRect(),n=function(e){const t=s(e),n=document.createElement("canvas").getContext("2d");return n.font="13px Arial",e.predicates.length<10?n.measureText(t).width:n.measureText(t).width/2}(e);return{top:t.top-30+"px",left:t.left-30+"px",width:n+"px"}}).html(function(e){return s(e)});let h;const g=function(){u.cancel(h),u.cancel(Ce),ue=null,n.hide(),be=u(function(){Ge()},500)};Le.call(n),Le.call(f);let m=Le.selectAll(".link"),y=Le.selectAll(".node");const v=o.forceCollide(e=>e.size+5).strength(.5),x=o.forceManyBody().strength(-300),S=o.forceCenter(de/2,pe/2);ke.nodes(ge.nodes).force("charge",x).force("collide",v).force("center",S).force("link",o.forceLink(ge.links).distance(function(e){return e.source.isTriple||e.target.isTriple?0:function(e){const t=$("<span></span>"),n=e.predicates[0].split("/"),r=n[n.length-1];t.addClass("predicate-text").text(r),$("body").append(t);const i=t.width()+2*e.source.size+2*e.target.size+50;return t.remove(),.75*i}(e)+30*e.connectedness})),ae.append("defs").selectAll("marker").data(ge.links).enter().append("marker").attr("class","arrow-marker").attr("id",function(e){return J(e)}).attr("viewBox","0 -5 10 10").attr("refX",function(e){return e.target.isTriple?11:e.target.size+11}).attr("refY",0).attr("markerWidth",10).attr("markerHeight",10).attr("orient","auto").append("path").attr("d","M0,-5L10,0L0,5 L10,0 L0, -5"),m=ae.selectAll(".link").data(ge.links).enter().append("g").attr("class","link-wrapper").attr("id",function(e){return(0,a.hK)(V(e))}).append("line").attr("class","link").style("stroke-width",1).style("fill","transparent").style("marker-end",function(e){return`url(#${J(e)})`});const I=ae.selectAll(".link-wrapper").append("text").text(function(e){return Be(e)}).attr("class",function(e){return e.predicates.length>1||ge.tripleNodes.has(V(e))?"predicates":"predicate"}).attr("dy","-0.5em").style("text-anchor","middle").style("display",D().showLinksText?"":"none").on("mouseover",function(e,t){e.stopPropagation(),function(e,t){u.cancel(d);const n=c=e.target;u(function(){c===n&&t.predicates.length>1&&f.show(t,c)},300)}(e,t)}).on("mouseout",function(){u.cancel(d),c=null,f.hide()}).on("click",function(t,n){t.stopPropagation(),function(t,n){$e();const r=V(n);if(1===n.predicates.length&&ge.tripleNodes.has(r)){fe=null;const e=ge.tripleNodes.get(r)[0];if(Ae(e,t.currentTarget,t.button)){const t={};t.iri=e.iri,t.pred=Ue(e.iri.split(" ")[1]),ze(t)}return}!function(t){if(e.showNodeInfo=!1,e.showPredicates=t.predicates.length>1,e.showFilter=!1,e.showInfoPanel=!1,fe===t)return e.showNodeInfo=!1,e.showInfoPanel=!1,void(fe=null);fe=t,e.showPredicates&&(e.predicates=_.map(t.predicates,function(e){const n=function(e,t){const n=V(t);return ge.tripleNodes.has(n)?ge.tripleNodes.get(n).findIndex(t=>t.iri.indexOf(e)>=0):-1}(e,t),r=n>-1;return{value:Ue(e),partOfTriple:r,linkId:r?V(t):"",nodeIndex:n}}),e.showInfoPanel=!0)}(n)}(t,n)});let w,k=0,L=null,C=null;const N=function(t,n,r){const i=Array.isArray(r)?r[n]:r;ge.countLinks(t,ge.links)<=D().linksLimit?Ee(t,!1,i):p.info(b.instant("graphexplore.increase.limit"),b.instant("graphexplore.node.at.max")),e.closeInfoPanel()};function P(e,t){let n,r,i,o,s=!0;if("down"===t)n=2*e.size,r=e.size/3,i=.8,o=.3;else if("down-fixed"===t)n=2*e.size,r=e.size,i=.8,o=.66;else if("up"===t)n=e.size/3,r=2*e.size,i=.3,o=.8;else{if("fixed"!==t)return;n=e.size,i=.66,s=!1}let a=ae.selectAll(".node-wrapper").filter(function(t){return t===e}).append("text").text("").classed("icon-any pinned",!0).style("font-size",n+"px").attr("x",function(e){return e.x}).attr("y",function(e){return e.y}).attr("opacity",i);"fixed"!==t&&"down-fixed"!==t||(e.pin=a),s&&(a=a.transition().duration(1e3).style("font-size",function(){return r+"px"}).attr("opacity",o),"down-fixed"!==t&&a.remove())}const A=o.drag().subject(function(e){return e}).on("start",function(e,t){T.isActive()||0===e.sourceEvent.button&&(t.fixedBeforeDrag=t.fixed,t.isBeingDragged=!0,t.beginDragging=!0,Ge(),o.select(e.currentTarget).classed("dragging",!0),ke.alphaTarget(.3).restart())}).on("drag",function(t,n){n.isBeingDragged&&(n.fx=t.x,n.fy=t.y,n.fixed?n.beginDragging&&P(n,"fixed"):(e.numberOfPinnedNodes++,n.fixed=!0,P(n,"down-fixed")),n.pinWasFixed=!0,n.beginDragging=null)}).on("end",function(e,t){t.isBeingDragged&&(t.pinWasFixed&&(t.pinWasFixed=null,o.select(".pinned").remove()),t.isBeingDragged=!1,o.select(e.currentTarget).classed("dragging",!1)),ke.alphaTarget(0)});y=ae.selectAll(".node").data(ge.nodes).enter().append("g").attr("class","node-wrapper").attr("id",function(e){return e.iri}).append("circle").attr("class","node").attr("r",function(e){return e.size}).style("fill",function(t){return"greyColor"===t.types?"c2c2c2":e.getColor(t.types[0])}).on("mouseover",function(t,r){if(!r.isBeingDragged){u.cancel(be);const i=t.currentTarget;Ce=u(()=>{(function(t,n){return!e.showInfoPanel&&((Pe.closeIcon||Pe.expandIcon||Pe.focusIcon||Pe.copyURIIcon)&&Pe.removeIcons(),ke.alpha()<.1&&(Pe.initIcons(t,n.parentNode),ke.stop(),Ne(),!0))})(r,i)&&function(e,t){u.cancel(h);const r=ue=t.target;u(function(){ue===r&&n.show(e,ue)},300)}(r,t)},400)}}).on("mouseout",g).on("click",function(t,n){if(t.button&&0!==t.button)return;const r=t.currentTarget;if(L&&C===r)return u.cancel(L),L=null,void N(n,0,r.parentNode);C=r,g(),e.showPredicates=!1,T.isActive()||(u.cancel(L),L=u(function(){Ae(n,0,t),L=null},40+ye))}).on("touchstart",(e,t)=>function(e){k=0,w=u(function(){k<5&&Me(e),w=null},1e3)}(t)).on("touchmove",function(){k++}).on("touchend",function(){u.cancel(w),w=null}).on("contextmenu",function(t,r){t.shiftKey||(t.preventDefault(),Ge(),e.closeInfoPanel(),r.fixed?(e.numberOfPinnedNodes--,r.fixed=!1,r.fx=null,r.fy=null,P(r,"up"),ke.alpha(1).restart()):(e.numberOfPinnedNodes++,r.fixed=!0,P(r,"down")),function(e){ue&&n.show(e,ue)}(r))}).on("gdb-expand-node",(e,t)=>N(t,0,e.srcElement.parentNode)).on("gdb-show-node-info",(e,t)=>je(t)).call(A);const M=e.saveSettings.truncateNodeLabels?"hidden":"visible",R=ae.selectAll(".node-wrapper").append("foreignObject").style("pointer-events","none").style("overflow",M).attr("width",function(e){return 2*e.size*ve});ae.insert("g").attr("class","menu-events"),(t=>{t.each(function(e){e.fontSize=r.A.Text.calcFontSizeRaw(e.labels[0].label,e.size,oe,!0)}).attr("height",function(e){return 4.2*e.fontSize}).append("xhtml:div").attr("class","node-label-body").classed("truncated-label",e.saveSettings.truncateNodeLabels).style("font-size",function(e){return e.fontSize+"px"}).append("xhtml:div").html(function(e){return l.U.getText(e.labels[0].label).replaceAll("\n","<br>")})})(R),ke.on("tick",function(){m.attr("x1",function(e){return H(e.source)}).attr("y1",function(e){return Z(e.source)}).attr("x2",function(e){return H(e.target)}).attr("y2",function(e){return Z(e.target)}),I.attr("x",function(e){const t=H(e.source),n=H(e.target);return e.x=.5*(t+n)}).attr("y",function(e){const t=Z(e.source),n=Z(e.target);return e.y=.5*(t+n)}).attr("transform",function(e){return"rotate("+function(e,t){const n=H(e.source),r=Z(e.source),i=H(e.target),o=Z(e.target);if(t)return 180*Math.atan2(o-r,i-n)/Math.PI;{const e=180*Math.atan2(o-r,i-n)/Math.PI;return e<=90&&e>=-90?e:(e>0?-1:1)*(180-Math.abs(e))}}(e,e.direction)+", "+e.x+", "+e.y+")"}),y.attr("cx",function(e){return e.x}).attr("cy",function(e){return e.y}),ae.select(".node-loader").attr("x",function(e){return e.x-e.size+3}).attr("y",function(e){return e.y-e.size}),ae.select(".loader-container").attr("cx",function(e){return e.x}).attr("cy",function(e){return e.y}),R.attr("x",function(e){return e.x-e.size*ve}).attr("y",function(e){return e.y-4.2*e.fontSize/2}),o.select(".pinned").attr("x",function(e){return e.x}).attr("y",function(e){return e.y}),Ne()}),angular.isDefined(_e)&&_e.setLoadingState(!1),e.loading&&(e.loading=!1),o.selectAll(".link-wrapper").each(function(){const e=$(this).attr("id").split(">")[0],t=$(this).attr("id").split(">")[1];o.selectAll(".link").each(function(n){const r=(0,a.hK)(n.source.iri),i=(0,a.hK)(n.target.iri);if(r===t&&i===e){let e=r;e+=">",e+=i;const t=document.createTextNode(" ⟶");document.getElementById(e).lastChild.appendChild(t),n.direction="double"}})}),o.selectAll(".d3-actions-tip").remove(),ke.alpha(.3).restart()}function Ne(){t.d3alpha=ke.alpha()}const Pe=new function(){function n(e,t){return"translate("+(t.x-14+(t.size+15)*Math.cos(e*Math.PI/180-Math.PI/2))+","+(t.y-14+(t.size+15)*Math.sin(e*Math.PI/180-Math.PI/2))+")"}this.closeIcon=void 0,this.expandIcon=void 0,this.collapseIcon=void 0,this.focusIcon=void 0,this.copyURIIcon=void 0,this.actionsTip=void 0,this.removeIcons=function(){this.closeIcon.remove("g"),this.expandIcon&&this.expandIcon.remove("g"),this.collapseIcon&&this.collapseIcon.remove("g"),this.focusIcon.remove("g"),this.copyURIIcon.remove("g"),this.closeIcon=void 0,this.expandIcon=void 0,this.collapseIcon=void 0,this.focusIcon=void 0,this.copyURIIcon=void 0,this.expandedState=!1},this.expandedState=!1,this.initIcons=function(r,s){const a=(0,i.A)().attr("class","d3-tip d3-actions-tip").customPosition(function(e,t){const n=t.target.getBoundingClientRect();return{top:n.top-20+"px",left:n.right+10+"px"}}).html(function(e){return e});Le.call(a),r.isExpanded?(this.collapseIcon=o.select(".menu-events").append("g").attr("class","collapse-icon").attr("name","collapse").attr("transform",function(){return n(20,r)}),this.collapseIcon.append("circle").attr("cx",14).attr("cy",14).attr("r",13).style("fill","#eee"),this.collapseIcon.append("path").attr("d","M22.67,12a.59.59,0,0,1-.53.65l-6.88.72H15.2a.59.59,0,0,1-.59-.65l.72-6.88A.58.58,0,0,1,16,5.33a.59.59,0,0,1,.53.65L16,11.11,21.3,5.79a.64.64,0,0,1,.91.91L16.89,12,22,11.49A.59.59,0,0,1,22.67,12ZM12.59,14.75l-6.75.85a.59.59,0,0,0-.51.66.58.58,0,0,0,.66.51l4.95-.62-5.2,5.2a.64.64,0,1,0,.91.91l5.2-5.2L11.23,22a.59.59,0,0,0,.51.66h.07a.59.59,0,0,0,.59-.52l.85-6.75a.59.59,0,0,0-.17-.49A.58.58,0,0,0,12.59,14.75Z").style("fill","var(--gw-primary-base)"),this.collapseIcon.on("click",function(){var e;(e=r).isExpanded=!1,ge.removeNodeLeafLinks(e),Te()}).on("mouseover",function(e){a.show(e.currentTarget.getAttribute("name"),e),u.cancel(Ce),u.cancel(be)}).on("mouseout",function(){a.hide(),be=u(function(){Ge()},500)})):(this.expandIcon=o.select(".menu-events").append("g").attr("class","expand-icon").attr("name","expand").attr("transform",function(){return n(20,r)}),this.expandIcon.append("circle").attr("cx",14).attr("cy",14).attr("r",13).style("fill","#eee"),this.expandIcon.append("path").attr("d","M22.37,6.28l-.72,6.88a.59.59,0,0,1-.59.53H21a.59.59,0,0,1-.53-.65L21,7.9l-5.32,5.32a.64.64,0,0,1-.91-.91L20.1,7,15,7.53a.59.59,0,0,1-.12-1.18l6.88-.72a.59.59,0,0,1,.65.65ZM12.89,20.34,7.95,21l5.2-5.2a.64.64,0,0,0-.91-.91L7,20.05l.62-4.95A.59.59,0,0,0,6.48,15l-.85,6.75a.59.59,0,0,0,.59.67h.07L13,21.52a.59.59,0,1,0-.15-1.18Z").style("fill","var(--gw-primary-base)"),this.expandIcon.on("click",function(){Ee(r,!1,s)}).on("mouseover",function(e){a.show(e.currentTarget.getAttribute("name"),e),u.cancel(be),u.cancel(Ce)}).on("mouseout",function(){a.hide(),be=u(function(){Ge()},500)})),this.focusIcon=o.select(".menu-events").append("g").attr("class","focus-icon").attr("name","focus").attr("transform",function(){return n(20,r)}),this.focusIcon.append("circle").attr("cx",14).attr("cy",14).attr("r",13).style("fill","#eee"),this.focusIcon.append("path").attr("d","M14.2,23.81a9.8,9.8,0,1,1,6.93-2.87h0A9.74,9.74,0,0,1,14.2,23.81Zm0-18.17a8.37,8.37,0,1,0,5.92,14.29h0A8.37,8.37,0,0,0,14.2,5.64Zm1.42,6.95a2,2,0,1,0,0,2.85A2,2,0,0,0,15.62,12.59Z").style("fill","var(--gw-primary-base)"),this.focusIcon.on("click",function(){t.$broadcast("onRootNodeChange",r.iri)}).on("mouseover",function(e){a.show(e.currentTarget.getAttribute("name"),e),u.cancel(be),u.cancel(Ce)}).on("mouseout",function(){a.hide(),be=u(function(){Ge()},500)}),this.copyURIIcon=o.select(".menu-events").append("g").attr("class","ri-links-line").attr("name","link").attr("transform",function(){return n(20,r)}),this.copyURIIcon.append("circle").attr("cx",14).attr("cy",14).attr("r",13).style("fill","#eee"),this.copyURIIcon.append("path").attr("d","M 13.457031 10.164062 C 13.648438 10.164062 13.820312 10.242188 13.941406 10.363281 L 15.492188 11.859375 C 15.984375 12.332031 16.292969 12.992188 16.292969 13.714844 C 16.292969 14.441406 15.984375 15.097656 15.492188 15.574219 L 10.394531 20.496094 C 9.902344 20.972656 9.222656 21.265625 8.472656 21.265625 C 7.71875 21.265625 7.039062 20.972656 6.546875 20.496094 L 4.996094 19 C 4.507812 18.523438 4.203125 17.867188 4.203125 17.144531 C 4.203125 16.421875 4.507812 15.765625 4.996094 15.289062 L 7.542969 12.824219 C 7.667969 12.707031 7.84375 12.628906 8.035156 12.628906 C 8.417969 12.628906 8.726562 12.929688 8.726562 13.300781 C 8.726562 13.484375 8.648438 13.652344 8.523438 13.773438 L 5.976562 16.234375 C 5.738281 16.46875 5.589844 16.792969 5.589844 17.148438 C 5.589844 17.503906 5.738281 17.824219 5.976562 18.058594 L 7.527344 19.566406 C 7.773438 19.792969 8.105469 19.929688 8.472656 19.929688 C 8.835938 19.929688 9.167969 19.792969 9.414062 19.566406 L 14.511719 14.644531 C 14.753906 14.410156 14.90625 14.089844 14.90625 13.730469 C 14.90625 13.375 14.753906 13.054688 14.511719 12.820312 L 12.964844 11.324219 C 12.839844 11.203125 12.761719 11.039062 12.761719 10.855469 C 12.761719 10.488281 13.070312 10.1875 13.449219 10.1875 Z M 17.082031 3.976562 C 17.082031 3.976562 17.085938 3.976562 17.085938 3.976562 C 17.824219 3.976562 18.492188 4.261719 18.980469 4.722656 L 20.535156 6.203125 C 21.042969 6.679688 21.355469 7.34375 21.355469 8.082031 C 21.355469 8.792969 21.058594 9.441406 20.582031 9.914062 L 18.0625 12.402344 C 17.9375 12.527344 17.761719 12.605469 17.566406 12.605469 C 17.183594 12.605469 16.875 12.304688 16.875 11.9375 C 16.875 11.753906 16.949219 11.589844 17.070312 11.46875 L 19.605469 8.984375 C 19.847656 8.75 19.996094 8.429688 19.996094 8.070312 C 19.996094 7.714844 19.847656 7.394531 19.605469 7.160156 L 18.019531 5.667969 C 17.773438 5.445312 17.4375 5.304688 17.070312 5.300781 C 16.703125 5.304688 16.367188 5.453125 16.128906 5.691406 L 11.085938 10.667969 C 10.84375 10.898438 10.695312 11.222656 10.695312 11.578125 C 10.695312 11.933594 10.84375 12.257812 11.085938 12.488281 L 12.675781 13.980469 C 12.804688 14.101562 12.882812 14.273438 12.882812 14.457031 C 12.882812 14.828125 12.574219 15.128906 12.191406 15.128906 C 12.003906 15.128906 11.832031 15.054688 11.707031 14.9375 L 10.140625 13.457031 C 9.636719 12.980469 9.324219 12.316406 9.324219 11.582031 C 9.324219 10.863281 9.621094 10.214844 10.101562 9.742188 L 15.140625 4.765625 C 15.625 4.285156 16.304688 3.980469 17.054688 3.976562 Z M 17.082031 3.976562").style("fill","var(--gw-primary-base)"),this.copyURIIcon.on("click",function(){e.copyToClipboard(r.iri),Ge(),a.hide()}).on("mouseover",function(e){a.show("<div style='text-align: center;'><b>Copy to ClipBoard</b><br>"+r.iri+"</div>",e),u.cancel(be),u.cancel(Ce)}).on("mouseout",function(){a.hide(),be=u(function(){Ge()},500)}),this.closeIcon=o.select(".menu-events").append("g").attr("class","close-icon").attr("name","remove").attr("transform",function(){return n(20,r)}),this.closeIcon.append("circle").attr("cx",14).attr("cy",14).attr("r",13).style("fill","#eee"),this.closeIcon.append("path").attr("d","M14.94,14l5.87-5.87a.66.66,0,1,0-.94-.94L14,13.06,8.13,7.19a.66.66,0,0,0-.94.94L13.06,14,7.19,19.87a.66.66,0,1,0,.94.94L14,14.94l5.87,5.87a.66.66,0,1,0,.94-.94Z").style("fill","var(--gw-primary-base)"),this.closeIcon.on("click",function(){Me(r)}).on("mouseover",function(e){a.show(e.currentTarget.getAttribute("name"),e),u.cancel(be),u.cancel(Ce)}).on("mouseout",function(){a.hide(),be=u(function(){Ge()},500)}),this.animateMenu(r)},this.animateMenu=function(e){const t=100,r=o.easeSin;let i=0,s=20;this.expandIcon&&this.expandIcon.transition().duration(t).style("opacity",1).ease(r).attr("transform",function(){return n(s,e)}).delay(i+=35),this.collapseIcon&&this.collapseIcon.transition().duration(t).style("opacity",1).ease(r).attr("transform",function(){return n(s,e)}).delay(i+=35),this.copyURIIcon.transition().duration(t).style("opacity",1).ease(r).attr("transform",function(){return s+=30,n(s,e)}).delay(i+=35),this.focusIcon.transition().duration(t).style("opacity",1).ease(r).attr("transform",function(){return s+=30,n(s,e)}).delay(i+=35),this.closeIcon.transition().duration(t).style("opacity",1).ease(r).attr("transform",function(){return s+=30,n(s,e)}).delay(i+=35),this.expandedState=!0}};function Ae(n,r,i){return e.showInfoPanel=!1,e.showPredicates=!1,e.showNodeInfo=!1,i.shiftKey&&(i.ctrlKey||i.metaKey)?(t.$broadcast("onRootNodeChange",n.iri),!1):i.ctrlKey||i.metaKey?(Me(n),!1):void 0!==e.openedNodeInfoPanel&&e.openedNodeInfoPanel===n?(e.pageslideExpanded=!1,e.openedNodeInfoPanel=void 0,!1):(je(n),!0)}function Me(e){ge.removeNode(e),Te()}function Re(t){!function(t){e.nodeSelected=!0,null===t.data.types&&(t.data.types="greyColor"),ge=new he,le=ce}(t),Oe(t)}function Oe(t,n,r){let i=t.data;i=_.filter(i,function(e){return-1===_.findIndex(ge.links,function(t){return e.source===t.source.iri&&e.target===t.target.iri})});const o=[],s=ge.tripleLinksCopy.values();for(let e=0;e<ge.tripleLinksCopy.size;e++)s.next().value.forEach(e=>{o.push(e)});i=_.filter(i,function(e){return-1===_.findIndex(o,function(t){return e.source===t.source.iri&&e.target===t.target.iri})}),i=_.filter(i,function(e){return e.source!==e.target});const a=Y("iri",_.union(_.flatten(_.map(t.data,function(e){return[{iri:e.source,isTriple:e.isTripleSource},{iri:e.target,isTriple:e.isTripleTarget}]})))),c=_.map(ge.nodes,function(e){return{iri:e.iri,isTriple:Boolean(e.isTriple)}}),l=ge.tripleNodes.values();for(let e=0;e<ge.tripleNodes.size;e++)l.next().value.forEach(e=>{c.push({iri:e.iri,isTriple:e.isTriple})});const d=_.reject(a,function(e){return _.some(c,e)});if(0===d.length){const e=a.length>0?a.length-1:0;(r||0===i.length)&&p.info(b.instant("graphexplore.error.node.connections",{count:e})),ge.addAndMatchLinks(i),Te()}else{const t=[],r=[],o=D();_.forEach(d,function(n,i){t.push(C.getInstanceNode({iri:n.isTriple?Q(n.iri):n.iri,config:e.configLoaded.id,languages:e.shouldShowSettings()?o.languages:[],includeInferred:o.includeInferred,sameAsState:o.sameAsState}).then(function(e){r[i]=e.data}))}),h.all(t).then(function(){_.forEach(r,function(e,t){const i=2*Math.PI*t/r.length,o=(n?n.x:0)+Math.cos(i)*pe/3,s=(n?n.y:0)+Math.sin(i)*pe/3;e.isTriple?ge.addTriple(e,o,s):ge.addNode(e,o,s)}),ge.addAndMatchLinks(i),n&&(n.isExpanded=!0),Te()})}}function Ee(t,n,r){if(_e.getLoadingState())return;_e.init(t,r);const i=D(),o=t.iri;C.getInstanceNodeLinks({iri:o,linksLimit:i.linksLimit,includeInferred:i.includeInferred,config:e.configLoaded.id,preferredTypes:e.shouldShowSettings()?i.preferredTypes:[],rejectedTypes:e.shouldShowSettings()?i.rejectedTypes:[],preferredPredicates:e.shouldShowSettings()?i.preferredPredicates:[],rejectedPredicates:e.shouldShowSettings()?i.rejectedPredicates:[],preferredTypesOnly:e.shouldShowSettings()?i.preferredTypesOnly:[],preferredPredicatesOnly:e.shouldShowSettings()?i.preferredPredicatesOnly:[],languages:e.shouldShowSettings()?i.languages:[],sameAsState:i.sameAsState,includeSchema:i.includeSchema}).then(function(e){Oe(e,t,n)},function(t){const n=getError(t.data);p.error(n,b.instant("graphexplore.error.exploring.node")),e.loading=!1,_e.setLoadingState(!1)})}function Ge(){angular.isDefined(Pe)&&Pe.expandedState&&Pe.removeIcons()}function je(t){ke.stop(),e.openedNodeInfoPanel=t,e.showNodeInfo=!0,e.showFilter=!1,e.showPredicates=!1,e.nodeLabels=t.labels,e.nodeTypes=t.types,e.rdfRank=t.rdfRank,e.nodeIri=t.iri,e.resourceType=t.isTriple?"triple":"uri",e.encodedIri=t.isTriple?encodeURIComponent(Q(t.iri)):encodeURIComponent(t.iri),e.showInfoPanel=!0,e.rdfsLabel=t.labels[0].label,e.rdfsComment=t.comment,e.expanded=!1,e.propertiesQueryObj.query="",e.dataNodeKeysQuery="";const n=D();C.getProperties({iri:t.isTriple?Q(t.iri):t.iri,config:e.configLoaded.id,languages:e.shouldShowSettings()?n.languages:[],includeInferred:n.includeInferred,sameAsState:n.sameAsState,rejectedPredicates:e.shouldShowSettings()?n.rejectedPredicates:[]}).then(function(t){e.data=_.mapKeys(t.data,function(t,n){return e.replaceIRIWithPrefix(n)}),e.propertiesObj.items=[],_.forEach(e.data,function(t,n){e.propertiesObj.items.push({key:n,value:t})}),e.nodeImage=void 0,e.propertiesNotFiltered=e.propertiesObj.items;const n=_.find(e.propertiesObj.items,function(e){return"image"===e.key});n&&(e.nodeImage=n.value[0].v),e.propertiesObj.items=_.reject(e.propertiesObj.items,function(e){return"image"===e.key}),e.propertiesNotFiltered=e.propertiesObj.items},function(e){p.warning(getError(e.data),"Error")})}function ze(e){De("predicate","var(--gw-primary-dark)",e),De("predicates","var(--gw-primary-dark)",e);const t=document.getElementsByClassName("link");t&&_.each(t,function(t){const n=t.__data__;(n.source.iri.indexOf(e.iri)>=0||n.target.iri.indexOf(e.iri)>=0)&&(t.style.stroke="var(--gw-primary-dark)",t.style.strokeWidth=4)});const n=document.getElementsByClassName("arrow-marker");n&&_.each(n,function(t){const n=t.__data__;(n.source.iri.indexOf(e.iri)>=0||n.target.iri.indexOf(e.iri)>=0)&&(t.style.stroke="var(--gw-primary-dark)",t.__data__.target.isTriple||t.setAttribute("refX","23"))})}function De(e,t,n){const r=document.getElementsByClassName(e);r&&_.each(r,function(e){const r=e.__data__;n?((r.source.iri.indexOf(n.iri)>=0||r.target.iri.indexOf(n.iri)>=0)&&(e.style.fill=t),K(n.iri)===V(r)&&(e.textContent=n.pred,e.style.fill=t),n.oppLinkIRI&&n.oppLinkIRI===V(r)&&(e.textContent=n.oppTriplePred,e.style.fill=t)):(e.style.fill=t,e.textContent=Be(r))})}function $e(){_.each(e.predicates,function(e){const t=document.getElementById(e.linkId+e.nodeIndex);t&&(t.style.fontWeight="normal")});const t=document.getElementsByClassName("link");t&&_.each(t,function(e){e.style.stroke="#999",e.style.strokeWidth=1}),De("predicate",""),De("predicates","");const n=document.getElementsByClassName("arrow-marker");n&&_.each(n,function(e){e.style.stroke="#999",e.__data__.target.isTriple||e.setAttribute("refX","59")})}function Fe(e){const t=K(e);if(ge.tripleNodes.has(t))return ge.tripleNodes.get(t).find(t=>t.iri===e)}function Be(e){return e.predicates.length>1?e.predicates.length+" predicates":Ue(e.predicates[0])}function Ue(t){const n=e.replaceIRIWithPrefix(t);return n.length===t.length?t.split("/")[t.split("/").length-1]:n}e.toggleSidePanel=function(){e.pageslideExpanded=!e.pageslideExpanded},e.closeInfoPanel=function(){e.pageslideExpanded=!1,e.openedNodeInfoPanel=void 0,e.predicates=[],fe=null,u(function(){e.showInfoPanel=!1})},e.clickLink=function(t){if(ge.tripleNodes.has(t.linkId)){$e();const n=ge.tripleNodes.get(t.linkId)[t.nodeIndex];je(n),e.showPredicates=!0;const r=document.getElementById(t.linkId+t.nodeIndex);r&&(r.style.fontWeight="bold");const i={},o=ge.tripleLinksCopy.values();for(let e=0;e<ge.tripleLinksCopy.size;e++){const e=o.next().value;e.length>1&&e.every(t=>t.source.iri===n.iri?(i.iri=e[0].source.iri,t.target.isTriple&&(i.oppLinkIRI=K(t.target.iri),i.oppTriplePred=Ue(t.target.iri.split(" ")[1])),i.pred=Ue(n.iri.split(" ")[1]),1===t.predicates.length&&(i.linkPred=t.predicates[0]),!1):t.target.iri!==n.iri||(i.iri=e[0].target.iri,t.source.isTriple&&(i.oppLinkIRI=K(t.source.iri),i.oppTriplePred=Ue(t.source.iri.split(" ")[1])),i.pred=Ue(n.iri.split(" ")[1]),1===t.predicates.length&&(i.linkPred=t.predicates[0]),!1))}i.iri||(i.iri=n.iri,i.pred=Ue(n.iri.split(" ")[1])),ze(i)}},e.splitPredicate=function(e){return e.split("/")[e.split("/").length-1]},e.getActiveRepository=function(){return n.getActiveRepository()},e.isLoadingLocation=function(){return n.isLoadingLocation()},e.hasActiveLocation=function(){return n.hasActiveLocation()},e.rotate=function(e){Ge();const t=10*(e?1:-1)*Math.PI/180,n=Math.cos(t),r=Math.sin(t),i=de/2,s=pe/2;o.selectAll(".node-wrapper").each(function(e){e.x=i+(n*(e.x-i)+r*(e.y-s)),e.y=s+(-r*(e.x-i)+n*(e.y-s)),e.fixed&&(e.fx=e.x,e.fy=e.y)}),ke.alpha(1).restart()},e.openUri=function(t,n){if(!n){const n={};e.configLoaded.id!==e.defaultGraphConfig.id&&(n.config=e.configLoaded.id),n.uri=t,n[d.REPOSITORY_ID_PARAM]=M.getSelectedRepository().id,j(n,{uri:t,config:e.configLoaded})}e.$broadcast("onRootNodeChange",t)},e.saveOrUpdateGraph=function(){const t=JSON.stringify(ge.copyState()),n={id:e.lastSavedGraphId,name:e.lastSavedGraphName,data:t,shared:e.shared,repositoryId:M.getSelectedRepository().id};n.id?e.saveGraphModal("update",n):e.saveGraphModal("new",n)},e.renameSavedGraph=function(t){e.saveGraphModal("rename",{id:t.id,name:t.name,config:t.config,shared:t.shared})};e.saveGraphModal=function(t,n,r){const i=x.open({templateUrl:"js/angular/graphexplore/templates/modal/save-graph.html",controller:"SaveGraphModalCtrl",resolve:{data:function(){return{mode:t,graph:n,graphExists:r,shared:n.shared}}}});E++,O=!0,i.result.then(function(t){if(t.restart)e.saveGraphModal(t.mode,t.graph,!1);else switch(t.mode){case"new":!function(t){e.configLoaded&&(t.config=e.configLoaded.id),k.addNewSavedGraph(t).success(function(n,r,i){e.lastSavedGraphName=t.name,e.lastSavedGraphId=i()["x-saved-graph-id"],e.shared=t.shared,e.refreshSavedGraphs(),p.success(b.instant("graphexplore.saved.graph",{name:t.name}))}).error(function(n,r){if(422===r)e.saveGraphModal("new",t,!0);else{const e=getError(n);p.error(e,b.instant("graphexplore.error.cannot.create.graph"))}})}(t.graph);break;case"update":case"rename":n=t.graph,k.editSavedGraph(n).success(function(){e.lastSavedGraphName=n.name,e.shared=n.shared,e.refreshSavedGraphs(),p.success(b.instant("graphexplore.saved.graph.was.edited",{name:n.name}))}).error(function(e){const t=getError(e);p.error(t,b.instant("graphexplore.error.cannot.edit"))})}var n}).finally(()=>{E--,E<=0&&(O=!1,E=0)})},e.refreshSavedGraphs=function(){k.getSavedGraphs().success(function(t){e.savedGraphs=t}).error(function(e){const t=getError(e);p.error(t,b.instant("graphexplore.error.getting.saved.graphs"))})},e.loadSavedGraph=function(t,n){t.owner?(e.lastSavedGraphName=t.name,e.lastSavedGraphId=t.id,e.shared=t.shared,e.configLoaded=e.findConfigById(t.config)):(e.lastSavedGraphName=null,e.lastSavedGraphId=null,e.shared=t.shared),e.configLoaded||(e.configLoaded=e.defaultGraphConfig);const r={...g.search(),saved:t.id,[d.REPOSITORY_ID_PARAM]:M.getSelectedRepository().id};ge.restoreState(JSON.parse(t.data)),n||j(r,{savedGraph:t})},e.copyToClipboardSavedGraph=function(t){const n=new URL(window.location.href);n.searchParams.set("saved",t.id),n.searchParams.set(d.REPOSITORY_ID_PARAM,M.getSelectedRepository().id),e.copyToClipboard(n.toString())},e.deleteSavedGraph=function(t){v.openSimpleModal({title:b.instant("common.confirm"),message:b.instant("graphexplore.confirm.delete.graph",{graphName:t.name}),warning:!0}).result.then(function(){!function(t){k.deleteSavedGraph(t).success(function(){e.refreshSavedGraphs(),p.success(b.instant("graphexplore.saved.graph.was.deleted",{name:t.name}))}).error(function(e){const t=getError(e);p.error(t,b.instant("graphexplore.error.cannot.delete"))})}(t)})},e.openIRI=function(t,n){return n.shiftKey?e.$broadcast("onRootNodeChange",t):window.open(t,"_blank"),!1},e.togglePinAllNodes=function(){Ge();const t=angular.isUndefined(e.numberOfPinnedNodes)||e.numberOfPinnedNodes<=0;e.numberOfPinnedNodes=0,o.selectAll(".node").each(function(n){n.fixed=t,t?(e.numberOfPinnedNodes++,n.fx=n.x,n.fy=n.y):(n.fx=null,n.fy=null)}),ke.alpha(1).restart()},$("body").on("keydown",function(t){!T.isActive()&&"input"!==t.target.nodeName&&e.nodeSelected&&(37===t.keyCode?e.rotate(!0):39===t.keyCode&&e.rotate(!1))}),e.getLiteralFromPropValue=function(e){return e.substring(e.indexOf(":")+1)};let We=!1;(()=>{if(!We){Le.append("rect").attr("width",10*de).attr("height",10*pe).attr("x",-(10*de-de)/2).attr("y",-(10*pe-pe)/2).style("fill","none").style("pointer-events","all").call(se).on("click",function(e){e.stopPropagation(),Ge(),ke.stop()});const e=e=>{e.preventDefault()};Le.node().addEventListener("wheel",e,{passive:!1}),R.push(()=>Le.node().removeEventListener("wheel",e)),We=!0}(t=>{const n=t.appSettings;e.defaultSettings.includeInferred=n.DEFAULT_INFERENCE,e.defaultSettings.sameAsState=n.DEFAULT_INFERENCE&&n.DEFAULT_SAMEAS,e.defaultSettings.includeSchema=n.DEFAULT_VIS_GRAPH_SCHEMA;const r=I.get(w.GRAPHS_VIZ);if(r&&"object"==typeof r)try{e.saveSettings=r,void 0===e.saveSettings.includeSchema&&(e.saveSettings.includeSchema=e.defaultSettings.includeSchema,e.saveSettings.rejectedPredicates=[...e.saveSettings.rejectedPredicates,...e.defaultSettings.rejectedPredicates].unique())}catch{e.saveSettings=_.cloneDeep(e.defaultSettings),I.set(w.GRAPHS_VIZ,e.saveSettings)}else e.saveSettings=_.cloneDeep(e.defaultSettings)})(A.getAuthenticatedUser()),me()})()}function u(e,t,n,r){switch(e.mode=n.mode,e.graph=_.cloneDeep(n.graph),e.graphExists=n.graphExists,e.mode){case"new":e.title=r.instant("graphexplore.create.new.graph"),e.okButtonText=r.instant("common.create.btn");break;case"update":e.title=r.instant("graphexplore.update"),e.okButtonText=r.instant("common.save.btn");break;case"rename":e.title=r.instant("graphexplore.rename"),e.okButtonText=r.instant("common.save.btn")}e.ok=function(){e.form.$valid&&(e.graph.name=i(e.graph.name),t.close({graph:e.graph,mode:e.mode}))},e.saveNew=function(){e.graph.name=i(e.graph.name)+" (new)",t.close({graph:e.graph,mode:"new",restart:!0})},e.cancel=function(){t.dismiss("cancel")};const i=e=>e.replace(/\s+/g," ").trim()}angular.module("graphdb.framework.graphexplore.controllers.graphviz",["ui.scroll.jqlite","ui.scroll","toastr","ui.bootstrap","ngTagsInput","graphdb.framework.utils.localstorageadapter","graphdb.core.services.workbench-context","graphdb.framework.core.services.rdf4j.repositories"]).controller("GraphsVisualizationsCtrl",p).controller("SaveGraphModalCtrl",u).config(["$uibTooltipProvider",function(e){e.options({appendToBody:!0})}]),p.$inject=["$scope","$rootScope","$repositories","toastr","$timeout","ClassInstanceDetailsService","$q","$location","$jwtAuth","UiScrollService","ModalService","$uibModal","$window","LocalStorageAdapter","LSKeys","SavedGraphsRestService","GraphConfigRestService","GraphDataRestService","$translate","GuidesService","WorkbenchContextService","RDF4JRepositoriesService"],u.$inject=["$scope","$uibModalInstance","data","$translate"]},62979(e,t,n){var r,i;r=[n(93462)],i=function(e){function t(e,t){return e.each(function(){var e=t.apply(this,arguments),n=select(this);for(var r in e)n.attr(r,e[r])})}function r(e,t){for(var n in t)e.attr(n,t[n]);return e}return void 0===e&&(e=n(93462)),e.selection.prototype.attrs=function(e){return("function"==typeof e?t:r)(this,e)},e.selection.prototype.moveToFront=function(){return this.each(function(){e.select(this.parentNode.appendChild(this))})},e.selection.prototype.moveToBack=function(){return this.each(function(){const e=this.parentNode.firstChild;e&&this.parentNode.insertBefore(this,e)})},e}.apply(t,r),void 0===i||(e.exports=i)},75468(e,t,n){n.d(t,{A:()=>o});var r=n(93462);const i={select:r.select,selection:r.selection},o=function(){var e=function(){return"n"},t=function(){return[0,0]},n=function(){return" "},r=u(),o=null,s=null,a=null,c=null;function l(e){var t;o="svg"===(t=(t=e).node()).tagName.toLowerCase()?t:t.ownerSVGElement,s=o.createSVGPoint(),document.body.appendChild(r)}l.show=function(){var r=Array.prototype.slice.call(arguments);r[r.length-1]instanceof SVGElement&&(a=r.pop());var i,o=n.apply(this,r),s=t.apply(this,r),u=e.apply(this,r),h=f(),g=p.length,m=document.documentElement.scrollTop||document.body.scrollTop,y=document.documentElement.scrollLeft||document.body.scrollLeft,v=c.apply(this,r);for(h.html(o).style("opacity",1).style("pointer-events","all");g--;)h.classed(p[g],!1);const x=r.filter(e=>e instanceof Event);return i=d.get(u).apply(this,x),v?Object.keys(v).forEach(function(e){h.style(e,v[e])}):h.classed(u,!0).style("top",i.top+s[0]+m+"px").style("left",i.left+s[1]+y+"px"),l},l.hide=function(){return f().style("opacity",0).style("pointer-events","none"),l},l.attr=function(e,t){if(arguments.length<2&&"string"==typeof e)return f().attr(e);var n=Array.prototype.slice.call(arguments);return i.selection.prototype.attr.apply(f(),n),l},l.style=function(e,t){if(arguments.length<2&&"string"==typeof e)return f().style(e);var n=Array.prototype.slice.call(arguments);return i.selection.prototype.style.apply(f(),n),l},l.direction=function(t){return arguments.length?(e=null==t?t:g(t),l):e},l.offset=function(e){return arguments.length?(t=null==e?e:g(e),l):t},l.html=function(e){return arguments.length?(n=null==e?e:g(e),l):n},l.customPosition=function(e){return arguments.length?(c=null==e?e:g(e),l):c},l.destroy=function(){return r&&(f().remove(),r=null),l};var d=new Map(Object.entries({n:function(e){var t=h(e);return{top:t.n.y-r.offsetHeight,left:t.n.x-r.offsetWidth/2}},s:function(e){var t=h(e);return{top:t.s.y,left:t.s.x-r.offsetWidth/2}},e:function(e){var t=h(e);return{top:t.e.y-r.offsetHeight/2,left:t.e.x}},w:function(e){var t=h(e);return{top:t.w.y-r.offsetHeight/2,left:t.w.x-r.offsetWidth}},nw:function(e){var t=h(e);return{top:t.nw.y-r.offsetHeight,left:t.nw.x-r.offsetWidth}},ne:function(e){var t=h(e);return{top:t.ne.y-r.offsetHeight,left:t.ne.x}},sw:function(e){var t=h(e);return{top:t.sw.y,left:t.sw.x-r.offsetWidth}},se:function(e){var t=h(e);return{top:t.se.y,left:t.e.x}}})),p=d.keys();function u(){var e=i.select(document.createElement("div"));return e.style("position","absolute").style("top",0).style("opacity",0).style("pointer-events","none").style("box-sizing","border-box"),e.node()}function f(){return null===r&&(r=u(),document.body.appendChild(r)),i.select(r)}function h(e){for(var t=a||e.target;void 0===t.getScreenCTM&&"undefined"===t.parentNode;)t=t.parentNode;var n={},r=t.getScreenCTM(),i=t.getBBox(),o=i.width,c=i.height,l=i.x,d=i.y;return s.x=l,s.y=d,n.nw=s.matrixTransform(r),s.x+=o,n.ne=s.matrixTransform(r),s.y+=c,n.se=s.matrixTransform(r),s.x-=o,n.sw=s.matrixTransform(r),s.y-=c/2,n.w=s.matrixTransform(r),s.x+=o,n.e=s.matrixTransform(r),s.x-=o/2,s.y-=c/2,n.n=s.matrixTransform(r),s.y+=c,n.s=s.matrixTransform(r),n}function g(e){return"function"==typeof e?e:function(){return e}}return l}},78618(e,t,n){n.d(t,{G4:()=>o,Sn:()=>s,hK:()=>i});var r=n(98980);const i=e=>e.replace(/[()']/g,""),o=e=>"string"==typeof e?"true"===e:Boolean(e),s=e=>e?(0,r.upperFirst)(e.toLowerCase()):e}};
|
|
2
|
-
//# sourceMappingURL=39518.68e0a6bf41cd48ce4e13.bundle.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
export const __webpack_esm_id__=67888;export const __webpack_esm_ids__=[9717,67888,73702,82926,96248];export const __webpack_esm_modules__={9717(){function e(e,r){return{restrict:"E",templateUrl:"js/angular/import/templates/import-resource-status-info.html",scope:{resource:"="},link:o=>{const t=[];o.popoverTemplate="resourceStatusInfoTemplate.html",o.popoverIsOpen=!1,o.context=o.resource.importResource.context,o.replaceGraphs=o.resource.importResource.replaceGraphs,o.baseUrl=decodeURIComponent(o.resource.importResource.baseURI),o.forceSerial=o.resource.importResource.forceSerial,o.importedOn=o.resource.importResource.importedOn,o.parserSettings=o.resource.importResource.parserSettings,o.open=()=>{o.closeAllDialogs(),o.popoverIsOpen=!0},o.closeAllDialogs=()=>{e.$broadcast("closePopovers")},o.close=()=>{o.popoverIsOpen=!1};const s=e=>{"Escape"===e.key&&o.$apply(()=>{o.close()})};t.push(o.$on("closePopovers",o.close)),r.on("keydown",s),o.$on("$destroy",()=>{r.off("keydown",s),t.forEach(e=>e())})}}}angular.module("graphdb.framework.import.directives.import-resource-status-info",[]).directive("importResourceStatusInfo",e),e.$inject=["$rootScope","$document"]},54419(e,r,o){o(96248);var t=o(28847),s=o(78618);function i(e){return{restrict:"E",templateUrl:"js/angular/import/templates/import-resource-message.html",scope:{resource:"="},link:r=>{r.ImportResourceStatus=t.I,r.toTitleCase=e=>s.Sn(e),r.showMessage=r=>{e.open({templateUrl:"js/angular/import/templates/import-resource-message-dialog.html",controller:"ImportResourceMessageDialogController",size:"lg",windowClass:"import-resource-message-dialog",backdrop:"static",resolve:{message:function(){return r?r.importResource.message:""}}})}}}}angular.module("graphdb.framework.import.directives.import-resource-message",["graphdb.framework.impex.import.controllers.import-resource-message-dialog"]).directive("importResourceMessage",i),i.$inject=["$uibModal"]},67888(e,r,o){o(82493),o(5687),o(39324),o(73702),o(82926),o(83136),o(76933),o(47195),o(56669),angular.module("graphdb.framework.impex.import",["toastr","ngRoute","ngFileUpload","ui.bootstrap","graphdb.framework.impex.import.controllers","graphdb.framework.core.services.repositories","graphdb.framework.import.directives.validate-uri","graphdb.framework.import.directives.import-progress-indicator","graphdb.framework.import.directives.import-resource-tree"])},73702(){function e(e){return{restrict:"A",require:"ngModel",link:function(r,o,t,s){s.$parsers.unshift(function(r){if(s.$setValidity("validateUri",!0),!s.$isEmpty(r)){const o=e.isValidIri(r,r.toString());s.$setValidity("validateUri",o)}return r})}}}angular.module("graphdb.framework.import.directives.validate-uri",[]).directive("validateUri",e),e.$inject=["UriUtils"]},82926(){function e(){return{link:function(e,r,o){e.$watch("file.status",function(){"IMPORTING"!==e.file.status&&"UPLOADING"!==e.file.status||!$(r).has("object").length>0&&$(r).append('<object width="'+o.size+'" height="'+o.size+'" data="js/angular/templates/loader/ot-loader.svg?v=3.3.2-RC3">{{\'common.loading\' | translate}}</object>')})}}}angular.module("graphdb.framework.import.directives.import-progress-indicator",[]).directive("ImportProgressIndicator",e),e.$inject=[]},83136(e,r,o){var t=o(28847),s=(o(54419),o(9717),o(18025)),i=o(57436),c=o(7796),a=o(56636),l=o(57154);const p={FILE:"FILE",DIRECTORY:"DIRECTORY",ALL:"ALL"},n={ALL:"ALL",NONE:"NONE",IMPORTED:"IMPORTED",NOT_IMPORTED:"NOT_IMPORTED"};function u(e,r){return{restrict:"E",templateUrl:"js/angular/import/templates/import-resource-tree.html",scope:{columnKeys:"=",showTypeFilter:"=",sortBy:"=",asc:"=",onImport:"&",onImportAll:"&",onReset:"&",onRemove:"&",onStopImport:"&",onEditResource:"&"},link:(o,u,m)=>{o.resources=new i.k,o.displayResources=[],o.TYPE_FILTER_OPTIONS=p,o.filterByType=p.ALL,o.filterByFileName="",o.STATUS_OPTIONS=n,o.selectedByStatus=void 0,o.areAllDisplayedImportResourcesSelected=!1,o.areAllDisplayedImportResourcesPartialSelected=!1,o.ImportResourceStatus=t.I,o.canRemoveResource=angular.isDefined(m.onRemove),o.canResetSelectedResources=!1,o.SORTING_TYPES=s.R,o.sortAsc=!angular.isDefined(m.asc)||o.asc,o.sortedBy=o.sortBy,o.showLoader=r.getShowLoader(),o.hasSelection=!1,o.selectionChanged=e=>{e.setSelection(e.selected),I(),d(),g()},o.selectResourceWithStatus=e=>{o.selectedByStatus=e,o.resources.setSelection(!1),n.ALL===o.selectedByStatus?o.resources.setSelection(!0):n.IMPORTED===o.selectedByStatus?o.resources.selectAllWithStatus([t.I.DONE]):n.NOT_IMPORTED===o.selectedByStatus&&o.resources.selectAllWithStatus([t.I.IMPORTING,t.I.NONE,t.I.ERROR,t.I.PENDING,t.I.INTERRUPTING]),R(),d()},o.filterByTypeChanged=e=>{o.filterByType=e,R()},o.filterByFileNameChanged=e=>{o.filterByFileName=e,N(R,100)},o.onResetStatus=()=>{const e=o.resources.getAllSelected().map(e=>e.path);e.length>0&&o.onReset({resources:e})},o.resetStatus=e=>{o.onReset({resources:[e.path]})},o.onRemoveResources=()=>{const e=o.resources.getAllSelected();e&&e.length>0&&o.onRemove({resources:e})},o.removeResource=e=>{o.onRemove({resources:[e]})},o.importAll=e=>{const r=o.resources.getAllSelectedForImport();r.length>0&&o.onImportAll({selectedResources:r,withoutChangingSettings:e})},o.stopImport=e=>{o.onStopImport({resource:e})},o.sort=e=>{o.sortedBy===e?o.sortAsc=!o.sortAsc:o.sortAsc=!0,o.sortedBy=e,R()},o.editResource=e=>{o.onEditResource({resource:e})};const d=()=>{o.canResetSelectedResources=o.resources.getSelectedImportedResources()},R=()=>{o.resources.getRoot().updateSelectionState(),y(),o.displayResources=o.resources.toList().filter(A).filter(E),g(),I()},g=()=>{const e=o.resources.getAllSelectedFilesNames();o.hasSelection=e.length>0,r.updateSelectedFilesNames(e)},I=()=>{const e=o.displayResources.some(e=>!e.selected),r=o.displayResources.some(e=>e.selected);o.areAllDisplayedImportResourcesSelected=r&&!e,o.areAllDisplayedImportResourcesPartialSelected=r&&e},y=()=>{s.R.NAME===o.sortedBy?o.resources.sort(f(o.sortAsc)):s.R.SIZE===o.sortedBy?o.resources.sort(h(o.sortAsc)):s.R.MODIFIED===o.sortedBy?o.resources.sort(S(o.sortAsc)):s.R.IMPORTED===o.sortedBy?o.resources.sort(T(o.sortAsc)):s.R.CONTEXT===o.sortedBy&&o.resources.sort(v(o.sortAsc))},f=e=>(r,o)=>e?r.importResource.name.localeCompare(o.importResource.name):o.importResource.name.localeCompare(r.importResource.name),h=e=>(r,o)=>{const t=l.ByteUtils.convertToBytes(r.importResource.size),s=l.ByteUtils.convertToBytes(o.importResource.size);return e?t-s:s-t},S=e=>(r,o)=>{const t=r.importResource.modifiedOn||Number.MAX_VALUE,s=o.importResource.modifiedOn||Number.MAX_VALUE;return e?t-s:s-t},T=e=>(r,o)=>{const t=r.importResource.importedOn||Number.MAX_VALUE,s=o.importResource.importedOn||Number.MAX_VALUE;return e?t-s:s-t},v=e=>(r,o)=>e?r.importResource.context.localeCompare(o.importResource.context):o.importResource.context.localeCompare(r.importResource.context),A=e=>p.ALL===o.filterByType||(o.filterByType===p.FILE?e.isFile():o.filterByType===p.DIRECTORY&&e.isDirectory()),E=e=>!o.filterByFileName||(o.filterByType===p.DIRECTORY?e.hasTextInDirectoriesName(o.filterByFileName):o.filterByType===p.FILE?e.hasTextInFilesName(o.filterByFileName):e.hasTextInResourcesName(o.filterByFileName));let O;const N=(r,o)=>{O&&e.cancel(O),O=e(r,o)},b=[];b.push(r.onResourcesUpdated((e=[])=>{const t=c.D.USER===r.getActiveTabId();o.resources.isEmpty()?(o.resources=a.Fp.toImportResourceTree(e,t),t&&(o.sortedBy=s.R.MODIFIED)):a.Fp.mergeResourceTree(o.resources,e,t),a.Fp.calculateElementIndent(o.resources),a.Fp.setupAfterTreeInitProperties(o.resources),R(),d()})),b.push(r.onShowLoaderUpdated(e=>o.showLoader=e)),b.push(r.onActiveTabIdUpdated(()=>o.resources=new i.k)),o.$on("$destroy",()=>{b.forEach(e=>e())})}}}angular.module("graphdb.framework.import.directives.import-resource-tree",["graphdb.framework.import.directives.import-resource-message","graphdb.framework.import.directives.import-resource-status-info"]).directive("importResourceTree",u),u.$inject=["$timeout","ImportContextService"]},96248(e,r,o){var t=o(304);angular.module("graphdb.framework.impex.import.controllers.import-resource-message-dialog",[]).controller("ImportResourceMessageDialogController",i),i.$inject=["$scope","$uibModalInstance","$translate","toastr","message"];const s=t.I.logger;function i(e,r,o,t,i){e.message=i,e.close=()=>{r.dismiss()},e.copyToClipboard=()=>{navigator.clipboard.writeText(e.message).then(()=>{t.success(o.instant("import.help.messages.copied_to_clipboard")),e.close()},e=>{s.error("Could not copy text: ",e)})}}}};
|
|
2
|
-
//# sourceMappingURL=67888.6250e334540bfa0ca257.bundle.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"67888.6250e334540bfa0ca257.bundle.js","mappings":"mJAQA,SAASA,EAAkCC,EAAYC,GACnD,MAAO,CACHC,SAAU,IACVC,YAAa,+DACbC,MAAO,CACHC,SAAU,KAEdC,KAAOC,IACH,MAAMC,EAAc,GAKpBD,EAAOE,gBAAkB,kCACzBF,EAAOG,eAAgB,EACvBH,EAAOI,QAAUJ,EAAOF,SAASO,eAAeD,QAChDJ,EAAOM,cAAgBN,EAAOF,SAASO,eAAeC,cACtDN,EAAOO,QAAUC,mBAAmBR,EAAOF,SAASO,eAAeI,SACnET,EAAOU,YAAcV,EAAOF,SAASO,eAAeK,YACpDV,EAAOW,WAAaX,EAAOF,SAASO,eAAeM,WACnDX,EAAOY,eAAiBZ,EAAOF,SAASO,eAAeO,eAKvDZ,EAAOa,KAAO,KACVb,EAAOc,kBACPd,EAAOG,eAAgB,GAG3BH,EAAOc,gBAAkB,KACrBrB,EAAWsB,WAAW,kBAG1Bf,EAAOgB,MAAQ,KACXhB,EAAOG,eAAgB,GAG3B,MAAMc,EAAwBC,IACR,WAAdA,EAAMC,KACNnB,EAAOoB,OAAO,KACVpB,EAAOgB,WAanBf,EAAYoB,KAAKrB,EAAOsB,IAAI,gBAAiBtB,EAAOgB,QACpDtB,EAAU6B,GAAG,UAAWN,GAExBjB,EAAOsB,IAAI,WAAY,KACnB5B,EAAU8B,IAAI,UAAWP,GAXzBhB,EAAYwB,QAASC,GAAeA,QAgBpD,CArEAC,QACKC,OAAO,kEAHI,IAIXC,UAAU,2BAA4BrC,GAE3CA,EAAkCsC,QAAU,CAAC,aAA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resource-status-info.directive.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/import/directives/import-resource-message.directive.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/import/app.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/import/directives/validate-uri.directive.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/import/directives/import-progress-indicator.directive.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/import/directives/import-resource-tree.directive.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/import/controllers/import-resource-message-dialog.controller.js"],"sourcesContent":["const modules = [];\n\nangular\n .module('graphdb.framework.import.directives.import-resource-status-info', modules)\n .directive('importResourceStatusInfo', importResourceStatusInfoDirective);\n\nimportResourceStatusInfoDirective.$inject = ['$rootScope', '$document'];\n\nfunction importResourceStatusInfoDirective($rootScope, $document) {\n return {\n restrict: 'E',\n templateUrl: 'js/angular/import/templates/import-resource-status-info.html',\n scope: {\n resource: '='\n },\n link: ($scope) => {\n const subscribers = [];\n\n // =========================\n // Public variables\n // =========================\n $scope.popoverTemplate = 'resourceStatusInfoTemplate.html';\n $scope.popoverIsOpen = false;\n $scope.context = $scope.resource.importResource.context;\n $scope.replaceGraphs = $scope.resource.importResource.replaceGraphs;\n $scope.baseUrl = decodeURIComponent($scope.resource.importResource.baseURI);\n $scope.forceSerial = $scope.resource.importResource.forceSerial;\n $scope.importedOn = $scope.resource.importResource.importedOn;\n $scope.parserSettings = $scope.resource.importResource.parserSettings;\n\n // =========================\n // Public functions\n // =========================\n $scope.open = () => {\n $scope.closeAllDialogs();\n $scope.popoverIsOpen = true;\n };\n\n $scope.closeAllDialogs = () => {\n $rootScope.$broadcast('closePopovers');\n };\n\n $scope.close = () => {\n $scope.popoverIsOpen = false;\n };\n\n const handleEscapeKeyPress = (event) => {\n if (event.key === 'Escape') {\n $scope.$apply(() => {\n $scope.close();\n });\n }\n };\n\n const removeAllSubscribers = () => {\n subscribers.forEach((subscriber) => subscriber());\n };\n\n // =========================\n // Subscriptions\n // =========================\n\n subscribers.push($scope.$on('closePopovers', $scope.close));\n $document.on('keydown', handleEscapeKeyPress);\n\n $scope.$on('$destroy', () => {\n $document.off('keydown', handleEscapeKeyPress);\n removeAllSubscribers();\n });\n }\n };\n}\n","import 'angular/import/controllers/import-resource-message-dialog.controller';\nimport {ImportResourceStatus} from \"../../models/import/import-resource-status\";\nimport * as stringUtils from \"../../utils/string-utils\";\n\nconst modules = ['graphdb.framework.impex.import.controllers.import-resource-message-dialog'];\n\nangular\n .module('graphdb.framework.import.directives.import-resource-message', modules)\n .directive('importResourceMessage', importResourceMessageDirective);\n\nimportResourceMessageDirective.$inject = ['$uibModal'];\n\nfunction importResourceMessageDirective($uibModal) {\n return {\n restrict: 'E',\n templateUrl: 'js/angular/import/templates/import-resource-message.html',\n scope: {\n resource: '='\n },\n link: ($scope) => {\n $scope.ImportResourceStatus = ImportResourceStatus;\n $scope.toTitleCase = (str) => stringUtils.toTitleCase(str);\n\n /**\n *\n * @param {ImportResourceTreeElement} resourceTreeElement\n */\n $scope.showMessage = (resourceTreeElement) => {\n $uibModal.open({\n templateUrl: 'js/angular/import/templates/import-resource-message-dialog.html',\n controller: 'ImportResourceMessageDialogController',\n size: 'lg',\n windowClass: 'import-resource-message-dialog',\n backdrop: 'static',\n resolve: {\n message: function () {\n return resourceTreeElement ? resourceTreeElement.importResource.message : '';\n }\n }\n });\n }\n }\n };\n}\n","import 'angular/core/services';\nimport 'angular/core/directives';\nimport 'angular/import/controllers/import-view.controller';\nimport 'angular/import/directives/validate-uri.directive';\nimport 'angular/import/directives/import-progress-indicator.directive';\nimport 'angular/import/directives/import-resource-tree.directive';\nimport 'angular/core/services/repositories.service';\nimport 'ng-file-upload/dist/ng-file-upload.min';\nimport 'ng-file-upload/dist/ng-file-upload-shim.min';\n\nconst modules = [\n 'toastr',\n 'ngRoute',\n 'ngFileUpload',\n 'ui.bootstrap',\n 'graphdb.framework.impex.import.controllers',\n 'graphdb.framework.core.services.repositories',\n 'graphdb.framework.import.directives.validate-uri',\n 'graphdb.framework.import.directives.import-progress-indicator',\n 'graphdb.framework.import.directives.import-resource-tree'\n];\n\nangular.module('graphdb.framework.impex.import', modules);\n","/**\n * This AngularJS directive validates whether an input value is a valid URI (IRI).\n *\n * @directive validateUri\n * @restrict A (Attribute)\n * @requires ngModel\n *\n * @example\n * <input type=\"text\" name=\"url\" ng-model=\"url\" validate-uri>\n */\nconst modules = [];\n\nangular\n .module('graphdb.framework.import.directives.validate-uri', modules)\n .directive('validateUri', validateUri);\n\nvalidateUri.$inject = ['UriUtils'];\n\n/**\n * @function validateUri\n * @param {UriUtils} UriUtils - Service for URI validation.\n */\nfunction validateUri(UriUtils) {\n return {\n restrict: 'A',\n require: 'ngModel',\n link: function (scope, element, attr, ctrl) {\n ctrl.$parsers.unshift(function (value) {\n ctrl.$setValidity('validateUri', true);\n if (!ctrl.$isEmpty(value)) {\n const valid = UriUtils.isValidIri(value, value.toString());\n ctrl.$setValidity('validateUri', valid);\n }\n return value;\n });\n }\n };\n}\n","const modules = [];\n\nangular\n .module('graphdb.framework.import.directives.import-progress-indicator', modules)\n .directive('ImportProgressIndicator', ImportProgressIndicator);\n\nImportProgressIndicator.$inject = [];\n\n// importDirectives.directive('filesOntoLoader',\nfunction ImportProgressIndicator() {\n return {\n link: function (scope, element, attr) {\n scope.$watch('file.status', function () {\n if (scope.file.status === 'IMPORTING' || scope.file.status === 'UPLOADING') {\n if (!$(element).has('object').length > 0) {\n $(element).append('<object width=\"' + attr.size + '\" height=\"' + attr.size + '\" data=\"js/angular/templates/loader/ot-loader.svg?v=3.3.2-RC3\">{{\\'common.loading\\' | translate}}</object>');\n }\n }\n });\n }\n };\n}\n","import {ImportResourceStatus} from \"../../models/import/import-resource-status\";\nimport 'angular/import/directives/import-resource-message.directive';\nimport 'angular/import/directives/import-resource-status-info.directive';\nimport {SortingType} from \"../../models/import/sorting-type\";\nimport {ImportResourceTreeElement} from \"../../models/import/import-resource-tree-element\";\nimport {TABS} from \"../services/import-context.service\";\nimport {ImportResourceTreeService} from \"../services/import-resource-tree.service\";\nimport {\n ByteUtils,\n} from \"@ontotext/workbench-api\";\n\nconst TYPE_FILTER_OPTIONS = {\n 'FILE': 'FILE',\n 'DIRECTORY': 'DIRECTORY',\n 'ALL': 'ALL',\n};\n\nconst STATUS_OPTIONS = {\n 'ALL': 'ALL',\n 'NONE': 'NONE',\n 'IMPORTED': 'IMPORTED',\n 'NOT_IMPORTED': 'NOT_IMPORTED',\n};\n\nconst modules = [\n 'graphdb.framework.import.directives.import-resource-message',\n 'graphdb.framework.import.directives.import-resource-status-info',\n];\n\nangular\n .module('graphdb.framework.import.directives.import-resource-tree', modules)\n .directive('importResourceTree', importResourceTreeDirective);\n\nimportResourceTreeDirective.$inject = ['$timeout', 'ImportContextService'];\n\nfunction importResourceTreeDirective($timeout, ImportContextService) {\n return {\n restrict: 'E',\n templateUrl: 'js/angular/import/templates/import-resource-tree.html',\n scope: {\n /**\n * Contains mapping of the column names to label keys. Should contain\n * keys for: name, size, imported, modified, context column names.\n */\n columnKeys: '=',\n /**\n * If the type filter buttons should be visible.\n */\n showTypeFilter: '=',\n /**\n * The default field to sort the resources by.\n */\n sortBy: '=',\n asc: '=',\n onImport: '&',\n onImportAll: '&',\n onReset: '&',\n onRemove: '&',\n onStopImport: '&',\n onEditResource: '&',\n },\n link: ($scope, element, attrs) => {\n // =========================\n // Public variables\n // =========================\n $scope.resources = new ImportResourceTreeElement();\n $scope.displayResources = [];\n $scope.TYPE_FILTER_OPTIONS = TYPE_FILTER_OPTIONS;\n $scope.filterByType = TYPE_FILTER_OPTIONS.ALL;\n $scope.filterByFileName = '';\n $scope.STATUS_OPTIONS = STATUS_OPTIONS;\n $scope.selectedByStatus = undefined;\n $scope.areAllDisplayedImportResourcesSelected = false;\n $scope.areAllDisplayedImportResourcesPartialSelected = false;\n $scope.ImportResourceStatus = ImportResourceStatus;\n $scope.canRemoveResource = angular.isDefined(attrs.onRemove);\n $scope.canResetSelectedResources = false;\n $scope.SORTING_TYPES = SortingType;\n $scope.sortAsc = angular.isDefined(attrs.asc) ? $scope.asc : true;\n $scope.sortedBy = $scope.sortBy;\n $scope.showLoader = ImportContextService.getShowLoader();\n $scope.hasSelection = false;\n\n // =========================\n // Public functions\n // =========================\n\n /**\n * Updates the selection model when a resource is selected or unselected.\n * @param {ImportResourceTreeElement} resource The resource that was selected or unselected.\n */\n $scope.selectionChanged = ((resource) => {\n resource.setSelection(resource.selected);\n updateSelectByStateDropdownModel();\n setCanResetResourcesFlag();\n updateHasSelection();\n });\n\n $scope.selectResourceWithStatus = (resourceStatus) => {\n $scope.selectedByStatus = resourceStatus;\n $scope.resources.setSelection(false);\n\n if (STATUS_OPTIONS.ALL === $scope.selectedByStatus) {\n $scope.resources.setSelection(true);\n } else if (STATUS_OPTIONS.IMPORTED === $scope.selectedByStatus) {\n $scope.resources.selectAllWithStatus([ImportResourceStatus.DONE]);\n } else if (STATUS_OPTIONS.NOT_IMPORTED === $scope.selectedByStatus) {\n $scope.resources.selectAllWithStatus([ImportResourceStatus.IMPORTING, ImportResourceStatus.NONE, ImportResourceStatus.ERROR, ImportResourceStatus.PENDING, ImportResourceStatus.INTERRUPTING]);\n }\n\n updateListedImportResources();\n setCanResetResourcesFlag();\n };\n\n $scope.filterByTypeChanged = (newType) => {\n $scope.filterByType = newType;\n updateListedImportResources();\n };\n\n $scope.filterByFileNameChanged = (filterByFileName) => {\n $scope.filterByFileName = filterByFileName;\n debounce(updateListedImportResources, 100);\n };\n\n /**\n * Resets the status of the selected resources.\n */\n $scope.onResetStatus = () => {\n const resourcesNames = $scope.resources.getAllSelected()\n .map((resource) => resource.path);\n if (resourcesNames.length > 0) {\n $scope.onReset({resources: resourcesNames});\n }\n };\n\n /**\n * Resets the status of the given resource.\n * @param {ImportResourceTreeElement} importResource\n */\n $scope.resetStatus = (importResource) => {\n $scope.onReset({resources: [importResource.path]});\n };\n\n $scope.onRemoveResources = () => {\n const selectedResources = $scope.resources.getAllSelected();\n if (selectedResources && selectedResources.length > 0) {\n $scope.onRemove({resources: selectedResources});\n }\n };\n\n $scope.removeResource = (resource) => {\n $scope.onRemove({resources: [resource]});\n };\n\n $scope.importAll = (withoutChangingSettings) => {\n const selectedResources = $scope.resources.getAllSelectedForImport();\n if (selectedResources.length > 0) {\n $scope.onImportAll({selectedResources: selectedResources, withoutChangingSettings});\n }\n };\n\n $scope.stopImport = (importResource) => {\n $scope.onStopImport({resource: importResource});\n };\n\n /**\n * Sorts resources by provided sorting type.\n * @param {SortingType} sortedBy The sorting type to use.\n */\n $scope.sort = (sortedBy) => {\n if ($scope.sortedBy === sortedBy) {\n $scope.sortAsc = !$scope.sortAsc;\n } else {\n $scope.sortAsc = true;\n }\n $scope.sortedBy = sortedBy;\n updateListedImportResources();\n };\n\n $scope.editResource = (resource) => {\n $scope.onEditResource({resource});\n };\n\n // =========================\n // Private functions\n // =========================\n\n /**\n * Sets the flag showing if any of the selected resources is already imported\n * and can have their states reset.\n */\n const setCanResetResourcesFlag = () => {\n $scope.canResetSelectedResources = $scope.resources.getSelectedImportedResources();\n };\n\n const updateListedImportResources = () => {\n $scope.resources.getRoot().updateSelectionState();\n sortResources();\n $scope.displayResources = $scope.resources.toList()\n .filter(filterByType)\n .filter(filterByName);\n\n updateHasSelection();\n updateSelectByStateDropdownModel();\n };\n\n const updateHasSelection = () => {\n const allSelectedFilesNames = $scope.resources.getAllSelectedFilesNames();\n $scope.hasSelection = allSelectedFilesNames.length > 0;\n ImportContextService.updateSelectedFilesNames(allSelectedFilesNames);\n };\n\n const updateSelectByStateDropdownModel = () => {\n const hasUnselectedDisplayedImportResource = $scope.displayResources.some((resource) => !resource.selected);\n const hasSelectedDisplayedImportResource = $scope.displayResources.some((resource) => resource.selected);\n $scope.areAllDisplayedImportResourcesSelected = hasSelectedDisplayedImportResource && !hasUnselectedDisplayedImportResource;\n $scope.areAllDisplayedImportResourcesPartialSelected = hasSelectedDisplayedImportResource && hasUnselectedDisplayedImportResource;\n };\n\n const sortResources = () => {\n if (SortingType.NAME === $scope.sortedBy) {\n $scope.resources.sort(compareByName($scope.sortAsc));\n } else if (SortingType.SIZE === $scope.sortedBy) {\n $scope.resources.sort(compareBySize($scope.sortAsc));\n } else if (SortingType.MODIFIED === $scope.sortedBy) {\n $scope.resources.sort(compareByModified($scope.sortAsc));\n } else if (SortingType.IMPORTED === $scope.sortedBy) {\n $scope.resources.sort(compareByImportedOn($scope.sortAsc));\n } else if (SortingType.CONTEXT === $scope.sortedBy) {\n $scope.resources.sort(compareByContext($scope.sortAsc));\n }\n };\n\n const compareByName = (acs) => (r1, r2) => {\n return acs ? r1.importResource.name.localeCompare(r2.importResource.name) : r2.importResource.name.localeCompare(r1.importResource.name);\n };\n\n const compareBySize = (acs) => (r1, r2) => {\n // The format of size returned by the backend has changed, but we need to keep the old format for backward compatibility.\n // Therefore, we convert the size to always be in bytes.\n const r1Size = ByteUtils.convertToBytes(r1.importResource.size);\n const r2Size = ByteUtils.convertToBytes(r2.importResource.size);\n return acs ? r1Size - r2Size : r2Size - r1Size;\n };\n\n const compareByModified = (acs) => (r1, r2) => {\n const r1ModifiedOn = r1.importResource.modifiedOn || Number.MAX_VALUE;\n const r2ModifiedOn = r2.importResource.modifiedOn || Number.MAX_VALUE;\n return acs ? r1ModifiedOn - r2ModifiedOn : r2ModifiedOn - r1ModifiedOn;\n };\n\n const compareByImportedOn = (acs) => (r1, r2) => {\n const r1ImportedOn = r1.importResource.importedOn || Number.MAX_VALUE;\n const r2ImportedOn = r2.importResource.importedOn || Number.MAX_VALUE;\n return acs ? r1ImportedOn - r2ImportedOn : r2ImportedOn - r1ImportedOn;\n };\n\n const compareByContext = (acs) => (r1, r2) => {\n return acs ? r1.importResource.context.localeCompare(r2.importResource.context) : r2.importResource.context.localeCompare(r1.importResource.context);\n };\n\n const filterByType = (resource) => {\n if (TYPE_FILTER_OPTIONS.ALL === $scope.filterByType) {\n return true;\n }\n\n if ($scope.filterByType === TYPE_FILTER_OPTIONS.FILE) {\n return resource.isFile();\n }\n\n if ($scope.filterByType === TYPE_FILTER_OPTIONS.DIRECTORY) {\n return resource.isDirectory();\n }\n\n return false;\n };\n\n const filterByName = (resource) => {\n if (!$scope.filterByFileName) {\n return true;\n }\n\n if ($scope.filterByType === TYPE_FILTER_OPTIONS.DIRECTORY) {\n return resource.hasTextInDirectoriesName($scope.filterByFileName);\n }\n\n if ($scope.filterByType === TYPE_FILTER_OPTIONS.FILE) {\n return resource.hasTextInFilesName($scope.filterByFileName);\n }\n return resource.hasTextInResourcesName($scope.filterByFileName);\n };\n\n let debounceTimeout;\n const debounce = (func, delay) => {\n // Clear previous timeout\n if (debounceTimeout) {\n $timeout.cancel(debounceTimeout);\n }\n\n // Set new timeout\n debounceTimeout = $timeout(func, delay);\n };\n\n // =========================\n // Subscription handlers\n // =========================\n\n const onResourcesUpdatedHandler = (newResources = []) => {\n const isUserImport = TABS.USER === ImportContextService.getActiveTabId();\n if ($scope.resources.isEmpty()) {\n $scope.resources = ImportResourceTreeService.toImportResourceTree(newResources, isUserImport);\n if (isUserImport) {\n $scope.sortedBy = SortingType.MODIFIED;\n }\n } else {\n ImportResourceTreeService.mergeResourceTree($scope.resources, newResources, isUserImport);\n }\n ImportResourceTreeService.calculateElementIndent($scope.resources);\n ImportResourceTreeService.setupAfterTreeInitProperties($scope.resources);\n updateListedImportResources();\n setCanResetResourcesFlag();\n };\n\n // =========================\n // Subscriptions\n // =========================\n const subscriptions = [];\n\n subscriptions.push(ImportContextService.onResourcesUpdated(onResourcesUpdatedHandler));\n subscriptions.push(ImportContextService.onShowLoaderUpdated((showLoader) => $scope.showLoader = showLoader));\n subscriptions.push(ImportContextService.onActiveTabIdUpdated(() => $scope.resources = new ImportResourceTreeElement()));\n\n const removeAllSubscribers = () => {\n subscriptions.forEach((subscription) => subscription());\n };\n\n // Deregister the watcher when the scope/directive is destroyed\n $scope.$on('$destroy', removeAllSubscribers);\n },\n };\n}\n","import {LoggerProvider} from \"../../core/services/logger-provider\";\n\nangular\n .module('graphdb.framework.impex.import.controllers.import-resource-message-dialog', [])\n .controller('ImportResourceMessageDialogController', ImportResourceMessageDialogController);\n\nImportResourceMessageDialogController.$inject = ['$scope', '$uibModalInstance', '$translate', 'toastr', 'message'];\n\nconst logger = LoggerProvider.logger;\n\nfunction ImportResourceMessageDialogController($scope, $uibModalInstance, $translate, toastr, message) {\n $scope.message = message;\n\n\n $scope.close = () => {\n $uibModalInstance.dismiss();\n };\n\n $scope.copyToClipboard = () => {\n navigator.clipboard.writeText($scope.message)\n .then(() => {\n toastr.success($translate.instant('import.help.messages.copied_to_clipboard'));\n $scope.close();\n }, (err) => {\n logger.error('Could not copy text: ', err);\n });\n };\n}\n"],"names":["importResourceStatusInfoDirective","$rootScope","$document","restrict","templateUrl","scope","resource","link","$scope","subscribers","popoverTemplate","popoverIsOpen","context","importResource","replaceGraphs","baseUrl","decodeURIComponent","baseURI","forceSerial","importedOn","parserSettings","open","closeAllDialogs","$broadcast","close","handleEscapeKeyPress","event","key","$apply","push","$on","on","off","forEach","subscriber","angular","module","directive","$inject","importResourceMessageDirective","$uibModal","ImportResourceStatus","toTitleCase","str","stringUtils","showMessage","resourceTreeElement","controller","size","windowClass","backdrop","resolve","message","validateUri","UriUtils","require","element","attr","ctrl","$parsers","unshift","value","$setValidity","$isEmpty","valid","isValidIri","toString","ImportProgressIndicator","$watch","file","status","$","has","length","append","TYPE_FILTER_OPTIONS","STATUS_OPTIONS","importResourceTreeDirective","$timeout","ImportContextService","columnKeys","showTypeFilter","sortBy","asc","onImport","onImportAll","onReset","onRemove","onStopImport","onEditResource","attrs","resources","ImportResourceTreeElement","displayResources","filterByType","ALL","filterByFileName","selectedByStatus","undefined","areAllDisplayedImportResourcesSelected","areAllDisplayedImportResourcesPartialSelected","canRemoveResource","isDefined","canResetSelectedResources","SORTING_TYPES","SortingType","sortAsc","sortedBy","showLoader","getShowLoader","hasSelection","selectionChanged","setSelection","selected","updateSelectByStateDropdownModel","setCanResetResourcesFlag","updateHasSelection","selectResourceWithStatus","resourceStatus","IMPORTED","selectAllWithStatus","DONE","NOT_IMPORTED","IMPORTING","NONE","ERROR","PENDING","INTERRUPTING","updateListedImportResources","filterByTypeChanged","newType","filterByFileNameChanged","debounce","onResetStatus","resourcesNames","getAllSelected","map","path","resetStatus","onRemoveResources","selectedResources","removeResource","importAll","withoutChangingSettings","getAllSelectedForImport","stopImport","sort","editResource","getSelectedImportedResources","getRoot","updateSelectionState","sortResources","toList","filter","filterByName","allSelectedFilesNames","getAllSelectedFilesNames","updateSelectedFilesNames","hasUnselectedDisplayedImportResource","some","hasSelectedDisplayedImportResource","NAME","compareByName","SIZE","compareBySize","MODIFIED","compareByModified","compareByImportedOn","CONTEXT","compareByContext","acs","r1","r2","name","localeCompare","r1Size","ByteUtils","convertToBytes","r2Size","r1ModifiedOn","modifiedOn","Number","MAX_VALUE","r2ModifiedOn","r1ImportedOn","r2ImportedOn","FILE","isFile","DIRECTORY","isDirectory","hasTextInDirectoriesName","hasTextInFilesName","hasTextInResourcesName","debounceTimeout","func","delay","cancel","subscriptions","onResourcesUpdated","onResourcesUpdatedHandler","newResources","isUserImport","TABS","USER","getActiveTabId","isEmpty","ImportResourceTreeService","toImportResourceTree","mergeResourceTree","calculateElementIndent","setupAfterTreeInitProperties","onShowLoaderUpdated","onActiveTabIdUpdated","removeAllSubscribers","subscription","ImportResourceMessageDialogController","logger","LoggerProvider","$uibModalInstance","$translate","toastr","dismiss","copyToClipboard","navigator","clipboard","writeText","then","success","instant","err","error"],"ignoreList":[],"sourceRoot":""}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
export const __webpack_esm_id__=99448;export const __webpack_esm_ids__=[99448];export const __webpack_esm_modules__={64088(e,t,n){n.d(t,{A:()=>r});var a=a||{};a.SingleChild={addPlaceholders:function e(t,n){if(t.children){for(var a=0;a<t.children.length;a++)e(t.children[a]);if(1===t.children.length){var r=1.2*t.size;n&&(r=.1*t.children[0].size),t.children.push({name:"placeholder",size:r})}}},removePlaceholders:function e(t){for(var n=t.length-1;n>=0;n--){var a=t[n];"placeholder"===a.data.name?t.splice(n,1):a.children&&e(a.children)}},centerNodes:function(e){for(var t=0;t<e.length;t++){var n=e[t];if(n.children&&1===n.children.length){var a=n.x-n.children[0].x;n.children[0].x+=a,r(n.children[0],a)}}function r(e,t){if(e.children)for(var n=0;n<e.children.length;n++)e.children[n].x+=t,r(e.children[n],t)}},makePositionsRelativeToZero:function(e){for(var t=e[0].x,n=e[0].y,a=0;a<e.length;a++){var r=e[a];r.x-=t,r.y-=n}}};const r=a},88141(e,t,n){n.d(t,{A:()=>i}),n(62979);const a={selectAll:n(93462).selectAll};var r=r||{};r.Export={getCSSRules:function(e){const t=$('link[href="'+e+'"]')[0].sheet.rules;let n="";return _.each(t,function(e){n+=e.cssText}),n},generateBase64ImageSource:function(e){e||(e="svg");const t=a.selectAll(e).attr("version","1.1").attr("xmlns","http://www.w3.org/2000/svg").node().parentNode.innerHTML;return"data:image/svg+xml;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(t)))}};const i=r},99448(e,t,n){var a=n(75468),r=n(64088),i=n(19935),s=n(93462),c=n(88141),o=(n(32150),n(57154));function l(e,t,n,l,d,h,u,f,p,g,x,m){return{restrict:"AE",template:'<div id="classChart"></div>',scope:{classHierarchyData:"=",flattenedClassNames:"=",selectedClass:"=",currentSliderValue:"=",showClassInfoPanel:"=",showExternalElements:"=",hidePrefixes:"=",currentBrowserLimit:"="},link:function(y,A,v){!function(y){let A=!1;let v,S;const C=s.pack().size([780,780]),R=s.scaleLinear().domain([0,4]).range(["hsl(19, 70%, 90%)","hsl(19, 70%, 50%)"]).interpolate(s.interpolateHcl),E=s.select("#classChart").insert("svg:svg","h2").attr("viewBox","0 0 800 800").attr("preserveAspectRatio","xMidYMid meet").on("dblclick.zoom",null);function P(){return E.append("svg:g").attrs({id:"main-group",transform:"translate(400,400)"})}function w(){return"true"===g.get(x.CLASS_HIERARCHY_HIDE_PREFIXES)}function H(){const e=c.A.Export.getCSSRules("css/rdf-class-hierarchy-labels.css?v=3.3.2-RC3");s.selectAll("#main-group").append("defs"),$("defs").append('<style type="text/css"><![CDATA['+e+"]]></style>"),s.selectAll("g").style("opacity",1);const t=c.A.Export.generateBase64ImageSource("#classChart svg");s.select(this).attrs({href:t,download:"class-hierarchy-"+h.getActiveRepository()+".svg"})}y.hidePrefixes=w();let I=P();const T=!!y.classHierarchyData?.classCount,L=h.getActiveRepository()&&!h.isSystemRepository();let D,k,N,b,F;(0,o.service)(o.LicenseContextService).onLicenseChanged(t=>{t?.valid&&!T&&L&&function(){e.loader=!0,e.hierarchyError=!1;const t=g.get(`classHierarchy-selectedGraph-${h.getActiveRepository()}`);n.getClassHierarchyData(null!==t?t.contextID.uri:"").success(function(t,n){e.loader=!1,207===n&&u.warning(m.instant("graphexplore.update.diagram"),m.instant("graphexplore.repository.data.changed")),y.classHierarchyData=t,s.select("#download-svg").on("mouseover",H)}).error(function(t){e.loader=!1,e.hierarchyError=getError(t),u.error(m.instant("graphexplore.error.request.failed",{name:p,error:getError(t)}))})}()});const z={};function O(n,c,o,h){b&&b(),F&&F(),s.selectAll("#main-group").remove(),I=P(),r.A.SingleChild.addPlaceholders(n,!0),S=s.hierarchy(n),S.sum(function(e){return e.size}),N=o||S,C(S);const u=S.descendants();let g;N.isInFocusTransitive=!0,r.A.SingleChild.removePlaceholders(u),r.A.SingleChild.centerNodes(u),r.A.SingleChild.makePositionsRelativeToZero(u),v||(v=(0,a.A)().attr("class","d3-tip").customPosition(function(e,t){return{top:"inherit",bottom:l.innerHeight-t.clientY+"px",right:l.innerWidth-t.clientX+"px"}}).html(function(e){return e.data.name}),E.call(v));const x=I.selectAll("circle").data(u).enter().append("g");c.doFade&&x.each(function(e){i.A.Transition.fadeIn(s.select(this),550)});let m=[];const w=x.append("circle").attr("class",function(e){return e.data.role}).attr("data-test",function(e){return"class-"+e.data.name}).attr("guide-selector",function(e){return"class-"+e.data.name}).style("fill",function(e){return e.children?R(e.depth):"#E0D0D0"}).each(function(e){if(e.circle=s.select(this),e.data.name!==p){const t=e.data.name;m.push({name:t}),z[[t]]=e,e.circle.classed("rdf-class",!0),e.circle.on("mouseover",function(t){c.noPrefixes||e.textHidden?v.show(e,t):v.hide(e)}),e.circle.on("mouseout",v.hide)}}).on("gdb-focus",(e,t)=>k(t)).on("gdb-zoom",(e,t)=>Z(t));let H;function T(e){s.selectAll(".selected").classed("selected",e.selected=!1),e.circle.classed("selected",e.selected=!0),H=e}function L(){y.showClassInfoPanel=!1}m&&(m=_.uniqBy(m,"name"),y.flattenedClassNames=m);const $=i.A.Click.delayDblClick();s.selectAll(".parent, .topLevelParent, .child, .root").call($),k=function(e){Z(e),e.data.name===p?(L(),s.selectAll(".selected").classed("selected",!1)):(T(e),A||(y.selectedClass=H,y.showClassInfoPanel=!0),y.$on("sidePanelClosed",function(t){s.selectAll(".selected").classed("selected",e.selected=!1)}))},$.on("click",function(e,t){t.data.id&&l.history.pushState({id:t.data.id},"classHierarchyPage"+t.data.id,"hierarchy#"+t.data.id),v.hide(),k(t)}),$.on("dblclick",function(t,a){a!==n&&(v.hide(),T(a),e.$broadcast("goToDomainRangeGraphView",H,N),t.stopPropagation())});let O=0;E.on("wheel",function(e){v.hide(),e.preventDefault(),e.stopPropagation();const t=Date.now();if(!(t-O>100))return;O=t;let n="";e.deltaY<=-1?n="in":e.deltaY>=1&&(n="out");let a=e.target.__data__;if(a||(a=N),"in"===n){if(a!==N){for(;a.parent&&!a.parent.isInFocusTransitive;)a=a.parent;a.depth<N.depth&&(a=N)}if(a===N&&a.children){let e=a.children[0];for(let t=1;t<a.children.length;t++)a.children[t].sortingRank>e.sortingRank&&(e=a.children[t]);e.children&&(a=e)}else a.children||(a=a.parent);Z(a,!0)}else"out"===n&&(a=N.parent,a&&Z(a,!0));N.data.name===p&&l.history.replaceState({id:1},"classHierarchyPage1","hierarchy#1"),U()});const Y=I.selectAll("text").data(u).enter().append("text").attr("class",function(e){return e.children&&e.children.length?"label":"label child-label"}).each(function(e){e.textSel=s.select(this)});c.noPrefixes?(Y.each(function(e){const t=e.data.name.indexOf(":");e.data.name.indexOf("http://")>-1?e.noPrefixName=e.data.name:t>-1&&(e.noPrefixName=e.data.name.substring(t+1))}),Y.style("font-size",function(e){return i.A.Text.calcFontSize(e.noPrefixName,e.r)}).text(function(e){return i.A.Text.getTextWithElipsisIfNeeded(e.noPrefixName,e.r/3)})):Y.style("font-size",function(e){return i.A.Text.calcFontSize(e.data.name,e.r)}).text(function(e){return i.A.Text.getTextWithElipsisIfNeeded(e.data.name,e.r/3)}),Y.style("display",function(e){return e.parent&&e.parent.data===N.data?(e.textHidden=this.textContent.indexOf("...")+3===this.textContent.length,null):(e.textHidden=!0,"none")}),c.doFade&&!c.keepPrevState&&Y.each(function(e){i.A.Transition.fadeIn(s.select(this),550)}),D=function(){function e(e){e&&w.each(function(t){+e===t.data.id&&k(t)})}const n=t.hash();l.onpopstate=function(t){t.state&&e(t.state.id)},e(n)};const B=I.selectAll("circle, text");function V(e,t){const n=800/e[2];g=e,B.attr("transform",function(t){return"translate("+(t.x-e[0])*n+","+(t.y-e[1])*n+")"}),w.attr("r",function(e){return e.r*n}),t&&Y.each(function(e){e.data.fullName!==N.data.topLevelParentUri&&N.data.topLevelParentUri!==p||(e.textSel.style("display","none"),N.children&&N.children.length?_.each(N.children,function(e){e.textSel.style("display","inline")}):N.textSel.style("display","inline"),N.parent&&_.each(N.parent.children,function(e){e.data.name!==N.data.name&&e.textSel.style("display","inline")}))}),Y.style("font-size",function(e){return c.noPrefixes?i.A.Text.calcFontSize(e.noPrefixName,e.r*n):i.A.Text.calcFontSize(e.data.name,e.r*n)}).text(function(e){return c.noPrefixes?i.A.Text.getTextWithElipsisIfNeeded(e.noPrefixName,e.r*n/3):i.A.Text.getTextWithElipsisIfNeeded(e.data.name,e.r*n/3)})}function M(e){let t=2*e+20;return 2*e/t<.3&&(t=2*e+2),t}function W(e){!e.isInFocusTransitive&&e.parent&&e.parent.isInFocusTransitive?(e.textHidden=this.textContent.indexOf("...")+3===this.textContent.length,this.style.display=""):(e.textHidden=!0,this.style.display="none")}function Z(e,t){if(d(function(){y.showExternalElements=e.data.name===p}),N===e)return;if(e.data.id&&l.history.replaceState({id:e.data.id},"classHierarchyPage"+e.data.id,"hierarchy#"+e.data.id),!e.children&&(e=e.parent,N===e))return;if(t&&(L(),s.selectAll(".selected").classed("selected",!1)),N.parent){let e=N;for(;e;)e.isInFocusTransitive=!1,e=e.parent}let n=e;for(;n;)n.isInFocusTransitive=!!n.children,n=n.parent;N=e,2*N.r/(2*N.r+20)<.3||y.currentSliderValue>y.currentBrowserLimit?(V([N.x,N.y,M(N.r)]),Y.each(function(e){W.call(this,e)})):s.transition().duration(f).tween("zoom",function(e){const t=s.interpolateZoom(g,[N.x,N.y,M(N.r)]);return function(e){V(t(e))}}).selectAll("text").each(W)}V([N.x,N.y,M(N.r)],h),b=y.$on("rootFocus",function(){l.history.pushState({id:1},"classHierarchyPage1","hierarchy#1"),k(S)}),F=y.$on("classSearch",function(e){k(e)})}function U(){const t=y.classHierarchyData.classCount;let n=g.get(x.CLASS_HIERARCHY_CURRENT_SLIDER_VALUE);(!n||n>t)&&(n=t,g.set(x.CLASS_HIERARCHY_CURRENT_SLIDER_VALUE,n)),e.$broadcast("classCount",t,n)}let Y,B,V,M;window.addEventListener("resize",U),window.addEventListener("beforeunload",function e(){window.removeEventListener("resize",U),window.removeEventListener("beforeunload",e)}),y.$watch("classHierarchyData",function(){Y&&Y(),B&&B(),V&&V(),M&&M();let e=w();if(y.classHierarchyData.classCount){U();const t=structuredClone(y.classHierarchyData);const n=s.hierarchy(t).descendants().sort(function(e,t){return e.data.sortingRank>t.data.sortingRank?-1:e.data.sortingRank<t.data.sortingRank||e.data.depth>t.data.depth?1:e.data.depth<t.data.depth?-1:0});let a,r;function i(e,t){const n={keepPrevState:!0,noPrefixes:w()};r=n.noPrefixes,O(a||e,n,N,!0),d(()=>{g.set(x.CLASS_HIERARCHY_SWITCH_PREFIXES,t),D(),A=!1},70)}function c(e,n,s){if(!e)return;g.set(x.CLASS_HIERARCHY_CURRENT_SLIDER_VALUE,e),a={name:p,children:[]};const c=new Set;for(let t=1;t<=e;t++)c.add(n[t].data.id),n[t].parent===n[0]&&a.children.push(n[t].data);(function e(t){if(!t.children)return;const n=[];for(const e of t.children)c.has(e.id)&&n.push($.extend({},e));t.children=n;for(const n of t.children)e(n)})(a),s?(r=angular.isUndefined(r)?w():r,O(a,{noPrefixes:r})):i(t)}const o=g.get(x.CLASS_HIERARCHY_CURRENT_SLIDER_VALUE);if(o)c(o,n);else{const h={doFade:!0,keepPrevState:!0,noPrefixes:w()};O(t,h),D()}let l;Y=y.$watch("hidePrefixes",function(n){angular.isUndefined(n)||e?e=void 0:d(function(){A=!0,function(e){angular.isUndefined(e)||g.set(x.CLASS_HIERARCHY_HIDE_PREFIXES,e)}(n),i(t,!0)},50)},!0),B=y.$watch("currentSliderValue",function(e){c(e,n,!0)},!0),M=y.$on("onEnterKeypressSearchAction",function(e){l&&k(l)}),V=y.$on("searchedClass",function(e,t){l=z[t.name],l&&k(l)})}},!0)}(y)}}}angular.module("graphdb.framework.graphexplore.directives.class",["graphdb.framework.graphexplore.controllers.class","graphdb.framework.utils.localstorageadapter"]).constant("ZOOM_DURATION",500).constant("ROOT_OBJ_NAME","RDF Class Hierarchy").directive("rdfClassHierarchy",l),l.$inject=["$rootScope","$location","GraphDataRestService","$window","$timeout","$repositories","toastr","ZOOM_DURATION","ROOT_OBJ_NAME","LocalStorageAdapter","LSKeys","$translate"]}};
|
|
2
|
-
//# sourceMappingURL=99448.7b61cd00c13a1c47843a.bundle.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"99448.7b61cd00c13a1c47843a.bundle.js","mappings":"mJAAA,IAAIA,EAAgBA,GAAiB,CAAC,EAEtCA,EAAcC,YA4EH,CACHC,gBAxEJ,SAASA,EAAgBC,EAAMC,GAC3B,GAAID,EAAKE,SAAU,CACf,IAAK,IAAIC,E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EHT,EAAyBzK,EAAMgL,OAAO,qBAAsB,SAAS5K,GACjE0L,EAAsB1L,EAAoBgL,GAAgB,EAC9D,GAAG,GAMHT,EAA8B3K,EAAMmH,IAAI,8BAA+B,SAASlC,GACxE2H,GACAhK,EAAQgK,EAEhB,GAEAlC,EAAyB1K,EAAMmH,IAAI,gBAAiB,SAASlC,EAAO8H,GAChEH,EAAuBzI,EAAmB4I,EAAcnQ,MACpDgQ,GACAhK,EAAQgK,EAEhB,EACJ,CACJ,GAAG,EACP,CA9zBII,CAAoBhN,EACxB,EA8zBJ,CA51BAyM,QACKQ,OAAO,kDAAmD,CACvD,mDACA,gDAEHC,SAAS,gBAAiB,KAC1BA,SAAS,gBAAiB,uBAC1BC,UAAU,oBAAqBlO,GAEpCA,EAAwBmO,QAAU,CAAC,aAAc,YAAa,uBAAwB,UAAW,WAAY,gBAAiB,SAAU,gBAAiB,gBAAiB,sBAAuB,SAAU,a","sources":["webpack://root-config/./packages/legacy-workbench/src/js/lib/common/circle-packing.js","webpack://root-config/./packages/legacy-workbench/src/js/lib/common/svg-export.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/graphexplore/directives/rdf-class-hierarchy.directive.js"],"sourcesContent":["var CirclePacking = CirclePacking || {};\n\nCirclePacking.SingleChild = function () {\n /*\n Functions that enable single child circles to display properly, see\n http://stackoverflow.com/questions/22307486/d3-js-packed-circle-layout-how-to-adjust-child-radius\n */\n function addPlaceholders(node, first) {\n if (node.children) {\n for (var i = 0; i < node.children.length; i++) {\n var child = node.children[i];\n addPlaceholders(child);\n }\n\n if (node.children.length === 1) {\n var placeholderSize = node.size * 1.2;\n if (first) {\n placeholderSize = node.children[0].size * 0.1;\n }\n node.children.push({\n name: 'placeholder', size: placeholderSize,\n // children: []\n });\n }\n }\n }\n\n function removePlaceholders(nodes) {\n for (var i = nodes.length - 1; i >= 0; i--) {\n var node = nodes[i];\n\n if (node.data.name === 'placeholder') {\n nodes.splice(i, 1);\n } else {\n if (node.children) {\n removePlaceholders(node.children);\n }\n }\n }\n }\n\n function centerNodes(nodes) {\n for (var i = 0; i < nodes.length; i++) {\n var node = nodes[i];\n\n if (node.children) {\n if (node.children.length === 1) {\n var offset = node.x - node.children[0].x;\n node.children[0].x += offset;\n reposition(node.children[0], offset);\n }\n }\n }\n\n function reposition(node, offset) {\n if (node.children) {\n for (var i = 0; i < node.children.length; i++) {\n node.children[i].x += offset;\n reposition(node.children[i], offset);\n }\n }\n }\n }\n\n function makePositionsRelativeToZero(nodes) {\n //use this to have vis centered at 0,0,0 (easier for positioning)\n var offsetX = nodes[0].x;\n var offsetY = nodes[0].y;\n\n for (var i = 0; i < nodes.length; i++) {\n\n var node = nodes[i];\n\n node.x -= offsetX;\n node.y -= offsetY;\n }\n }\n\n return {\n addPlaceholders: addPlaceholders,\n removePlaceholders: removePlaceholders,\n centerNodes: centerNodes,\n makePositionsRelativeToZero: makePositionsRelativeToZero\n }\n}();\n\nexport default CirclePacking;\n","import 'lib/d3.patch.js'\nimport {selectAll} from 'd3';\n\nconst d3 = {selectAll};\nvar SVG = SVG || {};\n\nSVG.Export = function () {\n function getCSSRules(cssSourceFilePath) {\n const cssRules = $('link[href=\"' + cssSourceFilePath + '\"]')[0].sheet.rules;\n let cssStr = \"\";\n _.each(cssRules, function (value) {\n cssStr += value.cssText;\n });\n return cssStr;\n }\n\n function generateBase64ImageSource(svgSelectorClass) {\n if (!svgSelectorClass) {\n svgSelectorClass = \"svg\";\n }\n // add needed xml namespace\n const exportSvg = d3.selectAll(svgSelectorClass)\n .attr(\"version\", \"1.1\")\n .attr(\"xmlns\", \"http://www.w3.org/2000/svg\")\n .node().parentNode.innerHTML;\n\n // convert selected html to base64\n return \"data:image/svg+xml;charset=utf-8;base64,\" + btoa(unescape(encodeURIComponent(exportSvg)));\n }\n\n return {\n getCSSRules: getCSSRules,\n generateBase64ImageSource: generateBase64ImageSource\n };\n}();\n\nexport default SVG;\n","/* eslint-disable no-invalid-this */\nimport d3tip from 'lib/d3-tip/d3-tip-patch';\nimport CirclePacking from 'lib/common/circle-packing';\nimport D3 from 'lib/common/d3-utils';\nimport * as d3 from 'd3';\nimport SVG from 'lib/common/svg-export';\nimport 'angular/utils/local-storage-adapter';\nimport {service, LicenseContextService} from '@ontotext/workbench-api';\n\nangular\n .module('graphdb.framework.graphexplore.directives.class', [\n 'graphdb.framework.graphexplore.controllers.class',\n 'graphdb.framework.utils.localstorageadapter',\n ])\n .constant(\"ZOOM_DURATION\", 500)\n .constant(\"ROOT_OBJ_NAME\", \"RDF Class Hierarchy\")\n .directive('rdfClassHierarchy', classHierarchyDirective);\n\nclassHierarchyDirective.$inject = ['$rootScope', '$location', 'GraphDataRestService', '$window', '$timeout', '$repositories', 'toastr', 'ZOOM_DURATION', 'ROOT_OBJ_NAME', 'LocalStorageAdapter', 'LSKeys', '$translate'];\n\nfunction classHierarchyDirective($rootScope, $location, GraphDataRestService, $window, $timeout, $repositories, toastr, ZOOM_DURATION, ROOT_OBJ_NAME, LocalStorageAdapter, LSKeys, $translate) {\n return {\n restrict: 'AE',\n template: '<div id=\"classChart\"></div>',\n scope: {\n classHierarchyData: '=',\n flattenedClassNames: '=',\n selectedClass: '=',\n currentSliderValue: '=',\n showClassInfoPanel: '=',\n showExternalElements: '=',\n hidePrefixes: '=',\n currentBrowserLimit: '=',\n },\n link: linkFunc,\n };\n\n function linkFunc(scope, element, attrs) {\n renderCirclePacking(scope, element);\n }\n\n function renderCirclePacking(scope, element) {\n /**\n * A boolean flag that determines whether the opening of the side info panel\n * should be suppressed when focusing on the chart while a class is selected.\n */\n let suppressPanelOpen = false;\n\n const width = 800;\n const height = 800;\n const diameter = height;\n const margin = 20;\n let tip;\n let rootHierarchy;\n\n const packLayout = d3.pack()\n .size([diameter - margin, diameter - margin]);\n\n const color = d3.scaleLinear()\n .domain([0, 4])\n .range([\"hsl(19, 70%, 90%)\", \"hsl(19, 70%, 50%)\"])\n .interpolate(d3.interpolateHcl);\n\n const svg = d3.select(\"#classChart\")\n .insert(\"svg:svg\", \"h2\")\n .attr(\"viewBox\", \"0 0 \" + width + \" \" + height)\n .attr(\"preserveAspectRatio\", \"xMidYMid meet\")\n .on(\"dblclick.zoom\", null);\n\n function appendMainGroup() {\n return svg.append(\"svg:g\")\n .attrs({\n id: \"main-group\",\n transform: \"translate(\" + width / 2 + \",\" + height / 2 + \")\",\n });\n }\n\n function savePrefixesState(hidePrefixes) {\n if (!angular.isUndefined(hidePrefixes)) {\n LocalStorageAdapter.set(LSKeys.CLASS_HIERARCHY_HIDE_PREFIXES, hidePrefixes);\n }\n }\n\n function getPrefixesState() {\n return LocalStorageAdapter.get(LSKeys.CLASS_HIERARCHY_HIDE_PREFIXES) === \"true\";\n }\n\n /*\n * Prepares SVG document image export by adding xml namespaces and\n * additional style information\n */\n function prepareForSVGImageExport() {\n // get css rules for the diagram\n const cssRules = SVG.Export.getCSSRules(\"css/rdf-class-hierarchy-labels.css?v=3.3.2-RC3\");\n // inline css rules in a defs tag\n d3.selectAll(\"#main-group\")\n .append(\"defs\");\n $(\"defs\").append('<style type=\"text/css\"><![CDATA[' + cssRules + ']]></style>');\n\n // switch opacity to visible\n d3.selectAll(\"g\")\n .style(\"opacity\", 1);\n\n // convert selected html to base64\n const imgSrc = SVG.Export.generateBase64ImageSource(\"#classChart svg\");\n\n // set the binary image and a name for the downloadable file on the export button\n d3.select(this).attrs({\n href: imgSrc,\n download: \"class-hierarchy-\" + $repositories.getActiveRepository() + \".svg\",\n });\n }\n\n scope.hidePrefixes = getPrefixesState();\n\n let g = appendMainGroup();\n\n function fetchClassHierarchy() {\n $rootScope.loader = true;\n $rootScope.hierarchyError = false;\n const selGraphFromCache = LocalStorageAdapter.get(`classHierarchy-selectedGraph-${$repositories.getActiveRepository()}`);\n GraphDataRestService.getClassHierarchyData(selGraphFromCache !== null ? selGraphFromCache.contextID.uri : \"\")\n .success(function(response, status) {\n $rootScope.loader = false;\n if (status === 207) {\n toastr.warning(\n $translate.instant('graphexplore.update.diagram'),\n $translate.instant('graphexplore.repository.data.changed'),\n );\n }\n scope.classHierarchyData = response;\n d3.select(\"#download-svg\").on(\"mouseover\", prepareForSVGImageExport);\n })\n .error(function(response) {\n $rootScope.loader = false;\n $rootScope.hierarchyError = getError(response);\n toastr.error(\n $translate.instant('graphexplore.error.request.failed', {\n name: ROOT_OBJ_NAME,\n error: getError(response),\n }),\n );\n });\n }\n\n const hasData = !!scope.classHierarchyData?.classCount;\n const canUseRepo = $repositories.getActiveRepository() && !$repositories.isSystemRepository();\n\n service(LicenseContextService).onLicenseChanged((license) => {\n if (license?.valid && !hasData && canUseRepo) {\n fetchClassHierarchy();\n }\n });\n\n let autoZoomToPreviousState;\n let doFocus;\n\n let focus;\n let rootFocusEvent;\n let classSearchEvent;\n const flattenedClassData = {};\n\n function drawDiagram(root, config, newFocus, switchPrefixes) {\n if (rootFocusEvent) rootFocusEvent();\n if (classSearchEvent) classSearchEvent();\n // remove old group tag containing the diagram\n d3.selectAll(\"#main-group\").remove();\n\n // append new empty group tag in order to rerender new diagram\n g = appendMainGroup();\n\n // fix for single child classes\n CirclePacking.SingleChild.addPlaceholders(root, true);\n\n rootHierarchy = d3.hierarchy(root);\n rootHierarchy.sum(function(d) {\n return d.size;\n });\n focus = newFocus ? newFocus : rootHierarchy;\n\n packLayout(rootHierarchy);\n\n const nodes = rootHierarchy.descendants();\n let view;\n\n focus.isInFocusTransitive = true;\n\n // fixes for single child classes\n CirclePacking.SingleChild.removePlaceholders(nodes);\n CirclePacking.SingleChild.centerNodes(nodes);\n CirclePacking.SingleChild.makePositionsRelativeToZero(nodes);\n\n if (!tip) {\n tip = d3tip()\n .attr('class', 'd3-tip')\n .customPosition(function(d, event) {\n return {\n top: 'inherit',\n bottom: ($window.innerHeight - event.clientY) + 'px',\n right: ($window.innerWidth - event.clientX) + 'px',\n };\n })\n .html(function(d) {\n return d.data.name;\n });\n svg.call(tip);\n }\n\n const circleGroup = g.selectAll(\"circle\")\n .data(nodes)\n .enter().append(\"g\");\n\n if (config.doFade) {\n circleGroup.each(function(d) {\n D3.Transition.fadeIn(d3.select(this), 550);\n });\n }\n\n let flattenedClassNames = [];\n\n const circle = circleGroup\n .append(\"circle\")\n .attr(\"class\", function(d) {\n return d.data.role;\n })\n .attr(\"data-test\", function(d) {\n return \"class-\" + d.data.name;\n })\n .attr(\"guide-selector\", function(d) {\n return \"class-\" + d.data.name;\n })\n .style(\"fill\", function(d) {\n //return colors[d.depth % 6];\n return d.children ? color(d.depth) : \"#E0D0D0\";\n })\n .each(function(d) {\n d.circle = d3.select(this);\n if (d.data.name !== ROOT_OBJ_NAME) {\n const key = d.data.name;\n flattenedClassNames.push({name: key});\n flattenedClassData[[key]] = d;\n\n d.circle.classed(\"rdf-class\", true);\n d.circle.on('mouseover', function(event) {\n if (config.noPrefixes) {\n tip.show(d, event);\n } else if (!d.textHidden) {\n tip.hide(d);\n } else {\n tip.show(d, event);\n }\n });\n d.circle.on('mouseout', tip.hide);\n }\n })\n // custom event used when user is following a guide\n .on(\"gdb-focus\", (event, d) => doFocus(d))\n .on(\"gdb-zoom\", (event, d) => zoom(d));\n\n\n if (flattenedClassNames) {\n flattenedClassNames = _.uniqBy(flattenedClassNames, 'name');\n scope.flattenedClassNames = flattenedClassNames;\n }\n\n let selectedClass;\n\n function getCurrentClassDataAndMarkSelected(obj) {\n d3.selectAll(\".selected\").classed(\"selected\", obj.selected = false);\n obj.circle.classed(\"selected\", obj.selected = true);\n selectedClass = obj;\n }\n\n function showClassInfoPanel() {\n scope.selectedClass = selectedClass;\n scope.showClassInfoPanel = true;\n }\n\n function closeClassInfoPanel() {\n scope.showClassInfoPanel = false;\n }\n\n function goToDomainRangeGraphView() {\n $rootScope.$broadcast('goToDomainRangeGraphView', selectedClass, focus);\n }\n\n const clickCancel = D3.Click.delayDblClick();\n d3.selectAll(\".parent, .topLevelParent, .child, .root\")\n .call(clickCancel);\n\n doFocus = function(obj) {\n zoom(obj);\n\n if (obj.data.name === ROOT_OBJ_NAME) {\n closeClassInfoPanel();\n d3.selectAll(\".selected\").classed(\"selected\", false);\n } else {\n getCurrentClassDataAndMarkSelected(obj);\n if (!suppressPanelOpen) {\n showClassInfoPanel();\n }\n\n // FIXME: is it ok to bind this event handler every time and not just once?\n scope.$on('sidePanelClosed', function(event) {\n d3.selectAll(\".selected\").classed(\"selected\", obj.selected = false);\n });\n }\n\n\n //do not stop event propagation here\n };\n\n clickCancel.on(\"click\", function(event, obj) {\n // add clicked class to browser history\n if (obj.data.id) {\n $window.history.pushState({id: obj.data.id}, \"classHierarchyPage\" + obj.data.id, \"hierarchy#\" + obj.data.id);\n }\n\n //hide current d3-tip tooltip\n tip.hide();\n\n doFocus(obj);\n });\n\n clickCancel.on(\"dblclick\", function(event, obj) {\n if (obj === root) {\n return;\n }\n // hide current d3-tip tooltip in order not to appear in the next view\n tip.hide();\n getCurrentClassDataAndMarkSelected(obj);\n goToDomainRangeGraphView();\n\n event.stopPropagation();\n });\n\n let lastTimeWheel = 0;\n svg.on('wheel', function(event) {\n // hide current d3-tip tooltip\n tip.hide();\n\n event.preventDefault();\n event.stopPropagation();\n\n // at least 100ms must have passed since last time we updated\n const now = Date.now();\n if (now - lastTimeWheel > 100) {\n lastTimeWheel = now;\n } else {\n return;\n }\n\n let direction = '';\n if (event.deltaY <= -1) {\n direction = 'in';\n } else if (event.deltaY >= 1) {\n direction = 'out';\n }\n\n let obj = event.target.__data__;\n\n if (!obj) {\n // scroll outside the big circle\n obj = focus;\n }\n\n if (direction === 'in') {\n // determine object to zoom to\n\n if (obj !== focus) {\n // consider the object on which the scroll event occurred\n // and find the furthest parent that has no focused children\n while (obj.parent && !obj.parent.isInFocusTransitive) {\n obj = obj.parent;\n }\n if (obj.depth < focus.depth) {\n // however if that parent is of lower depth than the focus we ignore it\n obj = focus;\n }\n }\n\n if (obj === focus && obj.children) {\n // if object is in focus and it has children we zoom to its biggest child\n // TODO: sort children on backend\n let newobj = obj.children[0];\n for (let i = 1; i < obj.children.length; i++) {\n if (obj.children[i].sortingRank > newobj.sortingRank) {\n newobj = obj.children[i];\n }\n }\n if (newobj.children) {\n // Use the child only if it has children\n obj = newobj;\n }\n } else if (!obj.children) {\n // If node has no children use its parent instead\n obj = obj.parent;\n }\n\n zoom(obj, true);\n } else if (direction === 'out') {\n // zooming out simply goes one parent up\n obj = focus.parent;\n if (obj) {\n zoom(obj, true);\n }\n }\n\n if (focus.data.name === ROOT_OBJ_NAME) {\n $window.history.replaceState({id: 1}, \"classHierarchyPage1\", \"hierarchy#1\");\n }\n\n // redraw slider on zoom out\n sendSliderData();\n });\n\n const text = g.selectAll(\"text\")\n .data(nodes)\n .enter().append(\"text\")\n .attr(\"class\", function(d) {\n return d.children && d.children.length ? \"label\" : \"label child-label\";\n })\n .each(function(d) {\n d.textSel = d3.select(this);\n });\n\n function trimPrefixes(d) {\n const idx = d.data.name.indexOf(\":\");\n const absUriIdx = d.data.name.indexOf(\"http://\");\n if (absUriIdx > -1) {\n // if we have no prefix available ignore\n d.noPrefixName = d.data.name;\n } else if (idx > -1) {\n d.noPrefixName = d.data.name.substring(idx + 1);\n }\n }\n\n if (config.noPrefixes) {\n text.each(trimPrefixes);\n text\n .style(\"font-size\", function(d) {\n return D3.Text.calcFontSize(d.noPrefixName, d.r);\n })\n .text(function(d) {\n return D3.Text.getTextWithElipsisIfNeeded(d.noPrefixName, d.r / 3);\n });\n } else {\n text\n .style(\"font-size\", function(d) {\n return D3.Text.calcFontSize(d.data.name, d.r);\n })\n .text(function(d) {\n return D3.Text.getTextWithElipsisIfNeeded(d.data.name, d.r / 3);\n });\n }\n\n // TODO: make this use the full version (same as zoom)\n text.style(\"display\", function(d) {\n if (d.parent && d.parent.data === focus.data) {\n d.textHidden = this.textContent.indexOf(\"...\") + 3 === this.textContent.length;\n return null;\n } else {\n d.textHidden = true;\n return \"none\";\n }\n });\n\n if (config.doFade && !config.keepPrevState) {\n text.each(function(d) {\n D3.Transition.fadeIn(d3.select(this), 550);\n });\n }\n\n autoZoomToPreviousState = function() {\n function focusOnCurrentClass(focusHistoryId) {\n if (focusHistoryId) {\n circle.each(function(d) {\n if (+focusHistoryId === d.data.id) {\n doFocus(d);\n }\n });\n }\n }\n\n const focusHistoryId = $location.hash();\n\n $window.onpopstate = function(event) {\n if (event.state) {\n const focusHistoryId = event.state.id;\n focusOnCurrentClass(focusHistoryId);\n }\n };\n\n focusOnCurrentClass(focusHistoryId);\n };\n\n const node = g.selectAll(\"circle, text\");\n\n function zoomTo(v, switchPrefixes) {\n const k = diameter / v[2];\n view = v;\n\n node.attr(\"transform\", function(d) {\n return \"translate(\" + (d.x - v[0]) * k + \",\" + (d.y - v[1]) * k + \")\";\n });\n\n circle.attr(\"r\", function(d) {\n return d.r * k;\n });\n\n function switchPrefixesInPlace(d) {\n // if uris match with the topLevelParentUri of the focused element\n // or your focus is a top level parent hide its label and if it is not\n // a child element show all of its child labels. If it is a child element\n // only show its label.\n if (d.data.fullName === focus.data.topLevelParentUri || focus.data.topLevelParentUri === ROOT_OBJ_NAME) {\n d.textSel.style(\"display\", \"none\");\n if (focus.children && focus.children.length) {\n _.each(focus.children, function(c) {\n c.textSel.style(\"display\", \"inline\");\n });\n } else {\n focus.textSel.style(\"display\", \"inline\");\n }\n\n // in order to show prefixes of siblings check if the focused\n // element has a parent and show all of its children except\n // for the name of the focused element because you need to see\n // its children\n if (focus.parent) {\n _.each(focus.parent.children, function(c) {\n if (c.data.name !== focus.data.name) {\n c.textSel.style(\"display\", \"inline\");\n }\n });\n }\n }\n }\n\n if (switchPrefixes) {\n text.each(switchPrefixesInPlace);\n }\n\n text\n .style(\"font-size\", function(d) {\n if (config.noPrefixes) {\n return D3.Text.calcFontSize(d.noPrefixName, d.r * k);\n }\n return D3.Text.calcFontSize(d.data.name, d.r * k);\n })\n .text(function(d) {\n if (config.noPrefixes) {\n return D3.Text.getTextWithElipsisIfNeeded(d.noPrefixName, d.r * k / 3);\n }\n return D3.Text.getTextWithElipsisIfNeeded(d.data.name, d.r * k / 3);\n });\n }\n\n\n function adjustRadius(r) {\n let newr = r * 2 + margin;\n if (r * 2 / newr < 0.3) {\n // for very small circles we need to adjust\n newr = r * 2 + 2;\n }\n return newr;\n }\n\n zoomTo([focus.x, focus.y, adjustRadius(focus.r)], switchPrefixes);\n\n function textUpdate(d) {\n if (d.isInFocusTransitive || !(d.parent && d.parent.isInFocusTransitive)) {\n // hide labels of classes that are in focus (including children) OR whose parents aren't in focus\n d.textHidden = true;\n this.style.display = \"none\";\n } else {\n // show all other labels\n d.textHidden = this.textContent.indexOf(\"...\") + 3 === this.textContent.length;\n this.style.display = \"\";\n }\n }\n\n function zoom(d, shouldClosePanel) {\n // use empty timeout to force the following code to be executed on the next $digest cycle\n // in order to avoid '$digest in progress' error\n $timeout(function() {\n scope.showExternalElements = (d.data.name === ROOT_OBJ_NAME);\n });\n\n if (focus === d) {\n // Node is already zoomed to\n // Important to return before we modify the history, otherwise we choke the browser\n return;\n }\n\n if (d.data.id) {\n $window.history.replaceState({id: d.data.id}, \"classHierarchyPage\" + d.data.id, \"hierarchy#\" + d.data.id);\n }\n\n if (!d.children) {\n // No children - zoom to parent instead\n d = d.parent;\n if (focus === d) {\n // Parent is already zoomed to\n return;\n }\n }\n\n if (shouldClosePanel) {\n closeClassInfoPanel();\n d3.selectAll(\".selected\").classed(\"selected\", false);\n }\n\n if (focus.parent) {\n let p = focus;\n while (p) {\n p.isInFocusTransitive = false;\n p = p.parent;\n }\n }\n\n let p = d;\n while (p) {\n p.isInFocusTransitive = !!p.children;\n p = p.parent;\n }\n\n focus = d;\n\n const isVerySmallCircle = focus.r * 2 / (focus.r * 2 + margin) < 0.3;\n\n if (isVerySmallCircle || scope.currentSliderValue > scope.currentBrowserLimit) {\n // no fancy animation for slower browsers if above the limit or if zooming to a very small circle\n zoomTo([focus.x, focus.y, adjustRadius(focus.r)]);\n\n text.each(function(d) {\n textUpdate.call(this, d);\n });\n } else {\n // the fancy version for faster browsers\n const transition = d3.transition()\n .duration(ZOOM_DURATION)\n .tween(\"zoom\", function(d) {\n const i = d3.interpolateZoom(view, [focus.x, focus.y, adjustRadius(focus.r)]);\n return function(t) {\n zoomTo(i(t));\n };\n });\n\n transition.selectAll(\"text\")\n // Experimental: hide texts to be hidden on \"start\", show texts to be shown on \"end\"\n .each(textUpdate);\n }\n }\n\n rootFocusEvent = scope.$on('rootFocus', function() {\n $window.history.pushState({id: 1}, \"classHierarchyPage1\", \"hierarchy#1\");\n doFocus(rootHierarchy);\n });\n\n classSearchEvent = scope.$on('classSearch', function(selectedClass) {\n doFocus(selectedClass);\n });\n }\n\n function sendSliderData() {\n const currentClassCount = scope.classHierarchyData.classCount;\n let currentSliderValue = LocalStorageAdapter.get(LSKeys.CLASS_HIERARCHY_CURRENT_SLIDER_VALUE);\n\n if (!currentSliderValue || currentSliderValue > currentClassCount) {\n currentSliderValue = currentClassCount;\n LocalStorageAdapter.set(LSKeys.CLASS_HIERARCHY_CURRENT_SLIDER_VALUE, currentSliderValue);\n }\n\n $rootScope.$broadcast(\"classCount\", currentClassCount, currentSliderValue);\n }\n\n window.addEventListener('resize', sendSliderData);\n\n window.addEventListener('beforeunload', removeResizeListener);\n\n function removeResizeListener() {\n window.removeEventListener('resize', sendSliderData);\n window.removeEventListener('beforeunload', removeResizeListener);\n }\n\n let prefixesWatch;\n let currentClassCountWatch;\n let searchedClassBroadcast;\n let onEnterClassSearchBroadcast;\n\n scope.$watch('classHierarchyData', function() {\n // when data changes unregister watchers by calling them\n if (prefixesWatch) prefixesWatch();\n if (currentClassCountWatch) currentClassCountWatch();\n if (searchedClassBroadcast) searchedClassBroadcast();\n if (onEnterClassSearchBroadcast) onEnterClassSearchBroadcast();\n\n // get initial state of prefixes (hidden or not) when changing repositories\n // in order to avoid triggering an unwanted prefixes watch\n let initialPrefixesState = getPrefixesState();\n\n if (scope.classHierarchyData.classCount) {\n sendSliderData();\n\n const rootData = structuredClone(scope.classHierarchyData);\n\n const root = d3.hierarchy(rootData);\n\n function sortRoot(root) {\n // add all classes to a flat array, add parent information\n // and sort according to instancesCount DESC, depth ASC\n\n return root.descendants()\n .sort(function(a, b) {\n if (a.data.sortingRank > b.data.sortingRank) {\n return -1;\n } else if (a.data.sortingRank < b.data.sortingRank) {\n return 1;\n } else if (a.data.depth > b.data.depth) {\n return 1;\n } else if (a.data.depth < b.data.depth) {\n return -1;\n } else {\n return 0;\n }\n });\n }\n\n const sortedChildren = sortRoot(root);\n\n // we start with an empty new rootData\n let filteredRootData;\n let noPrefixesGlobal;\n\n\n function restoreDiagramState(currentRootData, switchPrefixes) {\n const prefixesConfig = {\n keepPrevState: true,\n noPrefixes: getPrefixesState(),\n };\n\n // get noPrefixes flag from drawDiagram configuration params\n noPrefixesGlobal = prefixesConfig.noPrefixes;\n\n if (filteredRootData) {\n drawDiagram(filteredRootData, prefixesConfig, focus, true);\n } else {\n drawDiagram(currentRootData, prefixesConfig, focus, true);\n }\n\n $timeout(() => {\n LocalStorageAdapter.set(LSKeys.CLASS_HIERARCHY_SWITCH_PREFIXES, switchPrefixes);\n autoZoomToPreviousState();\n // Need to set this to false to enable the info panel to work when selecting a class.\n // The panel opening will be suppressed only when the prefixes are toggled.\n suppressPanelOpen = false;\n }, 70);\n }\n\n function redrawFilteredDiagram(currentSliderValue, sortedChildrenArray, useSlider) {\n if (!currentSliderValue) {\n return;\n }\n\n LocalStorageAdapter.set(LSKeys.CLASS_HIERARCHY_CURRENT_SLIDER_VALUE, currentSliderValue);\n\n filteredRootData = {\n name: ROOT_OBJ_NAME,\n children: [],\n };\n\n // walk through the given count of (sortedChildrenArray) classes\n // - record the id of each class we've seen\n // - add the rootData level classes to the new rootData\n const addedIds = new Set();\n for (let k = 1; k <= currentSliderValue; k++) {\n addedIds.add(sortedChildrenArray[k].data.id);\n if (sortedChildrenArray[k].parent === sortedChildrenArray[0]) { // i.e. the parent is the \"class hierarchy\"\n filteredRootData.children.push(sortedChildrenArray[k].data);\n }\n }\n\n // walk through all the classes in the new rootData and only keep those that have an \"added id\"\n // we create separate copies of the arrays in order not to contaminate the original data\n // we also copy each class's object ($.extend ...) for the same reason\n function fixChildren(node) {\n if (!node.children) {\n return;\n }\n const newChildren = [];\n for (const child of node.children) {\n if (addedIds.has(child.id)) {\n newChildren.push($.extend({}, child));\n }\n }\n node.children = newChildren;\n for (const child of node.children) {\n fixChildren(child);\n }\n }\n\n fixChildren(filteredRootData);\n\n if (useSlider) {\n // redraw diagram when slider value changes and persist current state\n // in local storage\n noPrefixesGlobal = angular.isUndefined(noPrefixesGlobal) ? getPrefixesState() : noPrefixesGlobal;\n const redrawConfig = {\n noPrefixes: noPrefixesGlobal,\n };\n drawDiagram(filteredRootData, redrawConfig);\n } else {\n // if the user returns to the diagram with back browser button\n // read the saved state (show/hide prefixes, current slider value)\n // from local storage and render the diagram according to the saved metrics\n restoreDiagramState(rootData);\n }\n }\n\n const currentSliderValue = LocalStorageAdapter.get(LSKeys.CLASS_HIERARCHY_CURRENT_SLIDER_VALUE);\n if (currentSliderValue) {\n redrawFilteredDiagram(currentSliderValue, sortedChildren);\n } else {\n const basicConfig = {\n doFade: true,\n keepPrevState: true,\n noPrefixes: getPrefixesState(),\n };\n drawDiagram(rootData, basicConfig);\n autoZoomToPreviousState();\n }\n\n prefixesWatch = scope.$watch('hidePrefixes', function(hidePrefixes) {\n if (angular.isUndefined(hidePrefixes) || initialPrefixesState) {\n initialPrefixesState = undefined;\n return;\n }\n // if digest overflows a possible fix might be wrapping this in $timeout\n $timeout(function() {\n suppressPanelOpen = true;\n savePrefixesState(hidePrefixes);\n restoreDiagramState(rootData, true);\n }, 50);\n }, true);\n\n currentClassCountWatch = scope.$watch('currentSliderValue', function(currentSliderValue) {\n redrawFilteredDiagram(currentSliderValue, sortedChildren, true);\n }, true);\n\n // we handle this event for the cases where we already have searched for a given class and\n // hit enter again on the already selected class in order again react and zoom to it again\n // if we are not at the moment\n let currentSearchedClass;\n onEnterClassSearchBroadcast = scope.$on('onEnterKeypressSearchAction', function(event) {\n if (currentSearchedClass) {\n doFocus(currentSearchedClass);\n }\n });\n\n searchedClassBroadcast = scope.$on('searchedClass', function(event, searchedClass) {\n currentSearchedClass = flattenedClassData[searchedClass.name];\n if (currentSearchedClass) {\n doFocus(currentSearchedClass);\n }\n });\n }\n }, true);\n }\n}\n"],"names":["CirclePacking","SingleChild","addPlaceholders","node","first","children","i","length","placeholderSize","size","push","name","removePlaceholders","nodes","data","splice","centerNodes","offset","x","reposition","makePositionsRelativeToZero","offsetX","offsetY","y","d3","selectAll","SVG","Export","getCSSRules","cssSourceFilePath","cssRules","$","sheet","rules","cssStr","_","each","value","cssText","generateBase64ImageSource","svgSelectorClass","exportSvg","attr","parentNode","innerHTML","btoa","unescape","encodeURIComponent","classHierarchyDirective","$rootScope","$location","GraphDataRestService","$window","$timeout","$repositories","toastr","ZOOM_DURATION","ROOT_OBJ_NAME","LocalStorageAdapter","LSKeys","$translate","restrict","template","scope","classHierarchyData","flattenedClassNames","selectedClass","currentSliderValue","showClassInfoPanel","showExternalElements","hidePrefixes","currentBrowserLimit","link","element","attrs","suppressPanelOpen","tip","rootHierarchy","packLayout","diameter","color","domain","range","interpolate","svg","insert","on","appendMainGroup","append","id","transform","getPrefixesState","get","CLASS_HIERARCHY_HIDE_PREFIXES","prepareForSVGImageExport","style","imgSrc","this","href","download","getActiveRepository","g","hasData","classCount","canUseRepo","isSystemRepository","autoZoomToPreviousState","doFocus","focus","rootFocusEvent","classSearchEvent","service","LicenseContextService","onLicenseChanged","license","valid","loader","hierarchyError","selGraphFromCache","getClassHierarchyData","contextID","uri","success","response","status","warning","instant","error","getError","fetchClassHierarchy","flattenedClassData","drawDiagram","root","config","newFocus","switchPrefixes","remove","sum","d","descendants","view","isInFocusTransitive","d3tip","customPosition","event","top","bottom","innerHeight","clientY","right","innerWidth","clientX","html","call","circleGroup","enter","doFade","D3","Transition","fadeIn","circle","role","depth","key","classed","noPrefixes","textHidden","show","hide","zoom","getCurrentClassDataAndMarkSelected","obj","selected","closeClassInfoPanel","uniqBy","clickCancel","Click","delayDblClick","$on","history","pushState","$broadcast","stopPropagation","lastTimeWheel","preventDefault","now","Date","direction","deltaY","target","__data__","parent","newobj","sortingRank","replaceState","sendSliderData","text","textSel","idx","indexOf","noPrefixName","substring","Text","calcFontSize","r","getTextWithElipsisIfNeeded","textContent","keepPrevState","focusOnCurrentClass","focusHistoryId","hash","onpopstate","state","zoomTo","v","k","fullName","topLevelParentUri","c","adjustRadius","newr","textUpdate","display","shouldClosePanel","p","duration","tween","t","currentClassCount","CLASS_HIERARCHY_CURRENT_SLIDER_VALUE","set","prefixesWatch","currentClassCountWatch","searchedClassBroadcast","onEnterClassSearchBroadcast","window","addEventListener","removeResizeListener","removeEventListener","$watch","initialPrefixesState","rootData","structuredClone","sortedChildren","sort","a","b","filteredRootData","noPrefixesGlobal","restoreDiagramState","currentRootData","prefixesConfig","CLASS_HIERARCHY_SWITCH_PREFIXES","redrawFilteredDiagram","sortedChildrenArray","useSlider","addedIds","Set","add","fixChildren","newChildren","child","has","extend","angular","isUndefined","basicConfig","currentSearchedClass","undefined","savePrefixesState","searchedClass","renderCirclePacking","module","constant","directive","$inject"],"ignoreList":[],"sourceRoot":""}
|