Represents the root container for semantic data, including models, objects, relationships and property sets.

A Data serves as the authoritative registry and lifecycle manager of:

It provides:

  • A central event hub via DataEvents
  • Lifecycle management (creation, destruction, registration)
  • Error reporting with optional console logging

See @xeokit/sdk/data for general usage examples.

Constructors

  • Creates a new Data.

    See @xeokit/sdk/data for usage.

    Parameters

    • OptionaldataParams: { logging?: boolean }

      Parameters for creating this Data.

      • Optionallogging?: boolean

        Indicates whether to log errors to the console for this Data.

    Returns Data

Properties

destroyed: boolean = false

Indicates whether this Data instance has been destroyed.

events: DataEvents

Events emitted by this Data instance.

logging: boolean = false

Indicates whether to log errors to the console for this Data.

Default value is false.

models: { [key: string]: DataModel }

A collection of DataModels in this Data, keyed by their ID.

objects: { [key: string]: DataObject }

A collection of DataObjects in this Data, keyed by their ID.

objectsByType: { [key: string]: { [key: string]: DataObject } }

A collection of DataObjects grouped by their type. Each type maps to a collection of objects keyed by their ID.

propertySets: { [key: string]: PropertySet }

A collection of PropertySets in this Data, keyed by their ID.

rootObjects: { [key: string]: DataObject }

A collection of root DataObjects in this Data, keyed by their ID.

Root objects are those that are not the "related" participant in any Relationships.

typeCounts: { [key: string]: number }

Tracks the count of DataObjects for each type in this Data.

Methods

  • Retrieves the IDs of DataObjects that have the specified type.

    Parameters

    • type: string

      The type of the objects to retrieve.

    Returns SDKResult<string[]>

    A result containing an array of object IDs on success, or an error message on failure.