Repository navigation
Draw charts at the real container size and fit metric tiles to phones [skip deploy] #no-deploy - #19
Merged
Conversation
… [skip deploy] #no-deploy
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
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.
Caso
viewBoxfijo (640 × 240 y 760 × 260) escalado al contenedor: en un teléfono eltexto de los ejes medía unos 5 px y dos tercios del alto quedaban vacíos; en escritorio el texto se agrandaba al
137 %. El tooltip dependía de hasta 480 círculos con
mouseenter, sin respuesta al tacto, y las marcas del eje X seelegían por índice, así que con huecos en las lecturas se encimaban. En las tarjetas de variables la insignia
«Ideal» partía etiquetas como «Humedad del sustrato» en tres líneas.
Cambio
useElementSize(ResizeObserver) ylib/chart.ts: el SVG se dibuja a escala 1:1, con 3, 4 o 5 marcas según elancho, repartidas por igual en el tiempo y con los extremos alineados al borde.
pointermove/pointerdown) busca el punto más cercano: funciona con mouse y con eldedo, con
touch-action: pan-ypara no bloquear el desplazamiento. Se agrega una guía vertical en el punto activo.MetricTile: la etiqueta va sola en su línea y la insignia se ubica junto al valor.nearestIndex,xTickCountytimeTicks.Verificación
viewBoxigual al contenedor (316 × 288), texto de 11 px a tamaño real, tooltip al tocar,marcas sin encimarse y dentro del gráfico.
bun run lint,tscybun run testen verde.