D3
OG
Old school D3 from simpler times
All examples
By author
By category
About
samurainamedmarcus
Full window
Github gist
weather_02022017
Built with
blockbuilder.org
<!DOCTYPE html> <head> <meta charset="utf-8"> <script src="https://d3js.org/d3.v4.min.js"></script> <style> body { margin:0;position:fixed;top:0;right:0;bottom:0;left:0; } </style> </head>"Harrisonburg Weather" ` <body> <script> var json = ({"coord":{"lon":-78.87,"lat":38.45},"weather":[{"id":800,"main":"Clear","description":"clear sky","icon":"01d"}],"base":"stations","main":{"temp":278.39,"pressure":1021,"humidity":55,"temp_min":276.15,"temp_max":281.15},"visibility":16093,"wind":{"speed":3.6,"deg":200},"clouds":{"all":1},"dt":1486047180,"sys":{"type":1,"id":2880,"message":0.1654,"country":"US","sunrise":1486037944,"sunset":1486075200},"id":4763231,"name":"Harrisonburg","cod":200}) console.log(json["name"]); console.log(json.name); console.log(json.main.temp) console.log(json.main.humidity) console.log(json.main.pressure) console.log(json.main.temp * 9/5 - 459.67); var base_url = "https://openweathermap.org/img/w/" var suffix = ".png" var icon = json.weather[0].icon console.log(base_url + icon + suffix) </script> </body>
https://d3js.org/d3.v4.min.js