import { DATUM_HIDE_KEY } from "../../../../utils/constant.js";
import { isLinearColor } from "../color/colorAdapter.js";
const cellStyle = (spec, context)=>{
    const { advancedVSeed, vseed } = context;
    const { chartType } = vseed;
    const cell = advancedVSeed.config?.[chartType]?.cell;
    const { datasetReshapeInfo } = advancedVSeed;
    const { unfoldInfo } = datasetReshapeInfo[0];
    return {
        ...spec,
        cell: {
            style: {
                visible: (datum)=>datum?.[DATUM_HIDE_KEY] !== true,
                shape: 'rect',
                stroke: cell?.stroke,
                lineWidth: cell?.lineWidth ?? 1,
                fill: {
                    field: isLinearColor(advancedVSeed, vseed) ? unfoldInfo.encodingColor : unfoldInfo.encodingColorId,
                    scale: 'color'
                }
            },
            state: {
                hover: {
                    shadowColor: cell?.hoverShadowColor,
                    shadowBlur: 5,
                    shadowOffsetX: 0,
                    shadowOffsetY: 0
                }
            }
        }
    };
};
export { cellStyle };

//# sourceMappingURL=cellStyle.js.map