Class: Catalog

Catalog(options)

new Catalog(options)

Represents a catalog with configurable options for display and interaction.
Parameters:
Name Type Description
options CatalogOptions Configuration options for the catalog.
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 sources
  },
  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);

Members

removeAll

Clear all the sources from the catalog
Source:

Methods

addSources(sources)

Add sources to the catalog
Parameters:
Name Type Description
sources Array.<Source> An array of sources or only one source to add
Source:

addSourcesAsArray(columnNames, array)

Create sources from a 2d array and add them to the catalog
Parameters:
Name Type Description
columnNames Array.<String> array with names of the columns
array Array.<Array.<String>> | Array.<Array.<number>> 2D-array, each item being a 1d-array with the same number of items as columnNames
Source:

deselectAll()

Unselect all the source of the catalog
Source:

getSource(idx) → {Source}

Get one source by its index in the catalog
Parameters:
Name Type Description
idx number the index of the source in the catalog sources
Source:
Returns:
- the source at the index
Type
Source

getSourceSize() → {number}

Get the size of the catalog sources
Source:
Returns:
- the size of the sources
Type
number

getSources() → {Array.<Source>}

Get all the sources
Source:
Returns:
- an array of all the sources in the catalog object
Type
Array.<Source>

hide()

Hide the catalog
Source:

remove(source)

Remove a specific source from the catalog
Parameters:
Name Type Description
source Source the source to remove
Source:

selectAll()

Select all the source catalog
Source:

setColor(color)

Set the color of the catalog
Parameters:
Name Type Description
color String the new color
Source:

setHoverColor(color)

Set the color of hovered sources
Parameters:
Name Type Description
color String the new color
Source:

setSelectionColor(color)

Set the color of selected sources
Parameters:
Name Type Description
color String the new color
Source:

setShape(shapeopt)

Set the color of the catalog
Parameters:
Name Type Attributes Default Description
shape string | function | HTMLImageCanvas | HTMLImageElement <optional>
"square" the type of the shape. Can be square, rhomb, plus, cross, triangle, circle. A callback function can also be called that return an HTMLImageElement in function of the source object. A canvas or an image can also be given.
Source:

setSourceSize(sourceSize)

Set the size of the catalog sources
Parameters:
Name Type Description
sourceSize number the new size
Source:

show()

Show the catalog
Source:

updateShape(optionsopt)

Set the shape of the sources
Parameters:
Name Type Attributes Description
options Object <optional>
shape options
Properties
Name Type Attributes Default Description
color string <optional>
the color of the shape
sourceSize number <optional>
size of the shape
shape string | function | HTMLImageCanvas | HTMLImageElement <optional>
"square" the type of the shape. Can be square, rhomb, plus, cross, triangle, circle. A callback function can also be called that return an HTMLImageElement in function of the source object. A canvas or an image can also be given.
Source: