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.


Did you find this page useful? Please give it a rating:
Thank you for rating this page!
Any issues or feedback?
What kind of problem would you like to report?
Please tell us more about what's wrong: