@tanstack/charts
Version:
<div align="center"> <picture> <source media="(prefers-color-scheme: dark)" srcset="https://tanstack.com/api/readme/charts.png?theme=dark" /> <source media="(prefers-color-scheme: light)" srcset="https://tanstack.com/
22 lines (21 loc) • 621 B
JavaScript
const positionChannel = /* @__PURE__ */ Symbol();
function readMaterializedPositionChannel(name, channel) {
if (name === "x" || name === "y") return name;
return channel[positionChannel];
}
function preserveMaterializedPositionChannel(name, channel) {
const position = readMaterializedPositionChannel(name, channel);
if (position === void 0) return channel;
if (channel[positionChannel] === position) {
return channel;
}
const positioned = {
...channel,
[positionChannel]: position
};
return positioned;
}
export {
preserveMaterializedPositionChannel,
readMaterializedPositionChannel
};