import { AXIS_LABEL_SPACE, LINEAR_AXIS_INNER_OFFSET_TOP } from "../../../../utils/index.js";
const linearAxisStyle = (config)=>{
    const { orient, visible = true, label, tick, title, grid, line, zero, nice, inverse, max, min, log, logBase = 10, formatMethod, titleText, id, seriesId, sync, isPivot = false, animation } = config;
    const axisConfig = {
        ...isPivot ? {
            range: {
                min,
                max
            }
        } : {
            min,
            max
        },
        visible,
        type: log ? 'log' : 'linear',
        base: logBase,
        orient,
        nice,
        zero: log ? false : zero,
        inverse,
        label: {
            space: AXIS_LABEL_SPACE,
            visible: label?.visible,
            formatMethod,
            style: {
                fill: label?.labelColor,
                angle: label?.labelAngle,
                fontSize: label?.labelFontSize,
                fontWeight: label?.labelFontWeight
            }
        },
        title: {
            visible: title?.visible,
            text: titleText,
            style: {
                fill: title?.titleColor,
                fontSize: title?.titleFontSize,
                fontWeight: title?.titleFontWeight
            }
        },
        tick: {
            visible: tick?.visible,
            tickSize: tick?.tickSize,
            inside: tick?.tickInside,
            style: {
                stroke: tick?.tickColor
            }
        },
        grid: {
            visible: grid?.visible,
            style: {
                lineWidth: grid?.gridWidth,
                stroke: grid?.gridColor,
                lineDash: grid?.gridLineDash
            }
        },
        domainLine: {
            visible: line?.visible,
            style: {
                lineWidth: line?.lineWidth,
                stroke: line?.lineColor
            }
        },
        animation: !!animation,
        animationUpdate: {
            duration: animation?.duration,
            easing: animation?.easing
        }
    };
    if ('bottom' === orient || 'top' === orient) axisConfig.innerOffset = {
        right: LINEAR_AXIS_INNER_OFFSET_TOP
    };
    else axisConfig.innerOffset = {
        top: LINEAR_AXIS_INNER_OFFSET_TOP
    };
    if (id) axisConfig.id = id;
    if (seriesId) axisConfig.seriesId = seriesId;
    if (sync) axisConfig.sync = sync;
    return axisConfig;
};
export { linearAxisStyle };

//# sourceMappingURL=linearAxisStyle.js.map