b54f82e264a8121048ec81119ab2da113483d66e389a02186e9d00cf49b5e56e2a1a3e002cdc421f12160ca4cdae36a146a0607a278be4ce02cdfe300d4f32 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. import { AnimationOptionMixin, AnimationOption } from '../util/types.js';
  2. import Element, { ElementAnimateConfig, ElementProps } from 'zrender/lib/Element.js';
  3. import Model from '../model/Model.js';
  4. import Displayable from 'zrender/lib/graphic/Displayable.js';
  5. export declare const transitionStore: (hostObj: Displayable<import("zrender/lib/graphic/Displayable").DisplayableProps>) => {
  6. oldStyle: Displayable['style'];
  7. };
  8. declare type AnimateOrSetPropsOption = {
  9. dataIndex?: number;
  10. cb?: () => void;
  11. during?: (percent: number) => void;
  12. removeOpt?: AnimationOption;
  13. isFrom?: boolean;
  14. };
  15. /**
  16. * Return null if animation is disabled.
  17. */
  18. export declare function getAnimationConfig(animationType: 'enter' | 'update' | 'leave', animatableModel: Model<AnimationOptionMixin>, dataIndex: number, extraOpts?: Pick<ElementAnimateConfig, 'easing' | 'duration' | 'delay'>, extraDelayParams?: unknown): Pick<ElementAnimateConfig, 'easing' | 'duration' | 'delay'> | null;
  19. /**
  20. * Update graphic element properties with or without animation according to the
  21. * configuration in series.
  22. *
  23. * Caution: this method will stop previous animation.
  24. * So do not use this method to one element twice before
  25. * animation starts, unless you know what you are doing.
  26. * @example
  27. * graphic.updateProps(el, {
  28. * position: [100, 100]
  29. * }, seriesModel, dataIndex, function () { console.log('Animation done!'); });
  30. * // Or
  31. * graphic.updateProps(el, {
  32. * position: [100, 100]
  33. * }, seriesModel, function () { console.log('Animation done!'); });
  34. */
  35. declare function updateProps<Props extends ElementProps>(el: Element<Props>, props: Props, animatableModel?: Model<AnimationOptionMixin>, dataIndex?: AnimateOrSetPropsOption['dataIndex'] | AnimateOrSetPropsOption['cb'] | AnimateOrSetPropsOption, cb?: AnimateOrSetPropsOption['cb'] | AnimateOrSetPropsOption['during'], during?: AnimateOrSetPropsOption['during']): void;
  36. export { updateProps };
  37. /**
  38. * Init graphic element properties with or without animation according to the
  39. * configuration in series.
  40. *
  41. * Caution: this method will stop previous animation.
  42. * So do not use this method to one element twice before
  43. * animation starts, unless you know what you are doing.
  44. */
  45. export declare function initProps<Props extends ElementProps>(el: Element<Props>, props: Props, animatableModel?: Model<AnimationOptionMixin>, dataIndex?: AnimateOrSetPropsOption['dataIndex'] | AnimateOrSetPropsOption['cb'] | AnimateOrSetPropsOption, cb?: AnimateOrSetPropsOption['cb'] | AnimateOrSetPropsOption['during'], during?: AnimateOrSetPropsOption['during']): void;
  46. /**
  47. * If element is removed.
  48. * It can determine if element is having remove animation.
  49. */
  50. export declare function isElementRemoved(el: Element): boolean;
  51. /**
  52. * Remove graphic element
  53. */
  54. export declare function removeElement<Props>(el: Element<Props>, props: Props, animatableModel?: Model<AnimationOptionMixin>, dataIndex?: AnimateOrSetPropsOption['dataIndex'] | AnimateOrSetPropsOption['cb'] | AnimateOrSetPropsOption, cb?: AnimateOrSetPropsOption['cb'] | AnimateOrSetPropsOption['during'], during?: AnimateOrSetPropsOption['during']): void;
  55. export declare function removeElementWithFadeOut(el: Element, animatableModel?: Model<AnimationOptionMixin>, dataIndex?: number): void;
  56. /**
  57. * Save old style for style transition in universalTransition module.
  58. * It's used when element will be reused in each render.
  59. * For chart like map, heatmap, which will always create new element.
  60. * We don't need to save this because universalTransition can get old style from the old element
  61. */
  62. export declare function saveOldStyle(el: Displayable): void;
  63. export declare function getOldStyle(el: Displayable): import("zrender/lib/core/types").Dictionary<any>;