new Catalog(options)
Constructor function for creating a new catalog instance.
Parameters:
Name |
Type |
Description |
options |
Object
|
Configuration options for the catalog.
Properties
Name |
Type |
Attributes |
Default |
Description |
url |
string
|
|
|
The URL of the catalog. |
name |
string
|
<optional>
|
"catalog"
|
The name of the catalog. |
color |
string
|
<optional>
|
|
The color associated with the catalog. |
sourceSize |
number
|
<optional>
|
8
|
The size of the sources in the catalog. |
shape |
string
|
function
|
Image
|
HTMLCanvasElement
|
<optional>
|
"square"
|
The shape of the sources (can be, "square", "circle", "plus", "cross", "rhomb", "triangle"). |
limit |
number
|
<optional>
|
|
The maximum number of sources to display. |
onClick |
string
|
function
|
<optional>
|
|
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. |
readOnly |
boolean
|
<optional>
|
false
|
Whether the catalog is read-only. |
raField |
string
|
<optional>
|
|
The ID or name of the field holding Right Ascension (RA). |
decField |
string
|
<optional>
|
|
The ID or name of the field holding Declination (dec). |
filter |
function
|
<optional>
|
|
The filtering function for sources. |
selectionColor |
string
|
<optional>
|
|
The color to apply to selected sources in the catalog. |
hoverColor |
string
|
<optional>
|
|
The color to apply to sources in the catalog when they are hovered. |
displayLabel |
boolean
|
<optional>
|
false
|
Whether to display labels for sources. |
labelColumn |
string
|
<optional>
|
|
The name of the column to be used for the label. |
labelColor |
string
|
<optional>
|
|
The color of the source labels. |
labelFont |
string
|
<optional>
|
"10px sans-serif"
|
The font for the source labels. |
|
- Source:
Example
const catalogOptions = {
url: "https://example.com/catalog",
name: "My Catalog",
color: "#ff0000",
sourceSize: 10,
markerSize: 15,
shape: "circle",
limit: 1000,
onClick: (source) => { /* handle source click * },
readOnly: true,
raField: "ra",
decField: "dec",
filter: (source) => source.mag < 15,
selectionColor: "#00ff00",
hoverColor: "#ff00ff",
displayLabel: true,
labelColor: "#00ff00",
labelFont: "12px Arial"
};
const myCatalog = new Catalog(catalogOptions);