From 07f72cff6ab5801f15a0587f2b52714af81e0c41 Mon Sep 17 00:00:00 2001 From: Matthieu Baumann Date: Mon, 10 Jun 2024 15:47:45 +0200 Subject: [PATCH] doc fixes --- src/js/A.js | 22 ------------------ src/js/Catalog.js | 41 +++++++++++++++++---------------- tutorials/Examples.md | 3 +++ tutorials/{UIGuide.md => UI.md} | 2 +- 4 files changed, 25 insertions(+), 43 deletions(-) create mode 100644 tutorials/Examples.md rename tutorials/{UIGuide.md => UI.md} (99%) diff --git a/src/js/A.js b/src/js/A.js index 8cf68555..4bd21b26 100644 --- a/src/js/A.js +++ b/src/js/A.js @@ -452,28 +452,6 @@ A.MOCFromPolygon= function (polygon, options, successCallback, errorCallback) { return moc; }; -/** - * Represents options for configuring a catalog. - * - * @typedef {Object} CatalogOptions - * @property {string} url - The URL of the catalog. - * @property {string} [name="catalog"] - The name of the catalog. - * @property {string} [color] - The color associated with the catalog. - * @property {number} [sourceSize=8] - The size of the sources in the catalog. - * @property {number} [markerSize=12] - The size of the markers associated with sources. - * @property {string} [shape="square"] - The shape of the sources (e.g., "square", "circle", "rhomb", "triangle", "cross"). - * @property {number} [limit] - The maximum number of sources to display. - * @property {function} [onClick] - The callback function to execute on a source click. - * @property {boolean} [readOnly=false] - Whether the catalog is read-only. - * @property {string} [raField] - The ID or name of the field holding Right Ascension (RA). - * @property {string} [decField] - The ID or name of the field holding Declination (dec). - * @property {function} [filter] - The filtering function for sources. Returns a boolean - * @property {boolean} [displayLabel=false] - Whether to display labels for sources. - * @property {string} [labelColumn] - The name of the column to be used for the label. - * @property {string} [labelColor] - The color of the source labels. - * @property {string} [labelFont="10px sans-serif"] - The font for the source labels. - */ - /** * Represents a catalog with configurable options for display and interaction. * diff --git a/src/js/Catalog.js b/src/js/Catalog.js index 6e7cdf1f..0326bb5d 100644 --- a/src/js/Catalog.js +++ b/src/js/Catalog.js @@ -40,34 +40,35 @@ import { Circle } from "./shapes/Circle.js"; import { Footprint } from "./Footprint.js"; /** + * Represents options for configuring a catalog. * - * @namespace - * @typedef {Object} Catalog + * @typedef {Object} CatalogOptions +* @property {string} url - The URL of the catalog. +* @property {string} [name="catalog"] - The name of the catalog. +* @property {string} [color] - The color associated with the catalog. +* @property {number} [sourceSize=8] - The size of the sources in the catalog. +* @property {string|function|Image|HTMLCanvasElement} [shape="square"] - The shape of the sources (can be, "square", "circle", "plus", "cross", "rhomb", "triangle"). +* @property {number} [limit] - The maximum number of sources to display. +* @property {string|Function} [onClick] - Whether the source data appears as a table row or a in popup. Can be 'showTable' string, 'showPopup' string or a custom user defined function that handles the click. +* @property {boolean} [readOnly=false] - Whether the catalog is read-only. +* @property {string} [raField] - The ID or name of the field holding Right Ascension (RA). +* @property {string} [decField] - The ID or name of the field holding Declination (dec). +* @property {function} [filter] - The filtering function for sources. +* @property {string} [selectionColor="#00ff00"] - The color to apply to selected sources in the catalog. +* @property {string} [hoverColor=color] - The color to apply to sources in the catalog when they are hovered. +* @property {boolean} [displayLabel=false] - Whether to display labels for sources. +* @property {string} [labelColumn] - The name of the column to be used for the label. +* @property {string} [labelColor=color] - The color of the source labels. +* @property {string} [labelFont="10px sans-serif"] - The font for the source labels. */ + export let Catalog = (function () { /** * Represents a catalog with configurable options for display and interaction. * * @class * @constructs Catalog - * @param {Object} options - Configuration options for the catalog. - * @param {string} options.url - The URL of the catalog. - * @param {string} [options.name="catalog"] - The name of the catalog. - * @param {string} [options.color] - The color associated with the catalog. - * @param {number} [options.sourceSize=8] - The size of the sources in the catalog. - * @param {string|function|Image|HTMLCanvasElement} [options.shape="square"] - The shape of the sources (can be, "square", "circle", "plus", "cross", "rhomb", "triangle"). - * @param {number} [options.limit] - The maximum number of sources to display. - * @param {string|Function} [options.onClick] - Whether the source data appears as a table row or a in popup. Can be 'showTable' string, 'showPopup' string or a custom user defined function that handles the click. - * @param {boolean} [options.readOnly=false] - Whether the catalog is read-only. - * @param {string} [options.raField] - The ID or name of the field holding Right Ascension (RA). - * @param {string} [options.decField] - The ID or name of the field holding Declination (dec). - * @param {function} [options.filter] - The filtering function for sources. - * @param {string} [options.selectionColor] - The color to apply to selected sources in the catalog. - * @param {string} [options.hoverColor] - The color to apply to sources in the catalog when they are hovered. - * @param {boolean} [options.displayLabel=false] - Whether to display labels for sources. - * @param {string} [options.labelColumn] - The name of the column to be used for the label. - * @param {string} [options.labelColor] - The color of the source labels. - * @param {string} [options.labelFont="10px sans-serif"] - The font for the source labels. + * @param {CatalogOptions} options - Configuration options for the catalog. * * @example * const catalogOptions = { diff --git a/tutorials/Examples.md b/tutorials/Examples.md new file mode 100644 index 00000000..edea0d6a --- /dev/null +++ b/tutorials/Examples.md @@ -0,0 +1,3 @@ +# JS API + +A list of examples illustrating the API is available at this [link](https://aladin.cds.unistra.fr/AladinLite/doc/API/examples/) diff --git a/tutorials/UIGuide.md b/tutorials/UI.md similarity index 99% rename from tutorials/UIGuide.md rename to tutorials/UI.md index 41d3482c..00db33ed 100644 --- a/tutorials/UIGuide.md +++ b/tutorials/UI.md @@ -1,4 +1,4 @@ -# User guide +# Customization This is a guide for users wanting to customize the apparence of Aladin Lite user interface.