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

One platform to build and deploy the best data apps

Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Learn more