Skip to content

Documentation / @finchart/core / XCoordinates

Interface: XCoordinates

Defined in: packages/core/src/plot/capabilities.ts:178

화면 x와 데이터 x를 오간다.

히트 테스트가 서드파티의 첫 요구인데 여기 문이 없었다. @finchart/tools가 쓰던 방법은 draw 컨텍스트를 변수에 훔쳐 두는 것이었다 — 첫 렌더 전에는 아무 판정도 못 하고, 잡아 둔 컨텍스트는 다음 프레임에 낡는다.

XMapping을 그대로 주지 않는 이유는 거기 rebuild가 있어서다 — 인덱스를 다시 세우는 것은 무대의 일이지 확장의 일이 아니다. 읽는 두 방향만 판다.

x만 여기 있는 것은 우연이 아니다 — x는 Plot이, 값은 Pane이 소유한다. 값 쪽 짝은 ValueCoordinates다.

소비자: @finchart/tools

Methods

pixelAtX()

pixelAtX(x): number

Defined in: packages/core/src/plot/capabilities.ts:182

데이터 x가 놓이는 화면 x(px).

Parameters

x

number

Returns

number


xAt()

xAt(pixel): number

Defined in: packages/core/src/plot/capabilities.ts:180

화면 x(px) 아래의 데이터 x. 봉 사이면 이웃 봉을 선형으로 나눈 값이다.

Parameters

pixel

number

Returns

number