refactor(charts-ng): filter out empty strings from echarts color palette and avoid warnings#1630
refactor(charts-ng): filter out empty strings from echarts color palette and avoid warnings#1630akashsonune wants to merge 1 commit intomainfrom
Conversation
There was a problem hiding this comment.
Code Review
This pull request aims to prevent warnings from echarts by filtering out empty strings from the color palette. While the intention is good, the current implementation introduces a potential runtime error by unconditionally calling .filter() on the palette variable, which is of type any. If palette holds a truthy non-array value (like a single color string), the application will crash. I've added a review comment with a suggestion to add a type guard to handle this case gracefully, making the code more robust.
There was a problem hiding this comment.
Code Review
This pull request refactors the chart component to filter out empty strings from the ECharts color palette, which prevents warnings in the console. The change is correct and addresses the issue. I've added one suggestion to improve the robustness of the code by handling cases where the theme palette might not be an array, which would prevent potential runtime errors. I've adjusted the severity to medium.
…tte and avoid warnings
d2a02ff to
fa6a250
Compare
|
@akashsonune how can those empty strings be part of the palette in the first place? |
Echarts does not like empty strings in color array
Documentation.
Examples.
Dashboards Demo.
Playwright report.
Coverage Reports: