MCPcopy Index your code
hub / github.com/apache/echarts / getTextRect

Function getTextRect

src/legacy/getTextRect.ts:23–47  ·  view source on GitHub ↗
(
    text: TextStyleProps['text'],
    font?: TextStyleProps['font'],
    align?: TextStyleProps['align'],
    verticalAlign?: TextStyleProps['verticalAlign'],
    padding?: TextStyleProps['padding'],
    rich?: TextStyleProps['rich'],
    truncate?: boolean,
    lineHeight?: number
)

Source from the content-addressed store, hash-verified

21
22type TextStyleProps = Text['style'];
23export function getTextRect(
24 text: TextStyleProps['text'],
25 font?: TextStyleProps['font'],
26 align?: TextStyleProps['align'],
27 verticalAlign?: TextStyleProps['verticalAlign'],
28 padding?: TextStyleProps['padding'],
29 rich?: TextStyleProps['rich'],
30 truncate?: boolean,
31 lineHeight?: number
32) {
33 const textEl = new Text({
34 style: {
35 text,
36 font,
37 align,
38 verticalAlign,
39 padding,
40 rich,
41 overflow: truncate ? 'truncate' : null,
42 lineHeight
43 }
44 });
45
46 return textEl.getBoundingRect();
47}

Callers

nothing calls this directly

Calls 1

getBoundingRectMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…