Class Slot

A slot is the entry point for the data that goes into a visualization. A slot can hold either categorical or continuous items. If the slot has categorical items, you can retrieve a distinct list using the tuples attributes. If the slot has continuous items, you can retrieve the domain (min and max) of the item values.

Hierarchy

  • Slot

Index

Properties

Accessors

Methods

Properties

caption

caption: string

The caption of the slot, taken from the data item that was mapped to this slot. Note: this caption is different from the slot caption defined in the vizdef!

domain

domain: Domain

Returns the value domain for this slot. Can be an empty domain (Domain.empty) if the slot has no values or if the slot represents a categorical data item.

segments

segments: Segment[]

A list of one or more segments that form the data item on the slot. Each segment has a caption and a key. The caption of a slot is a concatenation of the captions of all segments, with a predefined separator.

tuples

tuples: Tuple[]

Returns the list of tuples in this slot. Can be an empty list if there are no tuples or if the slot represents continuous data items.

Accessors

dataType

  • get dataType(): string
  • Returns the type of data that is mapped to this slot. Possible values are "cat", "cont" or "none". A slot that is not mapped returns "none".

    Returns string

mapped

  • get mapped(): boolean
  • Indicates if a slot is mapped. A slot is considered mapped if data has been assigned to the slot. If a slot is not mapped, then tuples is [], the domain is Domain.empty and the caption is "".

    Returns boolean

Methods

format

  • format(_value: number | null, _type?: FormatType): string
  • Formats a value.

    Parameters

    • _value: number | null

      Value to format.

    • Optional _type: FormatType

      Optional type (label or data). Defaults to label if not specified.

    Returns string

    The formatted value. If the slot is categorical or the slot is not mapped, then the 'toString' representation of the value is returned.