Skip to content

Commit

Permalink
fix(funnel): do not mutable data (#2900)
Browse files Browse the repository at this point in the history
* fix(funnel): do not mutable data

* revert(funnel): clone data firstly

* chore: remove unused import
  • Loading branch information
hustcc committed Oct 9, 2021
1 parent 268aa42 commit d92443e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/plots/funnel/adaptor.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { isFunction } from '@antv/util';
import { isFunction, clone } from '@antv/util';
import { Params } from '../../core/adaptor';
import { interaction, animation, theme, scale, annotation, tooltip } from '../../adaptor/common';
import { getLocale } from '../../core/locale';
Expand Down Expand Up @@ -27,7 +27,7 @@ import { FUNNEL_CONVERSATION, FUNNEL_PERCENT } from './constant';
*/
function defaultOptions(params: Params<FunnelOptions>): Params<FunnelOptions> {
const { options } = params;
const { compareField, xField, yField, locale, funnelStyle } = options;
const { compareField, xField, yField, locale, funnelStyle, data } = options;
const i18n = getLocale(locale);

const defaultOption = {
Expand Down Expand Up @@ -70,7 +70,7 @@ function defaultOptions(params: Params<FunnelOptions>): Params<FunnelOptions> {
};
}

return deepAssign({ options: defaultOption }, params, { options: { funnelStyle: style } });
return deepAssign({ options: defaultOption }, params, { options: { funnelStyle: style, data: clone(data) } });
}

/**
Expand Down

0 comments on commit d92443e

Please sign in to comment.