Skip to content

Commit

Permalink
refactor: 函数命名修正
Browse files Browse the repository at this point in the history
  • Loading branch information
visiky committed Jul 14, 2021
1 parent 08e1722 commit 33bad14
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/plots/dual-axes/adaptor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { findViewById } from '../../utils/view';
import { isColumn, getYAxisWithDefault, getGeometryOption, transformObjectToArray } from './util/option';
import { getViewLegendItems } from './util/legend';
import { drawSingleGeometry } from './util/geometry';
import { renderSlider } from './util/render-sider';
import { doSliderFilter } from './util/render-sider';
import { DualAxesOptions, AxisType, DualAxesGeometry } from './types';
import { LEFT_AXES_VIEW, RIGHT_AXES_VIEW } from './constant';

Expand Down Expand Up @@ -442,14 +442,14 @@ export function slider(params: Params<DualAxesOptions>): Params<DualAxesOptions>
if (isEqual(value, originValue)) {
return;
}
renderSlider(rightView, value);
doSliderFilter(rightView, value);
});
chart.once('afterpaint', () => {
// 初始化数据,配置默认值时需要同步
if (!isBoolean(slider)) {
const { start, end } = slider;
if (start || end) {
renderSlider(rightView, [start, end]);
doSliderFilter(rightView, [start, end]);
}
}
});
Expand Down
4 changes: 2 additions & 2 deletions src/plots/dual-axes/util/render-sider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ import { size, valuesOfKey } from '@antv/util';
import { isBetween } from '../../../utils';

/**
* 生成右侧 View slider
* 右侧 View 进行 slider 过滤
* 由于双轴图是多 View , 需要监听左侧 Slider 的 change 事件来同步右侧 View
* @param { View } view 右侧视图
* @param { number[] } sliderValue 滑块当前值
* @returns void
*/
export const renderSlider = (view: View, sliderValue: [number, number]) => {
export const doSliderFilter = (view: View, sliderValue: [number, number]) => {
const [min, max] = sliderValue;
const data = view.getOptions().data;
const xScale = view.getXScale();
Expand Down

0 comments on commit 33bad14

Please sign in to comment.