【D3】transition API
摘要:
動畫類API
一、API 使用
1. 1 d3.ease
?
1.2 d3.timer
Start a custom animation timer, invoking the specified?function?repeatedly until it returns true. There is no way to cancel the timer after it starts, so make sure your timer function returns true when done!
動畫開始動作,知道方法返回true 才會停止。 動畫開始后不能手動停止,只能方法返回true 才會停止。
An optional numeric?delay?in milliseconds may be specified when the given?function?should only be invoked after a delay. The delay is relative to the specified?time?in milliseconds since UNIX epoch; if?time?is not specified, it defaults to?Date.now.
可以設置動畫延遲時間,延時單位為毫秒。延遲是和指定的時間相關,如果沒制定時間,默認為當前時間。
You may use?delay?and?time?to specify relative and absolute moments in time when the?function?should start being invoked. For example, a calendar notification might be coded as:
可以使用延遲和時間指定動畫開始的確切時間。例如,日歷提醒可以如下編碼:
d3.timer(notify, -4 * 1000 * 60 * 60, +new Date(2012, 09, 29)); // four hours before midnight October 29 (months are zero-based)
Note that if d3.timer is called within the callback of another timer, the new timer will be invoked immediately at the end of the current frame (if active as determined by the specified?delay?and?time), rather than waiting until the next frame.
可以看到d3.timer 是在另一時刻被調用,新計時器將立刻被觸發 (如果指定動作的延遲和時間),而不是等待下一幀。
?
1.3 d3.interpolate
?
轉載于:https://www.cnblogs.com/huxiaoyun90/p/4562550.html
總結
以上是生活随笔為你收集整理的【D3】transition API的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 求一个唐姓最好听的女孩名字。
- 下一篇: 求一个关于朴灿烈的qq网名。