MCPcopy
hub / github.com/apache/echarts / confineInContainer

Function confineInContainer

src/component/axisPointer/viewHelper.ts:138–145  ·  view source on GitHub ↗
(position: number[], width: number, height: number, api: ExtensionAPI)

Source from the content-addressed store, hash-verified

136
137// Do not overflow ec container
138function confineInContainer(position: number[], width: number, height: number, api: ExtensionAPI) {
139 const viewWidth = api.getWidth();
140 const viewHeight = api.getHeight();
141 position[0] = Math.min(position[0] + width, viewWidth) - width;
142 position[1] = Math.min(position[1] + height, viewHeight) - height;
143 position[0] = Math.max(position[0], 0);
144 position[1] = Math.max(position[1], 0);
145}
146
147export function getValueLabel(
148 value: ScaleDataValue,

Callers 1

buildLabelElOptionFunction · 0.85

Calls 2

getWidthMethod · 0.65
getHeightMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…