Published
Edited
Mar 22, 2022
6 stars
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
chartAudio(mp3Path(voegel), mp3Naming(voegel))
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
urlRaw = "https://raw.githubusercontent.com/gitalm/BirdNetPiGitHub/master/BirdDB.csv"
Insert cell
import {addTooltips} from "@mkfreeman/plot-tooltip"
Insert cell
import {SummaryTable} from "@observablehq/summary-table"
Insert cell
dataset =d3.csv(urlRaw, function(d) {
return {
Datum: d3.timeParse("%Y/%m/%d")(d.Date), // convert "Year" column to Date
Zeit: d3.timeParse("%H:%M:%S")(d.Time),
Sci_Name: d.Sci_Name,
Com_Name: d.Com_Name,
Confidence: +d.Confidence, // convert "Length" column to number
Lat: +d.Lat,
Lon: +d.Lon,
Cutoff: +d.Cutoff,
Week: +d.Week,
Sens: +d.Sens,
Overlap: +d.Overlap
};
}) // load the data directly from a github repository

Insert cell
data = d3.csv(urlRaw, d3.autoType)
Insert cell
Insert cell
mp3Path = d => `https://raw.githubusercontent.com/gitalm/BirdNetPiGitHub/master/By_Common_Name/${d.Com_Name}/` +
encodeURI(`${d.Com_Name}-${Math.floor(d.Confidence*100)}%-${d.Date.replaceAll('/', '-')}-birdnet-${d.Time}.mp3`);

Insert cell
Insert cell
mp3Naming = d => d.Com_Name + ` `+ d.Date + ' ' + d.Time + ' Confidence ' + Math.round(d.Confidence*100) + '%'
Insert cell
Insert cell
rollup = d3.flatRollup(dataset, v => v.length, d => d.Com_Name, d => d.Datum)
Insert cell
rollup_data = rollup.map(([Art, Datum, Anzahl]) => ({Art, Datum, Anzahl}))
Insert cell
Insert cell
rollh = d3.flatRollup(data, v => v.length, d => d.Com_Name, d => d.Time)
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
# Function to list all files in GitHub

Thanks to [mootari](https://talk.observablehq.com/t/get-data-from-selected-item-in-table/6315/6)
Insert cell
Insert cell
files = listGithubFiles('gitalm', 'BirdNetPiGitHub', {prefix: 'By_Common_Name/', suffix: '.mp3'})
Insert cell
Insert cell
Insert cell
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