mirror of
https://github.com/apache/superset.git
synced 2026-04-22 09:35:23 +00:00
feat(dashboard): menu improvements, fallback support for Drill to Detail (#21351)
This commit is contained in:
@@ -17,7 +17,7 @@
|
||||
* under the License.
|
||||
*/
|
||||
import React from 'react';
|
||||
import { QueryObjectFilterClause } from '@superset-ui/core';
|
||||
import { BinaryQueryObjectFilterClause } from '@superset-ui/core';
|
||||
import { EventHandlers } from '../types';
|
||||
import Echart from '../components/Echart';
|
||||
import { GraphChartTransformedProps } from './types';
|
||||
@@ -47,7 +47,7 @@ export default function EchartsGraph({
|
||||
const sourceValue = data.find(item => item.id === e.data.source)?.name;
|
||||
const targetValue = data.find(item => item.id === e.data.target)?.name;
|
||||
if (sourceValue && targetValue) {
|
||||
const filters: QueryObjectFilterClause[] = [
|
||||
const filters: BinaryQueryObjectFilterClause[] = [
|
||||
{
|
||||
col: formData.source,
|
||||
op: '==',
|
||||
@@ -61,7 +61,7 @@ export default function EchartsGraph({
|
||||
formattedVal: targetValue,
|
||||
},
|
||||
];
|
||||
onContextMenu(filters, pointerEvent.clientX, pointerEvent.clientY);
|
||||
onContextMenu(pointerEvent.clientX, pointerEvent.clientY, filters);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
import { t, ChartMetadata, ChartPlugin } from '@superset-ui/core';
|
||||
import { t, ChartMetadata, ChartPlugin, Behavior } from '@superset-ui/core';
|
||||
import controlPanel from './controlPanel';
|
||||
import transformProps from './transformProps';
|
||||
import thumbnail from './images/thumbnail.png';
|
||||
@@ -46,6 +46,7 @@ export default class EchartsGraphChartPlugin extends ChartPlugin {
|
||||
t('Transformable'),
|
||||
],
|
||||
thumbnail,
|
||||
behaviors: [Behavior.DRILL_TO_DETAIL],
|
||||
}),
|
||||
transformProps,
|
||||
});
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
import {
|
||||
PlainObject,
|
||||
QueryFormData,
|
||||
QueryObjectFilterClause,
|
||||
BinaryQueryObjectFilterClause,
|
||||
} from '@superset-ui/core';
|
||||
import { GraphNodeItemOption } from 'echarts/types/src/chart/graph/GraphSeries';
|
||||
import { SeriesTooltipOption } from 'echarts/types/src/util/types';
|
||||
@@ -88,8 +88,8 @@ export type tooltipFormatParams = {
|
||||
export type GraphChartTransformedProps = EchartsProps & {
|
||||
formData: PlainObject;
|
||||
onContextMenu?: (
|
||||
filters: QueryObjectFilterClause[],
|
||||
clientX: number,
|
||||
clientY: number,
|
||||
filters?: BinaryQueryObjectFilterClause[],
|
||||
) => void;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user