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

Function parsePosition

src/chart/gauge/GaugeView.ts:46–60  ·  view source on GitHub ↗
(seriesModel: GaugeSeriesModel, api: ExtensionAPI)

Source from the content-addressed store, hash-verified

44}
45
46function parsePosition(seriesModel: GaugeSeriesModel, api: ExtensionAPI): PosInfo {
47 const center = seriesModel.get('center');
48 const width = api.getWidth();
49 const height = api.getHeight();
50 const size = Math.min(width, height);
51 const cx = parsePercent(center[0], api.getWidth());
52 const cy = parsePercent(center[1], api.getHeight());
53 const r = parsePercent(seriesModel.get('radius'), size / 2);
54
55 return {
56 cx: cx,
57 cy: cy,
58 r: r
59 };
60}
61
62function formatLabel(value: number, labelFormatter: string | ((value: number) => string)): string {
63 let label = value == null ? '' : (value + '');

Callers 1

renderMethod · 0.85

Calls 3

getWidthMethod · 0.65
getHeightMethod · 0.65
getMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…