iercan commented on code in PR #44562:
URL: https://github.com/apache/superset/pull/44562#discussion_r4102351514
##########
superset-frontend/plugins/plugin-chart-echarts/src/utils/series.ts:
##########
@@ -803,14 +818,20 @@ export function getLegendProps(
legendState?: LegendState,
padding?: LegendPaddingType,
): LegendComponentOption {
- const legend: LegendComponentOption = {
+ // `animation` is read by ECharts but missing from its legend option type
+ const legend: LegendComponentOption & { animation?: boolean } = {
orient: [LegendOrientation.Top, LegendOrientation.Bottom].includes(
orientation,
)
? 'horizontal'
: 'vertical',
show,
type,
+ // A scrolling legend is rebuilt from its first page on every re-render and
+ // then animated back to `scrollDataIndex`, which reads as the legend
+ // sliding away and returning. Turning the animation off makes it render on
+ // the right page to begin with.
+ animation: false,
Review Comment:
I've modified code accordingly. Also all pre-commit checks passed.
--
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]