Optional
pinia: null | PiniaOptional
hot: StoreGenericThe GUIDs of all rendered layers, in their draw order.
This list gives the GUIDs of the layers that are currently candidates for
rendering. This list is determined by the hierarchy of "layer maps"
registered with the engine and its current rendering mode. Layers in this
list might not be actually rendered if their enabled
flag is false, if
they are fully transparent, and so on.
In WWTAwareComponent this item is exposed under the name
wwtActiveLayers
.
Information about the imagesets that are available to be used as a background.
The info includes the name, which can then be used to set the background image via the setBackgroundImageByName mutation.
In WWTAwareComponent this item is exposed under the name
wwtAvailableImagesets
.
An (application-specific) string giving some additional information about the imageset.
The image filename extension(s) associated with this imageset.
May include multiple extensions separated by spaces. May also start with a leading period.
The internal GUID of the layer, if it is a HiPS layer
The user-facing name of the imageset.
The type of the imageset: panorama, sky, ...
The URL of the image data.
The current background Imageset, or null if it is undefined.
You can cause this state variable to change using the setBackgroundImageByName mutation.
In WWTAwareComponent this item is exposed under the name
wwtBackgroundImageset
.
The number of times that the progression of the WWT internal clock has been changed discontinuously.
The main use of this state variable is that you can watch for changes to it and be alerted when the clock has been altered.
In WWTAwareComponent this item is exposed under the name
wwtClockDiscontinuities
.
The rate at which the WWT internal clock progresses compared to real time. If the WWT clock is paused, this will be zero. Negative and fractional values are both possible.
In WWTAwareComponent this item is exposed under the name
wwtClockRate
.
The current time of WWT internal clock. In normal operation this variable will change with every rendered WWT frame, or every 30 ms or so.
In WWTAwareComponent this item is exposed under the name
wwtCurrentTime
.
Converts a Date object to a string.
Converts a Date object to a string.
Converts a Date object to a number.
Converts a Date object to a string or number.
The strings "number", "string", or "default" to specify what primitive to return.
A number if 'hint' was "number", a string if 'hint' was "string" or "default".
If 'hint' was given something other than "number", "string", or "default".
Sets the year of the Date object using local time.
A numeric value for the year.
Optional
month: numberA zero-based numeric value for the month (0 for January, 11 for December). Must be specified if numDate is specified.
Optional
date: numberA numeric value equal for the day of the month.
Sets the hour value in the Date object using local time.
A numeric value equal to the hours value.
Optional
min: numberA numeric value equal to the minutes value.
Optional
sec: numberA numeric value equal to the seconds value.
Optional
ms: numberA numeric value equal to the milliseconds value.
Sets the minutes value in the Date object using local time.
A numeric value equal to the minutes value.
Optional
sec: numberA numeric value equal to the seconds value.
Optional
ms: numberA numeric value equal to the milliseconds value.
Sets the month value in the Date object using local time.
A numeric value equal to the month. The value for January is 0, and other month values follow consecutively.
Optional
date: numberA numeric value representing the day of the month. If this value is not supplied, the value from a call to the getDate method is used.
Sets the year value in the Date object using Universal Coordinated Time (UTC).
A numeric value equal to the year.
Optional
month: numberA numeric value equal to the month. The value for January is 0, and other month values follow consecutively. Must be supplied if numDate is supplied.
Optional
date: numberA numeric value equal to the day of the month.
Sets the hours value in the Date object using Universal Coordinated Time (UTC).
A numeric value equal to the hours value.
Optional
min: numberA numeric value equal to the minutes value.
Optional
sec: numberA numeric value equal to the seconds value.
Optional
ms: numberA numeric value equal to the milliseconds value.
Sets the minutes value in the Date object using Universal Coordinated Time (UTC).
A numeric value equal to the minutes value.
Optional
sec: numberA numeric value equal to the seconds value.
Optional
ms: numberA numeric value equal to the milliseconds value.
Sets the month value in the Date object using Universal Coordinated Time (UTC).
A numeric value equal to the month. The value for January is 0, and other month values follow consecutively.
Optional
date: numberA numeric value representing the day of the month. If it is not supplied, the value from a call to the getUTCDate method is used.
Returns a date as a string value appropriate to the host environment's current locale.
Converts a date to a string by using the current or specified locale.
Optional
locales: string | string[]A locale string or array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used.
Optional
options: DateTimeFormatOptionsAn object that contains one or more properties that specify comparison options.
Converts a date to a string by using the current or specified locale.
Optional
locales: LocalesArgumentA locale string, array of locale strings, Intl.Locale object, or array of Intl.Locale objects that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used.
Optional
options: DateTimeFormatOptionsAn object that contains one or more properties that specify comparison options.
Returns a value as a string value appropriate to the host environment's current locale.
Converts a date and time to a string by using the current or specified locale.
Optional
locales: string | string[]A locale string or array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used.
Optional
options: DateTimeFormatOptionsAn object that contains one or more properties that specify comparison options.
Converts a date and time to a string by using the current or specified locale.
Optional
locales: LocalesArgumentA locale string, array of locale strings, Intl.Locale object, or array of Intl.Locale objects that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used.
Optional
options: DateTimeFormatOptionsAn object that contains one or more properties that specify comparison options.
Returns a time as a string value appropriate to the host environment's current locale.
Converts a time to a string by using the current or specified locale.
Optional
locales: string | string[]A locale string or array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used.
Optional
options: DateTimeFormatOptionsAn object that contains one or more properties that specify comparison options.
Converts a time to a string by using the current or specified locale.
Optional
locales: LocalesArgumentA locale string, array of locale strings, Intl.Locale object, or array of Intl.Locale objects that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used.
Optional
options: DateTimeFormatOptionsAn object that contains one or more properties that specify comparison options.
The current declination of the center of the WWT view, in radians.
TODO: define the meaning here for view modes other than "sky."
In WWTAwareComponent this item is exposed under the name
wwtDecRad
.
The current foreground Imageset, or null if it is undefined.
You can cause this state variable to change using the setForegroundImageByName mutation.
In WWTAwareComponent this item is exposed under the name
wwtForegroundImageset
.
The opacity of the foreground imageset. Values range between 0 (invisible) and 100 (fully opaque).
In WWTAwareComponent this item is exposed under the name
wwtForegroundOpacity
.
A table of activated imageset layers.
Use imagesetStateForLayer to access information about a particular layer.
In WWTAwareComponent this item is exposed under the name
wwtImagesetLayers
.
Whether a tour has been loaded up and is available for playback.
In WWTAwareComponent this item is exposed under the name
wwtIsTourPlayerActive
.
Whether a tour is actively playing back right now. This can spontaneously become false if the tour completes playing.
In WWTAwareComponent this item is exposed under the name
wwtIsTourPlaying
.
The current right ascension of the center of the WWT view, in radians.
TODO: define the meaning here for view modes other than "sky."
In WWTAwareComponent this item is exposed under the name
wwtRARad
.
The current mode of the WWT renderer.
This is derived from the "type" of the active background imageset. To change the mode, change the background imageset with setBackgroundImageByName.
In WWTAwareComponent this item is exposed under the name
wwtRenderType
.
The current roll of the view camera, in radians.
In WWTAwareComponent this item is exposed under the name
wwtRollRad
.
Whether or not to show a warning about recommending WebGL 2
In WWTAwareComponent this item is exposed under the name
wwtShowWebGl2Warning
.
A table of activated imageset layers.
Use imagesetStateForLayer to access information about a particular layer.
In WWTAwareComponent this item is exposed under the name
wwtSpreadSheetLayers
.
The time at which the Vue/Pinia system started up.
The number of times that a WWT tour has completed playing.
The main use of this state variable is that you can watch for changes to it and be alerted when a tour finishes. Watching isTourPlaying doesn't suffice because that will trigger when a tour is paused.
In WWTAwareComponent this item is exposed under the name
wwtTourCompletions
.
The total runtime of the current tour, in seconds, if there is one.
In WWTAwareComponent this item is exposed under the name
wwtTourRunTime
.
The timecodes at which the current tour’s "stops" begin, in seconds.
Each WWT tour is composed of one or more "stops", each of which has a fixed wall-clock duration. This variable gives the start times of the stops under the assumption that they all follow one another in sequence. It is possible to have nonlinear flow from one stop to the next.
If no tour is loaded, this is an empty array.
In WWTAwareComponent this item is exposed under the name
wwtTourStopStartTimes
.
The "timecode" of the current tour playback progression.
The "timecode" is approximately the number of seconds elapsed since tour playback began. More precisely, however, it is the start time of the current tour stop, plus however much wall-clock time has elapsed while at that stop. Because it is possible for stops to link to each other non-linearly, it is also possible for the timecode to progress non-linearly even when the tour plays back without user interaction.
In combination with tourStopStartTimes, you can use this value to determine the index number of the currently active tour stop.
If no tour is loaded, this is zero.
In WWTAwareComponent this item is exposed under the name
wwtTourTimecode
.
The WWT zoom level, in degrees.
TODO: define the semantics here in 3D and other modes.
In 2D sky mode, the zoom level is the angular height of the viewport, times six.
In WWTAwareComponent this item is exposed under the name
wwtZoomDeg
.
Readonly
activeGet the reactive state for the active imageset layers
These layers are created using the addImageSetLayer action. The state structures returned by this function are part of the reactive store, so you can wire them up to your UI and they will update correctly. The list is returned in the engine's render order.
The layer states
Add an Annotation to the view.
Request the creation of a image layer. Either a single FITS or an image set.
The action resolves to a new ImageSetLayer instance. It’s asynchronous because the requested url has to be downloaded.
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.
This returns the imageset that ultimately resides in the engine's database. It could either be the input argument, if it was newly added, or a pre-existing imageset in the no-op condition.
Alter one or more settings of the specified FITS image layer as specified in the options.
Alter one WWT engine setting.
Alter one or more settings of the specified tabular data layers as specified in the options.
Readonly
catalogClear all Annotations from the view.
Request the creation of a tabular data layer.
The action resolves to a new SpreadSheetLayer instance.
Delete the specified layer from the layer manager.
A layer may be identified by either its name or its id.
Readonly
findRADecReadonly
findCommand the view to steer to a specific configuration.
The async action completes when the view arrives, or when a subsequent view command overrides this one.
TODO: document semantics when not in 2D sky mode!
Command the view to steer as specified in the options.
The async action completes when the view arrives, or when a subsequent view command overrides this one.
Readonly
imagesetLook up the WWT engine object for an active imageset layer.
This getter gets the WWT Imageset
object associated with an imageset
layer. The returned object is not part of the Vue(x) reactivity system,
so you shouldn't use it to set up UI elements, but you can obtain more
detailed information about the imageset than is stored in the state
management system. For UI purposes, use imagesetStateForLayer.
The GUID of the layer to query, as a string
The layer's underlying imageset, or null if the GUID is unrecognized
Readonly
imagesetGet the actual WWT ImageSetLayer
for the imageset layer with the given ID.
Do not use this function for UI purposes -- the WWT layer object is not integrated into the reactive state system, and so if you use it as a basis for UI elements, those elements will not be updated properly if/when the layer's settings change. Use imagesetStateForLayer instead.
The imageset layer's identifier.
Readonly
imagesetLook up the reactive state for an active imageset layer.
These layers are created using the addImageSetLayer action. The state returned by this function is part of the reactive store, so you can wire it up to your UI and it will update as the layer settings are changed. If you need "runtime" state not captured in the reactivity system, you may need to use imagesetForLayer instead.
The GUID of the layer to query, as a string
The layer state, or null if the GUID is unrecognized
Readonly
layerGet the actual WWT Layer
for the layer with the given ID.
Do not use this function for UI purposes -- the WWT layer object is not integrated into the reactive state system, and so if you use it as a basis for UI elements, those elements will not be updated properly if/when the layer's settings change. If you know the specific type of your layer, you can use functions like imagesetStateForLayer or spreadSheetStateById to get reactive data structures.
The layer's identifier.
Readonly
layerGet the actual WWT SpreadSheetLayer
for the named HiPS catalog.
Do not use this function for UI purposes -- the WWT layer object is not integrated into the reactive state system, and so if you use it as a basis for UI elements, those elements will not be updated properly if/when the layer's settings change. Use spreadsheetStateForHipsCatalog instead.
The datasetName
of the HiPS catalog
Deprecated. Use addImageSetLayer instead. Request the creation of a FITS image layer.
The action resolves to a new ImageSetLayer instance. It’s asynchronous because the requested FITS file has to be downloaded.
Request the engine to load the specified image collection.
The image collection is a WTML file Images in collections loaded this way become usable for name-based lookup by interfaces such as setForegroundImageByName.
The action resolves to a Folder instance. It’s asynchronous because the specified WTML file has to be downloaded.
Request the engine to load a tour file.
The action resolves when the load is complete. It’s asynchronous because the full WTT tour file has to be downloaded.
Readonly
lookupLook up an Imageset in the engine’s table of ones with registered names.
This delegates to WWTControl.getImagesetByName(), which has very eager name-matching rules. But if nothing matches, null is returned.
Imagesets are not added to the engine’s list of names automatically. In order for an imageset to be findable by this function, its containing folder must have been loaded using the loadImageCollection action.
Remove the specified Annotation from the view.
Seek tour playback to the specified timecode.
See tourTimecode for a definition of the tour timecode.
An important limitation is that the engine can only seek to the very beginning of a tour stop. If you request a timecode in the middle of a slide, the seek will actually occur to the start time of that slide.
Set the current background Imageset based on its name.
The name lookup here is effectively done using lookupImageset. If the name is not found, the current background imageset remains unchanged.
Changing the background imageset may change the value of renderType, and the overall "mode" of the WWT renderer.
Set the rate at which the WWT clock progresses compared to wall-clock time.
A value of 10 means that the WWT clock progresses ten times faster than real time. A value of -0.1 means that the WWT clock moves backwards, ten times slower than real time.
Altering this causes an increment in clockDiscontinuities.
Set whether the WWT clock should progress with real time.
See SpaceTimeController.set_syncToClock(). This interface effectively allows you to pause the WWT clock.
Altering this causes an increment in clockDiscontinuities.
Set the colormap used for a FITS image layer according to the options.
Set the current foreground Imageset based on its name.
The name lookup here is effectively done using lookupImageset. If the name is not found, the current foreground imageset remains unchanged.
Change the ImageSetLayer position in the draw cycle.
Set the current time of WWT's internal clock.
Altering this causes an increment in clockDiscontinuities.
Set whether the renderer settings of tours should remain applied after those tours finish playing back.
This specialized option helps avoid jarring visual effects when tours finish playing. If a tour activates a renderer option like "local horizon mode", by default that option will turn off when the tour finishes, causing the view to suddenly change. If this option is set to True, that setting will remain active, preventing the sudden change.
Set the "tracked object" in the 3D solar system view.
Allowed values are defined in @wwtelescope/engine-types.
Set up the background and foreground imagesets according to the options
The main use of this interface is that it provides a mechanism to guess the appropriate background imageset given a foreground imageset that you want to show.
Readonly
spreadGet the actual WWT SpreadSheetLayer
for the table layer corresponding
to the given CatalogLayerInfo.
Do not use this function for UI purposes -- the WWT layer object is not integrated into the reactive state system, and so if you use it as a basis for UI elements, those elements will not be updated properly if/when the layer's settings change. Use spreadsheetState instead.
Readonly
spreadGet the actual WWT SpreadSheetLayer
for the table layer with the given ID.
Do not use this function for UI purposes -- the WWT layer object is not integrated into the reactive state system, and so if you use it as a basis for UI elements, those elements will not be updated properly if/when the layer's settings change. Use spreadsheetState instead.
The table layer's identifier.
Readonly
spreadsheetGet reactive SpreadSheetLayer
settings for the table layer corresponding to
the given CatalogLayerInfo.
The returned data structure is a component of the app's reactive state. You can therefore use the settings to construct UI elements, and they will update reactively as the state evolves. The actual data structures used by WWT are separate, but the two mirror each other.
A CatalogLayerInfo object corresponding to the layer.
Readonly
spreadsheetGet reactive SpreadSheetLayer
settings for the table layer with the given ID.
The returned data structure is a component of the app's reactive state. You can therefore use the settings to construct UI elements, and they will update reactively as the state evolves. The actual data structures used by WWT are separate, but the two mirror each other.
The identifier of the table layer.
Readonly
spreadsheetGet reactive SpreadSheetLayer
settings for the named HiPS catalog.
The returned data structure is a component of the app's reactive state. You can therefore use the settings to construct UI elements, and they will update reactively as the state evolves. The actual data structures used by WWT are separate, but the two mirror each other.
The datasetName
of the HiPS catalog
Alter the "stretch" of a FITS image layer according to the options.
Returns the time it would take, in seconds, to navigate to the given target.
Update the contents of a tabular data layer according to the options.
Wait for the WWT engine to become ready for usage.
You should invoke this action and wait for is completion before trying to do anything else with a WWT-aware component. The action resolves when the WWT engine has completed its initialization, which involes the download of some supporting data files.
Set the zoom level of the view.
This action may result in an action that takes a perceptible amount of time to resolve, if the "smooth pan" renderer option is enabled. To have proper asynchronous feedback about when the zoom operation completes, use gotoRADecZoom.
Generated using TypeDoc
The Pinia “use store” function defining the state of the WWT engine.
According to modern conventions, this function should be named
useWWTEngineStore()
. Calling it returns a Pinia store object that allows you to access and modify the WWT state. To get a broad sense of how Pinia store objects may be used in general, explore the Pinia documentation.See The WWT Pinia Interface below for an organized overview of all of the ways your code can control WWT using this framework.
Example
If you were implementing a WWT-aware component using the Vue “Composition API” with a
<script setup>
single-file component, you might write something like:If you wanted to define a Vue component manually in TypeScript using the Options API, you could manually connect some of its state or methods to the WWT Pinia store with code like:
This would define a component with an associated method named
gotoRADecZoom
that would be magically wired up to the corresponding gotoRADecZoom store action. However, the whole point of the WWTAwareComponent class is to make it so that you don’t need to write this code yourself: it exposes all of the store’s state and methods in a predefined component. Instead of manually mapping out of the store as written above, you can just extend it and get everything “for free”.The WWT Pinia Interface
Here we document all of the available WWT interfaces, grouping them by category. As a reminder, in the Pinia paradigm, state is expressed in state variables and getters, and modified either directly or through actions (which can be asynchronous).
Initialization
Actions:
Basic View Information
State:
Getters:
Actions:
Image Sets
State:
Getters:
Actions:
General Layer Management
State:
Getters:
Actions:
Imageset Layers (including FITS imagery)
State:
Getters:
Actions:
Tabular (“Spreadsheet”) Data Layers
State:
Getters:
Actions:
Annotations
Actions:
Progressive HiPS Catalogs
These have some characteristics of both imagesets and tabular ("spreadsheet") data layers.
Getters:
Actions:
Tours
State:
Actions:
Miscellaneous
State:
Actions: