Skip to content

Commit

Permalink
fix: cr
Browse files Browse the repository at this point in the history
  • Loading branch information
pearmini committed Apr 3, 2023
1 parent d1cafc8 commit fe453fa
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/runtime/render.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,11 +139,11 @@ export function renderToMountedElement<T extends G2ViewTree = G2ViewTree>(
// Make sure that plot chart after container is ready for every time.
plot<T>({ ...keyed, width, height }, selection, library, context)
.then(() => {
setTimeout(() => {
// Wait for the next tick.
const canvas = group.ownerDocument.defaultView;
canvas.requestAnimationFrame(() => {
emitter.emit(ChartEvent.AFTER_RENDER);
resolve?.();
}, 20);
});
})
.catch((e) => {
reject?.(e);
Expand Down

0 comments on commit fe453fa

Please sign in to comment.