import { createFormatterByDimension } from "../../../../utils/index.js";
const pivotColumns = (spec, context)=>{
    const { advancedVSeed } = context;
    const { encoding } = advancedVSeed;
    const dimensions = advancedVSeed.dimensionTree;
    const columns = dimensions.filter((item)=>encoding.column?.includes(item.id));
    return {
        ...spec,
        columns: columns.map((item)=>{
            const formatter = createFormatterByDimension(item, advancedVSeed.locale);
            return {
                dimensionKey: item.id,
                title: item.alias || item.id,
                width: 'auto',
                headerStyle: {
                    textAlign: 'center'
                },
                headerFormat: (value)=>formatter(value)
            };
        })
    };
};
export { pivotColumns };

//# sourceMappingURL=pivotColumns.js.map