Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • WWTInstance

Index

Constructors

constructor

  • 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

Readonly ctl

ctl: WWTControl

Readonly lm

lm: typeof LayerManager

Readonly si

si: ScriptInterface

Readonly stc

stc: typeof SpaceTimeController

tourEndedCallback

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

A callback to be invoked when a tour completes playing.

Methods

applyFitsLayerSettings

applySetting

  • applySetting(setting: EngineSetting): void
  • Parameters

    • setting: EngineSetting

    Returns void

applyTableLayerSettings

getActiveTourPlayer

  • getActiveTourPlayer(): null | TourPlayer
  • If the tour playback mode is active, get the active TourPlayer object.

    Returns null | TourPlayer

getEffectiveTourTimecode

  • getEffectiveTourTimecode(): number
  • 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

getIsTourPlaying

  • getIsTourPlaying(_player: TourPlayer): boolean
  • 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

gotoRADecZoom

  • gotoRADecZoom(raRad: number, decRad: number, zoomDeg: number, instant: boolean): Promise<void>
  • Parameters

    • raRad: number
    • decRad: number
    • zoomDeg: number
    • instant: boolean

    Returns Promise<void>

gotoTarget

  • Command the view to show a Place.

    Parameters

    Returns Promise<void>

loadAndPlayTour

  • loadAndPlayTour(url: string): 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.

loadFitsLayer

  • Load 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.

    Parameters

    Returns Promise<ImageSetLayer>

loadImageCollection

  • loadImageCollection(url: string): Promise<Folder>
  • 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.

    returns:

    A promise that resolves to an initialized Folder object.

    Parameters

    • url: string

    Returns Promise<Folder>

loadTour

  • loadTour(url: string): Promise<void>
  • 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.

seekToTourTimecode

  • seekToTourTimecode(value: number): void
  • "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

setBackgroundImageByName

  • setBackgroundImageByName(imagesetName: string): void
  • Parameters

    • imagesetName: string

    Returns void

setFitsLayerColormap

setForegroundImageByName

  • setForegroundImageByName(imagesetName: string): void
  • Parameters

    • imagesetName: string

    Returns void

setForegroundOpacity

  • setForegroundOpacity(opacity: number): 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

setupForImageset

  • 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

stretchFitsLayer

updateTableLayer

waitForReady

  • waitForReady(): Promise<void>

Generated using TypeDoc