import { isMetricsOnlyFunnel } from '../../shared/isMetricsOnlyFunnel';
/**
 * Determines if a query can be rendered as a specific chart type
 */
export const canRenderAsChart = (chartType, metricQuery) => {
    switch (chartType) {
        case 'table':
            return true; // Table can always render
        case 'bar':
        case 'horizontal':
        case 'line':
        case 'scatter':
            // Charts require at least one dimension and one metric
            return (metricQuery.dimensions.length > 0 &&
                metricQuery.metrics.length > 0);
        case 'pie':
            // Pie charts require at least one dimension and one metric
            return (metricQuery.dimensions.length > 0 &&
                metricQuery.metrics.length > 0);
        case 'funnel':
            // Funnel stages come either from rows (dimension + metric) or
            // from the metric columns of a single-row result (no dimension)
            return ((metricQuery.dimensions.length > 0 &&
                metricQuery.metrics.length > 0) ||
                isMetricsOnlyFunnel(metricQuery));
        default:
            return false;
    }
};
//# sourceMappingURL=canRenderAsChart.js.map