fix(echarts): pass vizType to enable theme overrides in all chart types (#36389)

(cherry picked from commit 1d8d30e5bb)
This commit is contained in:
Gabriel Torres Ruiz
2025-12-04 13:51:40 -04:00
committed by Joe Li
parent 3e42dd8511
commit 3ce1687725
14 changed files with 25 additions and 7 deletions

View File

@@ -380,6 +380,7 @@ function BigNumberVis({
height={maxHeight}
echartOptions={echartOptions}
eventHandlers={eventHandlers}
vizType={formData?.vizType}
/>
)
);

View File

@@ -21,7 +21,8 @@ import { allEventHandlers } from '../utils/eventHandlers';
import { BoxPlotChartTransformedProps } from './types';
export default function EchartsBoxPlot(props: BoxPlotChartTransformedProps) {
const { height, width, echartOptions, selectedValues, refs } = props;
const { height, width, echartOptions, selectedValues, refs, formData } =
props;
const eventHandlers = allEventHandlers(props);
@@ -33,6 +34,7 @@ export default function EchartsBoxPlot(props: BoxPlotChartTransformedProps) {
echartOptions={echartOptions}
eventHandlers={eventHandlers}
selectedValues={selectedValues}
vizType={formData.vizType}
/>
);
}

View File

@@ -83,6 +83,7 @@ export default function EchartsGantt(props: EchartsGanttChartTransformedProps) {
echartOptions={echartOptions}
selectedValues={selectedValues}
eventHandlers={eventHandlers}
vizType={formData.vizType}
/>
</>
);

View File

@@ -175,6 +175,7 @@ export default function EchartsGraph({
width={width}
echartOptions={echartOptions}
eventHandlers={eventHandlers}
vizType={formData.vizType}
/>
);
}

View File

@@ -20,13 +20,14 @@ import { HeatmapTransformedProps } from './types';
import Echart from '../components/Echart';
export default function Heatmap(props: HeatmapTransformedProps) {
const { height, width, echartOptions, refs } = props;
const { height, width, echartOptions, refs, formData } = props;
return (
<Echart
refs={refs}
height={height}
width={width}
echartOptions={echartOptions}
vizType={formData.vizType}
/>
);
}

View File

@@ -28,6 +28,7 @@ export default function Histogram(props: HistogramTransformedProps) {
onFocusedSeries,
onLegendStateChanged,
refs,
formData,
} = props;
const eventHandlers: EventHandlers = {
@@ -55,6 +56,7 @@ export default function Histogram(props: HistogramTransformedProps) {
width={width}
echartOptions={echartOptions}
eventHandlers={eventHandlers}
vizType={formData.vizType}
/>
);
}

View File

@@ -217,6 +217,7 @@ export default function EchartsMixedTimeseries({
echartOptions={echartOptions}
eventHandlers={eventHandlers}
selectedValues={selectedValues}
vizType={formData.vizType}
/>
);
}

View File

@@ -20,7 +20,7 @@ import { SankeyTransformedProps } from './types';
import Echart from '../components/Echart';
export default function Sankey(props: SankeyTransformedProps) {
const { height, width, echartOptions, refs } = props;
const { height, width, echartOptions, refs, formData } = props;
return (
<Echart
@@ -28,6 +28,7 @@ export default function Sankey(props: SankeyTransformedProps) {
height={height}
width={width}
echartOptions={echartOptions}
vizType={formData.vizType}
/>
);
}

View File

@@ -160,6 +160,7 @@ export default function EchartsSunburst(props: SunburstTransformedProps) {
echartOptions={echartOptions}
eventHandlers={eventHandlers}
selectedValues={selectedValues}
vizType={formData.vizType}
/>
);
}

View File

@@ -16,21 +16,23 @@
* specific language governing permissions and limitations
* under the License.
*/
import { EchartsProps } from '../types';
import { TreeTransformedProps } from './types';
import Echart from '../components/Echart';
export default function EchartsGraph({
export default function EchartsTree({
echartOptions,
height,
refs,
width,
}: EchartsProps) {
formData,
}: TreeTransformedProps) {
return (
<Echart
refs={refs}
height={height}
width={width}
echartOptions={echartOptions}
vizType={formData.vizType}
/>
);
}

View File

@@ -163,6 +163,7 @@ export default function EchartsTreemap({
echartOptions={echartOptions}
eventHandlers={eventHandlers}
selectedValues={selectedValues}
vizType={formData.vizType}
/>
);
}

View File

@@ -23,7 +23,8 @@ import { EventHandlers } from '../types';
export default function EchartsWaterfall(
props: WaterfallChartTransformedProps,
) {
const { height, width, echartOptions, refs, onLegendStateChanged } = props;
const { height, width, echartOptions, refs, onLegendStateChanged, formData } =
props;
const eventHandlers: EventHandlers = {
legendselectchanged: payload => {
@@ -44,6 +45,7 @@ export default function EchartsWaterfall(
width={width}
echartOptions={echartOptions}
eventHandlers={eventHandlers}
vizType={formData.vizType}
/>
);
}

View File

@@ -131,6 +131,7 @@ function Echart(
zrEventHandlers,
selectedValues = {},
refs,
vizType,
}: EchartsProps,
ref: Ref<EchartsHandler>,
) {

View File

@@ -55,6 +55,7 @@ export interface EchartsProps {
selectedValues?: Record<number, string>;
forceClear?: boolean;
refs: Refs;
vizType?: string;
}
export interface EchartsHandler {