Skip to content

Commit

Permalink
doc fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
bmatthieu3 committed Jun 11, 2024
1 parent 5b38480 commit 07f72cf
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 43 deletions.
22 changes: 0 additions & 22 deletions src/js/A.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down
41 changes: 21 additions & 20 deletions src/js/Catalog.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
3 changes: 3 additions & 0 deletions tutorials/Examples.md
Original file line number Diff line number Diff line change
@@ -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/)
2 changes: 1 addition & 1 deletion tutorials/UIGuide.md → tutorials/UI.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# User guide
# Customization

This is a guide for users wanting to customize the apparence of Aladin Lite user interface.

Expand Down

0 comments on commit 07f72cf

Please sign in to comment.