From 4d17404d07f963d9866377179394c7b584538af9 Mon Sep 17 00:00:00 2001 From: zengyue ye Date: Wed, 21 Feb 2024 20:29:28 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E7=AB=9E=E9=80=9F=E5=8A=A8=E7=94=BB?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=95=B0=E5=AD=97=E5=8F=98=E5=8C=96=E5=8A=A8?= =?UTF-8?q?=E7=94=BB=E7=A4=BA=E4=BE=8B=20(#1926)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/f2/test/timeline/interval.test.tsx | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/packages/f2/test/timeline/interval.test.tsx b/packages/f2/test/timeline/interval.test.tsx index f1a064438..9cb923b4e 100644 --- a/packages/f2/test/timeline/interval.test.tsx +++ b/packages/f2/test/timeline/interval.test.tsx @@ -63,6 +63,21 @@ describe('Chart', () => { textAlign: 'start', textBaseline: 'middle', }} + animation={{ + update: { + easing: 'linear', + duration: 450, + property: ['x', 'y'], + onFrame(t, animationContext) { + const { start, end } = animationContext; + const startText = parseInt(start.text); + const endText = parseInt(end.text); + return { + text: `${(startText + (endText - startText) * t).toFixed(0)}`, + }; + }, + }, + }} /> ); })}