Skip to content

Add bar and ring visualizations for number fields#59

Merged
priethor merged 2 commits into
mainfrom
priethor/add/number-visuals
May 5, 2026
Merged

Add bar and ring visualizations for number fields#59
priethor merged 2 commits into
mainfrom
priethor/add/number-visuals

Conversation

@priethor

@priethor priethor commented May 5, 2026

Copy link
Copy Markdown
Collaborator

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 by because their values already map directly to the fill: 0.5 is 50%.

Testing

  1. Add a Number field with values like 45, 0.5, and 1966.
  2. Set Show as to Bar, change Divide by, pick a color, and toggle Show number.
  3. Switch to Ring and confirm the same options work.
  4. Change Number format to Percent and confirm Divide by hides.
  5. Switch back to Number and reload; choices should persist.

Screen recording

Grabacion.de.pantalla.2026-05-05.a.las.16.53.45.mov

priethor added 2 commits May 5, 2026 15:29
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.
@priethor priethor merged commit 0098b4a into main May 5, 2026
7 of 8 checks passed
@priethor priethor deleted the priethor/add/number-visuals branch May 6, 2026 09:21
@priethor priethor added this to the 0.1.0 milestone May 28, 2026
@priethor priethor added type: enhancement Improvement to existing behavior. area: collections Fields, rows, views, DataViews, relations, rollups, formulas, and row properties. labels May 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: collections Fields, rows, views, DataViews, relations, rollups, formulas, and row properties. type: enhancement Improvement to existing behavior.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Show number fields as bars or rings

1 participant