Skip to content

Commit

Permalink
fix: dual-axes thumbnails out of sync
Browse files Browse the repository at this point in the history
  • Loading branch information
anhaohui.ahh committed Oct 15, 2024
1 parent 556b54c commit b21ee7c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ jobs:
uses: actions/setup-node@v2
with:
node-version: 14

- name: yarn install
run: |
yarn install
Expand All @@ -34,7 +35,7 @@ jobs:
npm run build
test:
runs-on: macos-latest
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js 14
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 @@ -21,8 +21,8 @@ export const doSliderFilter = (view: View, sliderValue: [number, number]) => {
const values = valuesOfKey(data, xScale.field);
const xValues = isHorizontal ? values : values.reverse();
const xTickCount = size(xValues);
const minIndex = Math.floor(min * (xTickCount - 1));
const maxIndex = Math.floor(max * (xTickCount - 1));
const minIndex = Math.round(min * (xTickCount - 1));
const maxIndex = Math.round(max * (xTickCount - 1));

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

0 comments on commit b21ee7c

Please sign in to comment.