Hierarchy

  • WWTInstance

Constructors

  • Create a WWT control, attaching it to a DOM element.

    Parameters

    • options: InitControlSettings = {}

      Options to apply to the control.

      Compared to the underlying library, this class provides a more JavaScript-y API.

    Returns WWTInstance

Properties

ctl: WWTControl

The WWTControl associated with this instance.

lm: typeof LayerManager

The LayerManager associated with this instance.

si: ScriptInterface

The ScriptInterface associated with this instance.

stc: typeof SpaceTimeController

The SpaceTimeController associated with this instance.

tourEndedCallback: null | ((tp) => void) = null

A callback to be invoked when a tour completes playing.

Type declaration

    • (tp): void
    • Parameters

      • tp: TourPlayer

      Returns void

Methods

  • Add a new HiPS catalog to the view, by name.

    The promise will resolve when the catalog metadata have fully downloaded. It will reject if the name is unrecognized.

    HiPS catalogs are something of an awkward hybrid. They are managed like imagesets, but rendered like spreadsheet layers. To get the SpreadSheetLayer associated with a HiPS catalog imageset, access:

    imgset.get_hipsProperties().get_catalogSpreadSheetLayer()
    

    You can use methods like applyTableLayerSettings to modify the settings of this layer by extracting its ID string with layer.id.toString().

    The contents of this catalog will update dynamically as the user navigates the WWT view.

    Parameters

    Returns Promise<Imageset>

  • Load an image set or a remote FITS file into a data layer and display it.

    The FITS file must be downloaded and processed, so this API is asynchronous, and is not appropriate for files that might be large.

    The image set must have previously been created with loadImageCollection

    Parameters

    Returns Promise<ImageSetLayer>

  • Add an imageset directly into the engine's database.

    If an imageset with the same URL has already been loaded, this is a no-op.

    Parameters

    • imgset: Imageset

      The imageset to add

    Returns Imageset

    Either the input argument, if it was added to the engine's database, or the pre-existing imageset. The pre-existing imageset will have the same URL but might differ in other respects, such as its name.

  • Parameters

    • setting: EngineSetting

    Returns void

  • Capture the current frame as an image.

    This function returns a Promise whose resolved value is the image represented as a Blob.

    Parameters

    Returns Promise<null | Blob>

  • Capture a video as a sequence of frames using the given parameters

    This function returns a readable stream whose values are the exported frames.

    Parameters

    Returns ReadableStream<null | Blob>

  • If the tour playback mode is active, get the active TourPlayer object.

    Returns null | TourPlayer

  • Fetch the subset of catalog HiPS data contained within the current view.

    The imageset should have been loaded with the addCatalogHipsByName call. The limit option should almost always be true, since if it is false the data-fetch operation can potentially attempt to download and return gigabytes of data.

    Parameters

    Returns Promise<InViewReturnMessage>

  • Find out how far we have progressed into the tour, in seconds.

    This number does not necessarily progress monotonically due to the way that WWT measures tour playback progress. We associate a start time with each "stop" in the tour, and can measure progress through a stop, but stops do not necessarily transition from one to another in linear fashion.

    That being said, this number should range between 0 and the runtime of the current tour. If no tour is loaded, it will be zero.

    Returns number

  • Find out whether a tour is playing.

    For obscure reasons, this is a static method in WWT that is not attached to a TourPlayer instance. We take one as an argument for future-proofiness.

    Parameters

    • _player: TourPlayer

    Returns boolean

  • Navigate the camera to the specified position, asynchronously.

    This wraps the underlying engine function of the same name, but homogenizing some of the angular arguments to use radians.

    Parameters

    • raRad: number

      The RA to seek to, in radians

    • decRad: number

      The declination to seek to, in radians

    • zoomDeg: number

      The zoom setting, in degrees

    • instant: boolean

      Whether to snap the camera instantly, or pan it

    • Optional rollRad: number

      If specified, the roll of the target camera position, in radians

    Returns Promise<void>

    A void promise that resolves when the camera arrives at the target position.

  • Command the view to show a Place.

    Parameters

    Returns Promise<void>

  • Load a tour from a URL and start playing it.

    Parameters

    • url: string

      The URL of the tour to load and play.

    Returns Promise<void>

    A promise that resolves when the tour has loaded and started playing.

  • Load a WTML collection and the imagesets that it contains.

    This function triggers a download of the specified URL, which should return an XML document in the WTML collection format. Any ImageSet entries in the collection, or Place entries containing image sets, will be added to the WWT instance’s list of available imagery. Subsequent calls to functions like setForegroundImageByName will be able to locate the new imagesets and display them to the user.

    Each unique URL is only requested once. Once a given URL has been successfully loaded, the promise returned by additional calls will resolve immediately. URL uniqueness is tested with simple string equality, so if you really want to load the same URL more than once you could add a fragment specifier.

    If the URL is not accessible due to CORS restrictions, the request will automatically be routed through the WWT’s CORS proxying service.

    Parameters

    • url: string
    • Optional loadChildFolders: boolean

      When true, this method will recursively download and unpack the content of all Folders contained in the WTML file. @returns: A promise that resolves to an initialized Folder object.

    Returns Promise<Folder>

  • Load a tour from a URL.

    Once the tour has loaded, you can use getActiveTourPlayer to get the tour player controller and the underlying tour document.

    Parameters

    • url: string

      The URL of the tour to load and play.

    Returns Promise<void>

    A promise that resolves when the tour has loaded.

  • "Seek" tour playback to approximately the specified timecode (in seconds).

    The tour will start playing back.

    This operation is approximate because WWT can only resume playback from the beginning of a "tour stop". So, if the desired timecode is in the middle of such a stop, playback will start there, not at the exact value that was commanded. This can be a little annoying when a slide is long.

    If no tour or tour player is active, nothing happens.

    Parameters

    • value: number

    Returns void

  • Parameters

    • imagesetName: string

    Returns void

  • Parameters

    • imagesetName: string

    Returns void

  • Set the opacity with which the foreground imageset is rendered.

    Parameters

    • opacity: number

      The opacity, between 0 (invisible) and 100 (fully opaque).

    Returns void

  • Change the ImageSetLayer position in the layer stack.

    Parameters

    Returns void

  • Set up the view to instantaneously display the specified imageset.

    This function aspires to provide a one-stop shop for configuring the engine to show one arbitrary imageset. It aims to automatically choose the right, or at least justifiable, values for things like the background imageset, the camera position, and the zoom level.

    Because this function makes instantaneous changes, it is not appropriate for interactive use. It is intended to be used as a WWT view is being initialized.

    Parameters

    Returns void

  • Returns how long moving to a given position will take, in seconds.

    This wraps the underlying engine function of the same name, but homogenizing some of the angular arguments to use radians.

    Parameters

    • raRad: number

      The RA of the target position, in radians

    • decRad: number

      The declination of the target position, in radians

    • zoomDeg: number

      The zoom setting, in degrees

    • Optional rollRad: number

      If specified, the roll of the target camera position, in radians

    Returns number

    The amount of time, in seconds, that moving to the given position would take.

  • Returns Promise<void>

Generated using TypeDoc