diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 694bf578a8..bb84eba64d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -11,6 +11,7 @@ jobs: uses: actions/setup-node@v2 with: node-version: 14 + - name: yarn install run: | yarn install @@ -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 diff --git a/src/plots/dual-axes/util/render-sider.ts b/src/plots/dual-axes/util/render-sider.ts index d8f89b1a65..be75e84e56 100644 --- a/src/plots/dual-axes/util/render-sider.ts +++ b/src/plots/dual-axes/util/render-sider.ts @@ -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) => {