diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 15d4cfc61f..8682adddef 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -27,7 +27,6 @@ jobs: - name: Update coverall if: ${{ success() }} uses: coverallsapp/github-action@master - continue-on-error: true # 暂时改动 with: github-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/src/component/legendCategory.ts b/src/component/legendCategory.ts index d40fc0c7fe..ba76544889 100644 --- a/src/component/legendCategory.ts +++ b/src/component/legendCategory.ts @@ -170,6 +170,13 @@ function inferLegendShape( return { width, height }; } +function filterEmptyIds(legendStyle) { + return { + ...legendStyle, + data: legendStyle?.data.filter((item) => item.id !== '') || [], + }; +} + /** * Guide Component for ordinal color scale. */ @@ -211,8 +218,9 @@ export const LegendCategory: GCC = (options) => { const { legendCategory: legendTheme = {} } = theme; + // Filter out the data items with empty string IDs in the wordCloud's data before generating the legend. const categoryStyle = adaptor( - Object.assign({}, legendTheme, legendStyle, style), + Object.assign({}, legendTheme, filterEmptyIds(legendStyle), style), ); const layoutWrapper = new LegendCategoryLayout({