@visactor/vchart
Version:
charts lib based @visactor/VGrammar
37 lines (29 loc) • 916 B
JavaScript
import { barGrowIn, barGrowOut } from "../bar/animation";
import { Factory } from "../../core/factory";
import { DEFAULT_ANIMATION_CONFIG } from "../../animation/config";
const Appear_FadeIn = {
type: "fadeIn"
}, Appear_ScaleIn = {
type: "growCenterIn"
};
export function waterfallPresetAnimation(params, preset) {
switch (preset) {
case "fadeIn":
return Appear_FadeIn;
case "scaleIn":
return Appear_ScaleIn;
default:
return barGrowIn(params, !1);
}
}
export const registerWaterfallAnimation = () => {
Factory.registerAnimation("waterfall", ((params, preset) => ({
appear: waterfallPresetAnimation(params, preset),
enter: barGrowIn(params, !1),
exit: barGrowOut(params, !1),
disappear: {
duration: DEFAULT_ANIMATION_CONFIG.disappear.duration
}
})));
};
//# sourceMappingURL=animation.js.map