MCPcopy Create free account
hub / github.com/apache/echarts / wrapInlineValueRichText

Function wrapInlineValueRichText

src/component/tooltip/tooltipMarkup.ts:470–485  ·  view source on GitHub ↗
(
    ctx: TooltipMarkupBuildContext,
    values: string | string[],
    alignRight: boolean,
    valueCloseToMarker: boolean,
    style: RichTextStyle
)

Source from the content-addressed store, hash-verified

468}
469
470function wrapInlineValueRichText(
471 ctx: TooltipMarkupBuildContext,
472 values: string | string[],
473 alignRight: boolean,
474 valueCloseToMarker: boolean,
475 style: RichTextStyle
476): string {
477 const styles: Dictionary<unknown>[] = [style];
478 const paddingLeft = valueCloseToMarker ? 10 : 20;
479 alignRight && styles.push({ padding: [0, 0, 0, paddingLeft], align: 'right' });
480 // Value has commas inside, so use ' ' as delimiter for multiple values.
481 return ctx.markupStyleCreator.wrapRichTextStyle(
482 isArray(values) ? values.join(' ') : values,
483 styles
484 );
485}
486
487
488export function retrieveVisualColorForTooltipMarker(

Callers 1

buildNameValueFunction · 0.85

Calls 2

isArrayFunction · 0.85
wrapRichTextStyleMethod · 0.80

Tested by

no test coverage detected