import { chartLibrariesSettings } from "./chartLibrariesSettings";
export const getChartURLOptions = (attributes, shouldEliminateZeroDimensions) => {
    const { appendOptions, overrideOptions, } = attributes;
    let ret = "";
    ret += overrideOptions
        ? overrideOptions.toString()
        : chartLibrariesSettings[attributes.chartLibrary].options(attributes);
    if (typeof appendOptions === "string") {
        ret += `|${encodeURIComponent(appendOptions)}`;
    }
    ret += "|jsonwrap";
    if (shouldEliminateZeroDimensions) {
        ret += "|nonzero";
    }
    if (attributes.dimensionsAggrMethod === "sum-of-abs"
        || (!attributes.dimensionsAggrMethod && attributes.groupBy && attributes.groupBy !== "dimension")) {
        ret += "|absolute";
    }
    return ret;
};
//# sourceMappingURL=get-chart-url-options.js.map