fix: Drill to detail blocked by tooltip (#22082)

Co-authored-by: Ville Brofeldt <ville.brofeldt@apple.com>
This commit is contained in:
Michael S. Molina
2022-11-23 14:50:06 -05:00
committed by GitHub
parent 1809d2b957
commit 3bc0865d90
45 changed files with 572 additions and 255 deletions

View File

@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
import { ChartProps, getMetricLabel, DataRecordValue } from '@superset-ui/core';
import { getMetricLabel, DataRecordValue } from '@superset-ui/core';
import { EChartsCoreOption, TreeSeriesOption } from 'echarts';
import {
TreeSeriesCallbackDataParams,
@@ -24,12 +24,13 @@ import {
} from 'echarts/types/src/chart/tree/TreeSeries';
import { OptionName } from 'echarts/types/src/util/types';
import {
EchartsTreeChartProps,
EchartsTreeFormData,
DEFAULT_FORM_DATA as DEFAULT_GRAPH_FORM_DATA,
TreeDataRecord,
TreeTransformedProps,
} from './types';
import { DEFAULT_TREE_SERIES_OPTION } from './constants';
import { EchartsProps } from '../types';
import { DEFAULT_FORM_DATA, DEFAULT_TREE_SERIES_OPTION } from './constants';
import { Refs } from '../types';
export function formatTooltip({
params,
@@ -49,8 +50,11 @@ export function formatTooltip({
].join('');
}
export default function transformProps(chartProps: ChartProps): EchartsProps {
export default function transformProps(
chartProps: EchartsTreeChartProps,
): TreeTransformedProps {
const { width, height, formData, queriesData } = chartProps;
const refs: Refs = {};
const data: TreeDataRecord[] = queriesData[0].data || [];
const {
@@ -67,7 +71,7 @@ export default function transformProps(chartProps: ChartProps): EchartsProps {
nodeLabelPosition,
childLabelPosition,
emphasis,
}: EchartsTreeFormData = { ...DEFAULT_GRAPH_FORM_DATA, ...formData };
}: EchartsTreeFormData = { ...DEFAULT_FORM_DATA, ...formData };
const metricLabel = getMetricLabel(metric);
const nameColumn = name || id;
@@ -212,8 +216,10 @@ export default function transformProps(chartProps: ChartProps): EchartsProps {
};
return {
formData,
width,
height,
echartOptions,
refs,
};
}