sleeplinePlotFn = (allData, params) => {
const { x, y, margin, seriesIndex, plotHeight, TargetThreshold } = params;
if (allData.flat().filter((d) => TargetThreshold <= d.y).length === 0)
return null;
const calculateTime = calculatecalculateTime(allData);
const output = svg`
<g transform="translate(${x(calculateTime)}, ${y(TargetThreshold) - 10})">
${renderTargetIcon()}
</g>
<rect class="sleep-line-border"
x="${x(calculateTime) - 2.5}" width="3"
y="${y(TargetThreshold)}"
height="${plotHeight - y(TargetThreshold)}"
/>
<rect class="sleep-line"
x="${x(calculateTime) - 2.5}" width="3"
y="${y(TargetThreshold)}"
height="${plotHeight - y(TargetThreshold) + 12}"
/>
`;
return output;
}