MAIDR JavaScript API
    Preparing search index...

    Type Alias PowerBIDataPointRef

    PowerBIDataPointRef:
        | {
            kind: "categorical";
            categoryIndex: number
            | null;
            valueColumnIndex: number | null;
        }
        | { kind: "table"; rowIndex: number }

    Where one navigable MAIDR position came from in the data view.

    What a visual needs to act on the reader's position — highlight its own mark, or build a selection id and call selectionManager.select() so the other visuals on the page cross-filter to it:

    const builder = host.createSelectionIdBuilder();
    if (ref.kind === 'table') {
    // `withTable` needs visuals API 2.5.0 or later.
    return dataView.table ? builder.withTable(dataView.table, ref.rowIndex).createSelectionId() : null;
    }
    const categorical = dataView.categorical;
    if (ref.categoryIndex !== null && categorical?.categories?.[0]) {
    builder.withCategory(categorical.categories[0], ref.categoryIndex);
    }
    const column = ref.valueColumnIndex !== null ? categorical?.values?.[ref.valueColumnIndex] : undefined;
    if (categorical?.values && column) {
    if (categorical.values.source) {
    // Only when a series (legend) field is bound.
    builder.withSeries(categorical.values, column);
    }
    if (column.source.queryName) {
    builder.withMeasure(column.source.queryName);
    }
    }
    return builder.createSelectionId();

    A categorical reference names the category row and the value column; a table reference names the result row. Either index is null where the position has no such coordinate — a pie built from series alone has no category.

    Type Declaration

    • {
          kind: "categorical";
          categoryIndex: number | null;
          valueColumnIndex: number | null;
      }
      • Readonlykind: "categorical"
      • ReadonlycategoryIndex: number | null

        Index into categorical.categories[0].values, or null.

      • ReadonlyvalueColumnIndex: number | null

        Index into categorical.values, or null.

    • { kind: "table"; rowIndex: number }
      • Readonlykind: "table"
      • ReadonlyrowIndex: number

        Index into table.rows.