Warning

Nightly releases are generated automatically from the latest source code and are intended for experimental purposes only. These builds may contain incomplete or untested features, bugs, or security vulnerabilities, and as such, are not for production use. Users should be aware that nightly releases may cause unexpected behavior, data loss, or system instability. Use of these releases is at the user's own risk, and it is advised to have adequate backups before testing. The software is provided as is with no guarantees or support.

HubAPI

The HubAPI provides functionalities to get information from the instant3Dhub-backend. This includes:

  • requesting basic hub information
  • requesting service states

Every webvis instance requires a backend connection. The backend address is defined by SettingStrings.HUB_URL. Webvis will automatically connect to the backend in the background using the specified huburl.

Example: Request the supported content types from the backend.

const context = webvis.getContext();

const contentTyes = await context.requestSupportedContentTypes();

The following events are associated with the HubAPI:

interface HubAPI {
    requestHubVersion(): Promise<string>;
    requestServiceStates(): Promise<Map<ServiceType, ServiceState>>;
    requestSupportedContentTypes(): Promise<ContentType[]>;
    requestSupportedRenderSetups(): Promise<{ name: string; value: string }[]>;
}

Hierarchy (View Summary)

Methods

  • Request the current version of the connected instant3Dhub-backend. May return undefined for older versions.

    Returns Promise<string>

    Returns a Promise which contains a string containing the version of the connected backend.

  • Requests all available services of the backend and their current state.

    Returns Promise<Map<ServiceType, ServiceState>>

    Returns a Promise which contains a map of all available services and their states.

  • Request a list of (model) data formats which are supported by the connected instance3Dhub-backend. If requested before the connection to the Hub is established, it will return the local list of content types.

    Returns Promise<ContentType[]>

    Returns a Promise which contains the list of all supported data formats.

  • Request all supported render setups if one or more are available. The render setup is a key value pair where the key is the name of the render setup and the value could be used as an input value for the ViewerSettingStrings.RENDER_SETUP setting.

    Returns Promise<{ name: string; value: string }[]>

    Returns a Promise which contains the list of supported render setups.