Add bar and ring visualizations for number fields#59
Merged
Conversation
Adds NumberBar and NumberRing for the new `display` setting on number_format. Both visuals fill proportionally to value/divideBy (default 100), or to the raw value when the field uses percent style since those numbers are already 0..1. Ring is a small inline SVG and bar is a track + fill span; both clamp to [0, 1] so values past the configured max peg the visual at full instead of overflowing. Color comes from a small shared palette in formatColors.js so the cell renderer and the Edit field popover stay in sync. The default entry has no hex so the visual inherits the WordPress admin theme color, which keeps every site's accent showing through out of the box.
The Edit field panel grows a Show as section with three tiles (Number / Bar / Ring) for number fields, modelled on Notion's thumbnails. Picking Bar or Ring reveals a config block underneath: Color (10-color palette in a third-level flyout), Divide by (inline NumberControl, hidden for percent style since the value is already the ratio), and Show number (toggle that hides the trailing label when off). All four selections persist to number_format and auto- save through core-data the same way the existing rows do.
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.
What
Closes #129
Adds Bar and Ring display modes for number fields.
A number column can now stay as text, render as a horizontal bar, or render as a ring. Bar and Ring share controls for color, max value (
Divide by), and whether to show the formatted number next to the visual.Percent fields skip
Divide bybecause their values already map directly to the fill:0.5is 50%.Testing
45,0.5, and1966.Screen recording
Grabacion.de.pantalla.2026-05-05.a.las.16.53.45.mov