mirror of
https://github.com/apache/superset.git
synced 2026-04-20 08:34:37 +00:00
feat: Implement context menu for drill by (#23454)
This commit is contained in:
committed by
GitHub
parent
542bf25729
commit
9fbfd1c1d8
@@ -137,11 +137,16 @@ export default function EchartsGraph({
|
||||
const data = (echartOptions as any).series[0].data as Data;
|
||||
const drillToDetailFilters =
|
||||
e.dataType === 'node' ? handleNodeClick(data) : handleEdgeClick(data);
|
||||
const node = data.find(item => item.id === e.data.id);
|
||||
|
||||
onContextMenu(pointerEvent.clientX, pointerEvent.clientY, {
|
||||
drillToDetail: drillToDetailFilters,
|
||||
crossFilter: getCrossFilterDataMask(
|
||||
data.find(item => item.id === e.data.id),
|
||||
),
|
||||
crossFilter: getCrossFilterDataMask(node),
|
||||
drillBy: node && {
|
||||
filters: [{ col: node.col, op: '==', val: node.name }],
|
||||
groupbyFieldName:
|
||||
node.col === formData.source ? 'source' : 'target',
|
||||
},
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
@@ -48,7 +48,11 @@ export default class EchartsGraphChartPlugin extends ChartPlugin {
|
||||
t('Transformable'),
|
||||
],
|
||||
thumbnail,
|
||||
behaviors: [Behavior.INTERACTIVE_CHART, Behavior.DRILL_TO_DETAIL],
|
||||
behaviors: [
|
||||
Behavior.INTERACTIVE_CHART,
|
||||
Behavior.DRILL_TO_DETAIL,
|
||||
Behavior.DRILL_BY,
|
||||
],
|
||||
}),
|
||||
transformProps,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user