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

Function applyLeaveTransition

src/animation/customGraphicTransition.ts:228–252  ·  view source on GitHub ↗
(
    el: Element,
    elOption: TransitionElementOption,
    animatableModel: Model<AnimationOptionMixin>,
    onRemove?: () => void
)

Source from the content-addressed store, hash-verified

226}
227
228export function applyLeaveTransition(
229 el: Element,
230 elOption: TransitionElementOption,
231 animatableModel: Model<AnimationOptionMixin>,
232 onRemove?: () => void
233): void {
234 if (el) {
235 const parent = el.parent;
236 const leaveToProps = transitionInnerStore(el).leaveToProps;
237 if (leaveToProps) {
238 // TODO TODO use leave after leaveAnimation in series is introduced
239 // TODO Data index?
240 const config = getElementAnimationConfig('update', el, elOption, animatableModel, 0);
241 config.done = () => {
242 parent && parent.remove(el);
243 onRemove && onRemove();
244 };
245 el.animateTo(leaveToProps, config);
246 }
247 else {
248 parent && parent.remove(el);
249 onRemove && onRemove();
250 }
251 }
252}
253
254export function isTransitionAll(transition: TransitionProps): transition is 'all' {
255 return transition === 'all';

Callers 4

renderMethod · 0.90
removeChildFromGroupFunction · 0.90
processRemoveFunction · 0.90
removeElFunction · 0.90

Calls 2

removeMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…