D3
OG
Old school D3 from simpler times
All examples
By author
By category
About
tophtucker
Full window
Github gist
Mystery box
Inspired by
@veltman
.
<!DOCTYPE html> <meta charset="utf-8"> <style> body { padding: 2em; text-align: center; } </style> <body> <img src="box.jpg"> </body> <script> var user = 'tophtucker'; fetch('https://api.github.com/users/' + user + '/gists').then(function(response) { return response.ok ? response.text() : Promise.reject(response.status); }).then(function(text) { var gists = JSON.parse(text); window.location = 'https://bl.ocks.org/' + user + '/' + gists[Math.floor(Math.random() * gists.length)].id; }); </script>