2022-02-18 13:07:44 +00:00
|
|
|
"use strict";var data,graph,_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function getLabelAttribute(e){if(void 0!==e["https://schema.org/name"])return"https://schema.org/name";switch(e["@type"]){case"https://schema.org/WebSite":if(void 0!==e["https://schema.org/url"])return"https://schema.org/url";break;case"https://schema.org/ImageObject":if(void 0!==e["https://schema.org/caption"])return"https://schema.org/caption";if(void 0!==e["https://schema.org/contentUrl"])return"https://schema.org/contentUrl";break;case"https://schema.org/PostalAddress":if(void 0!==e["https://schema.org/addressLocality"])return"https://schema.org/addressLocality";break;case"https://schema.org/OrganizationRole":if(void 0!==e["https://schema.org/roleName"])return"https://schema.org/roleName"}return"@id"}function getNodeLabel(e){var t=e[getLabelAttribute(e)];return t=void 0===(t=void 0===t?e["@id"]:t)?"":t}function getNodeYear(e){return void 0!==e["https://schema.org/dateCreated"]?9==e["https://schema.org/dateCreated"].length?e["https://schema.org/dateCreated"]:e["https://schema.org/dateCreated"].substr(0,4):void 0!==e["https://schema.org/datePublished"]?e["https://schema.org/datePublished"].substr(0,4):void 0===e["https://schema.org/startDate"]?void 0!==e["https://schema.org/endDate"]?e["https://schema.org/endDate"].substr(0,4):void 0!==e["https://schema.org/foundingDate"]?e["https://schema.org/foundingDate"].substr(0,4):void 0!==e["https://schema.org/temporalCoverage"]&&e["https://schema.org/temporalCoverage"].match(/\d{4}-\d{4}/)?e["https://schema.org/temporalCoverage"].substr(5,4):null:e["https://schema.org/startDate"].substr(0,4)}function getDisplayAttr(e){return e.replace(/.*[#|\/]/,"")}function jsonLdToGraph(e){var t,n,r={},a=[];for(t in e)r[e[t]["@id"]]=e[t];for(n in e){var o,i=e[n],s=i["@id"];for(o in i){var d,c=Array.isArray(i[o])?i[o]:[i[o]];for(d in c)"@id"!==o&&"string"==typeof c[d]&&r[c[d]]?a[a.length]={source:s,target:c[d],name:o}:void 0!==c[d]["@id"]&&(1==Object.keys(c[d]).length&&void 0===r[c[d]["@id"]]||(a[a.length]={source:s,target:c[d]["@id"],name:o}))}}return{nodes:Object.values(r),links:a}}var nodeMap={},linkMap={},breadcrumbs={},weights={},requestPromise=fetch("/assets/js/rubenvandeven.jsonld").then(function(e){return e.json()}),rankingPromise=fetch("/assets/js/ranking.json").then(function(e){return e.json()});function inCircle(e,t,n){var r=Math.abs(e),a=Math.abs(t);return!(n<r||n<a)&&(r+a<=n||Math.pow(e,2)+Math.pow(t,2)<=Math.pow(n,2))}function createLinkMap(e){var t={},n=!0,r=!1,a=void 0;try{for(var o,i=e.links[Symbol.iterator]();!(n=(o=i.next()).done);n=!0){var s=o.value;void 0===t[s.source]&&(t[s.source]=[]),t[s.source][t[s.source].length]={id:s.target,name:s.name},void 0===t[s.target]&&(t[s.target]=[]),t[s.target][t[s.target].length]={id:s.source,name:s.name}}}catch(e){r=!0,a=e}finally{try{!n&&i.return&&i.return()}finally{if(r)throw a}}return t}Promise.all([requestPromise,rankingPromise]).then(function(e){for(var t in weights=e[0].hasOwnProperty("@graph")?(data=e[0],e[1]):(data=e[1],e[0]),(graph=jsonLdToGraph(data["@graph"])).nodes)nodeMap[graph.nodes[t]["@id"]]=graph.nodes[t];startGraph(graph)});var nodeSize=40,selectedNodeSize=140,firstNodeId="https://rubenvandeven.com/";function getSizeForNode(e){return e.hasOwnProperty("https://schema.org/thumbnailUrl")?nodeSize:weights[e["@id"]]?nodeSize*weights[e["@id"]]:e["@id"]==firstNodeId?1.2*nodeSize:nodeSize*(.7+Math.min(20,linkMap[e["@id"]].length)/40)}function createBreadcrumbs(c,e){var l={};l[e]=[];for(var t=[e];0<t.length;){var n=[],r=!0,a=!1,o=void 0;try{for(var i,s=t[Symbol.iterator]();!(r=(i=s.next()).done);r=!0)var d=function(e){var t=l[e].slice();t.push(e);var n=[],r=!0,a=!1,o=void 0;try{for(var i,s=c[e][Symbol.iterator]();!(r=(i=s.next()).done);r=!0){var d=i.value;void 0===l[d.id]&&(l[d.id]=t,n.push(d.id))}}catch(e){a=!0,o=e}finally{try{!r&&s.return&&s.return()}finally{if(a)throw o}}return n}(i.value),n=
|