Project overhaul - #87
Merged
Merged
Conversation
i suck at math
commit 81a0e2e Author: antoniolago <45375617+antoniolago@users.noreply.github.com> Date: Sun Feb 2 01:28:59 2025 -0300 tst commit dc6f5f4 Author: antoniolago <45375617+antoniolago@users.noreply.github.com> Date: Sat Feb 1 01:12:26 2025 -0300 fix height correction commit f098e46 Merge: 0d65e12 b7905ca Author: antoniolago <45375617+antoniolago@users.noreply.github.com> Date: Fri Jan 31 23:03:57 2025 -0300 Merge branch 'main' into resize2 commit 0d65e12 Author: antoniolago <45375617+antoniolago@users.noreply.github.com> Date: Fri Jan 31 22:59:48 2025 -0300 tst commit b7905ca Author: antoniolago <45375617+antoniolago@users.noreply.github.com> Date: Fri Jan 31 22:39:50 2025 -0300 Update package.json commit d512b31 Author: Antônio Lago <45375617+antoniolago@users.noreply.github.com> Date: Fri Jan 31 22:05:17 2025 -0300 Fix flickering on resize (#73)
antoniolago
had a problem deploying
to
github-pages
December 25, 2025 20:23 — with
GitHub Actions
Failure
antoniolago
had a problem deploying
to
github-pages
December 25, 2025 20:47 — with
GitHub Actions
Failure
antoniolago
had a problem deploying
to
github-pages
December 25, 2025 20:58 — with
GitHub Actions
Failure
antoniolago
had a problem deploying
to
github-pages
December 25, 2025 21:04 — with
GitHub Actions
Failure
antoniolago
added a commit
that referenced
this pull request
Dec 26, 2025
This reverts commit 85cb251.
Owner
Author
Merged
Owner
Author
|
Po que massa saber que esse projeto teve impacto por aí, obrigado por compartilhar, bem interessante mesmo. Criei outro PR para termos o preview dessa versão nova: #89
Valeuuu! As férias vai ser curtindo umas praias no Uruguai hehehe |
antoniolago
added a commit
that referenced
this pull request
Jan 17, 2026
* Almost responsive * tst * This is almost functional responsive to grid i suck at math * Squashed commit of the following: commit 81a0e2e Author: antoniolago <45375617+antoniolago@users.noreply.github.com> Date: Sun Feb 2 01:28:59 2025 -0300 tst commit dc6f5f4 Author: antoniolago <45375617+antoniolago@users.noreply.github.com> Date: Sat Feb 1 01:12:26 2025 -0300 fix height correction commit f098e46 Merge: 0d65e12 b7905ca Author: antoniolago <45375617+antoniolago@users.noreply.github.com> Date: Fri Jan 31 23:03:57 2025 -0300 Merge branch 'main' into resize2 commit 0d65e12 Author: antoniolago <45375617+antoniolago@users.noreply.github.com> Date: Fri Jan 31 22:59:48 2025 -0300 tst commit b7905ca Author: antoniolago <45375617+antoniolago@users.noreply.github.com> Date: Fri Jan 31 22:39:50 2025 -0300 Update package.json commit d512b31 Author: Antônio Lago <45375617+antoniolago@users.noreply.github.com> Date: Fri Jan 31 22:05:17 2025 -0300 Fix flickering on resize (#73) * Update index.tsx * tst * chpnt * tst * fitting semicircles on parent * tst * tst * tst * Update GaugeGallery.tsx * tst * tst * tst * render fix * tst * tst * tst * render flickr fix * Update pointer.ts * Update arc.ts * tst * tst * tst * blob position fix * tst * add pipeline tests * Update SandboxToolbar.tsx * tst * tst * tst * tst * tst * Update SandboxToolbar.tsx * Update index.tsx * range set flickr fix * Update index.tsx * Update Pointer.ts * Offset resize fix * tests fixs * needle on grafana * Angles fixes * test fix * Update App.test.js * Update publish-npm.yml * Update ci.yml * Fix ticks positioning * gallery rework * Update presets.tsx * Update GaugeCard.tsx * add ends padding bypass * fix subarc padding mirroring main arc * add rendering tests * Lodash to lodash-es Should resolve #88 * toolbar adjust * Fix pointer flickering * tst * Add multiple pointers * move docs to jsdocs * Update App.test.js * Fix flickerings and add pointer behavior * Update utils.ts * fix double arcs * tst * Update chart.ts * fix flickering animation before time + remove debug logs * Fix vanishing pointer * Create CHANGELOG.md * add CHANGELOG, update API, fix compile error * Update CHANGELOG.md * enhance toolbar sizing * Fix duplicating pointers * Update renderCount.test.ts * Update performance.test.ts * Update publish-npm.yml * Update publish-npm.yml * Update publish-npm.yml * Project overhaul v2.0.0-rc (#87) v1.2.64 -> v2.0.0 Note: This version is a full overhaul of the Gauge component and will surely require a lot of patches along the way, so upgrade with care. New Features Now grafana type supports pointers. Is it possible to make type radial behave the same as grafana to get something like this? #37 Added support for multiple pointers. Multiple Pointers/values #48 Pointers are now INPUTS too, just set onValueChange and try to grab the pointer through arcs. DEMO editor with copy/paste function, very helpful to build gauges. Added some CSS/SVG effects like glow, blur and shadows Grafana second arc can be configured Strokes can be configured for pointers. You can remove padding of the initial/final arcs via arc.padEndpoints. Padding is applied at the start and end of the gauge not just between sub arcs #75 Added support for live editor. Create live editor of gauge properties in DEMO #25 Added a lot of unit tests Create unit tests #24 Added support components in labels. Any way to do multi line on value label? #69 Add feature: components can be passed as parameters to labels #74 Added distanceFromText to TickLineConfig and default tick config. The most special one for me: proper resizing and placing, no elements are cut from the frame, the whole gauge painting gets compressed dynamically to keep all elements visible. Bug Fixes Added pointer existence/count validation utilities to detect mismatches and recover. Fixed several pointer rendering/animation edge cases (flicker, incorrect reuse, inconsistent redraw behavior). Improved arc validation and subArc limit handling (clamping + auto-adjustment for invalid limits). Because of the new coordinate system, tick label placement logic was updated to respect spacing and it's easily edited on the editor. Error Config Stick label #51 Rendering architecture Coordinate-system layout Introduced a dedicated coordinate system module for computing layout (center, viewBox, radii). Gauge blobs are misaligned on half-circle depending on screen/element size (Responsive Design issue) #79 Added focused unit tests around layout math (coordinate system, containment, svg sizing). Resize + two-pass render behavior In order to correctly calculate all the container's available space, a double render was introduced so we can get the total viewBox given a gauge, then we use that viewBox to redraw utilizing all the possible space (noice!), at the cost of performance obviously. This makes the component more reliable on resizing (which was a nightmare). Gauge ignores container height changes and overflows on vertical resize (horizontal resize works) #86 Outer arc doesn't scale and becomes very thin on 4K screens - proposed solution #84 ResizeObserver loop completed with undelivered notifications #80 Fill gauge into svg space #63 Arrow becomes misaligned with arc at smaller sizes #45 Render entry point Added a render.tsx entry point to centralize rendering responsibilities. Dependency / build changes Dependency updates Migration from lodash to lodash-es. Lodash Import > Treeshake #88 Notes / Known behavior Arc warnings If you see messages like “SubArc limit X is outside range …”, they are emitted by the new validation logic to prevent invalid configurations from producing broken rendering. * API.md move * Update README.md * Add flicker fixes * Revert "Project overhaul v2.0.0-rc (#87)" This reverts commit 85cb251. * fix resizing * fix flickering * Fix mobile initial render * fix flickerings on resize * Remove internal props from copied content * Update API.md * bump d3 and lodash-es versions * Update presets.tsx * Update GaugeCard.tsx * Add animation on first render * smooth value changes + 0 pointers config * tst * Fix value sliders * add lots of tests to fix rerendering on value change * fix mobile error * Add minInnerPadding tick label * code imports lodash -> lodash-es * Update package.json * Revise README with new features and usage details Updated README to include new features, installation instructions, and API reference. * Update README.md * Update changelog * Update renderCount.test.ts
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.



This was moved to #89
I created this project to be able to show a datacenter sensor's humidity/temperature in my graduation final paper's Datacenter-Automated-Controller (DAC) which is vastly documented and used around the world (sarcasm), the pre-fork gauge did not cut it because of the 0-100 hard limit so I had to step in, the min/max issue was piece of cake but this was the beginning of an insane rabbit hole that I dropped it at some point because it was a side quest and simply not worth the insane amount of time I was spending getting lost calculating those damn angles, svg frames and other nasty stuff.
And then real good LLMs happened and suddenly I had the firepower to be able to make this project so much better, it REALLY helped, but it was still hundreds of hours to bring v2 to a decent point.
I never touched DAC again after finishing school and the only page used to developed this gauge was the DEMO page, so anyone reading this can help by testing this new version specially on existing environments to catch possible bugs or unwanted behavior, but I really hope this make your projects a lot cooler, enough chit chat:
ps: Yep my commit flow sucks, but try to create a resizing framework for this component at 5am.
Changelog
v1.2.64 -> v2.0.05-rc
New Features
Details
onValueChangeand try to grab the pointer through arcs.arc.padEndpoints. Padding is applied at the start and end of the gauge not just between sub arcs #75distanceFromTexttoTickLineConfigand default tick config.Bug Fixes
Rendering architecture
Coordinate-system layout
Resize + two-pass render behavior
Render entry point
render.tsxentry point to centralize rendering responsibilities.Dependency / build changes
lodashtolodash-es. Lodash Import > Treeshake #88Notes / Known behavior