import { ChartTypeEnum } from "../constant.js";
const isMeasure = (measure)=>!('children' in measure);
const isMeasureGroup = (measure)=>'children' in measure;
const isMeasures = (measures)=>measures.every(isMeasure);
const isPositionMeasure = (measure, chartType)=>{
    if (!measure.encoding) return true;
    if (chartType === ChartTypeEnum.Funnel) return 'size' === measure.encoding;
    if (chartType === ChartTypeEnum.Heatmap) return 'color' === measure.encoding;
    if ([
        ChartTypeEnum.Pie,
        ChartTypeEnum.Donut,
        ChartTypeEnum.Rose,
        ChartTypeEnum.RoseParallel
    ].includes(chartType)) return 'angle' === measure.encoding;
    if (chartType === ChartTypeEnum.DualAxis) return [
        'primaryYAxis',
        'secondaryYAxis'
    ].includes(measure.encoding);
    if (ChartTypeEnum.Radar === chartType) return 'radius' === measure.encoding;
    if ([
        ChartTypeEnum.Line,
        ChartTypeEnum.Area,
        ChartTypeEnum.AreaPercent,
        ChartTypeEnum.Column,
        ChartTypeEnum.ColumnParallel,
        ChartTypeEnum.ColumnPercent
    ].includes(chartType)) return 'yAxis' === measure.encoding;
    if ([
        ChartTypeEnum.Bar,
        ChartTypeEnum.BarParallel,
        ChartTypeEnum.BarPercent
    ].includes(chartType)) return 'xAxis' === measure.encoding;
    return chartType === ChartTypeEnum.Boxplot && 'value' === measure.encoding;
};
export { isMeasure, isMeasureGroup, isMeasures, isPositionMeasure };

//# sourceMappingURL=typeGuard.js.map