Repository navigation
fix: render figures with drawn labels as one image (0.8.1) - #15
Merged
Merged
Conversation
A figure built from tiny drawings, bitmaps and several chart clusters, labelled in a smaller font than the body, came out as partial crops plus loose label paragraphs and empty tables. lib/figures.py now merges such parts and their label lines into one region, bounded by flow lines (body text, [...] marker lines, captions, numbered headings), renders it as one crop and drops the labels and inner tables from the text flow. An unnumbered one-line title directly below a figure is its caption. A cluster of labels with no image is recorded as figure_labels and gates.py warns figure_without_image. Co-Authored-By: Claude Opus 5.5 <[email protected]>
MichaelD-42
added a commit
that referenced
this pull request
Nov 29, 2026
fix: render figures with drawn labels as one image (0.8.1)
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.
Problem
A PDF figure built from tiny drawings, bitmaps and several chart clusters, labelled in a smaller font than the body, came out as partial crops plus loose label paragraphs and empty tables. An unnumbered caption below a figure stayed a body paragraph.
Fix
lib/figures.py:_merge_figure_zonesjoins a figure's parts (kept regions,tinyclusters, bitmaps) and its label lines (font < 0.9 x body size) into one region. Parts and labels join within 24 pt vertically. Flow lines (body text,[...]marker lines, captions, numbered headings) bound the region and its padding. The region renders as one crop ("zone": true), its labels becomefigure_text, inner bitmaps get no element, and inner tables becometable_in_figure.find_caption_line: a one-line title directly below an image is its caption.gates.py: new warningfigure_without_imagefor afigure_labelscluster (4+ label lines, no drawing or bitmap) that no image covers. The grader prompt and docs mention it.Verification
tests/test_figure_zones.py(no customer material).test_audit_fixes.py::TestQueueInitSafety::test_a_dot_name_input_deletes_nothing, fails onmaintoo (local Python 3.14)./eval-graderafter the smallagents/grader.mdaddition.🤖 Generated with Claude Code