fix(decompile): honour <c:delete> and <c:dLbls> on bar charts#21
Closed
marsmike wants to merge 1 commit into
Closed
fix(decompile): honour <c:delete> and <c:dLbls> on bar charts#21marsmike wants to merge 1 commit into
marsmike wants to merge 1 commit into
Conversation
`_emit_bar_chart` always emitted Y-axis tick labels, X-axis category labels, and per-bar value labels — regardless of what the source's chart XML actually requested. Many showcase charts set `<c:catAx><c:delete val="1"/>` and/or `<c:valAx><c:delete val="1"/>` to hide the axes for a clean look and `<c:dLbls><c:showVal val="0"/>` to suppress value labels, but our renders painted them all anyway — extra text running through the source's empty space at every tick position, every category boundary, and above every bar. `_emit_bar_chart` now reads: - `<c:catAx><c:delete>` / `<c:valAx><c:delete>` — skip the corresponding axis labels AND expand the plot area to fill the space that would otherwise be reserved for them - `<c:dLbls><c:showVal>` / `<c:showCatName>` — gate value-above-bar and category labels on the explicit source flags rather than always-emit End-to-end measured on the showcase deck (six bar-chart slides above the 15% struct threshold): | slide | before | after | |---------|-------:|-------:| | 56 | 26.1% | 25.7% | | 66 | 24.9% | 23.6% | | 67 | 16.6% | 13.9% | | 93 | 16.5% | 14.8% | | 94 | 15.4% | 13.1% | | 98 | 18.7% | 16.7% | Three slides (67, 93, 94) cleared the threshold. The two clean-look showcase charts (56, 66) still carry residual diff from their horizontal/doughnut hybrid composition — separate work. This is purely a deeper read of XML data the source was already providing; nothing was invented or estimated. Signed-off-by: Mike Mueller <mike@objektarium.de>
3 tasks
Owner
Author
2 tasks
marsmike
added a commit
that referenced
this pull request
May 21, 2026
`_text_runs` defaulted any paragraph whose run/`<a:pPr>`/`<a:lstStyle>` all omitted explicit `sz` to a hardcoded 18pt. PowerPoint's actual cascade reaches into the slide layout and slide master: 1. slide-level run `<a:rPr sz="...">` (already honoured) 2. paragraph `<a:pPr><a:defRPr sz="...">` (already honoured) 3. slide's `<a:txBody><a:lstStyle>...defRPr sz` (already honoured) 4. **layout's placeholder `<p:txBody><a:lstStyle>...defRPr sz`** ← new 5. **master's `<p:txStyles><p:titleStyle|bodyStyle>...defRPr sz`** ← new 6. hardcoded 18pt fallback Steps 4 and 5 are the layout-inheritance cascade. On a typical chapter- divider layout the slide-level placeholder writes only `<a:t>Chapter title</a:t>` and inherits the 60pt+ headline size from the layout's matching placeholder. Without the lookup we render at 18pt — visibly too small. New helper `_layout_placeholder_default_sz(slide, ph_type, ph_idx)` walks the layout (then the master's `<p:txStyles>`) for the matching placeholder. `_text_runs` gains an `inherited_default_sz` kwarg fed by `_emit_sp` whenever the shape carries `ph_type`/`ph_idx`. The cascade priority remains correct: slide-level lstStyle still wins over inherited; inherited only fires when no slide-level default exists. End-to-end on the 99-slide showcase, plus stacks cleanly with the chart-axis (PR #21) and alpha-fills (PR #22) improvements: mean struct_diff: 8.21% → 6.71% (91.79% → 93.29% quality) slides above 15% threshold: 13 → 5 Signed-off-by: Mike Mueller <mike@objektarium.de>
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.
Summary
_emit_bar_chartalways emitted Y-axis tick labels, X-axis category labels, and per-bar value labels regardless of what the source's chart XML requested. Many showcase charts set<c:catAx><c:delete val=\"1\"/>/<c:valAx><c:delete val=\"1\"/>to hide the axes for a clean look and<c:dLbls><c:showVal val=\"0\"/>to suppress value labels, but our renders painted them all anyway — extra text running through the source's empty space at every tick position, every category boundary, and above every bar._emit_bar_chartnow reads:<c:catAx><c:delete>/<c:valAx><c:delete>→ skip the corresponding axis labels AND expand the plot area to fill the space that would otherwise be reserved for them<c:dLbls><c:showVal>/<c:showCatName>→ gate value-above-bar and category labels on the explicit source flags rather than always-emitResult
Measured on the same 99-slide corporate template that drove the recent decompile work, six bar-chart slides above the 15% struct_diff threshold improved as follows:
Three slides (67, 93, 94) cleared the threshold. This is a deeper read of XML the source was already providing — nothing invented or estimated.
Test plan
🤖 Generated with Claude Code