Public
Edited
Dec 12, 2023
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
url_example_1 = "https://corsproxy.io/?https://services.surfline.com/kbyg/spots/forecasts/wave?spotId="+spotid
Insert cell
Insert cell
wave_data_example_1 = (await fetch(url_example_1)).json()
Insert cell
Insert cell
Insert cell
Insert cell
just_data_plus_date = add_formatted_date(wave_data_example_1,"wave")
Insert cell
Insert cell
number_of_forecast_instances =wave_data_example_1.data.wave.length
Insert cell
last_item_in_array_numb = number_of_forecast_instances -1
Insert cell
timestamp = wave_data_example_1.data.wave[0].timestamp
Insert cell
wave_data_example_1.data.wave[0].timestamp
Insert cell
Insert cell
first_forecast = new Date(wave_data_example_1.data.wave[0].timestamp * 1000)
Insert cell
last_forecast = new Date(wave_data_example_1.data.wave[last_item_in_array_numb].timestamp * 1000)
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
L = {
const L = await require("leaflet@1/dist/leaflet.js");
if (!L._style) {
const href = await require.resolve("leaflet@1/dist/leaflet.css");
document.head.appendChild(L._style = html`<link href=${href} rel=stylesheet>`);
}
return L;
}
Insert cell
Insert cell
Insert cell
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more