[Perf] Tooltip: every move re-renders the React chart, builds unused default content and rewrites unchanged attributes
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 25/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- react, typescript
- Área
- data-visualization, frontend
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- TypeScript
- Estrellas
- 870
- Forks
- 57
- Merge medio
- 11 h 58 min
- PR fusionados (30 d)
- 18
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de TanStack/charts
-
[Perf] Canvas layer composition is quadratic: splitRenderLayers re-copies the node array per nodeAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
[Bug] Focus guides: `url(#id)` paints ignore `idPrefix`Posiblemente ocupada @getdownandcode la tomó hace 37 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
TanStack/charts#211 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Add reverse options to waffleY and waffleXPosiblemente ocupada @tannerlinsley la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 25/100
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 55/100
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
Los mantenedores suelen responder en 1 día
Todos los issues de TanStack/charts
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
fb55/htmlparser2#2579 ·
Los mantenedores suelen responder en 1 día
-
bug good first issue needs-review
Dificultad 1/5 1-3 horas Aptitud para principiantes 83/100
Los mantenedores suelen responder en 1 día
-
Add Module DB RulesAbiertodocumentation public
Dificultad 1/5 1-3 horas Aptitud para principiantes 68/100
midnightntwrk/umbradb#65 ·
Los mantenedores suelen responder en 2 días
-
area/channels kind/bug priority/medium
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
nanocoai/nanoclaw#4501 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Docker images: plain X.Y.Z tag (e.g. 7.2.3) is never updated after the initial release buildAbiertoneeds verification
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
Los mantenedores suelen responder en 13 días