UtilityAPI¶
- addTranslation(lang, key, value)¶
- Arguments
lang (
string()
) –key (
string()
) –value (
string()
) –- Returns
void
- appendURL(baseUrl, appendix, replaceQuestionMark)¶
- Arguments
baseUrl (
string()
) –appendix (
string()
) –replaceQuestionMark (
boolean()
) – Optional- Returns
string
- copyToClipboard(text, html)¶
- Arguments
text (
string()
) –html (
string()
) –- Returns
void
- createBoxVolume(min, max)¶
Creates a new BoxVolume object.
- Arguments
min (
Float32Array()
) – Optionalmax (
Float32Array()
) – Optional- Returns
BoxVolume – A new Box Volume
- getCurrentSceneVolume()¶
- Returns
Promise<BoxVolume>
- getDataInfoValue(key, value)¶
- Arguments
key (
string()
) –value (
string()
) –- Returns
string
- getDeviceTags()¶
- Returns
Array<string>
- getFileSuffix(uri)¶
- Arguments
uri (
string()
) –- Returns
string
- getFullSceneVolume()¶
- Returns
Promise<BoxVolume>
- getMetadata(nodeID)¶
Returns a json object containing the metadata for the given nodeID
- Arguments
nodeID (
number()
) – The ID of a node- Returns
Promise<MetaDataJSON> – A json object containing the requested metadata
- getResourceRootID(nodeID)¶
experimental
Returns the id of the given node's resource root
- Arguments
nodeID (
number()
) – The ID of the node- Returns
Promise<number> – The ID of the nodes resource root
- getUnitConversionValues()¶
- Returns
any
- getWebvisLocation()¶
- Returns
string
- initDownload(dataURL, name)¶
- Arguments
dataURL (
string()
) –name (
string()
) –- Returns
void
- requestUserData(nodeID, userRef, responseType)¶
Returns an array of the requested user data in a given response type
- Arguments
nodeID (
number()
) – The ID of a nodeuserRef (
string()
) – The path to the userdataresponseType (
string()
) – The type of the response. (“text”, “json”, “blob”, “arraybuffer”)- Returns
Promise<any> – An Object containing the requested userdata in the subtree of the given nodeID
- takeScreenshot(callback)¶
Takes a screenshot of the current view and invokes the callback with its dataURL.
- Arguments
callback (
any()
) – The callback function which is called when the screenshot is taken- Returns
void
- toSemanticUnit(semanticString, value, color, unit)¶
- Arguments
semanticString (
string()
) –value (
Array
) –color (
Array
) –unit (
string()
) –- Returns
string
- toUnit(value, unit, decimals)¶
- Arguments
value (
number()
) –unit (
string()
) –decimals (
number()
) – Optional- Returns
string
- translate(value)¶
- Arguments
value (
string()
) –- Returns
string
- waitFor(state)¶
Register a callback to a specific state. The callback is executed once when the state is reached. If webVis is already in that state the callback is triggered immediately.
- Arguments
state (
string()
) – The state for which a callback is registered- Returns
Promise<any> – A promise which throws an error if the requested state is invalid The following states are allowed as target </br> <code>init</code> - Is reached when webVis is fully configured and set up.<br> <code>resourceStateUpdated</code> - Is reached when there is state information available for all resources (This information can also be “still transcoding”).<br> <code>resourceProcessed</code> - This is triggered when all resources are done transcoding.<br> <code>renderingFinished</code> - This is triggered when webVis is done with rendering. So no more image changes are imminent.<br>