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

//# sourceMappingURL=pivotRows.js.map