bito-code-review[bot] commented on code in PR #34876:
URL: https://github.com/apache/superset/pull/34876#discussion_r2320446153
##########
superset-frontend/plugins/plugin-chart-echarts/src/Bubble/EchartsBubble.tsx:
##########
@@ -20,13 +20,14 @@ import { BubbleChartTransformedProps } from './types';
import Echart from '../components/Echart';
export default function EchartsBubble(props: BubbleChartTransformedProps) {
- const { height, width, echartOptions, refs } = props;
+ const { height, width, echartOptions, refs, formData } = props;
return (
<Echart
height={height}
width={width}
echartOptions={echartOptions}
refs={refs}
+ vizType={formData.vizType}
Review Comment:
<div>
<div id="suggestion">
<div id="issue"><b>Incorrect formData property access</b></div>
<div id="fix">
The code is accessing `formData.vizType` but the formData object contains
`viz_type` (snake_case) instead of `vizType` (camelCase). This will cause a
runtime error where `undefined` is passed to the Echart component's vizType
prop, breaking chart theming functionality. Change to `formData.viz_type`.
</div>
<details>
<summary>
<b>Code suggestion</b>
</summary>
<blockquote>Check the AI-generated fix before applying</blockquote>
<div id="code">
```suggestion
vizType={formData.viz_type}
```
</div>
</details>
</div>
<small><i>Code Review Run <a
href=https://github.com/apache/superset/pull/34876#issuecomment-3251079276>#c979cf</a></i></small>
</div>
---
Should Bito avoid suggestions like this for future reviews? (<a
href=https://alpha.bito.ai/home/ai-agents/review-rules>Manage Rules</a>)
- [ ] Yes, avoid them
##########
docs/docs/configuration/theming.mdx:
##########
@@ -165,6 +165,206 @@ Or in the CRUD interface theme JSON:
This feature works with the stock Docker image - no custom build required!
+## ECharts Configuration Overrides
+
+:::note
+Available since Superset 6.0
+:::
+
+Superset provides fine-grained control over ECharts visualizations through
theme-level configuration overrides. This allows you to customize the
appearance and behavior of all ECharts-based charts without modifying
individual chart configurations.
+
+### Global ECharts Overrides
+
+Apply settings to all ECharts visualizations using `echartsOptionsOverrides`:
+
+```python
+THEME_DEFAULT = {
+ "token": {
+ "colorPrimary": "#2893B3",
+ # ... other Ant Design tokens
+ },
+ "echartsOptionsOverrides": {
+ "grid": {
+ "left": "10%",
+ "right": "10%",
+ "top": "15%",
+ "bottom": "15%"
+ },
+ "tooltip": {
+ "backgroundColor": "rgba(0, 0, 0, 0.8)",
+ "borderColor": "#ccc",
+ "textStyle": {
+ "color": "#fff"
+ }
+ },
+ "legend": {
+ "textStyle": {
+ "fontSize": 14,
+ "fontWeight": "bold"
+ }
+ }
+ }
+}
+```
+
+### Chart-Specific Overrides
+
+Target specific chart types using `echartsOptionsOverridesByChartType`:
+
+```python
+THEME_DEFAULT = {
+ "token": {
+ "colorPrimary": "#2893B3",
+ # ... other tokens
+ },
+ "echartsOptionsOverridesByChartType": {
+ "echarts_pie": {
+ "legend": {
+ "orient": "vertical",
+ "right": 10,
+ "top": "center"
+ }
+ },
+ "echarts_timeseries": {
+ "xAxis": {
+ "axisLabel": {
+ "rotate": 45,
+ "fontSize": 12
+ }
+ },
+ "dataZoom": [{
+ "type": "slider",
+ "show": True,
+ "start": 0,
+ "end": 100
+ }]
+ },
+ "echarts_bubble": {
+ "grid": {
+ "left": "15%",
+ "bottom": "20%"
+ }
+ }
+ }
+}
+```
+
+### UI Configuration
+
+You can also configure ECharts overrides through the theme CRUD interface:
+
+```json
+{
+ "token": {
+ "colorPrimary": "#2893B3"
+ },
+ "echartsOptionsOverrides": {
+ "grid": {
+ "left": "10%",
+ "right": "10%"
+ },
+ "tooltip": {
+ "backgroundColor": "rgba(0, 0, 0, 0.8)"
+ }
+ },
+ "echartsOptionsOverridesByChartType": {
+ "echarts_pie": {
+ "legend": {
+ "orient": "vertical",
+ "right": 10
+ }
+ }
+ }
+}
+```
+
+### Override Precedence
+
+The system applies overrides in the following order (last wins):
+
+1. **Base ECharts theme** - Default Superset styling
+2. **Plugin options** - Chart-specific configurations
+3. **Global overrides** - `echartsOptionsOverrides`
+4. **Chart-specific overrides** -
`echartsOptionsOverridesByChartType[chartType]`
+
+This ensures chart-specific overrides take precedence over global ones.
+
+### Common Chart Types
+
+Available chart types for `echartsOptionsOverridesByChartType`:
+
+- `echarts_timeseries` - Time series/line charts
Review Comment:
<div>
<div id="suggestion">
<div id="issue"><b>Incorrect chart type reference in documentation</b></div>
<div id="fix">
The chart type `echarts_timeseries` is documented but the actual
implementation uses more specific variants like `echarts_timeseries_line`,
`echarts_timeseries_bar`, etc. This mismatch will cause configuration overrides
to fail for users following the documentation.
</div>
<details>
<summary>
<b>Code suggestion</b>
</summary>
<blockquote>Check the AI-generated fix before applying</blockquote>
<div id="code">
```
-- `echarts_timeseries` - Time series/line charts
+- `echarts_timeseries_line` - Time series line charts
+- `echarts_timeseries_bar` - Time series bar charts
+- `echarts_timeseries_scatter` - Time series scatter charts
+- `echarts_timeseries_smooth` - Time series smooth line charts
+- `echarts_timeseries_step` - Time series step line charts
```
</div>
</details>
</div>
<small><i>Code Review Run <a
href=https://github.com/apache/superset/pull/34876#issuecomment-3251079276>#c979cf</a></i></small>
</div>
---
Should Bito avoid suggestions like this for future reviews? (<a
href=https://alpha.bito.ai/home/ai-agents/review-rules>Manage Rules</a>)
- [ ] Yes, avoid them
##########
docs/docs/configuration/theming.mdx:
##########
@@ -165,6 +165,206 @@
This feature works with the stock Docker image - no custom build required!
+## ECharts Configuration Overrides
+
+:::note
+Available since Superset 6.0
+:::
+
+Superset provides fine-grained control over ECharts visualizations through
theme-level configuration overrides. This allows you to customize the
appearance and behavior of all ECharts-based charts without modifying
individual chart configurations.
+
+### Global ECharts Overrides
+
+Apply settings to all ECharts visualizations using `echartsOptionsOverrides`:
+
+```python
+THEME_DEFAULT = {
+ "token": {
+ "colorPrimary": "#2893B3",
+ # ... other Ant Design tokens
+ },
+ "echartsOptionsOverrides": {
+ "grid": {
+ "left": "10%",
+ "right": "10%",
+ "top": "15%",
+ "bottom": "15%"
+ },
+ "tooltip": {
+ "backgroundColor": "rgba(0, 0, 0, 0.8)",
+ "borderColor": "#ccc",
+ "textStyle": {
+ "color": "#fff"
+ }
+ },
+ "legend": {
+ "textStyle": {
+ "fontSize": 14,
+ "fontWeight": "bold"
+ }
+ }
+ }
+}
+```
+
+### Chart-Specific Overrides
+
+Target specific chart types using `echartsOptionsOverridesByChartType`:
+
+```python
+THEME_DEFAULT = {
+ "token": {
+ "colorPrimary": "#2893B3",
+ # ... other tokens
+ },
+ "echartsOptionsOverridesByChartType": {
+ "echarts_pie": {
+ "legend": {
+ "orient": "vertical",
+ "right": 10,
+ "top": "center"
+ }
+ },
+ "echarts_timeseries": {
+ "xAxis": {
+ "axisLabel": {
+ "rotate": 45,
+ "fontSize": 12
+ }
+ },
+ "dataZoom": [{
+ "type": "slider",
+ "show": True,
+ "start": 0,
+ "end": 100
+ }]
+ },
+ "echarts_bubble": {
+ "grid": {
+ "left": "15%",
+ "bottom": "20%"
+ }
+ }
+ }
+}
+```
+
+### UI Configuration
+
+You can also configure ECharts overrides through the theme CRUD interface:
+
+```json
+{
+ "token": {
+ "colorPrimary": "#2893B3"
+ },
+ "echartsOptionsOverrides": {
+ "grid": {
+ "left": "10%",
+ "right": "10%"
+ },
+ "tooltip": {
+ "backgroundColor": "rgba(0, 0, 0, 0.8)"
+ }
+ },
+ "echartsOptionsOverridesByChartType": {
+ "echarts_pie": {
+ "legend": {
+ "orient": "vertical",
+ "right": 10
+ }
+ }
+ }
+}
+```
+
+### Override Precedence
+
+The system applies overrides in the following order (last wins):
+
+1. **Base ECharts theme** - Default Superset styling
+2. **Plugin options** - Chart-specific configurations
+3. **Global overrides** - `echartsOptionsOverrides`
+4. **Chart-specific overrides** -
`echartsOptionsOverridesByChartType[chartType]`
+
+This ensures chart-specific overrides take precedence over global ones.
+
+### Common Chart Types
+
+Available chart types for `echartsOptionsOverridesByChartType`:
+
+- `echarts_timeseries` - Time series/line charts
+- `echarts_pie` - Pie and donut charts
Review Comment:
<div>
<div id="suggestion">
<div id="issue"><b>Non-existent chart type in documentation</b></div>
<div id="fix">
The chart type `echarts_pie` is documented but doesn't exist in the
codebase. The actual chart type is `pie`. This will cause configuration
overrides to fail.
</div>
<details>
<summary>
<b>Code suggestion</b>
</summary>
<blockquote>Check the AI-generated fix before applying</blockquote>
<div id="code">
```
-- `echarts_pie` - Pie and donut charts
+- `pie` - Pie and donut charts
```
</div>
</details>
</div>
<small><i>Code Review Run <a
href=https://github.com/apache/superset/pull/34876#issuecomment-3251079276>#c979cf</a></i></small>
</div>
---
Should Bito avoid suggestions like this for future reviews? (<a
href=https://alpha.bito.ai/home/ai-agents/review-rules>Manage Rules</a>)
- [ ] Yes, avoid them
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]