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

fix: multi deck.gl bug fixes #7854

Merged
merged 2 commits into from Jul 12, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 10 additions & 4 deletions superset/assets/src/visualizations/deckgl/Multi/Multi.jsx
Expand Up @@ -35,6 +35,7 @@ class DeckMulti extends React.PureComponent {
constructor(props) {
super(props);
this.state = { subSlicesLayers: {} };
this.onViewportChange = this.onViewportChange.bind(this);
}

componentDidMount() {
Expand All @@ -47,8 +48,12 @@ class DeckMulti extends React.PureComponent {
this.loadLayers(formData, payload);
}

loadLayers(formData, payload) {
this.setState({ subSlicesLayers: {} });
onViewportChange(viewport) {
this.setState({ viewport });
}

loadLayers(formData, payload, viewport) {
this.setState({ subSlicesLayers: {}, viewport });
payload.data.slices.forEach((subslice) => {
// Filters applied to multi_deck are passed down to underlying charts
// note that dashboard contextual information (filter_immune_slices and such) aren't
Expand Down Expand Up @@ -86,15 +91,16 @@ class DeckMulti extends React.PureComponent {
}

render() {
const { payload, viewport, formData, setControlValue } = this.props;
const { payload, formData, setControlValue } = this.props;
const { subSlicesLayers } = this.state;

const layers = Object.values(subSlicesLayers);

return (
<DeckGLContainer
mapboxApiAccessToken={payload.data.mapboxApiKey}
viewport={viewport}
viewport={this.state.viewport || this.props.viewport}
onViewportChange={this.onViewportChange}
layers={layers}
mapStyle={formData.mapbox_style}
setControlValue={setControlValue}
Expand Down
1 change: 1 addition & 0 deletions superset/data/deck.py
Expand Up @@ -181,6 +181,7 @@ def load_deck_dash():
"point_radius_fixed": {"type": "metric", "value": "count"},
"point_unit": "square_m",
"min_radius": 1,
"max_radius": 250,
"row_limit": 5000,
"time_range": " : ",
"size": "count",
Expand Down