Skip to content

Commit d92443e

Browse files
authored
fix(funnel): do not mutable data (#2900)
* fix(funnel): do not mutable data * revert(funnel): clone data firstly * chore: remove unused import
1 parent 268aa42 commit d92443e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/plots/funnel/adaptor.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { isFunction } from '@antv/util';
1+
import { isFunction, clone } from '@antv/util';
22
import { Params } from '../../core/adaptor';
33
import { interaction, animation, theme, scale, annotation, tooltip } from '../../adaptor/common';
44
import { getLocale } from '../../core/locale';
@@ -27,7 +27,7 @@ import { FUNNEL_CONVERSATION, FUNNEL_PERCENT } from './constant';
2727
*/
2828
function defaultOptions(params: Params<FunnelOptions>): Params<FunnelOptions> {
2929
const { options } = params;
30-
const { compareField, xField, yField, locale, funnelStyle } = options;
30+
const { compareField, xField, yField, locale, funnelStyle, data } = options;
3131
const i18n = getLocale(locale);
3232

3333
const defaultOption = {
@@ -70,7 +70,7 @@ function defaultOptions(params: Params<FunnelOptions>): Params<FunnelOptions> {
7070
};
7171
}
7272

73-
return deepAssign({ options: defaultOption }, params, { options: { funnelStyle: style } });
73+
return deepAssign({ options: defaultOption }, params, { options: { funnelStyle: style, data: clone(data) } });
7474
}
7575

7676
/**

0 commit comments

Comments
 (0)