Skip to content

Commit

Permalink
Merge pull request #6797 from lyft/VIZ-187
Browse files Browse the repository at this point in the history
Fix play slider in deck.gl visualizations
  • Loading branch information
xtinec authored Feb 1, 2019
2 parents adc9a6b + a09348d commit 5669a82
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,19 @@ export default class CategoricalDeckGLContainer extends React.PureComponent {
*/
constructor(props) {
super(props);
this.state = this.getInitialStateFromProps(props);
this.state = this.getStateFromProps(props);

this.getLayers = this.getLayers.bind(this);
this.onValuesChange = this.onValuesChange.bind(this);
this.onViewportChange = this.onViewportChange.bind(this);
this.toggleCategory = this.toggleCategory.bind(this);
this.showSingleCategory = this.showSingleCategory.bind(this);
}
componentWillReceiveProps(nextProps) {
if (nextProps.payload.form_data !== this.state.formData) {
this.setState({ ...this.getStateFromProps(nextProps) });
}
}
onValuesChange(values) {
this.setState({
values: Array.isArray(values)
Expand All @@ -88,7 +93,7 @@ export default class CategoricalDeckGLContainer extends React.PureComponent {
onViewportChange(viewport) {
this.setState({ viewport });
}
getInitialStateFromProps(props, state) {
getStateFromProps(props, state) {
const features = props.payload.data.features || [];
const timestamps = features.map(f => f.__timestamp);
const categories = getCategories(props.formData, features);
Expand Down

0 comments on commit 5669a82

Please sign in to comment.