@synergy-design-system/components
Version:
101 lines (98 loc) • 3.19 kB
JavaScript
import {
buildAxisLabelConfigWithIcon,
updateAxisConfig
} from "./chunk.KMZLWOXI.js";
import {
getRealStyleValue,
getRealValueWithoutUnit
} from "./chunk.DKVCRWJF.js";
import {
compose
} from "./chunk.T3OQKYCT.js";
import {
__export,
__spreadValues
} from "./chunk.VK2FVWOF.js";
// src/components/chart/configs/axes/presets.ts
var presets_exports = {};
__export(presets_exports, {
axesAddXLabelIcons: () => axesAddXLabelIcons,
axesAddYLabelIcons: () => axesAddYLabelIcons,
axesHideLabels: () => axesHideLabels,
axesHideXLabels: () => axesHideXLabels,
axesHideYLabels: () => axesHideYLabels,
axesShowSplitLines: () => axesShowSplitLines,
axesShowXSplitLines: () => axesShowXSplitLines,
axesShowYSplitLines: () => axesShowYSplitLines
});
var axesShowYSplitLines = ({ axisIndex } = {}) => (config) => ({
yAxis: updateAxisConfig(config, "yAxis", {
splitLine: { show: true }
}, { axisIndex })
});
var axesShowXSplitLines = ({ axisIndex } = {}) => (config) => ({
xAxis: updateAxisConfig(config, "xAxis", {
splitLine: { show: true }
}, { axisIndex })
});
var axesShowSplitLines = ({ xAxisIndex, yAxisIndex } = {}) => compose(
axesShowYSplitLines({ axisIndex: yAxisIndex }),
axesShowXSplitLines({ axisIndex: xAxisIndex }),
(config) => ({
xAxis: updateAxisConfig(config, "xAxis", {
axisLine: { show: true }
}, { axisIndex: xAxisIndex }),
yAxis: updateAxisConfig(config, "yAxis", {
axisLine: { show: true }
}, { axisIndex: yAxisIndex })
})
);
var axesHideXLabels = ({ axisIndex } = {}) => (config) => ({
xAxis: updateAxisConfig(config, "xAxis", {
axisLabel: { show: false },
nameGap: getRealValueWithoutUnit("--syn-spacing-small")
}, { axisIndex })
});
var axesHideYLabels = ({ axisIndex } = {}) => (config) => ({
yAxis: updateAxisConfig(config, "yAxis", {
axisLabel: { show: false },
nameTextStyle: { align: "left" }
}, { axisIndex })
});
var axesHideLabels = ({ xAxisIndex, yAxisIndex } = {}) => compose(
axesHideXLabels({ axisIndex: xAxisIndex }),
axesHideYLabels({ axisIndex: yAxisIndex })
);
var axesAddLabelIcons = (axisKey, options) => (config) => {
const defaults = {
iconColor: getRealStyleValue("--syn-color-neutral-950"),
iconPosition: axisKey === "xAxis" ? "top" : "left"
};
const mergedOptions = __spreadValues(__spreadValues({}, defaults), options);
return {
[axisKey]: updateAxisConfig(config, axisKey, {
axisLabel: buildAxisLabelConfigWithIcon({
config,
iconColor: mergedOptions.iconColor,
iconPosition: mergedOptions.iconPosition,
iconsStyle: mergedOptions.iconsStyle,
iconUrls: mergedOptions.iconUrls,
labelsStyle: mergedOptions.labelsStyle
})
}, { axisIndex: mergedOptions.axisIndex })
};
};
var axesAddXLabelIcons = (options) => axesAddLabelIcons("xAxis", options);
var axesAddYLabelIcons = (options) => axesAddLabelIcons("yAxis", options);
export {
axesShowYSplitLines,
axesShowXSplitLines,
axesShowSplitLines,
axesHideXLabels,
axesHideYLabels,
axesHideLabels,
axesAddXLabelIcons,
axesAddYLabelIcons,
presets_exports
};
//# sourceMappingURL=chunk.VCDIUHSK.js.map