antvis/G2

5.1.15: animate: type is undefined does not disable animation #6162

sspilleman posted onGitHub

Problem

Take a simple barchart

chart
    .interval()
    .animate({ enter: { type: undefined } }) <------------
    .data(data)
    .encode('x', 'genre')
    .encode('y', 'sold');

It still animates. In order to prevent the animation, you also need to add "duration: 0" like so:

chart
    .interval()
    .animate({ enter: { type: undefined, duration: 0 } }) <------------
    .data(data)
    .encode('x', 'genre')
    .encode('y', 'sold');

Which I believe is not correct. I suspect the animation is still enabled, just not visible any longer. It should not be anabled at all

Software macOS, Chrome


please comment and close if you don't think this is an issue....

posted by sspilleman about 1 year ago

If you want to prevent the animation:

.animate(fase);
posted by hustcc about 1 year ago

Thanks, that works! Please add that to the documentation

posted by sspilleman about 1 year ago

Thanks, that works! Please add that to the documentation

Would you be interested in submitting a PR (Pull Request)? Thank you.

posted by hustcc about 1 year ago

Fund this Issue

$0.00
Funded

Pull requests