Skip to content

feat: bug fixes, widget elements, deferred dithering, pixel code sizing - #2

Merged
eigger merged 4 commits into
mainfrom
feat/dithering-widgets-and-code-sizing
Jun 29, 2026
Merged

feat: bug fixes, widget elements, deferred dithering, pixel code sizing#2
eigger merged 4 commits into
mainfrom
feat/dithering-widgets-and-code-sizing

Conversation

@eigger

@eigger eigger commented Jun 29, 2026

Copy link
Copy Markdown
Owner

Fixes

  • plot: default y_end derived from y_start (was x_start) — wrong vertical extent
  • diagram: accept float bar values; clear error on non-positive max; require x/y/height
  • plot: stop mutating the caller's history list in place
  • dlimg: use startswith for url scheme detection (was substring in)
  • group: wrap child handler errors with element context, like the top loop
  • colors: support #RGB shorthand; warn (not silent white) on unknown color names

New elements (widgets.py)

  • legend: color-swatch <-> label rows (the companion pie/plot lacked)
  • star_rating: full/half/empty stars
  • battery: vector battery gauge with proportional fill + low-color threshold

Dithering model

  • Quantization is now deferred: elements draw in full color and the whole image is mapped to the palette once at the end; dither picks halftone vs flat. Output is always strictly on-palette; in-palette colors stay crisp.
  • Per-element dither: true/false override on any element (isolated + quantized at draw time), shared via a new dispatch module so group children get it too.

Code element sizing (predictable, pixel-based)

  • barcode: width/height scale to a pixel box (was mm + DPI only); expose dpi; route colors through the palette
  • qrcode/datamatrix: width/height fit to a square pixel box (crisp, integer upscale)

Docs/examples/tests

  • README: deferred-mapping + per-element dither sections, ESL(3-color)/label(2-color) dithering samples, widget + code-sizing reference updates
  • new example generators (dither labels) and element previews
  • tests: 97 passing (deferred/per-element dither, widgets, code pixel sizing, fixed-bug regressions)

eigger and others added 4 commits June 30, 2026 08:37
Fixes
- plot: default y_end derived from y_start (was x_start) — wrong vertical extent
- diagram: accept float bar values; clear error on non-positive max; require x/y/height
- plot: stop mutating the caller's history list in place
- dlimg: use startswith for url scheme detection (was substring `in`)
- group: wrap child handler errors with element context, like the top loop
- colors: support #RGB shorthand; warn (not silent white) on unknown color names

New elements (widgets.py)
- legend: color-swatch <-> label rows (the companion pie/plot lacked)
- star_rating: full/half/empty stars
- battery: vector battery gauge with proportional fill + low-color threshold

Dithering model
- Quantization is now deferred: elements draw in full color and the whole image
  is mapped to the palette once at the end; `dither` picks halftone vs flat.
  Output is always strictly on-palette; in-palette colors stay crisp.
- Per-element `dither: true/false` override on any element (isolated + quantized
  at draw time), shared via a new dispatch module so `group` children get it too.

Code element sizing (predictable, pixel-based)
- barcode: `width`/`height` scale to a pixel box (was mm + DPI only); expose `dpi`;
  route colors through the palette
- qrcode/datamatrix: `width`/`height` fit to a square pixel box (crisp, integer
  upscale)

Docs/examples/tests
- README: deferred-mapping + per-element dither sections, ESL(3-color)/label(2-color)
  dithering samples, widget + code-sizing reference updates
- new example generators (dither labels) and element previews
- tests: 97 passing (deferred/per-element dither, widgets, code pixel sizing,
  fixed-bug regressions)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
actions/checkout@v4 runs on the deprecated Node.js 20 runtime; v5 targets
Node.js 24, clearing the deprecation warnings. The other actions
(setup-python@v6, upload/download-artifact@v5) are already on Node 24.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Feature release: new widget elements (legend/star_rating/battery), deferred
palette mapping with per-element dither override, and pixel-based sizing for
barcode/qrcode/datamatrix. Includes a behavior change (render output is now
always palette-mapped), warranting a minor bump.

Updates the version in pyproject.toml and the illustrative pins in README /
docs/migration.md, and refreshes the test count (97).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
upload-artifact@v5 and download-artifact@v5 still run on the deprecated
Node.js 20 runtime (verified via their action.yml `using:` field). The first
Node 24 majors are upload-artifact@v7 and download-artifact@v8; bump to those
to clear the remaining deprecation warnings. checkout@v5 and setup-python@v6
are already on Node 24.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@eigger
eigger merged commit 1f1535b into main Jun 29, 2026
5 checks passed
@eigger
eigger deleted the feat/dithering-widgets-and-code-sizing branch June 29, 2026 23:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant