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

Function setLabelLineState

src/label/labelGuideHelper.ts:531–552  ·  view source on GitHub ↗
(
    labelLine: Polyline,
    ignore: boolean,
    stateName: string,
    stateModel: Model
)

Source from the content-addressed store, hash-verified

529type LabelLineModel = Model<LabelLineOption>;
530
531function setLabelLineState(
532 labelLine: Polyline,
533 ignore: boolean,
534 stateName: string,
535 stateModel: Model
536) {
537 const isNormal = stateName === 'normal';
538 const stateObj = isNormal ? labelLine : labelLine.ensureState(stateName);
539 // Make sure display.
540 stateObj.ignore = ignore;
541 // Set smooth
542 let smooth = stateModel.get('smooth');
543 smooth = smooth === true ? 0.3 : Math.max(+smooth, 0) || 0;
544
545 stateObj.shape = stateObj.shape || {};
546
547 // always set the `smooth` property
548 (stateObj.shape as Polyline['shape']).smooth = smooth;
549
550 const styleObj = stateModel.getModel('lineStyle').getLineStyle();
551 isNormal ? labelLine.useStyle(styleObj) : stateObj.style = styleObj;
552}
553
554function buildLabelLinePath(path: CanvasRenderingContext2D, shape: Polyline['shape']) {
555 const smooth = shape.smooth as number;

Callers 1

setLabelLineStyleFunction · 0.85

Calls 3

getLineStyleMethod · 0.80
getMethod · 0.45
getModelMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…