Skip to content

Commit b21ee7c

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

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

Diff for: .github/workflows/build.yml

+2-1
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
@@ -34,7 +35,7 @@ jobs:
3435
npm run build
3536
3637
test:
37-
runs-on: macos-latest
38+
runs-on: ubuntu-latest
3839
steps:
3940
- uses: actions/checkout@v2
4041
- name: Use Node.js 14

Diff for: src/plots/dual-axes/util/render-sider.ts

+2-2
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)