sadpandajoe commented on code in PR #45234:
URL: https://github.com/apache/superset/pull/45234#discussion_r4284990529
##########
superset-frontend/plugins/preset-chart-deckgl/src/CategoricalDeckGLContainer.tsx:
##########
@@ -124,16 +160,28 @@ const CategoricalDeckGLContainer = (props:
CategoricalDeckGLContainerProps) => {
props.payload.form_data,
);
const [viewport, setViewport] = useState(getAdjustedViewport());
+ const featuresRef = useRef(props.payload.data.features);
useEffect(() => {
+ const features = props.payload.data.features || [];
if (props.payload.form_data !== stateFormData) {
- const features = props.payload.data.features || [];
const categories = getCategories(props.formData, features);
setViewport(getAdjustedViewport());
setStateFormData(props.payload.form_data);
setCategories(categories);
+ } else if (props.payload.data.features !== featuresRef.current) {
Review Comment:
With autozoom on, a standalone Scatterplot/Arc/Path now stays mounted
through an auto-refresh, but this branch only reconciles categories and never
recomputes `viewport`. The v1 payload is `queriesData[0]` with no `form_data`,
so the `payload.form_data !== stateFormData` branch above never fires either.
If the refreshed rows move from San Francisco to London, the map stays fitted
to San Francisco and looks empty, where the old remount refit it. Should this
branch also call `setViewport(getAdjustedViewport())` when autozoom is enabled?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]