// Helper function for synchronizing variables across cells, see https://observablehq.com/@observablehq/synchronized-inputsfunctionadjust(input, value) {// Set a new value to the input input.value= input.value+ value;// Dispatch an update event to the input input.dispatchEvent(newEvent("input", {bubbles:true}));}
viewof newbirb =html`<button>New Birb</button>`;//html`<p style="font-family:courier;">This is a paragraph.</p>`;// Select from array of birb datacurrent_birb = {set(viewof score,20);const buttonClicked =await newbirb;return birbdata[Math.floor(Math.random()*birbdata.length)];}
Code
viewof CS = { newbirb;let value =0;const button =html`<button>[1] Conservation Status</button>`;Object.defineProperty(button,"value", {get() { return value; }}); button.onclick= () =>++value;return button;}CStext = {if (CS >0) {//Adjust score at one button press asdasif (CS ==1){adjust(viewof score,-1)};//Change conservation status textreturn (newbirb, current_birb[0][0]) } else {return"\n"}}//Output conservation status textviewof CSA = Inputs.text({value:CStext,disabled:true})
Code
viewof BN = { newbirb;let value =0;const button =html`<button>[1] Binomial name</button>`;Object.defineProperty(button,"value", {get() { return value; }}); button.onclick= () =>++value;return button;}BNtext = {if (BN >0) {//Adjust score at one button press asdasif (BN ==1){adjust(viewof score,-1)};//Change conservation status textreturn (newbirb, current_birb[1][0]) } else {return"\n"}}//Output conservation status textviewof BNA = Inputs.text({value:BNtext,disabled:true})
Compliance:
This material uses data from the eBird Status and Trends Project at the Cornell Lab of Ornithology, eBird.org. Any opinions, findings, and conclusions or recommendations expressed in this material are those of the author(s) and do not necessarily reflect the views of the Cornell Lab of Ornithology.
Range data: Fink, D., T. Auer, A. Johnston, M. Strimas-Mackey, S. Ligocki, O. Robinson, W. Hochachka, L. Jaromczyk, C. Crowley, K. Dunham, A. Stillman, I. Davies, A. Rodewald, V. Ruiz-Gutierrez, C. Wood. 2023. eBird Status and Trends, Data Version: 2022; Released: 2023. Cornell Lab of Ornithology, Ithaca, New York. https://doi.org/10.2173/ebirdst.2022