Merged PR 178687: Custom Visuals: Add Support Of "Group On key"

visuals now can use gok datasets , and should be able to do selections on the in a way that notifies power bi using the opaque id infrastructure.
This commit is contained in:
George Keldawi 2021-06-15 11:59:56 +00:00
Родитель 319eea1721
Коммит e43593315f
1 изменённых файлов: 31 добавлений и 1 удалений

Просмотреть файл

@ -333,7 +333,8 @@ export interface IFilterHierarchyAggrTarget extends IFilterHierarchyTarget, IFil
export declare type IFilterKeyTarget = (IFilterKeyColumnsTarget | IFilterKeyHierarchyTarget); export declare type IFilterKeyTarget = (IFilterKeyColumnsTarget | IFilterKeyHierarchyTarget);
export declare type IFilterTarget = (IFilterColumnTarget | IFilterHierarchyTarget | IFilterMeasureTarget | INotSupportedFilterTarget | IFilterColumnAggrTarget | IFilterHierarchyAggrTarget); export declare type IFilterTarget = (IFilterColumnTarget | IFilterHierarchyTarget | IFilterMeasureTarget | INotSupportedFilterTarget | IFilterColumnAggrTarget | IFilterHierarchyAggrTarget);
export type ITupleFilterTarget = IFilterTarget[]; export type ITupleFilterTarget = IFilterTarget[];
export type IFilterGeneralTarget = IFilterTarget | IFilterKeyTarget | ITupleFilterTarget; export type IIdentityFilterTarget = number[];
export type IFilterGeneralTarget = IFilterTarget | IFilterKeyTarget | ITupleFilterTarget | IIdentityFilterTarget;
export interface IFilter { export interface IFilter {
$schema: string; $schema: string;
target: IFilterGeneralTarget; target: IFilterGeneralTarget;
@ -341,6 +342,12 @@ export interface IFilter {
displaySettings?: IFilterDisplaySettings; displaySettings?: IFilterDisplaySettings;
} }
export type IdentityFilterOperators = "In";
export interface IIdentityFilter extends IFilter {
operator: IdentityFilterOperators;
target: IIdentityFilterTarget;
}
export interface IFilterDisplaySettings { export interface IFilterDisplaySettings {
isLockedInViewMode?: boolean; isLockedInViewMode?: boolean;
isHiddenInViewMode?: boolean; isHiddenInViewMode?: boolean;
@ -463,6 +470,7 @@ export enum FilterType {
TopN = 5, TopN = 5,
Tuple = 6, Tuple = 6,
RelativeTime = 7, RelativeTime = 7,
Identity = 8,
} }
export enum RelativeDateFilterTimeUnit { export enum RelativeDateFilterTimeUnit {
@ -738,6 +746,28 @@ export class BasicFilterWithKeys extends BasicFilter {
} }
} }
export class IdentityFilter extends Filter {
static schemaUrl: string = "http://powerbi.com/product/schema#identity";
operator: IdentityFilterOperators;
target: IIdentityFilterTarget;
constructor(
target: IIdentityFilterTarget,
operator: IdentityFilterOperators
) {
super(target, FilterType.Identity);
this.operator = operator;
this.schemaUrl = IdentityFilter.schemaUrl;
}
toJSON(): IIdentityFilter {
const filter = super.toJSON() as IIdentityFilter;
filter.operator = this.operator;
filter.target = this.target;
return filter;
}
}
export class TupleFilter extends Filter { export class TupleFilter extends Filter {
static schemaUrl: string = "http://powerbi.com/product/schema#tuple"; static schemaUrl: string = "http://powerbi.com/product/schema#tuple";
operator: TupleFilterOperators; operator: TupleFilterOperators;