Skip to content

Instantly share code, notes, and snippets.

@deristnochda
deristnochda / .block
Created January 31, 2017 14:18 — forked from mbostock/.block
Zoom to Bounding Box
license: gpl-3.0
@deristnochda
deristnochda / index.html
Created November 28, 2016 16:28
d3js v4 line chart (zoom not working)
<html>
<head>
<script src="https://d3js.org/d3.v4.min.js"></script>
<style>
.axis {
font-size: 11pt;
}
.line {
fill: none;
@deristnochda
deristnochda / d3.v4.3.min.js
Created November 28, 2016 16:25
d3js v4 zoomable line chart
// https://d3js.org Version 4.3.0. Copyright 2016 Mike Bostock.
(function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n(t.d3=t.d3||{})})(this,function(t){"use strict";function n(t){return function(n,e){return Ms(t(n),e)}}function e(t,n,e){var r=Math.abs(n-t)/Math.max(0,e),i=Math.pow(10,Math.floor(Math.log(r)/Math.LN10)),o=r/i;return o>=Fs?i*=10:o>=Is?i*=5:o>=Ys&&(i*=2),n<t?-i:i}function r(t){return t.length}function i(){}function o(t,n){var e=new i;if(t instanceof i)t.each(function(t,n){e.set(n,t)});else if(Array.isArray(t)){var r,o=-1,u=t.length;if(null==n)for(;++o<u;)e.set(o,t[o]);else for(;++o<u;)e.set(n(r=t[o],o,t),r)}else if(t)for(var a in t)e.set(a,t[a]);return e}function u(){return{}}function a(t,n,e){t[n]=e}function c(){return o()}function s(t,n,e){t.set(n,e)}function f(){}function l(t,n){var e=new f;if(t instanceof f)t.each(function(t){e.add(t)});else if(t){var r=-1,i=t.length;if(null==n)for(;++r<i;)e.add(t[r]);else