Skip to content

Commit

Permalink
Fixes lint
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-s-molina committed Oct 5, 2023
1 parent bb68aac commit fa0d0e6
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export default function EchartsWaterfall(
setDataMask,
labelMap,
groupby,
refs,
selectedValues,
} = props;
const handleChange = useCallback(
Expand Down Expand Up @@ -65,10 +66,14 @@ export default function EchartsWaterfall(
[setDataMask, groupby, labelMap],
);

const eventHandlers = allEventHandlers(props, handleChange);
const eventHandlers = {
...allEventHandlers(props),
handleChange,
};

return (
<Echart
refs={refs}
height={height}
width={width}
echartOptions={echartOptions}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,11 @@ import {
ISeriesData,
WaterfallChartTransformedProps,
} from './types';
import { defaultGrid, defaultTooltip, defaultYAxis } from '../defaults';
import { getDefaultTooltip } from '../utils/tooltip';
import { defaultGrid, defaultYAxis } from '../defaults';
import { ASSIST_MARK, LEGEND, TOKEN, TOTAL_MARK } from './constants';
import { extractGroupbyLabel, getColtypesMapping } from '../utils/series';
import { Refs } from '../types';

function formatTooltip({
theme,
Expand Down Expand Up @@ -163,6 +165,7 @@ export default function transformProps(
theme,
inContextMenu,
} = chartProps;
const refs: Refs = {};
const { data = [] } = queriesData[0];
const coltypeMapping = getColtypesMapping(queriesData[0]);
const { setDataMask = () => {}, onContextMenu } = hooks;
Expand Down Expand Up @@ -368,7 +371,7 @@ export default function transformProps(
axisLabel: { formatter: numberFormatter },
},
tooltip: {
...defaultTooltip,
...getDefaultTooltip(refs),
appendToBody: true,
trigger: richTooltip ? 'axis' : 'item',
show: !inContextMenu,
Expand All @@ -384,6 +387,7 @@ export default function transformProps(
};

return {
refs,
formData,
width,
height,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@ import {
} from '@superset-ui/core';
import { BarDataItemOption } from 'echarts/types/src/chart/bar/BarSeries';
import { OptionDataValue } from 'echarts/types/src/util/types';
import { EchartsLegendFormData, EChartTransformedProps } from '../types';
import {
BaseTransformedProps,
CrossFilterTransformedProps,
LegendFormData,
} from '../types';

export type WaterfallFormXTicksLayout =
| '45°'
Expand All @@ -39,7 +43,7 @@ export type ISeriesData =
| OptionDataValue[];

export type EchartsWaterfallFormData = QueryFormData &
EchartsLegendFormData & {
LegendFormData & {
metric: QueryFormMetric;
yAxisLabel: string;
xAxisLabel: string;
Expand All @@ -59,4 +63,4 @@ export interface EchartsWaterfallChartProps extends ChartProps {
}

export type WaterfallChartTransformedProps =
EChartTransformedProps<EchartsWaterfallFormData>;
BaseTransformedProps<EchartsWaterfallFormData> & CrossFilterTransformedProps;

0 comments on commit fa0d0e6

Please sign in to comment.