feat: bug fixes, widget elements, deferred dithering, pixel code sizing - #2
Merged
Merged
Conversation
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>
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.
Fixes
in)New elements (widgets.py)
Dithering model
ditherpicks halftone vs flat. Output is always strictly on-palette; in-palette colors stay crisp.dither: true/falseoverride on any element (isolated + quantized at draw time), shared via a new dispatch module sogroupchildren get it too.Code element sizing (predictable, pixel-based)
width/heightscale to a pixel box (was mm + DPI only); exposedpi; route colors through the palettewidth/heightfit to a square pixel box (crisp, integer upscale)Docs/examples/tests