import { isPivotChart } from "../../../../utils/index.js";
const datasetDualAxis = (options)=>(spec, context)=>{
        const { advancedVSeed, vseed } = context;
        const { analysis, datasetReshapeInfo } = advancedVSeed;
        const orderMapping = analysis?.orderMapping || {};
        const { unfoldInfo } = datasetReshapeInfo[0];
        const x = unfoldInfo.encodingX;
        const colorId = unfoldInfo.encodingColorId;
        const id = datasetReshapeInfo[0].id;
        const fields = {};
        if (x) {
            const order = orderMapping[x];
            if (order) fields[x] = {
                sortIndex: 0,
                domain: order,
                lockStatisticsByDomain: true
            };
            else fields[x] = {
                sortIndex: 0
            };
        }
        if (colorId) {
            const order = orderMapping[colorId];
            if (order) fields[colorId] = {
                sortIndex: 0,
                domain: order,
                lockStatisticsByDomain: true
            };
            else fields[colorId] = {
                sortIndex: 0
            };
        }
        return {
            ...spec,
            data: {
                id: `${id}-${options.axisType}-${options.chartType}`,
                values: isPivotChart(vseed) ? void 0 : advancedVSeed.dataset,
                fields: fields
            }
        };
    };
export { datasetDualAxis };

//# sourceMappingURL=datasetDualAxis.js.map