Skip to content

fix(decompile): honour <c:delete> and <c:dLbls> on bar charts#21

Closed
marsmike wants to merge 1 commit into
mainfrom
fix/chart-axis-visibility
Closed

fix(decompile): honour <c:delete> and <c:dLbls> on bar charts#21
marsmike wants to merge 1 commit into
mainfrom
fix/chart-axis-visibility

Conversation

@marsmike
Copy link
Copy Markdown
Owner

Summary

_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 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_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

Result

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:

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. This is a deeper read of XML the source was already providing — nothing invented or estimated.

Test plan

  • All 996 existing tests still pass
  • Manually verified on slides 56, 66, 67, 93, 94, 98 against source render

🤖 Generated with Claude Code

`_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>
@marsmike
Copy link
Copy Markdown
Owner Author

Consolidated into PR #23 along with #22. All three XML deep-read fixes (chart-axis visibility, alpha-fills, layout font inheritance) now ship together.

@marsmike marsmike closed this May 20, 2026
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>
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