portfolio/assets/js/portfolio.min.js
2022-11-09 11:34:12 +01:00

2 lines
21 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

"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=n.concat(d)}catch(e){a=!0,o=e}finally{try{!r&&s.return&&s.return()}finally{if(a)throw o}}t=n}return l}var nodePositions={};function startGraph(H){var e,d=0,t={};for(e in linkMap=createLinkMap(H),breadcrumbs=createBreadcrumbs(linkMap,firstNodeId),H.nodes){var n=H.nodes[e]["@type"];void 0===t[n]&&(t[n]=[]),t[n].push(e)}document.getElementById("graphControls");var a=document.getElementById("typeLinks"),r=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[1]-e[1]});var i,c=0;for(i in s)!function(e){var i=s[e][0],t=document.createElement("li"),n=document.createElement("a"),r=document.createElement("span");r.innerHTML=s[e][1],r.classList.add("typeCount"),n.innerHTML=getDisplayAttr(i),n.title=i,n.addEventListener("click",function(){X(i)}),n.addEventListener("mouseover",function(){var e=document.getElementsByClassName(i),t=!0,n=!1,r=void 0;try{for(var a,o=e[Symbol.iterator]();!(t=(a=o.next()).done);t=!0)a.value.classList.add("typeHighlight")}catch(e){n=!0,r=e}finally{try{!t&&o.return&&o.return()}finally{if(n)throw r}}}),n.addEventListener("mouseout",function(){var e=document.getElementsByClassName(i),t=!0,n=!1,r=void 0;try{for(var a,o=e[Symbol.iterator]();!(t=(a=o.next()).done);t=!0)a.value.classList.remove("typeHighlight")}catch(e){n=!0,r=e}finally{try{!t&&o.return&&o.return()}finally{if(n)throw r}}}),t.append(n),t.append(r),(c<5?a:o).appendChild(t),c++}(i);r.addEventListener("click",function(){document.body.classList.add("showMoreLinks");function t(e){e.preventDefault(),e.stopPropagation(),document.body.removeEventListener("mouseup",t,!0),document.body.classList.remove("showMoreLinks")}document.body.addEventListener("mouseup",t,!0)},!1);function l(){return g.attr("viewBox").split(" ").map(parseFloat)}function u(e){w(),"object"==(void 0===e?"undefined":_typeof(e))&&null!==e&&1==e.length&&(e=e[0]),nodePositions={},null!==e&&("object"==(void 0===e?"undefined":_typeof(e))?x(e):nodePositions[e]=[p,m],z.each(function(e,t,n){void 0!==nodePositions[t]?(n[t].classList.add("centeredNode"),n[t].classList.add("visibleNode")):(n[t].classList.remove("centeredNode"),n[t].classList.remove("visibleNode"))}),v.alpha(1),v.restart())}function P(n,e){var t=document.createElement("dd");t.classList.add("relLink");var r=document.createElement("a");return r.innerHTML=getNodeLabel(n),null!==getNodeYear(n)&&(r.innerHTML+="<span class='nodeYear'>"+getNodeYear(n)+"</span>"),r.classList.add("nodeTitle"),r.classList.add("nodeTitleNr"+e),r.addEventListener("click",function(e){var t=H.nodes.indexOf(n);B(t)}),(e=document.createElement("a")).classList.add("nodeType"),e.innerHTML=getDisplayAttr(n["@type"]),e.title=n["@type"],e.addEventListener("click",function(e){X(n["@type"])}),t.appendChild(r),t.appendChild(e),t}function h(t,r){for(document.body.classList.add("detailsOpen"),scrollToY(0,4e3);I.hasChildNodes();)I.removeChild(I.lastChild);var e=[],n=[],a=[],o=document.createElement("div");o.id="nodeDetailsScaler",o.addEventListener("mousedown",function(e){function t(e){I.style.width=window.innerWidth-e.clientX+5+"px"}document.body.addEventListener("mousemove",t),document.body.addEventListener("mouseup",function(){document.body.removeEventListener("mousemove",t)})}),nodeDetails.appendChild(o);var i=document.createElement("ul");i.classList.add("breadcrumbs");var s=!0,d=!1,c=void 0;try{for(var l,u=breadcrumbs[t["@id"]][Symbol.iterator]();!(s=(l=u.next()).done);s=!0)!function(n){var e=document.createElement("li"),t=document.createElement("span");t.classList.add("crumb"),t.addEventListener("click",function(e){var t=H.nodes.indexOf(nodeMap[n]);B(t)}),t.innerHTML=""+getNodeLabel(nodeMap[n]);var r=getNodeYear(nodeMap[n]);null!==r&&(t.innerHTML+="<span class='nodeYear'>"+r+"</span>"),e.appendChild(t),i.appendChild(e),a.push(getNodeLabel(nodeMap[n]))}(l.value)}catch(e){d=!0,c=e}finally{try{!s&&u.return&&u.return()}finally{if(d)throw c}}I.appendChild(i),a.push(getNodeLabel(t)),o=getLabelAttribute(t),(d=document.createElement("h2")).innerHTML=getNodeLabel(t),(c=document.createElement("span")).classList.add("nodeType"),c.innerHTML=getDisplayAttr(t["@type"]),c.title=t["@type"],c.addEventListener("click",function(e){X(t["@type"])}),d.appendChild(c),I.appendChild(d);var h,p=document.createElement("dl"),m=["@id","x","y","index","@type","vy","vx","fx","fy","leftX","rightX"];for(h in"https://schema.org/contentUrl"!==o&&(m[m.length]=o),t)if(-1==m.indexOf(h)){var g,f,v=Array.isArray(t[h])?t[h]:[t[h]];for(g in v)"string"==typeof v[g]&&nodeMap[v[g]]||void 0===v[g]["@id"]&&("https://schema.org/url"==h||"https://schema.org/identifier"==h||"http://www.w3.org/2000/01/rdf-schema#seeAlso"==h?p.innerHTML+="<dt class='dt-"+getDisplayAttr(h)+"' title='"+h+"'>"+getDisplayAttr(h)+"</dt><dd class='dd-"+getDisplayAttr(h)+"'><a href='"+v[g]+"'>"+v[g]+"</a></dd>":"https://schema.org/embedUrl"==h?(p.innerHTML+="<dt class='dt-"+getDisplayAttr(h)+"' title='"+h+"'>"+getDisplayAttr(h)+"</dt><dd class='dd-"+getDisplayAttr(h)+"'><a href='"+v[g]+"'>"+v[g]+"</a></dd>",p.innerHTML+="<dd class='dd-embed'><embed src='"+v[g]+"'></embed></dd>"):"https://schema.org/contentUrl"==h?(p.innerHTML+="<dt class='dt-"+getDisplayAttr(h)+"' title='"+h+"'>"+getDisplayAttr(h)+"</dt><dd class='dd-"+getDisplayAttr(h)+"'><a href='"+v[g]+"'>"+v[g]+"</a></dd>","https://schema.org/VideoObject"==t["@type"]?(f=t["https://schema.org/thumbnailUrl"]?"poster='"+t["https://schema.org/thumbnailUrl"]+"'":"",p.innerHTML+="<dd class='dd-contentobject'><video controls "+f+" autoplay><source src='"+v[g]+"' ></video></dd>"):p.innerHTML+="<dd class='dd-contentobject'><object data='"+v[g]+"'></object></dd>"):(f=v[g].replace(/\n/g,"<br>"),p.innerHTML+="<dt class='dt-"+getDisplayAttr(h)+"' title='"+h+"'>"+getDisplayAttr(h)+"</dt><dd class='dd-"+getDisplayAttr(h)+"'>"+f+"</dd>"))}I.appendChild(p);for(var y,b,L=document.createElement("dl"),x=0;x<H.links.length;x++){var M=H.links[x];M.source["@id"]==t["@id"]&&(void 0===n[M.name]&&(n[M.name]=[]),n[M.name][n[M.name].length]=M.target),M.target["@id"]==t["@id"]&&(void 0===e[M.name]&&(e[M.name]=[]),e[M.name][e[M.name].length]=M.source)}for(y in n){var w,N=document.createElement("dt");for(w in N.innerHTML=getDisplayAttr(y),L.appendChild(N),n[y].sort(function(e,t){return weights[t["@id"]]-weights[e["@id"]]}),n[y]){var k,T,A,S=n[y][w];L.appendChild(P(S)),void 0!==S["https://schema.org/contentUrl"]&&((k=document.createElement("dd")).classList.add("dd-contentobject"),"https://schema.org/VideoObject"==S["@type"]?(T=S["https://schema.org/encodingFormat"]?"type='"+S["https://schema.org/encodingFormat"]+"'":"",A=S["https://schema.org/thumbnailUrl"]?"poster='"+S["https://schema.org/thumbnailUrl"]+"'":"",k.innerHTML+='<video controls preload="none" '+A+"><source src='"+S["https://schema.org/contentUrl"]+"' "+T+"></video>"):k.innerHTML="<object data='"+S["https://schema.org/contentUrl"]+"'></object>",L.appendChild(k))}}for(b in e){var E,C=document.createElement("dt");for(E in C.innerHTML=getDisplayAttr(b),L.appendChild(C),e[b].sort(function(e,t){return weights[t["@id"]]-weights[e["@id"]]}),e[b]){var O,D,j,F=e[b][E];L.appendChild(P(F,E)),void 0!==F["https://schema.org/contentUrl"]&&((O=document.createElement("dd")).classList.add("dd-contentobject"),"https://schema.org/VideoObject"==F["@type"]?(D=F["https://schema.org/encodingFormat"]?"type='"+F["https://schema.org/encodingFormat"]+"'":"",j=F["https://schema.org/thumbnailUrl"]?"poster='"+F["https://schema.org/thumbnailUrl"]+"'":"",O.innerHTML+='<video controls preload="none" '+j+"><source src='"+F["https://schema.org/contentUrl"]+"' "+D+"></video>"):O.innerHTML="<object data='"+F["https://schema.org/contentUrl"]+"'></object>",L.appendChild(O))}}I.appendChild(L),z.each(function(e,t,n){t==r?n[t].classList.add("selectedNode"):n[t].classList.remove("selectedNode")}),document.title=a.join(" :: ")}var p,m,g=d3.select("svg"),f=(g.attr("width"),g.attr("height"),g.append("g").attr("id","container")),v=d3.forceSimulation().force("link",d3.forceLink().id(function(e){return e["@id"]}).strength(.005)).force("charge",d3.forceManyBody()).force("collision",d3.forceCollide(function(e){return 1.1*getSizeForNode(e)})),y=f.append("g").attr("class","links").selectAll(".relationship").data(H.links).enter().append("g").attr("class",function(e){return"relationship "+e.name}),b=y.append("line").attr("marker-end","url(#arrowHead)"),L=y.append("text").text(function(e){return getDisplayAttr(e.name)}),z=f.append("g").attr("class","nodes").selectAll(".node").data(H.nodes).enter().append("g").attr("class",function(e){var t,n="node "+e["@type"];return!e["@type"]||-1<(t=e["@type"].lastIndexOf("/"))&&(n+=" "+e["@type"].substr(t+1)),n}),x=function(e,t){var n=l(),r=N();w(),void 0===t&&(t=1==e.length?n[2]/6:n[2]/(4+Math.max(0,2.5-e.length))),d=t;for(var a=n[0]+n[2]/2-r.dx,o=n[1]+n[3]/2-r.dy,i=2*Math.PI/e.length,s=0;s<e.length;s++)nodePositions[e[s]]=[a+Math.sin(i*s)*t,o+Math.cos(i*s)*t];v.alpha(1),v.restart()},X=function(e,t){void 0===t&&(t=!0),Array.isArray(e)||(e=[e]);var n,r=[];for(n in H.nodes)-1<e.indexOf(H.nodes[n]["@type"])&&(r[r.length]=n);M(),t?history.pushState({types:e},"","/@type/"+e.map(getDisplayAttr).join("+")):history.replaceState({types:e},"","/@type/"+e.map(getDisplayAttr).join("+")),u(r.length?r:null)},I=(d3.transition().duration(750).ease(d3.easeLinear),document.getElementById("nodeDetails")),B=function(r,e){void 0===e&&(e=!0);var i,s,t,a=null,d=null;z.each(function(e,t,n){t==r&&(a=n[r],d=e)}),a&&(t=null,t=d["@id"].startsWith("https://rubenvandeven.com/")?d["@id"].substr(26):"?id="+d["@id"],e?history.pushState({node:r},getNodeLabel(d),"/"+t):history.replaceState({node:r},getNodeLabel(d),"/"+t),u(r),(i=breadcrumbs[d["@id"]].slice())[i.length]=d["@id"],s=[],y.each(function(n,e,t,r){n.source==d||n.target==d?(t[e].classList.add("activeLink","visibleLink"),t[e].getElementsByTagName("line")[0].setAttribute("marker-end","url(#arrowHeadSelected)"),z.filter(function(e,t){e=e["@id"]==n.source["@id"]||e["@id"]==n.target["@id"];return e&&-1===s.indexOf(t)&&(s[s.length]=t),e}).classed("visibleNode",!0)):(t[e].classList.remove("activeLink"),t[e].getElementsByTagName("line")[0].setAttribute("marker-end","url(#arrowHead)"));var a=i.indexOf(n.source["@id"]),o=i.indexOf(n.target["@id"]);-1<a&&-1<o&&1==Math.abs(a-o)?(t[e].classList.add("breadcrumbLink"),t[e].getElementsByTagName("line")[0].setAttribute("marker-end","url(#arrowHeadCrumbTrail)")):t[e].classList.remove("breadcrumbLink")}),-1!==(t=s.indexOf(r))&&s.splice(t,1),x(s),h(d,r))},M=function(){u(null),y.each(function(e,t,n,r){n[t].classList.remove("activeLink"),n[t].classList.remove("breadcrumbLink"),n[t].getElementsByTagName("line")[0].setAttribute("marker-end","url(#arrowHead)")}),document.body.classList.remove("detailsOpen"),scrollToY(0,4e3)};window.addEventListener("popstate",function(e){e.state.hasOwnProperty("node")?B(e.state.node,!1):(e=H.nodes.find(function(e){return e["@id"]===firstNodeId}),B(H.nodes.indexOf(e),!1))});var w=function(){var e=l(),t=N();p=e[0]+e[2]/2-t.dx,m=e[1]+e[3]/2-t.dy},N=function(){var e=document.getElementById("container"),t=0,n=0,r=1;if(0<e.transform.baseVal.length){var a=!0,o=!1,i=void 0;try{for(var s,d=e.transform.baseVal[Symbol.iterator]();!(a=(s=d.next()).done);a=!0){var c=s.value;c.type==SVGTransform.SVG_TRANSFORM_TRANSLATE?(t+=c.matrix.e,n+=c.matrix.f):c.type==SVGTransform.SVG_TRANSFORM_SCALE&&(r*=c.matrix.a)}}catch(e){o=!0,i=e}finally{try{!a&&d.return&&d.return()}finally{if(o)throw i}}}return{dx:t,dy:n,scale:r}};w();var k=!1;v.force("centerActive",function(o){z.each(function(e,t,n){var r=e,a=.1*o;r.fx=null,r.fy=null,void 0!==nodePositions[t]?0==k?(r.x=nodePositions[t][0],r.y=nodePositions[t][1],r.vx=0,r.vy=0):(r.vx-=(r.x-nodePositions[t][0])*a*5,r.vy-=(r.y-nodePositions[t][1])*a*5):d<1||inCircle(e=r.x-p,t=r.y-m,d)&&(0==k?(r.fx=r.x+e*(2+Math.random()),r.fy=r.y+t*(2+Math.random())):(r.vx+=e*a*4,r.vy+=t*a*4))})});z.append("path").attr("id",function(e,t){return"nodePath"+t}).attr("d",function(e){var t=.9*getSizeForNode(e);getSizeForNode(e);return"M0 0 m -"+t+", 0 a "+t+","+t+" 0 1,0 "+2*t+",0 a "+t+","+t+" 0 1,0 -"+2*t+",0"});z.call(d3.drag().on("start",function(e,t,n){d3.event.active||v.alphaTarget(.3).restart();t=n[t];e.fx=e.x,e.fy=e.y,t.classList.add("drag")}).on("drag",function(e,t){e.fx=d3.event.x,e.fy=d3.event.y}).on("end",function(e,t,n){d3.event.active||v.alphaTarget(0);t=n[t];e.fx=null,e.fy=null,t.classList.remove("drag")})).on("click",function(e,t,n){n=n[t];B(t,n,e)}).on("mouseover",function(a,e){y.each(function(e,t,n,r){e.source!=a&&e.target!=a||n[t].classList.add("hoverLink")})}).on("mouseout",function(){for(var e=document.getElementsByClassName("hoverLink");0<e.length;)e[0].classList.remove("hoverLink")}),g.call(d3.zoom().scaleExtent([.3,3]).on("start",function(){g.node().classList.add("dragging")}).on("end",function(){g.node().classList.remove("dragging")}).on("zoom",function(e,t,n){f.attr("transform",d3.event.transform)})),z.append("circle").attr("r",function(e){return getSizeForNode(e)}).attr("class","nodeBg"),z.append("circle").attr("r",function(e){return 1.08*getSizeForNode(e)}).attr("class","highlightCircle"),z.append("text").attr("class","nodeType").text(function(e){return e["@type"]}),z.append("text").attr("class","nodeYear").attr("y","22").text(function(e){return getNodeYear(e)});if(z.append("text").attr("class","nodeTitle").attr("y","5").each(function(e,t){var n,r=void 0,a=d3.select(this),o=getNodeLabel(e),i=!1;(r=!1!==(i=20<o.length?function(e){var t=Math.floor(e.length/2),n=!1,r=!1,a=!0,o=!1,i=void 0;try{for(var s,d=[" ","-","­"][Symbol.iterator]();!(a=(s=d.next()).done);a=!0){var c,l=s.value;e.indexOf(l)<0||(-1===(c=e.substr(0,t).lastIndexOf(l))&&(c=e.indexOf(l)),c+=1,(!1===n||Math.abs(c-t)<Math.abs(n-t))&&(n=c,r=l))}}catch(e){o=!0,i=e}finally{try{!a&&d.return&&d.return()}finally{if(o)throw i}}if(!1===n)return!1;i=e.substr(0,n).trim();return"­"==r&&(i+="-"),[i,e.substr(n).trim()]}(o):i)?(a.append("tspan").text(i[0]).attr("y","-10").attr("x","0"),i=(n=a.append("tspan").text(i[1]).attr("y","10").attr("x","0")).node().getComputedTextLength(),n=n.node().getComputedTextLength(),Math.max(i,n)):(a.text(o),a.node().getComputedTextLength()))>2*getSizeForNode(e)&&a.attr("transform","scale("+2*getSizeForNode(e)/r/1.05+")")}),z.each(function(e){e["https://schema.org/thumbnailUrl"]&&d3.select(this).append("svg:image").attr("xlink:href",e["https://schema.org/thumbnailUrl"]).attr("width",function(e){return 2*getSizeForNode(e)}).attr("height",function(e){return 2*getSizeForNode(e)}).attr("transform",function(e){return"translate(-"+getSizeForNode(e)+" -"+getSizeForNode(e)+")"}).attr("clip-path","url(#clipNodeImage)").attr("preserveAspectRatio","xMidYMid slice")}),z.each(function(e){"https://schema.org/VideoObject"===e["@type"]&&(getSizeForNode(e),d3.select(this).append("svg:polygon").attr("points","-10,-10, -10,10, 10,0").attr("class","play"))}),v.nodes(H.nodes).on("tick",function(){H.nodes.forEach(function(e,t){e.leftX=e.rightX=e.x}),b.each(function(e){var t,n;e.source.rightX<e.target.leftX?(t=e.source.rightX,n=e.target.leftX):e.target.rightX<e.source.leftX?(n=e.target.rightX,t=e.source.leftX):n=t=e.target.isCircle?e.target.x:e.source.isCircle?e.source.x:((o=(e.source.x+e.target.x)/2)>e.target.rightX?o=e.target.rightX:o>e.source.rightX?o=e.source.rightX:o<e.target.leftX?o=e.target.leftX:o<e.source.leftX&&(o=e.source.leftX),o);var r=e.target.y-e.source.y,a=Math.atan2(n-t,r),o=getSizeForNode(e.source)+3.2,r=getSizeForNode(e.target)+3.2;e.sourceX=t+Math.sin(a)*o,e.targetX=n-Math.sin(a)*r,e.sourceY=e.source.y+Math.cos(a)*o,e.targetY=e.target.y-Math.cos(a)*r}).attr("x1",function(e){return e.sourceX}).attr("y1",function(e){return e.sourceY}).attr("x2",function(e){return e.targetX}).attr("y2",function(e){return e.targetY}),L.attr("transform",function(e){var t=(e.target.x-e.source.x)/2,n=(e.target.y-e.source.y)/2,r=e.source.x+t,e=e.source.y+n,t=180*Math.atan(n/t)/Math.PI;return isNaN(t)?"":"translate("+r+" "+e+") rotate("+t+") translate(0, -10)"}),z.attr("transform",function(e){return"translate("+e.x+","+e.y+")"})}),v.force("link").links(H.links).distance(function(e){return e.name,300}),location.pathname.startsWith("/@type/"))for(var T in t)getDisplayAttr(T)==location.pathname.substr(7)&&X(T,!1);else{var A=location.search.startsWith("?id=")?location.search.substr(4):"https://rubenvandeven.com"+location.pathname,S=H.nodes.find(function(e){return e["@id"]===A});B(H.nodes.indexOf(S),!1)}S=document.getElementById("initPlaceholder");g.node().removeChild(S),setTimeout(function(){k=!0,document.body.classList.add("graphInitialised")},500)}var reqAnimFrame=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.msRequestAnimationFrame||window.oRequestAnimationFrame||function(e){window.setTimeout(e,1e3/60)};function scrollToY(r,e,a,o){var i=window.scrollY,r=r||0,e=e||2e3,a=a||"easeOutSine",s=0,o=o||!1,d=Math.max(.1,Math.min(Math.abs(i-r)/e,.8)),c=(Math.PI,{easeOutSine:function(e){return Math.sin(e*(Math.PI/2))},easeInOutSine:function(e){return-.5*(Math.cos(Math.PI*e)-1)},easeInOutQuint:function(e){return(e/=.5)<1?.5*Math.pow(e,5):.5*(Math.pow(e-2,5)+2)}});!function e(){var t=(s+=1/60)/d,n=c[a](t);t<1?(reqAnimFrame(e),window.scrollTo(0,i+(r-i)*n)):(window.scrollTo(0,r),o&&o())}()}
//# sourceMappingURL=portfolio.min.js.map