Class Tuple

A tuple is a categorical data element found in a (categorical) slot. You can retrieve the list of tuples on a slot through slot.tuples. If your data has rows, then each row can have a reference to one of the tuples in a slot.

// Retrieve the list of tuples for slot 1.
const tuples: Tuple[] = _info.data.cols[ 1 ].tuples

// Take the tuple in slot 1 from the first data row.
const tuple: Tuple = _info.data.rows[ 0 ].tuple( 1 );

// Retrieve the captions for each tuple.
const captions: string[] = tuples.map( _tuple => _tuple.caption );

Hierarchy

  • Tuple

Index

Properties

Accessors

Properties

caption

caption: string

The caption of this tuple.

index

index: number

The zero-based index of the tuple in the slot.

key

key: string

A unique key value for this tuple. You can use the key when you perform d3 data binding.

// Create a d3 text element for each tuple in column #1
const tuples = _info.data.cols[ 1 ];
node.selectAll( "text" )
    .data( tuples, ( _t: Tuple ) => _t.key )
    .join( "text" )
        .text( _tuple => _tuple.caption );

segments

segments: Segment[]

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

Accessors

highlighted

  • get highlighted(): boolean
  • Returns true if the tuple is highlighted.

    Returns boolean

selected

  • get selected(): boolean
  • Returns true if the tuple is selected. Note that the visual selection state of a tuple might depend on the selected state of other data elements.

    Returns boolean