Skip to content
Browse files

Add minified files.

  • Loading branch information...
1 parent ce77a82 commit 61eecec54b1e27e64a6aa1e49da2f7784f8612c0 @mbostock committed
Showing with 8 additions and 2 deletions.
  1. +5 −0 d3.v3.min.js
  2. +2 −2 index.html
  3. +1 −0 stack.v0.min.js
View
5 d3.v3.min.js
5 additions, 0 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
View
4 index.html
@@ -93,5 +93,5 @@ <h1 class="caption">GRATUITOUS IMAGE<br>WITH CAPTION</h1>
<p class="grey">View source to get started.
</section>
-<script src="d3.v2.js?2.7.3"></script>
-<script src="stack.v0.js"></script>
+<script src="d3.v3.min.js"></script>
+<script src="stack.v0.min.js"></script>
View
1 stack.v0.min.js
@@ -0,0 +1 @@
+var stack=function(){function t(t){return w-1>u&&u==d&&u>t?(p.deactivate.call(y[0][d],d),p.activate.call(y[0][--d],d),u-=.5-v/i/2,scrollTo(0,u*i),!0):void 0}function e(){v=(window.innerHeight-i)/2,f=1+v/i,d3.select(g).style("margin-top",v+"px").style("margin-bottom",v+"px").style("height",(w-.5)*i+v+"px")}function n(){var t=+location.hash.slice(1);isNaN(t)||h.position(t)}function a(){var t;switch(d3.event.keyCode){case 39:if(d3.event.metaKey)return;case 40:case 34:t=d3.event.metaKey?1/0:1;break;case 37:if(d3.event.metaKey)return;case 38:case 33:t=d3.event.metaKey?-1/0:-1;break;case 32:t=d3.event.shiftKey?-1:1;break;default:return}r&&(r=clearTimeout(r)),null==m&&(m=(t>0?Math.floor:Math.ceil)(u==d?d:u+(.5-v/i/2))),h.position(m=Math.max(0,Math.min(w-1,m+t))),d3.event.preventDefault()}function l(){g!==x&&x.scrollTop&&(g=x);var e=Math.max(0,g.scrollTop/i);if(e>=w-1.51+v/i&&(e=w-1),!t(e)){var n=Math.max(0,Math.floor(u=e)),a=Math.min(f,2*(u%1));d!=n&&(null!=d&&p.deactivate.call(y[0][d],d),p.activate.call(y[0][n],n),d=n),y.classed("active",!1),d3.select(y[0][d]).style("-webkit-transform",a?"translate3d(0,"+-a*i+"px,0)":null).style("-o-transform",a?"translate(0,"+-a*i+"px)":null).style("-moz-transform",a?"translate(0,"+-a*i+"px)":null).style("transform",a?"translate(0,"+-a*i+"px)":null).classed("active",a!=f),d3.select(y[0][d+1]).style("-webkit-transform",a?"translate3d(0,0,0)":null).style("-o-transform",a?"translate(0,0)":null).style("-moz-transform",a?"translate(0,0)":null).style("transform",a?"translate(0,0)":null).classed("active",a>0)}}function o(){var t=d3.event.clientY;if(t!==c&&(c=t,null==m)){var e=h.position(),n=Math.max(0,Math.round(e+.25));0>=e||e>=w-1.51+v/i||(n>e&&.5-v/i>n-e?scrollTo(0,n*i):n!==e&&h.position(n))}}function s(t){return function(){var e=d3.interpolateNumber(this.scrollTop,t*i);return function(t){scrollTo(0,e(t)),l()}}}var r,c,i,u,d,m,f,v,h={},p=d3.dispatch("activate","deactivate"),y=d3.selectAll("section"),k=d3.select(window),g=document.body,x=document.documentElement,M=250,b="cubic-in-out",w=y[0].length;return y.classed("stack",!0).style("z-index",function(t,e){return w-e}),y.classed("active",!0),i=y.node().getBoundingClientRect().height,y.classed("active",!1),h.position=function(e){var n=g.scrollTop/i;return arguments.length<1?n:(e>=w?e=w-1:0>e&&(e=Math.max(0,w+e)),e=Math.floor(e),n-e&&(k.on("scroll.stack",null),t(e),d3.select(g).transition().duration(M).ease(b).tween("scrollTop",s(m=e)).each("end",function(){m=null,k.on("scroll.stack",l)})),location.replace("#"+e),h)},y.style("display")!="block"?(k.on("keydown.stack",a).on("resize.stack",e).on("scroll.stack",l).on("mousemove.stack",o).on("hashchange.stack",n),e(),l(),n(),h.duration=function(t){return arguments.length?(M=t,h):M},h.ease=function(t){return arguments.length?(b=t,h):b},d3.rebind(h,p,"on"),h):void 0}();

0 comments on commit 61eecec

Please sign in to comment.
Something went wrong with that request. Please try again.