MCPcopy
hub / github.com/nhn/tui.chart / validXPosition

Function validXPosition

apps/chart/src/component/plot.ts:25–30  ·  view source on GitHub ↗
({ axisData, offsetSize, value, startIndex = 0 }: XPositionParam)

Source from the content-addressed store, hash-verified

23}
24
25function validXPosition({ axisData, offsetSize, value, startIndex = 0 }: XPositionParam) {
26 const dataIndex = getValidIndex(value as number, startIndex);
27 const x = getXPosition(axisData, offsetSize, value, dataIndex);
28
29 return x > 0 ? Math.min(offsetSize, x) : 0;
30}
31
32function getPlotAxisData(vertical: boolean, axes: Axes) {
33 return vertical ? axes.xAxis : axes.yAxis;

Callers 2

renderLinesMethod · 0.85
renderBandsMethod · 0.85

Calls 2

getXPositionFunction · 0.90
getValidIndexFunction · 0.85

Tested by

no test coverage detected