static getDataViewBuilderColumnIdentitySources()

in src/dataViewBuilder/testDataViewBuilder.ts [95:119]


    static getDataViewBuilderColumnIdentitySources(options: TestDataViewBuilderColumnOptions[] | TestDataViewBuilderColumnOptions): DataViewBuilderColumnIdentitySource[] {
        let optionsArray: TestDataViewBuilderColumnOptions[] = <any>(Array.isArray(options) ? options : [options]);

        let fields = optionsArray.map(() => { }),
            optionsIdentityExpressions: any[][] = optionsArray.map((opt) => opt.values),
            identityExpressions: any[] = [];

        if (optionsIdentityExpressions.length > 1) {
            let identityExpressionsLength = optionsIdentityExpressions.length,
                identityExpressionsValuesLength = max(map(optionsIdentityExpressions, x => x.length));

            for (let vi = 0; vi < identityExpressionsValuesLength; vi++) {
                let current: any = optionsIdentityExpressions[0][vi];

                identityExpressions.push(current);
            }
        } else {
            identityExpressions = optionsIdentityExpressions[0];
        }

        return optionsArray.map((opt, i) => <DataViewBuilderColumnIdentitySource>{
            fields: fields,
            identities: identityExpressions
        });
    }