D3
OG
Old school D3 from simpler times
All examples
By author
By category
About
biovisualize
Full window
Github gist
Planet OS point API basic demo
Built with
blockbuilder.org
<!DOCTYPE html> <head> <meta charset="utf-8"> <script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.5/d3.min.js"></script> <style> </style> </head> <body> <div class="container"></div> <script> // Just grab your API key from https://data.planetos.com/account/settings/ var API_KEY = 'd7d0466b16e24b7084d0c97ea8343762'; d3.json('https://api.planetos.com/v1/datasets/noaa_ww3_global_1.25x1d/point?lon=-50.5&lat=49.5&apikey='+API_KEY, function(error, json){ console.log(json); var html = '<ul>'; json.entries.forEach(function(d, i){ d3.entries(d.data).forEach(function(dB, iB){ html += '<li>' + dB.key + ': ' + dB.value + '</li>'; }); }); html += '</ul>'; document.querySelector('.container').innerHTML = html }); </script> </body>
https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.5/d3.min.js