Skip to content

Commit

Permalink
fix(plugin-chart-echarts): disabling dragging treemap on the dashboard (
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenLYZ authored and zhaoyongjie committed Nov 26, 2021
1 parent dab8a4b commit b6f2df9
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,7 @@ export default function transformProps(chartProps: EchartsTreemapChartProps): Ec
dateFormat,
showLabels,
showUpperLabels,
nodeClick,
roam,
dashboardId,
}: EchartsTreemapFormData = {
...DEFAULT_TREEMAP_FORM_DATA,
...formData,
Expand Down Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -58,8 +57,6 @@ export const DEFAULT_FORM_DATA: Partial<EchartsTreemapFormData> = {
showLabels: true,
showUpperLabels: true,
dateFormat: 'smart_date',
nodeClick: 'zoomToNode',
roam: true,
};

interface TreePathInfo {
Expand Down

0 comments on commit b6f2df9

Please sign in to comment.