Catalog

Catalog

new Catalog(options)

Description:
  • Represents a catalog with configurable options for display and interaction.
Source:
Example
aladin.addCatalog(A.catalogFromVizieR("VII/237/pgc", "M31", 3, {
  limit: 1000,
  onClick: 'showTable',
  color: 'yellow',
  hoverColor: 'blue',
  shape: (s) => {
    let coo = A.coo();
    coo.parse(s.data['RAJ2000'] + ' ' + s.data['DEJ2000'])

    let a = (0.1 * Math.pow(10, +s.data.logD25)) / 60;
    let b = (1.0 / Math.pow(10, +s.data.logR25)) * a

    return A.ellipse(coo.lon, coo.lat, a, b, +s.data.PA, {lineWidth: 3});
  }
}));
Parameters:
Name Type Description
options CatalogOptions Configuration options for the catalog.

Members

removeAll

Description:
  • Clear all the sources from the catalog
Source:
Clear all the sources from the catalog

Methods

addSources(sources)

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

addSourcesAsArray(columnNames, array)

Description:
  • Create sources from a 2d array and add them to the catalog
Source:
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

deselectAll()

Description:
  • Unselect all the source of the catalog
Source:

getSource(idx) → {Source}

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

getSourceSize() → {number}

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

getSources() → {Array.<Source>}

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

hide()

Description:
  • Hide the catalog
Source:

remove(source)

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

selectAll()

Description:
  • Select all the source catalog
Source:

setColor(color)

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

setHoverColor(color)

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

setSelectionColor(color)

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

setShape(shapeopt)

Description:
  • Set the shape of the catalog sources
Source:
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.

setSourceSize(sourceSize)

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

show()

Description:
  • Show the catalog
Source:

updateShape(optionsopt)

Description:
  • Set the shape of the sources
Source:
Parameters:
Name Type Attributes Description
options Object <optional>
shape options
Properties
Name Type Attributes Default Description
color string <optional>
the color of the shape
selectionColor string <optional>
the color of the shape when selected
sourceSize number <optional>
size of the shape
hoverColor string <optional>
options.color the color to apply to sources in the catalog when they are hovered.
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.
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.