public syncSelectionState()

in src/interactivityFilterService.ts [172:196]


    public syncSelectionState(): void {
        if (this.isInvertedSelectionMode) {
            return this.syncSelectionStateInverted();
        }

        if (!this.selectableDataPoints && !this.selectableLegendDataPoints) {
            return;
        }

        if (this.selectableDataPoints) {
            this.updateSelectableDataPointsBySelectedCategories(this.selectableDataPoints, this.selectedCategories);
        }

        if (this.selectableLegendDataPoints) {
            this.updateSelectableDataPointsBySelectedCategories(this.selectableLegendDataPoints, this.selectedCategories);
        }

        if (this.selectableLabelsDataPoints) {
            for (let labelsDataPoint of this.selectableLabelsDataPoints) {
                labelsDataPoint.selected = this.selectedCategories.some((value: powerbi.PrimitiveValue) => {
                    return value === <powerbi.PrimitiveValue>labelsDataPoint.category;
                });
            }
        }
    }