feat(matrixify): implement matrix of any charts as core Superset feature (#34526)

Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
Maxime Beauchemin
2025-08-19 08:36:55 -07:00
committed by GitHub
parent 6969f2cf7a
commit e6c8343fd0
54 changed files with 5696 additions and 106 deletions

View File

@@ -16,6 +16,8 @@
* specific language governing permissions and limitations
* under the License.
*/
// Mock isMatrixifyEnabled before loading any modules
import fetchMock from 'fetch-mock';
import {
getChartControlPanelRegistry,
@@ -33,6 +35,12 @@ import {
} from 'spec/helpers/testing-library';
import ExploreViewContainer from '.';
jest.doMock('@superset-ui/core', () => ({
__esModule: true,
...jest.requireActual('@superset-ui/core'),
isMatrixifyEnabled: jest.fn(() => false),
}));
const reduxState = {
explore: {
controls: {

View File

@@ -30,6 +30,7 @@ import {
useChangeEffect,
useComponentDidMount,
usePrevious,
isMatrixifyEnabled,
} from '@superset-ui/core';
import { debounce, isEqual, isObjectLike, omit, pick } from 'lodash';
import { Resizable } from 're-resizable';
@@ -323,10 +324,30 @@ function ExploreViewContainer(props) {
const onQuery = useCallback(() => {
props.actions.setForceQuery(false);
// Skip main query if Matrixify is enabled
if (isMatrixifyEnabled(props.form_data)) {
// Set chart to success state since Matrixify will handle its own queries
props.actions.chartUpdateSucceeded([], props.chart.id);
props.actions.chartRenderingSucceeded(props.chart.id);
// Update history and controls
addHistory();
setLastQueriedControls(props.controls);
return;
}
// Normal behavior for non-Matrixify
props.actions.triggerQuery(true, props.chart.id);
addHistory();
setLastQueriedControls(props.controls);
}, [props.controls, addHistory, props.actions, props.chart.id]);
}, [
props.controls,
addHistory,
props.actions,
props.chart.id,
props.form_data,
]);
const handleKeydown = useCallback(
event => {