Skip to content

Fix PPTX chart stalls and render charts as SVG - #5333

Open
xiejinwen113 wants to merge 2 commits into
opendatalab:masterfrom
xiejinwen113:codex/fix-pptx-chart-workbook-range
Open

xiejinwen113 wants to merge 2 commits into
opendatalab:masterfrom
xiejinwen113:codex/fix-pptx-chart-workbook-range

Conversation

@xiejinwen113

@xiejinwen113 xiejinwen113 commented Jul 27, 2026

Copy link
Copy Markdown

Motivation

PPTX charts backed by embedded workbooks can stall when series formulas span many rows. After that performance issue was fixed, Office Markdown still replaced native charts with their extracted HTML data tables, so the visual chart was lost.

Modification

  • Read each one-dimensional chart formula range with a single iter_rows() stream and trim only trailing empty values.
  • Parse chart titles, axis titles and scales, series colors, line widths, and dash styles from OOXML.
  • Render supported scatter and bar charts from cached OOXML data as SVG images.
  • Carry the SVG through the Office middle JSON image pipeline while preserving extracted HTML chart data.
  • Emit the chart image first in multimodal Markdown and keep structured chart data in a collapsible chart content details block.
  • Add regression coverage for streaming workbook reads, SVG visual properties, rotated value-axis labels, and Markdown image priority.

BC-breaking

No. Structured chart content remains available in middle JSON and content-list output. Multimodal Markdown now shows the chart image first and retains the HTML data table in a collapsible details block.

Testing

  • Targeted Pytest: 5 passed.
  • Ruff passes for all changed source and test files, excluding the module's existing ANN baseline.
  • A 25-slide regression PPTX containing 16 charts completes Office parsing in about 3 seconds and produces SVG image paths for all 16 chart blocks.
  • Slide 24 produces exactly two SVG charts. Headless-browser screenshots verified curve shape, legends, axis ranges and titles, colors, and solid/dashed line styles against the source slide.

Checklist

  • Lint checks pass for changed code, excluding the module's existing ANN baseline.
  • The performance bug and visual-output bug are covered by unit tests.
  • The modification is covered by a real-document regression test and visual screenshot inspection.
  • No new runtime dependency is required; reportlab is already declared by the project.

@dosubot dosubot Bot added size:S This PR changes 10-29 lines, ignoring generated files. bug Something isn't working labels Jul 27, 2026
@github-actions

github-actions Bot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@dosubot dosubot Bot added size:XL This PR changes 500-999 lines, ignoring generated files. and removed size:S This PR changes 10-29 lines, ignoring generated files. labels Jul 28, 2026
@xiejinwen113 xiejinwen113 changed the title Fix slow PPTX chart workbook range reads Fix PPTX chart stalls and render charts as SVG Jul 28, 2026
@xiejinwen113
xiejinwen113 force-pushed the codex/fix-pptx-chart-workbook-range branch from ec75177 to 3c08d30 Compare July 28, 2026 02:50
@xiejinwen113

Copy link
Copy Markdown
Author

I have read the CLA Document and I hereby sign the CLA

github-actions Bot added a commit that referenced this pull request Jul 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working size:XL This PR changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant