This is an automated email from the ASF dual-hosted git repository.
christine pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-superset.git
The following commit(s) were added to refs/heads/master by this push:
new a09348d Fix playslider
new 5669a82 Merge pull request #6797 from lyft/VIZ-187
a09348d is described below
commit a09348d0ec27463a394d9914dcd5cbfd5670a5ee
Author: Beto Dealmeida <[email protected]>
AuthorDate: Thu Jan 31 17:23:59 2019 -0800
Fix playslider
---
.../src/visualizations/deckgl/CategoricalDeckGLContainer.jsx | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git
a/superset/assets/src/visualizations/deckgl/CategoricalDeckGLContainer.jsx
b/superset/assets/src/visualizations/deckgl/CategoricalDeckGLContainer.jsx
index be30aad..e1933a4 100644
--- a/superset/assets/src/visualizations/deckgl/CategoricalDeckGLContainer.jsx
+++ b/superset/assets/src/visualizations/deckgl/CategoricalDeckGLContainer.jsx
@@ -70,7 +70,7 @@ 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);
@@ -78,6 +78,11 @@ export default class CategoricalDeckGLContainer extends
React.PureComponent {
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)
@@ -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);