mirror of
https://github.com/apache/superset.git
synced 2026-04-20 00:24:38 +00:00
feat: Adds drill to detail context menu for ECharts visualizations (#20891)
* feat: Adds drill to detail context menu for ECharts visualizations * Rebases and adds time grain * Fixes selected gauge values * Fixes Treemap edge click * Adds right click to big number trendline * Address some comments
This commit is contained in:
committed by
GitHub
parent
0042ade66f
commit
3df8335f87
@@ -31,9 +31,9 @@ import {
|
||||
EChartGraphNode,
|
||||
DEFAULT_FORM_DATA as DEFAULT_GRAPH_FORM_DATA,
|
||||
EdgeSymbol,
|
||||
GraphChartTransformedProps,
|
||||
} from './types';
|
||||
import { DEFAULT_GRAPH_SERIES_OPTION } from './constants';
|
||||
import { EchartsProps } from '../types';
|
||||
import { getChartPadding, getLegendProps, sanitizeHtml } from '../utils/series';
|
||||
|
||||
type EdgeWithStyles = GraphEdgeItemOption & {
|
||||
@@ -157,8 +157,11 @@ function getCategoryName(columnName: string, name?: DataRecordValue) {
|
||||
return String(name);
|
||||
}
|
||||
|
||||
export default function transformProps(chartProps: ChartProps): EchartsProps {
|
||||
const { width, height, formData, queriesData } = chartProps;
|
||||
export default function transformProps(
|
||||
chartProps: ChartProps,
|
||||
): GraphChartTransformedProps {
|
||||
const { width, height, formData, queriesData, hooks, inContextMenu } =
|
||||
chartProps;
|
||||
const data: DataRecord[] = queriesData[0].data || [];
|
||||
|
||||
const {
|
||||
@@ -295,6 +298,7 @@ export default function transformProps(chartProps: ChartProps): EchartsProps {
|
||||
animationDuration: DEFAULT_GRAPH_SERIES_OPTION.animationDuration,
|
||||
animationEasing: DEFAULT_GRAPH_SERIES_OPTION.animationEasing,
|
||||
tooltip: {
|
||||
show: !inContextMenu,
|
||||
formatter: (params: any): string =>
|
||||
edgeFormatter(
|
||||
params.data.source,
|
||||
@@ -309,9 +313,14 @@ export default function transformProps(chartProps: ChartProps): EchartsProps {
|
||||
},
|
||||
series,
|
||||
};
|
||||
|
||||
const { onContextMenu } = hooks;
|
||||
|
||||
return {
|
||||
width,
|
||||
height,
|
||||
formData,
|
||||
echartOptions,
|
||||
onContextMenu,
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user