From 4eea3d3bf996306e295ce9a60d71be57037f17ab Mon Sep 17 00:00:00 2001 From: Matthieu Baumann Date: Thu, 13 Feb 2025 23:25:21 +0100 Subject: [PATCH] #210 add documentation for catalogFromSimbad and fix the default nb_ref order to be in desc order direction by default --- src/js/A.js | 8 +++++--- src/js/URLBuilder.js | 3 +++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/js/A.js b/src/js/A.js index c6cd668c..32fc57e5 100644 --- a/src/js/A.js +++ b/src/js/A.js @@ -648,9 +648,11 @@ A.catalogFromURL = function (url, options, successCallback, errorCallback, usePr * @param {number} target.ra - Right Ascenscion in degrees of the cone's center * @param {number} target.dec - Declination in degrees of the cone's center * @param {number} radius - Radius of the cone in degrees - * @param {Object|CatalogOptions} [options] - Additional configuration options for SIMBAD cone search. See the {@link https://simbad.cds.unistra.fr/cone/help/#/ConeSearch/get_ SIMBAD cone search} parameters. - * @param {number} [options.limit] - The max number of sources to return - * @param {string} [options.orderBy='nb_ref'] - Order the result by specific ref number + * @param {Object|CatalogOptions} [options] - Additional configuration options for SIMBAD cone search. See this {@link https://simbad.cds.unistra.fr/cone/help/#/ConeSearch/get_ SIMBAD cone search} page for more explanations about the optional parameters you can pass here. + * @param {number} [options.limit] - The max number of sources to return. The SIMBAD query will be truncated so that the output does not exceed that number of rows. + * @param {string} [options.orderBy='nb_ref'] - Return the sources satisfying a specific order in priority. Default is descending order based on the ref number of the source i.e. sources will be returned from the most cited one at first to the least cited one at last. + * Available values are: oid4, oid4ref, main_id, ra, dec, coo, otype, otype_label, pm, radvel, plx, dim, sp_type, morph_type, U, B, V, R, I, J, H, K, G, nb_ref, distance + * @param {string} [options.orderDir='DESC'] - Change to 'ASC' for ascending order. By default, sources being the most referred are returned at first (i.e. 'nb_ref' in DESC order dir). * @param {number} [options.verbosity=2] - Verbosity, put 3 if you want all the column * @param {function} [successCallback] - The callback function to execute on successful catalog creation. * @param {function} [errorCallback] - The callback function to execute on error during catalog creation. diff --git a/src/js/URLBuilder.js b/src/js/URLBuilder.js index 0c8a88de..0bd7aa39 100644 --- a/src/js/URLBuilder.js +++ b/src/js/URLBuilder.js @@ -47,6 +47,9 @@ export let URLBuilder = (function() { const orderBy = options && options.orderBy || 'nb_ref'; url += '&ORDER_BY=' + orderBy; + const orderDir = options && options.orderDir || 'DESC'; + url += '&ORDER_DIR=' + orderDir; + return url; },