From dcfff32fcc82ce08f04279579d5dc8cbce37efb3 Mon Sep 17 00:00:00 2001 From: Mashintime Date: Sat, 4 Nov 2023 14:56:25 -0400 Subject: [PATCH] Function descriptions --- gui/src/js/freedata.ts | 10 ++++++++++ gui/src/js/waterfallHandler.js | 7 +++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/gui/src/js/freedata.ts b/gui/src/js/freedata.ts index 18fdd623..01bf11a5 100644 --- a/gui/src/js/freedata.ts +++ b/gui/src/js/freedata.ts @@ -26,6 +26,11 @@ export function atob(data) { return window.btoa(Buffer.from(data, "base64").toString("utf8")); } //https://medium.com/@asadise/sorting-a-json-array-according-one-property-in-javascript-18b1d22cd9e9 +/** + * Sort a json collection by a property ascending + * @param {string} property property to sort on + * @returns sorted json collection + */ export function sortByProperty(property) { return function (a, b) { if (a[property] > b[property]) return 1; @@ -36,6 +41,11 @@ export function sortByProperty(property) { } //https://medium.com/@asadise/sorting-a-json-array-according-one-property-in-javascript-18b1d22cd9e9 +/** + * Sort a json collection by a property descending + * @param {string} property property to sort on + * @returns sorted json collection + */ export function sortByPropertyDesc(property) { return function (a, b) { if (a[property] < b[property]) return 1; diff --git a/gui/src/js/waterfallHandler.js b/gui/src/js/waterfallHandler.js index b2e0156d..022cf446 100644 --- a/gui/src/js/waterfallHandler.js +++ b/gui/src/js/waterfallHandler.js @@ -25,10 +25,13 @@ export function addDataToWaterfall(data) { //console.log(e); } } - +/** + * Setwaterfall colormap array by index + * @param {number} index colormap index to use + */ export function setColormap(index) { if (isNaN(index)) index=0; - console.log("Setting waterfall colormap to " + index) + //console.log("Setting waterfall colormap to " + index) spectrum.setColorMap(index); }