fix(plugin-chart-echarts): disabling dragging treemap on the dashboard (#1109)

This commit is contained in:
Yaozong Liu
2021-11-26 11:47:09 +08:00
committed by Yongjie Zhao
parent dab8a4be4b
commit b6f2df9583
3 changed files with 6 additions and 10 deletions
@@ -24,8 +24,8 @@ export const Treemap = ({ width, height }) => {
queriesData={[{ data }]}
formData={{
colorScheme: 'supersetColors',
groupby: ['gender', 'name'],
metrics: ['count', 'MIN(num_boys)'],
groupby: ['genre'],
metrics: ['count'],
showLabels: boolean('Show labels', true),
showUpperLabels: boolean('Show upperLabels', true),
labelType: select('Treemap label type', ['key', 'value', 'key_value'], 'key_value'),
@@ -97,8 +97,7 @@ export default function transformProps(chartProps: EchartsTreemapChartProps): Ec
dateFormat,
showLabels,
showUpperLabels,
nodeClick,
roam,
dashboardId,
}: EchartsTreemapFormData = {
...DEFAULT_TREEMAP_FORM_DATA,
...formData,
@@ -204,8 +203,8 @@ export default function transformProps(chartProps: EchartsTreemapChartProps): Ec
animation: false,
width: '100%',
height: '100%',
nodeClick,
roam,
nodeClick: dashboardId ? undefined : 'zoomToNode',
roam: !dashboardId,
breadcrumb: {
show: false,
emptyItemWidth: 25,
@@ -35,8 +35,7 @@ export type EchartsTreemapFormData = QueryFormData & {
showUpperLabels: boolean;
numberFormat: string;
dateFormat: string;
nodeClick: undefined | 'zoomToNode' | 'link';
roam: boolean | 'scale' | 'move';
dashboardId?: number;
};
export enum EchartsTreemapLabelType {
@@ -58,8 +57,6 @@ export const DEFAULT_FORM_DATA: Partial<EchartsTreemapFormData> = {
showLabels: true,
showUpperLabels: true,
dateFormat: 'smart_date',
nodeClick: 'zoomToNode',
roam: true,
};
interface TreePathInfo {