Choose a version:
47% The original file has 451131 bytes (440.6k) and is available from the project website.
There you can find the official minified version, too, which brings down the size to 214203 bytes (209.2k, 47%).

After GZIP compression these minified files vary in size:
Boot
  82409 bytes (80.5k)
CDN, direct link
cdnjs
  72918 bytes (71.2k)
CDN, direct link
gzip -6 (default)
  72455 bytes (70.8k)
local copy
jsdelivr
  72314 bytes (70.6k)
CDN, direct link
gzip -9
  72169 bytes (70.5k)
local copy
libdeflate -12
  69402 bytes (67.8k)
local copy
7zip -mx=9 -tgzip
  69026 bytes (67.4k)
local copy
kzip -s0 -rn -b7
  68809 bytes (67.2k)
local copy
pigz -11 -n
  68594 bytes (67.0k)
local copy
Zopfli
  68553 bytes (66.9k)
local copy
Zopfli (defluff)
  68551 bytes (66.9k)
local copy

perma-link to the smallest file on my server:
http://minime.stephan-brumme.com/files/d3/d3-4.5.0.min.js

You will automatically get the smallest D3 4.5.0 file, ETag caching is available and
if your browser doesn't support GZIP decompression then the uncompressed version will be sent.

Currently best Zopfli settings

Save 3761 bytes by using my D3 4.5.0 Zopfli version instead of the best available CDN (5.49% smaller than jsdelivr, 68553 vs. 72314 bytes):
You can use my super-compressed files for whatever purpose you like as long as you respect the library's original license agreement.
There are no restrictions from my side - but please avoid hot-linking if you run a high-traffic website.

These command-line settings yielded the best compression ratio so far (Linux version of zopfli-krzymod):
zopfli --i1000000 --mb8 --mls512 --bsr17 --lazy --ohh

(found January 31, 2017)
Description Value Parameter
iterations 1000000  --i1000000
maximum blocks 8  --mb8
maximum length score 512  --mls512
block splitting recursion 17  --bsr17
lazy matching in LZ77 yes  --lazy
optimized Huffman headers yes  --ohh
initial random W for iterations 1  --rw1
initial random Z for iterations 2  --rz2

Even Smaller Files Thanks To Defluff

Zopfli's output can be further optimized by the defluff tool.
In this particular case, defluff saves 2 more bytes (68551 bytes).

Verify file integrity

After decompression, my uncompressed files are identical to the original ones:

MD5:
curl --silent --compressed https://raw.githubusercontent.com/mbostock/d3/v4.5.0/d3.zip --location | md5sum
5d9d6575d9c22e4fbe609b1b06d50e50  -
curl --silent --compressed http://minime.stephan-brumme.com/files/d3/d3-4.5.0.min.zopfli.js.gz | md5sum
5d9d6575d9c22e4fbe609b1b06d50e50  -

SHA1:
curl --silent --compressed https://raw.githubusercontent.com/mbostock/d3/v4.5.0/d3.zip --location | sha1sum
9f255cd030c4410115135091a778c920c02ea7ab  -
curl --silent --compressed http://minime.stephan-brumme.com/files/d3/d3-4.5.0.min.zopfli.js.gz | sha1sum
9f255cd030c4410115135091a778c920c02ea7ab  -

All listed CDNs deliver identical contents:
CDN Size (compressed) MD5 (uncompressed) Timestamp
Boot 82409 bytes 5d9d6575d9c22e4fbe609b1b06d50e50 January 29, 2017 @ 13:12
cdnjs 72918 bytes 5d9d6575d9c22e4fbe609b1b06d50e50 January 29, 2017 @ 06:47
jsdelivr 72314 bytes 5d9d6575d9c22e4fbe609b1b06d50e50 January 29, 2017 @ 07:03

Note: only the MD5 hashes are shown to keep things simple.

Other Versions

Available D3 versions at minime.stephan-brumme.com:

4.10.0,
4.9.1, 4.9.0, 4.8.0, 4.7.4, 4.7.3, 4.7.2, 4.7.1, 4.7.0, 4.6.0, 4.5.0, 4.4.4, 4.4.3, 4.4.2, 4.4.1, 4.4.0, 4.3.0, 4.2.8, 4.2.7, 4.2.6, 4.2.5, 4.2.4, 4.2.3, 4.2.2, 4.2.1, 4.2.0, 4.1.1, 4.1.0, 4.0.0,
3.5.17, 3.5.16, 3.5.15, 3.5.14, 3.5.13, 3.5.12, 3.5.11, 3.5.10, 3.5.9, 3.5.8, 3.5.7, 3.5.6, 3.5.5, 3.5.4, 3.5.3, 3.5.2, 3.5.1, 3.5.0, 3.4.13, 3.4.12, 3.4.11, 3.4.10, 3.4.9, 3.4.8, 3.4.6, 3.4.5, 3.4.4, 3.4.3, 3.4.2, 3.4.1, 3.4.0, 3.3.13, 3.3.12, 3.3.11, 3.3.10, 3.3.9, 3.3.8, 3.3.7, 3.3.6, 3.3.5, 3.3.4, 3.3.3, 3.3.2, 3.3.1, 3.3.0, 3.2.8, 3.2.7, 3.2.6, 3.2.5, 3.2.4, 3.2.3, 3.2.2, 3.2.1, 3.2.0, 3.1.10, 3.1.9, 3.1.8, 3.1.7, 3.1.6, 3.1.5, 3.1.4, 3.1.3, 3.1.2, 3.1.1, 3.1.0, 3.0.8, 3.0.7, 3.0.6, 3.0.5, 3.0.4, 3.0.3, 3.0.2, 3.0.1, 3.0.0

The project site contains an overview how well these versions were compressed.
Other interesting projects are AngularJS, BackboneJS, Bootstrap, Dojo, Ember, jQuery, Knockout, lodash, React, Socket.IO, ThreeJS, UnderscoreJS and Vue.

Changelog

Best Zopfli parameters so far:
Size Improvement Parameters Found
68553 bytes -4 bytes zopfli --i1000000 --mls512 --bsr17 --lazy --ohh January 31, 2017 @ 07:39
68557 bytes -1 byte zopfli --i100000 --mls512 --bsr17 --lazy --ohh January 30, 2017 @ 13:34
68558 bytes -6 bytes zopfli --i100000 --mls512 --bsr40 --lazy --ohh January 30, 2017 @ 12:10
68564 bytes -1 byte zopfli --i10000 --mls512 --bsr17 --lazy --ohh January 30, 2017 @ 11:59
68565 bytes -7 bytes zopfli --i10000 --mls512 --bsr40 --lazy --ohh January 30, 2017 @ 10:55
68572 bytes -1 byte zopfli --i1000 --mls512 --bsr40 --lazy --ohh January 30, 2017 @ 10:47
68573 bytes -3 bytes zopfli --i1000 --mls512 --bsr17 --lazy --ohh January 30, 2017 @ 10:46
68576 bytes -1 byte zopfli --i1000 --mls512 --bsr23 --lazy --ohh January 30, 2017 @ 10:46
68577 bytes -22 bytes zopfli --i1000 --mls8 --bsr11 --lazy --ohh January 30, 2017 @ 10:46
68599 bytes zopfli --i100 --mls8 --bsr11 --lazy --ohh January 30, 2017 @ 10:40

If there are multiple parameter sets yielding the same compressed size, only the first one found is shown.

Most recent activity on January 31, 2017 @ 11:49.

Heatmaps

This Zopfli heatmap visualizes how compression changes when modifying the --bsr and --mls parameter.
Cell's contents is the best filesize achieved (in bytes, hover with mouse over cells to see number of iterations).

Good parameters are green, bad are red. The best and worst are bold as well.
The brightness of the blue background color indicates how many iterations were processed:
10,000, 100,000 or 1,000,000.
bsr \ mls
2 4 8 16 32 64 128 256 512 1024 2048 4096 8192 16384 32768
bsr \ mls
2 4 8 16 32 64 128 256 512 1024 2048 4096 8192 16384 32768
68943 68971 68858 68882 68878 68880 68893 68911 68873 68841 68829 68811 68799 68796 68782
68851 68621 68606 68728 68856 68703 68657 68600 68716 68739 68731 68739 68631 68729 68716
68602 68584 68686 68726 68661 68658 68668 68582 68600 68680 68711 68726 68732 68752 68729
68872 68581 68607 68769 68726 68659 68764 68706 68584 68731 68743 68736 68748 68738 68724
68635 68595 68602 68653 68655 68658 68778 68706 68793 68711 68731 68719 68761 68731 68752
68620 68705 68582 68714 68574 68656 68660 68585 68694 68714 68713 68719 68732 68751 68728
68722 68647 68587 68717 69636 69637 68760 68773 68696 68702 68720 68720 68731 68741 68736
68626 68577 68568 68654 68650 68655 68751 68577 68612 68726 68709 68721 68739 68725 68742
68719 68574 68629 68616 68658 68663 68745 68701 68560 68713 68709 68738 68758 68741 68735
68620 68589 68621 68651 68659 68656 68784 68706 68566 68718 68707 68735 68723 68728 68741
68719 68714 68578 68664 68661 68653 68743 68701 68579 68703 68713 68741 68724 68741 68744
68604 68721 68579 68651 68659 68659 68748 68709 68579 68699 68711 68736 68730 68729 68749
68744 68673 68582 68652 68661 68655 68740 68713 68566 68566 68710 68743 68699 68745 68732
68584 68575 68580 68680 68717 68711 68744 68711 68553 68717 68710 68738 68677 68715 68716
68621 68585 68586 68645 69636 68710 68744 68710 68694 68568 68713 68732 68700 68729 68708
68616 68677 68678 68711 68799 68792 68783 68711 68696 68701 68713 68719 68696 68704 68748
68622 68579 68677 68711 69655 69631 68779 68707 68695 68699 68711 68719 68734 68738 68709
68620 68583 68630 68714 68736 68597 68774 68731 68696 68699 68713 68718 68711 68728 68706
68622 68578 68587 68719 68658 68659 68773 68668 68697 68671 68678 68719 68749 68723 68713
68590 68582 68571 68718 68656 68658 68656 68679 68560 68670 68710 68720 68701 68743 68721
68582 68589 68579 68714 68717 68661 68655 68712 68567 68569 68677 68727 68744 68734 68711
68621 68620 68581 68614 69642 68796 68758 68739 68711 68786 68664 68709 68728 68723 68722
68618 68583 68616 68651 68718 68576 68747 68720 68558 68785 68667 68715 68727 68736 68692

Due to the Monte Carlo design of my search algorithm, not all parameters have reached the same number of iterations yet:
Iterations Min. Bytes Reduction Coverage
100 68599 bytes 100%
1,000 68572 bytes -27 bytes 100%
10,000 68564 bytes -8 bytes 100%
100,000 68557 bytes -7 bytes 1.16%
1,000,000 68553 bytes -4 bytes 0.29%
10,000,000

KZIP has far less options available for tuning/optimization. I only played around with the number of blocks (parameter -n):
Blocks Min. Bytes Compared To Best Zopfli Compared To Best KZIP
68822 bytes +269 bytes (+0.39%) +13 bytes
70129 bytes +1576 bytes (+2.30%) +1320 bytes
69814 bytes +1261 bytes (+1.84%) +1005 bytes
68938 bytes +385 bytes (+0.56%) +129 bytes
68816 bytes +263 bytes (+0.38%) +7 bytes
68837 bytes +284 bytes (+0.41%) +28 bytes
68841 bytes +288 bytes (+0.42%) +32 bytes
68809 bytes +256 bytes (+0.37%)
68814 bytes +261 bytes (+0.38%) +5 bytes

Non-DEFLATE Algorithms

Archivers based on completely different compression algorithms often produce superior results.
Unfortunately, browsers only support gzip compression at the moment.
Algorithm Program Parameters Size Compared To Best Zopfli
ZPAQ (Wikipedia) zpaq zpaq -method 69 53913 bytes -14640 bytes (-21.36%)
RAR (proprietary) RAR rar a -m5 -md64m -mc63:128t -mt1 59982 bytes -8571 bytes (-12.50%)
LZMA2 (Wikipedia) xz xz -9 60752 bytes -7801 bytes (-11.38%)
Brotli (Wikipedia) brotli brotli -q 11 60944 bytes -7609 bytes (-11.10%)
PPMd (Wikipedia) 7zip 7za a -mx=9 -m0=ppmd 61917 bytes -6636 bytes (-9.68%)
ZSTD (Wikipedia) zstd zstd -19 66187 bytes -2366 bytes (-3.45%)
Burrows-Wheeler transform (Wikipedia) bzip2 bzip2 -9 67386 bytes -1167 bytes (-1.70%)

Detailled Analysis

I wrote a DEFLATE decoder in Javascript. Click the button below to start a client-side analysis of the smallest gzipped files (may take a second):


Notes: pigz is a fast open source multi-threaded implementation of gzip written by one of the original authors of gzip.
However, when using compression level 11, pigz actually switches to the slower Zopfli algorithm and isn't multi-threaded anymore.
KrzyMOD's extensions to Zopfli offer the highest level of configuration and is therefore used for my brute-force search.
Ken Silverman wrote the closed-source KZIP compression program and Jonathon Fowler ported it to Linux.
Defluff was created by Joachim Henke; DeflOpt is a tool by Ben Jos Walbeehm.

website made by Stephan Brumme in 2015 and still improving in 2017.
all timestamps are displayed in central european time. see my changelog.
no flash, not even images or external css files - and everything squeezed into a single html file.
which was handsomely compressed before releasing it into the wild internet - obviously.

please visit my homepage and my blog, too.
email: minime (at) stephan-brumme.com