[Perf] Tooltip: every move re-renders the React chart, builds unused default content and rewrites unchanged attributes
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 25/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- react, typescript
- Ambito
- data-visualization, frontend
Direzione di ricerca
The issue bundles five separate tooltip gaps, so pick one section rather than all five. Start with hide() in packages/charts-core/src/tooltip.ts and the exit cancel path in packages/charts-core/src/motion.ts, using the fake Element.animate repro. Done when the exit is no longer cancelled by repeated hide calls and the repro shows 0 cancel calls. The design proposals (external store, per-phase motion, data-state attributes, delays) need maintainer input before implementation.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Version: @tanstack/charts 1.1.0 (57774e1).
With a custom tooltip body (and with the motion() renderer for F), each pointer move that changes the tooltip does work no one sees: the React adapter re-renders the chart (A), core builds the default content the custom body replaces (E), and paint rewrites attributes that did not change (F). Related: #179 (only the default tooltip duration).
Paths are under packages/; links pin commit 57774e14a1a86081eddb3a23523724a40da05640.
A. Tooltip target state re-renders the chart (react-charts)
useTooltipBodykeeps the target inReact.useState;onChangecallssetTarget(tooltip.tsx:152-159).- Each render rebuilds
hostOptions, so the layout effect callsadapter.update(RendererChart.tsx:162-186).updaterefreshes DOM text metrics (renderer.ts:985-986). - Repro (vitest + jsdom, 4 pointer moves):
expected 3 to be +0calls toadapter.update. - Expected: a target change updates only the tooltip body. Proposed: keep the target in an external store read by a leaf component (
useSyncExternalStore). - Downstream measurement (bklit migration, Chrome, core
Chart+ external store): pointermove p95 2-6x lower.
B. A repeated hide() restarts the exit
Moved to #209 (a bug, together with C).
C. Finished tooltip animations stay attached
Moved to #209.
D. First show cannot be styled or delayed
Moved to #210 (a feature, together with the per-phase
motionproposed under B).
E. Default content is always built
paintalways callscreateChartTooltipContentbefore the custom body (tooltip.ts:117-124), and the result feeds thearia-label(:293).- Repro: an
items[].textformatter is called 1 time per paint with a custom body, expected 0. - Expected: default content computed only when read. Proposed: resolve
contentlazily, or let a custom body supply the accessible label. - Downstream measurement (bklit migration, Chrome CDP profile, 300 moves): about 6 ms per 100 moves; grows with series count.
F. Each paint rewrites the tooltip element (from this comment)
- On every move that repaints the tooltip,
paintsetsvisibility: hiddenand removes it again, and re-setsclassName,pointer-events,user-selectanddata-sticky, even when nothing changed (tooltip.ts:106-162).configureTooltipSemanticsre-setsrole,aria-liveandaria-label. - The spring glide writes
style.translatefromrequestAnimationFrameevery frame (motion.ts:419-428, motion.ts:484-497). The tween glide uses WAAPI instead. - Measured (production build, sankey,
MutationObserveron the tooltip, 60 moves): about 12 mutation records per move. About 4.7 aretranslate, 2.5visibility, 3.75 the unchanged attributes, 1.8 content and 1left/top. - Proposed: compare before writing in
paint. Run the spring glide as a sampled WAAPItranslate, like the tween path.
- Lingua principale
- TypeScript
- Stelle
- 870
- Fork
- 57
- Merge medio
- 11h 58m
- PR unite (30g)
- 18
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di TanStack/charts
-
[Perf] Canvas layer composition is quadratic: splitRenderLayers re-copies the node array per nodeAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
[Bug] Focus guides: `url(#id)` paints ignore `idPrefix`Forse già presa @getdownandcode l’ha presa 37 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
TanStack/charts#211 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Add reverse options to waffleY and waffleXForse già presa @tannerlinsley l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 25/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 55/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di TanStack/charts
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
fb55/htmlparser2#2579 ·
I maintainer di solito rispondono entro 1 giorno
-
bug good first issue needs-review
Difficoltà 1/5 1-3 ore Idoneità per principianti 83/100
I maintainer di solito rispondono entro 1 giorno
-
Add Module DB RulesApertadocumentation public
Difficoltà 1/5 1-3 ore Idoneità per principianti 68/100
midnightntwrk/umbradb#65 ·
I maintainer di solito rispondono entro 2 giorni
-
area/channels kind/bug priority/medium
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
nanocoai/nanoclaw#4501 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
needs verification
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
I maintainer di solito rispondono entro 13 giorni