public static getCategoricalColumns()

in src/asterPlotColumns.ts [61:72]


    public static getCategoricalColumns(dataView: DataView) {
        let categorical = dataView && dataView.categorical;
        let categories = categorical && categorical.categories || [];
        let values = categorical && categorical.values || <DataViewValueColumns>[];
        return categorical && mapValues(
            new this<DataViewCategoryColumn & DataViewValueColumn[] & DataViewValueColumns>(),
            (n, i) => {
                return categories.filter(x => x.source.roles && x.source.roles[i])[0]
                    || values.source && values.source.roles && values.source.roles[i]
                    || values.filter(x => x.source.roles && x.source.roles[i]);
            });
    }