This is an automated email from the ASF dual-hosted git repository. sushuang pushed a commit to branch fix/treemap-click in repository https://gitbox.apache.org/repos/asf/incubator-echarts.git
commit f6e0dec10c1383867aaf11382787f238ad7ba3fb Author: 100pah <[email protected]> AuthorDate: Mon Nov 2 01:24:51 2020 +0800 fix: Make `util/graphic` `updateProps` and `initProps` param `cb` listen "aborted". Because, at present, all of the cb usage are about "remove el", which are needed in both "done" and "aborted". Currently the usage of `cb`: initProps ParallelView SankeyView ThemeRiverView updateProps TreeView custom --- src/util/graphic.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/util/graphic.ts b/src/util/graphic.ts index 81ec014..2a911ae 100644 --- a/src/util/graphic.ts +++ b/src/util/graphic.ts @@ -290,6 +290,9 @@ export const subPixelOptimize = subPixelOptimizeUtil.subPixelOptimize; type AnimateOrSetPropsOption = { dataIndex?: number; + // `cb` will be called when "done" or "aborted". + // Note: if there is requirment to ditinguish "done" and "aborted", + // in the future, we can add them to the params. cb?: () => void; during?: (percent: number) => void; isFrom?: boolean; @@ -381,6 +384,7 @@ function animateOrSetProps<Props>( delay: animationDelay as number || 0, easing: animationEasing, done: cb, + aborted: cb, force: !!cb || !!during, scope: animationType, during: during @@ -390,6 +394,7 @@ function animateOrSetProps<Props>( delay: animationDelay as number || 0, easing: animationEasing, done: cb, + aborted: cb, force: !!cb || !!during, setToFinal: true, scope: animationType, --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
