portfolio/assets/js/portfolio.min.js

3 lines
20 KiB
JavaScript
Raw Normal View History

2019-11-22 20:51: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"}return"@id"}function getNodeLabel(e){var t=e[getLabelAttribute(e)];return void 0===t&&(t=e["@id"]),void 0===t&&(t=""),t}function getNodeYear(e){return void 0!==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"]?e["https://schema.org/startDate"].substr(0,4):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):null}function getDisplayAttr(e){return e.replace(/.*[#|\/]/,"")}function jsonLdToGraph(e){var t={},r=[];for(var n in e)t[e[n]["@id"]]=e[n];for(var a in e){var o=e[a],i=o["@id"];for(var s in o){var d=Array.isArray(o[s])?o[s]:[o[s]];for(var c in d)"@id"!==s&&"string"==typeof d[c]&&t[d[c]]?r[r.length]={source:i,target:d[c],name:s}:void 0!==d[c]["@id"]&&(1==Object.keys(d[c]).length&&void 0===t[d[c]["@id"]]||(r[r.length]={source:i,target:d[c]["@id"],name:s}))}}return{nodes:Object.values(t),links:r}}var nodeMap={},linkMap={},breadcrumbs={},requestPromise=fetch("/assets/js/rubenvandeven.jsonld").then(function(e){return e.json()}).then(function(e){for(var t in(graph=jsonLdToGraph(e["@graph"])).nodes)nodeMap[graph.nodes[t]["@id"]]=graph.nodes[t];startGraph(graph)});function inCircle(e,t,r){var n=Math.abs(e),a=Math.abs(t);return!(r<n||r<a)&&(n+a<=r||Math.pow(e,2)+Math.pow(t,2)<=Math.pow(r,2))}function createLinkMap(e){var t={},r=!0,n=!1,a=void 0;try{for(var o,i=e.links[Symbol.iterator]();!(r=(o=i.next()).done);r=!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){n=!0,a=e}finally{try{!r&&i.return&&i.return()}finally{if(n)throw a}}return t}var nodeSize=40,selectedNodeSize=140,firstNodeId="https://rubenvandeven.com/";function getSizeForNode(e){return e.hasOwnProperty("https://schema.org/thumbnailUrl")?nodeSize:e["@id"]==firstNodeId?1.2*nodeSize:nodeSize*(.7+Math.min(20,linkMap[e["@id"]].length)/40)}function createBreadcrumbs(c,e){var l={},t=function(e){var t=l[e].slice();t.push(e);var r=[],n=!0,a=!1,o=void 0;try{for(var i,s=c[e][Symbol.iterator]();!(n=(i=s.next()).done);n=!0){var d=i.value;void 0===l[d.id]&&(l[d.id]=t,r.push(d.id))}}catch(e){a=!0,o=e}finally{try{!n&&s.return&&s.return()}finally{if(a)throw o}}return r};l[e]=[];for(var r=[e];0<r.length;){var n=[],a=!0,o=!1,i=void 0;try{for(var s,d=r[Symbol.iterator]();!(a=(s=d.next()).done);a=!0){var u=t(s.value);n=n.concat(u)}}catch(e){o=!0,i=e}finally{try{!a&&d.return&&d.return()}finally{if(o)throw i}}r=n}return l}var nodePositions={};function startGraph(z){var d=0,t={};for(var e in linkMap=createLinkMap(z),breadcrumbs=createBreadcrumbs(linkMap,firstNodeId),z.nodes){var r=z.nodes[e]["@type"];void 0===t[r]&&(t[r]=[]),t[r].push(e)}document.getElementById("graphControls");var a=document.getElementById("typeLinks"),n=document.getElementById("showMoreTypeLinks"),o=document.getElementById("moreTypeLinks"),s=(document.getElementById("relLinks"),Object.keys(t).map(function(e){return[e,t[e].length]}));s.sort(function(e,t){return t
//# sourceMappingURL=portfolio.min.js.map