Interface SheetApi

This API relates to SAS Visual Investigator's sheet functionality.

Accessed from the window at window.sas.vi.sheet.

window.sas.vi.sheet.getOpenObjects();
interface SheetApi {
    addToExistingWorkspace(targetObject: VIObject, workspaceClientId: string, objectsToAdd: ObjectIdentifier[], networkData?: NetworkData, isUndoRedo?: boolean): Promise<void>;
    addToNewWorkspace(objectsToAdd: ObjectIdentifier[], targetObjectType: string, options?: AddToNewWorkspaceOptions): Promise<void>;
    createContextMenuForNodes(workspace: ClientSheet, handleAddToWorkspaceFn?: (() => void), handleAddToInsightsFn?: (() => void)): Promise<ContextMenuItem[]>;
    getOpenObject(objectId: string, objectType: string): undefined | VIObject;
    getOpenObjectBySheet(sheet: ClientSheet): undefined | VIObject;
    getOpenObjects(): VIObject[];
    openAddAllObjectsToWorkspaceDialog(objects: ObjectIdentifier[], options?: AddAllObjectsToWorkspaceDialogOptions): Promise<void>;
    openAddImageToInsightsDialog(imageData: Uint8Array | HTMLElement, contentType?: string, height?: string, width?: string): Promise<void>;
    registerNetworkMenuCallback(menuType: NetworkMenuType, callback?: NetworkMenuCallback): void;
}

Methods

  • Parameters

    • targetObject: VIObject

      {VIObject} Object containing the existing workspace.

    • workspaceClientId: string

      {string} Client ID of the workspace to add to.

    • objectsToAdd: ObjectIdentifier[]

      {ObjectIdentifier[]} Objects to add. It is safe to pass objects that are already in the workspace.

    • OptionalnetworkData: NetworkData

      {NetworkData} If provided, network data that will be merged into any existing network data on the workspace.

    • OptionalisUndoRedo: boolean

      {boolean} Specifies if the function was called as part of an undo/redo operation.

    Returns Promise<void>

    Adds objects to an existing workspace.

  • Parameters

    • objectsToAdd: ObjectIdentifier[]

      {ObjectIdentifier[]} Objects to add to the new workspace.

    • targetObjectType: string

      {string} Object type where the workspace is created.

    • Optionaloptions: AddToNewWorkspaceOptions

      {AddToNewWorkspaceOptions} Additional options to set a target object ID, workspace name and so on.

    Returns Promise<void>

    Creates a new workspace in the target object, populating it with an initial set of objects. Allows the creation of new objects assuming create mode is supported for the object type. If options.targetObjectId is undefined, then a new object is created.

  • Parameters

    • workspace: ClientSheet

      {ClientSheet} Workspace containing the network. The workspace should not be manually constructed.

    • OptionalhandleAddToWorkspaceFn: (() => void)

      {function} A callback to handle adding the selected nodes to a workspace.

        • (): void
        • Returns void

    • OptionalhandleAddToInsightsFn: (() => void)

      {function} A callback to handle adding the NLD to an Insight.

        • (): void
        • Returns void

    Returns Promise<ContextMenuItem[]>

    Promise resolving to the list containing all Context Menu Items.

    use registerNetworkMenuCallback instead.

    Deprecated. This function is deprecated and replaced with registerNetworkMenuCallback. The original function did not allow users to extend the menu being constructed by a context click.

    Creates and returns the list containing all Context Menu Items for a right-click on a network diagram node. The menu is not rendered on the network diagram.

  • Parameters

    • objectId: string

      {string} Open object's ID.

    • objectType: string

      {string} Open object's type.

    Returns undefined | VIObject

    The specified object or undefined if it is not found.

    Gets a specified object that is currently open and allows sheets.

  • Parameters

    • sheet: ClientSheet

      {ClientSheet} Sheet contained within the expected object.

    Returns undefined | VIObject

    The requested object or undefined if it could not be found.

    Gets the open object containing the specified sheet.

  • Returns VIObject[]

    A list of currently open objects or an empty list if none are found.

    Gets all of the objects currently open that allow sheets.

  • Parameters

    • objects: ObjectIdentifier[]

      {ObjectIdentifier[]} Objects to add to a workspace.

    • Optionaloptions: AddAllObjectsToWorkspaceDialogOptions

      {AddAllObjectsToWorkspaceDialogOptions} Additional options to customize the dialog box and select the Visualization to display after the objects are added.

    Returns Promise<void>

    Adds objects to a workspace selected in the "Add Objects to Workspace" dialog box.

  • Parameters

    • imageData: Uint8Array | HTMLElement

      {Uint8Array | HTMLElement} Image to add. Either directly as an array of bytes or from an HTMLElement on the page.

    • OptionalcontentType: string

      {string} Used in the content-type header when the file is uploaded.

    • Optionalheight: string

      {string} Height of the Insights cell.

    • Optionalwidth: string

      {string} Width of the Insights cell.

    Returns Promise<void>

    Adds an image to the Insights selected in the "Add image to Insights" dialog box.

  • Parameters

    • menuType: NetworkMenuType

      {NetworkMenuType} The type of menu to extend.

    • Optionalcallback: NetworkMenuCallback

      {NetworkMenuCallback} The callback function invoked when the context menu is constructed. This function is passed the menu object, which can be modified/extended, and the "client Id" of the current workspace. If callback not passed in or is undefined, the callback is unregistered.

    Returns void

    void

    Registers a callback that is invoked whenever the node or network context menu is constructed. The caller can extend the menu to provide access to extra functionality. It is the caller's responsibility to ensure that they properly extend the menu. Failing to do so can result in application errors.

    The callback can be unregistered by calling this function without passing in a callback function or setting it to undefined.