// /** // * // * @param {*} e // * @param {*} timespan Timespan backwards from now in hours // * @returns CSV download STA URL // */ // function csvDownloadLink(e, timespan) { // let csv; // if (e.Datastreams[0]) { // let now = new Date(); // let h = now - timespan * 3600000; // let filter = '/Observations' + // '?$resultFormat=CSV' + // '&$filter=during(phenomenonTime,' + // new Date(h).toISOString() + '/' + now.toISOString() + ')' + // '&$orderBy=phenomenonTime desc' + // '&$select=id,phenomenonTime,result' + // '&$top=10000'; // csv = e.Datastreams[0]['@iot.selfLink'] + filter; // } // return csv; // } // /** // * // * @param {*} e // * @param {*} n // * @returns // */ // function lastNObs(e, n) { // let uri; // if (e.Datastreams[0]) { // uri = e.Datastreams[0]['@iot.selfLink'] + // '/Observations' + // '?$orderBy=phenomenonTime desc' + // '&$top=' + n; // } // return uri; // } /** * * @param {*} e * @param {*} m */ function addTooltip(e, m) { // Name and @iot.ids let title = e.name; let desc = e.description; let html = `