Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implementing keyframe system for deck.gl layers #56

Merged
merged 4 commits into from
Dec 16, 2020
Merged

Conversation

chrisgervang
Copy link
Collaborator

@chrisgervang chrisgervang commented Dec 16, 2020

  • Define keyframes in getKeyframes
import {Keyframes} from '@hubble.gl/core';
import {easing} from 'popmotion';

const getKeyframes = () => {
  return {
    station: new Keyframes({
      features: ['radiusScale'],
      keyframes: [{radiusScale: 0}, {radiusScale: 6}],
      timings: [0, 2000],
      easings: [easing.anticipate]
    })
  };
};
  • Provide getKeyframes to adapter.render and new DeckScene({initialKeyframes})
  • Provide getLayers to adapter.getProps to apply animation to layers.
const getLayers = scene => {
    const scatter = scene.keyframes.scatter.getFrame();
    return [
      new ScatterplotLayer({
        ...
        radiusScale: scatter.radiusScale
      })
    ];
  };

@chrisgervang chrisgervang merged commit e3d439f into master Dec 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant