Skip to content

Animation System #115

@draedful

Description

@draedful

Right now we don't have any animation mechanisms, but we do have some kind of animations using the [startAnimation] helper (https://github.com/gravity-ui/graph/blob/main/src/utils/functions/index.ts#L139 ). But it has a critical flaw - it is not synchronized with our scheduler. Because of this, animations may look jerky or slow-motion.

Expected DX

interface Animation {
 start(): void;
 stop(): void;
 state: AnimationState.idle/Pause/playing,
 destroy(): void;
 bbox: THitbox;
}

const animation = graph.animate((animation: Animation) => {
  this.performRender();
}, { timing: TimingFunction.Linear, duration: 5_000, bBox: this });

animation.start();

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions