personal-security-checklist/docs/dist/voronoi-app.js

1 line
8.4 KiB
JavaScript
Raw Normal View History

2018-06-17 04:34:43 -06:00
!function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="/dist/",n(n.s=1)}([function(t,e,n){"use strict";e.__esModule=!0;var r=function(){function t(t){void 0===t&&(t="#vonoroi"),this.target=d3.select(t),this.renderTheAwesome(),this.watchForResize()}return t.prototype.renderTheAwesome=function(){var t=this;this.svg=this.target.append("svg"),this.width=this.target.node().getBoundingClientRect().width,this.height=this.target.node().getBoundingClientRect().height,this.svg.attr("width",this.width),this.svg.attr("height",this.height),this.mouseLeaveEvents(),this.sites=d3.range(300).map(function(e){return[Math.random()*t.width,Math.random()*t.height]});var e=this;this.svg.on("touchmove mousemove",function(){e.sites[0]=d3.mouse(this),e.redraw()}),this.voronoi=d3.voronoi().extent([[-1,-1],[this.width+1,this.height+1]]),this.polygon=this.svg.append("g").attr("class","polygons").selectAll("path").data(this.voronoi.polygons(this.sites)).enter().append("path").call(this.redrawPolygon),this.link=this.svg.append("g").attr("class","links").selectAll("line").data(this.voronoi.links(this.sites)).enter().append("line").call(this.redrawLink),this.site=this.svg.append("g").attr("class","sites").selectAll("circle").data(this.sites).enter().append("circle").attr("r",2.5).call(this.redrawSite)},t.prototype.redraw=function(){var t=this.voronoi(this.sites);this.polygon=this.polygon.data(t.polygons()).call(this.redrawPolygon),this.link=this.link.data(t.links()),this.link.exit().remove(),this.link=this.link.enter().append("line").merge(this.link).call(this.redrawLink),this.site=this.site.data(this.sites).call(this.redrawSite)},t.prototype.redrawPolygon=function(t){t.attr("d",function(t){return t?"M"+t.join("L")+"Z":null}).attr("class",function(t,e){return"v-"+e%9})},t.prototype.redrawLink=function(t){t.attr("x1",function(t){return t.source[0]}).attr("y1",function(t){return t.source[1]}).attr("x2",function(t){return t.target[0]}).attr("y2",function(t){return t.target[1]})},t.prototype.redrawSite=function(t){t.attr("cx",function(t){return t[0]}).attr("cy",function(t){return t[1]})},t.prototype.rerender=function(){this.svg.remove(),this.renderTheAwesome()},t.prototype.watchForResize=function(){var t=this,e=void 0;window.addEventListener("resize",function(){return clearTimeout(e),e=setTimeout(function(){return t.rerender()},250)})},t.prototype.mouseLeaveEvents=function(){this.svg.on("mouseleave",function(){d3.selectAll(".polygons :first-child").attr("class","deselect-polygon")})},t}();e.default=r},function(t,e,n){"use strict";n.r(e);n(7);var r=n(0),i=()=>{document.querySelectorAll('a[href^="#"]').forEach(t=>{t.addEventListener("click",function(t){t.preventDefault(),document.querySelector(this.getAttribute("href").replace("/?id=","")).scrollIntoView({behavior:"smooth"})})})};new(n.n(r).a);Window.finishMdRender=(()=>i())},,function(t,e){t.exports=function(t){var e="undefined"!=typeof window&&window.location;if(!e)throw new Error("fixUrls requires window.location");if(!t||"string"!=typeof t)return t;var n=e.protocol+"//"+e.host,r=n+e.pathname.replace(/\/[^\/]*$/,"/");return t.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi,function(t,e){var i,o=e.trim().replace(/^"(.*)"$/,function(t,e){return e}).replace(/^'(.*)'$