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

After GZIP compression these minified files vary in size:
Boot
  83036 bytes (81.1k)
CDN
cdnjs
  73431 bytes (71.7k)
CDN
gzip -6 (default)
  72989 bytes (71.3k)
local copy
jsdelivr
  72982 bytes (71.3k)
CDN
gzip -9
  72712 bytes (71.0k)
local copy
libdeflate -12
  69886 bytes (68.2k)
local copy
7zip -mx=9 -tgzip
  69647 bytes (68.0k)
local copy
kzip -s0 -rn -b7
  69315 bytes (67.7k)
local copy
pigz -11 -n
  69173 bytes (67.6k)
local copy
Zopfli
  69096 bytes (67.5k)
local copy
Zopfli (defluff)
  69092 bytes (67.5k)
local copy

perma-link to the smallest file on my server:
http://minime.stephan-brumme.com/files/d3/d3-4.7.0.min.js (or via HTTPS)

You will automatically get the smallest D3 4.7.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 3886 bytes by using my D3 4.7.0 Zopfli version instead of the best available CDN (5.62% smaller than jsdelivr, 69096 vs. 72982 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 --mls4 --bsr11 --lazy --ohh

(found May 3, 2017)
Description Value Parameter
iterations 1000000  --i1000000
maximum blocks 8  --mb8
maximum length score 4  --mls4
block splitting recursion 11  --bsr11
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 4 more bytes (69092 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.7.0/d3.zip --location | md5sum
9abe1be5a187a5d757f87656bfe69953  -
curl --silent --compressed https://minime.stephan-brumme.com/files/d3/d3-4.7.0.min.zopfli.js.gz | md5sum
9abe1be5a187a5d757f87656bfe69953  -

SHA1:
curl --silent --compressed https://raw.githubusercontent.com/mbostock/d3/v4.7.0/d3.zip --location | sha1sum
4e4d4eee3efb4cba137e96f8fd5f57cee1ea772d  -
curl --silent --compressed https://minime.stephan-brumme.com/files/d3/d3-4.7.0.min.zopfli.js.gz | sha1sum
4e4d4eee3efb4cba137e96f8fd5f57cee1ea772d  -

All listed CDNs deliver identical contents:
CDN Size (compressed) MD5 (uncompressed) Timestamp
Boot 83036 bytes 9abe1be5a187a5d757f87656bfe69953 March 3, 2017 @ 17:52
cdnjs 73431 bytes 9abe1be5a187a5d757f87656bfe69953 February 28, 2017 @ 21:33
jsdelivr 72982 bytes 9abe1be5a187a5d757f87656bfe69953 October 25, 2017 @ 16:11

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

Other Versions

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

5.7.0, 5.6.0, 5.5.0, 5.4.0, 5.3.0, 5.2.0, 5.1.0, 5.0.1, 5.0.0,
4.13.0, 4.12.2, 4.12.1, 4.12.0, 4.11.0, 4.10.2, 4.10.1, 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
69096 bytes -4 bytes zopfli --i1000000 --mls4 --bsr11 --lazy --ohh May 3, 2017 @ 08:51
69100 bytes -1 byte zopfli --i100000 --mls4 --bsr20 --lazy --ohh May 2, 2017 @ 19:36
69101 bytes -4 bytes zopfli --i100000 --mls4 --bsr11 --lazy --ohh May 2, 2017 @ 18:18
69105 bytes -10 bytes zopfli --i10000 --mls4 --bsr11 --lazy --ohh April 29, 2017 @ 02:48
69115 bytes -2 bytes zopfli --i1000 --mls4 --bsr20 --lazy --ohh April 28, 2017 @ 15:38
69117 bytes -28 bytes zopfli --i1000 --mls4 --bsr23 --lazy --ohh April 28, 2017 @ 15:33
69145 bytes zopfli --i100 --mls4 --bsr20 --lazy --ohh April 28, 2017 @ 14:37

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

Most recent activity on October 25, 2017 @ 16:11.

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
69431 69540 69352 69378 69393 69374 69408 69349 69380 69368 69357 69338 69323 69310 69375
69232 69214 69144 69143 69160 69168 69166 69144 69162 69285 69246 69257 69256 69259 69275
69238 69115 69123 69111 69132 69102 69128 69251 69263 69249 69251 69258 69256 69248 69254
69155 69146 69136 69150 69160 69185 69467 69242 69240 69247 69251 69281 69278 69253 69285
69175 69164 69123 69150 69255 69311 69330 69246 69265 69243 69261 69255 69266 69272 69263
69145 69148 69348 69158 69358 69305 69285 69255 69135 69241 69237 69241 69281 69249 69274
69145 69104 69186 69336 70138 69263 69338 69267 69240 69241 69248 69260 69247 69239 69253
69156 69096 69139 69104 69305 69275 69281 69249 69244 69236 69243 69258 69240 69257 69243
69181 69139 69140 69146 70160 69279 69310 69246 69291 69234 69246 69253 69268 69286 69290
69150 69148 69142 69153 69258 69266 69336 69270 69250 69236 69246 69267 69258 69272 69255
69155 69148 69226 69151 69289 69290 70160 69248 69259 69236 69243 69242 69240 69272 69239
69148 69188 69139 69149 69252 69316 69227 69247 69246 69240 69240 69252 69242 69242 69237
69176 69174 69136 69147 69253 69276 69223 69244 69137 69203 69244 69242 69238 69270 69298
69185 69238 69140 69149 69257 69353 69316 69236 69247 69203 69216 69249 69237 69244 69312
69150 70154 69301 69306 69343 69301 69338 69242 69269 69214 69204 69275 69272 69271 69287
69147 69148 69355 69309 69353 69361 69308 69213 69239 69219 69206 69244 69257 69242 69294
69193 69096 69265 69298 69342 69261 69330 69244 69248 69236 69210 69257 69256 69243 69295
69148 69149 69139 69151 69253 69260 69337 69243 69238 69207 69238 69249 69259 69235 69288
69150 69242 69140 69218 69217 69264 69340 69245 69240 69219 69243 69244 69254 69260 69299
69145 69111 69145 69147 69143 69188 69254 69245 69246 69209 69205 69257 69249 69245 69242
69145 69237 69139 69351 69256 69288 69273 69280 69247 69203 69214 69291 69273 69245 69243
69180 69183 69222 69184 69268 69234 69214 69260 69255 69217 69224 69257 69253 69257 69270
69185 69248 69226 69227 70142 69262 69252 69214 69228 69204 69214 69264 69254 69258 69272

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 69145 bytes 100%
1,000 69115 bytes -30 bytes 100%
10,000 69105 bytes -10 bytes 100%
100,000 69100 bytes -5 bytes 2.03%
1,000,000 69096 bytes -4 bytes 0.58%
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
69339 bytes +243 bytes (+0.35%) +24 bytes
70652 bytes +1556 bytes (+2.25%) +1337 bytes
70334 bytes +1238 bytes (+1.79%) +1019 bytes
69458 bytes +362 bytes (+0.52%) +143 bytes
69341 bytes +245 bytes (+0.35%) +26 bytes
69355 bytes +259 bytes (+0.37%) +40 bytes
69364 bytes +268 bytes (+0.39%) +49 bytes
69315 bytes +219 bytes (+0.32%)
69320 bytes +224 bytes (+0.32%) +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.
However, support for Brotli is constantly growing - but your browser doesn't support it.
Algorithm Program Parameters Size Compared To Best Zopfli
ZPAQ (Wikipedia) zpaq zpaq -method 69 54234 bytes -14862 bytes (-21.51%)
RAR (proprietary) RAR rar a -m5 -md64m -mc63:128t -mt1 60392 bytes -8704 bytes (-12.60%)
LZMA2 (Wikipedia) xz xz -9 61208 bytes -7888 bytes (-11.42%)
Brotli (Wikipedia) brotli brotli -q 11 61463 bytes -7633 bytes (-11.05%)
PPMd (Wikipedia) 7zip 7za a -mx=9 -m0=ppmd 62337 bytes -6759 bytes (-9.78%)
Zstandard (Wikipedia) zstd zstd -19 66768 bytes -2328 bytes (-3.37%)
Burrows-Wheeler transform (Wikipedia) bzip2 bzip2 -9 67809 bytes -1287 bytes (-1.86%)

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 2018.
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