API Documentation

Index

Type aliases

AbortPredicate

AbortPredicate: (currentRowCount: number) => boolean

Type declaration

    • (currentRowCount: number): boolean
    • Predicate to determine if a current read operation for DataView.allRows should be aborted when there is new, non-streaming, data available. If this predicate returns true the DataView.allRows promise will be rejected and no rows will be returned.

      Parameters

      • currentRowCount: number

      Returns boolean

AnalysisPropertyDataType

AnalysisPropertyDataType: string | number | boolean | Date | TimeSpan | Time

Represents the data types possible to store in a document, table or column AnalysisProperty.

DataViewProxy

Represents an object that provides access to a DataView.

DataViewValueType

DataViewValueType: number | string | boolean | Date | Time | TimeSpan

Represents the type of a DataView value. The actual type that a given value has depends on the type of the expression on the associated axis.

ExtractValueType

ExtractValueType<readableArray>: {[ readableName in keyof readableArray]: readableArray[readableName] extends Readable<infer readableNameType> ? readableNameType : never }

From readableArray, an array of Readable of some value type, extract an array of this value type.

Type parameters

  • readableArray: ReadonlyArray<Readable<any>>

MarkingOperation

MarkingOperation: "Replace" | "Add" | "Subtract" | "Toggle" | "Intersect" | "ToggleOrAdd"

Specifies how a Marking shall be modified.

- "Replace" - replaces the current marking.
- "Add" - adds to the current marking.
- "Subtract" - removes the current marking.
- "Toggle" - toggles marking on each item in the set.
- "Intersect" - marks the intersection of the current marking and the specified set.
- "ToggleOrAdd" - will behave like toggle if all or no rows in the set are marked, otherwise it is an add operation. This is the default Spotfire behavior for control marking.

MethodKeys

MethodKeys<T>: {[ P in keyof T]: T[P] extends Function ? P : never }[keyof T]

Extract from T the keys of all properties with function values.

Type parameters

  • T

ModPropertyDataType

ModPropertyDataType: string | number | boolean

Represents the data types possible to store in a mod ModProperty.

OmittedReadableProxyMethods

OmittedReadableProxyMethods: "value" | "valueList"

Represents methods that are not available on a ReadableProxy. To access these methods the ReadableProxy must be awaited.

OnLoadCallback

OnLoadCallback: (mod: Mod) => void | Promise<void>

Type declaration

    • (mod: Mod): void | Promise<void>
    • Represents a function that consumes the Mod API. See initialize.

      Parameters

      Returns void | Promise<void>

ReadableProxy

ReadableProxy<Node>: Readable<Node> & Omit<Pick<Node, MethodKeys<Node>>, OmittedReadableProxyMethods>

Represents an object that provides access to a node of the specified type. It can be used as a Readable but also acts as a proxy to the node by exposing all its methods. Nodes that represent model state in the Spotfire document can thus be modified without first waiting and materializing them in the browser.

A full node will be created by using a Reader.

Type parameters

  • Node

UnionFromTupleTypes

UnionFromTupleTypes<T, U>: T[number] | U

Extract all possible types in a Tuple type.

Type parameters

  • T: readonly any[]

  • U = never

Functions

initialize

  • Initializes the Mod API. The specified onLoaded callback is called when the initialization is complete.

    example
    Spotfire.initialize(async (mod) => {
     console.log("Mod API loaded.");
    });
    

    The initialize method will invoke the provided callback with an instance of the mod API, to be used by the mod developer.

    The initialize method needs to be invoked in order for the mod to function. Even if the mod only displays static content, the API must be initialized in order for events and export to work.

    Parameters

    • onLoaded: OnLoadCallback

      Callback that is called when the mod API is initialized and ready to be interacted with.

    Returns void