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

Method makeBtn

src/component/timeline/SliderTimelineView.ts:543–570  ·  view source on GitHub ↗
(
            position: number[],
            iconName: ControlName,
            onclick: () => void,
            willRotate?: boolean
        )

Source from the content-addressed store, hash-verified

541 );
542
543 function makeBtn(
544 position: number[],
545 iconName: ControlName,
546 onclick: () => void,
547 willRotate?: boolean
548 ) {
549 if (!position) {
550 return;
551 }
552 const iconSize = parsePercent(
553 retrieve2(timelineModel.get(['controlStyle', iconName + 'BtnSize' as any]), controlSize),
554 controlSize
555 );
556 const rect = [0, -iconSize / 2, iconSize, iconSize];
557 const btn = makeControlIcon(timelineModel, iconName + 'Icon' as ControlIconName, rect, {
558 x: position[0],
559 y: position[1],
560 originX: controlSize / 2,
561 originY: 0,
562 rotation: willRotate ? -rotation : 0,
563 rectHover: true,
564 style: itemStyle,
565 onclick: onclick
566 });
567 btn.ensureState('emphasis').style = hoverStyle;
568 group.add(btn);
569 enableHoverEmphasis(btn);
570 }
571 }
572
573 private _renderCurrentPointer(

Callers

nothing calls this directly

Calls 4

enableHoverEmphasisFunction · 0.90
makeControlIconFunction · 0.85
getMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected