Repository navigation
perf: stop redrawing the sunburst on hover - #4
Merged
Merged
Conversation
Moving across a wedge rebuilt every arc and restarted the opacity transition on all of them. Arcs are built once, and hover only updates the active wedge.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
這個 PR 做了什麼
旭日圖在扇區之間移動時會整頁重畫,每個扇區的淡出動畫也會重跑。角度、顏色、透明度、提示框和點進去的行為維持原樣。
src/app/analyze/page.tsxsetState之後走訪每一個扇區改 class。變淡是 svg 上的一個 class;換扇區只拿掉上一個、加上現在這個幾何是同一組式子。8 層半徑、起角每 7°、張角 2/15/90/181/360 度,共 2080 組,字串不一致 0 筆。1620 段弧建一次約 0.49 ms;若每次換扇區都重算,30 次約 40.2 ms(平均 1.34 ms)。這是 Apple M4 Max 上的 bun,只量幾何,不含 DOM。舊實作另外還會對每個扇區改 class,並讓 opacity transition 重跑。
沒有改掃描,也沒有改配色公式。沒有在 Tauri 視窗裡掃過目錄看圖。
相關 issue
沒有對應的 issue。接續 #3。
怎麼驗
bunx tsc --noEmit通過bun run build通過檢查清單
tool/check/commits.sh:這個 repo 沒有這支腳本flutter analyze/flutter test:這是 Tauri / Next,不適用。代替的是上面的 tsc 和 next buildperf/simplify-hot-paths,所以現在不會跑。本機bun run build已過