| 833 | } |
| 834 | |
| 835 | function pointerMoveTo( |
| 836 | pointer: TimelineSymbol, |
| 837 | progressLine: graphic.Line, |
| 838 | dataIndex: number, |
| 839 | axis: TimelineAxis, |
| 840 | timelineModel: SliderTimelineModel, |
| 841 | noAnimation?: boolean |
| 842 | ) { |
| 843 | if (pointer.dragging) { |
| 844 | return; |
| 845 | } |
| 846 | |
| 847 | const pointerModel = timelineModel.getModel('checkpointStyle'); |
| 848 | const toCoord = axis.dataToCoord(timelineModel.getData().get('value', dataIndex)); |
| 849 | |
| 850 | if (noAnimation || !pointerModel.get('animation', true)) { |
| 851 | pointer.attr({ |
| 852 | x: toCoord, |
| 853 | y: 0 |
| 854 | }); |
| 855 | progressLine && progressLine.attr({ |
| 856 | shape: { x2: toCoord } |
| 857 | }); |
| 858 | } |
| 859 | else { |
| 860 | const animationCfg = { |
| 861 | duration: pointerModel.get('animationDuration', true), |
| 862 | easing: pointerModel.get('animationEasing', true) |
| 863 | }; |
| 864 | pointer.stopAnimation(null, true); |
| 865 | pointer.animateTo({ |
| 866 | x: toCoord, |
| 867 | y: 0 |
| 868 | }, animationCfg); |
| 869 | progressLine && progressLine.animateTo({ |
| 870 | shape: { x2: toCoord } |
| 871 | }, animationCfg); |
| 872 | } |
| 873 | } |
| 874 | |
| 875 | export default SliderTimelineView; |