Skip to content

Commit 3356701

Browse files
author
anhaohui.ahh
committed
fix: dual-axes thumbnails out of sync
1 parent 556b54c commit 3356701

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

.github/workflows/build.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ jobs:
1111
uses: actions/setup-node@v2
1212
with:
1313
node-version: 14
14+
1415
- name: yarn install
1516
run: |
1617
yarn install
@@ -38,9 +39,10 @@ jobs:
3839
steps:
3940
- uses: actions/checkout@v2
4041
- name: Use Node.js 14
41-
uses: actions/setup-node@v2
42+
uses: actions/setup-node@v4
4243
with:
4344
node-version: 14
45+
architecture: 'x64'
4446
- name: yarn install
4547
run: |
4648
yarn install

src/plots/dual-axes/util/render-sider.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ export const doSliderFilter = (view: View, sliderValue: [number, number]) => {
2121
const values = valuesOfKey(data, xScale.field);
2222
const xValues = isHorizontal ? values : values.reverse();
2323
const xTickCount = size(xValues);
24-
const minIndex = Math.floor(min * (xTickCount - 1));
25-
const maxIndex = Math.floor(max * (xTickCount - 1));
24+
const minIndex = Math.round(min * (xTickCount - 1));
25+
const maxIndex = Math.round(max * (xTickCount - 1));
2626

2727
// 增加 x 轴的过滤器
2828
view.filter(xScale.field, (value: any) => {

0 commit comments

Comments
 (0)