Skip to content

feat: [US-042] DOCX parser - embedded charts (basic)#8

Merged
developer0hye merged 2 commits into
mainfrom
ralph/phase4-polish
Feb 27, 2026
Merged

feat: [US-042] DOCX parser - embedded charts (basic)#8
developer0hye merged 2 commits into
mainfrom
ralph/phase4-polish

Conversation

@developer0hye

@developer0hye developer0hye commented Feb 27, 2026

Copy link
Copy Markdown
Owner

Summary

  • Add embedded chart parsing for DOCX documents with data table rendering
  • Parse chart*.xml files from DOCX ZIP for bar, column, line, pie, area, and scatter chart types
  • Extract chart title, category labels, and series data from cached string/numeric values
  • Render charts as Typst data tables with bold title, italic type label, and category/series columns

Key Changes

  • New parser/chart.rs module: Chart XML parser with parse_chart_xml(), scan_chart_references(), scan_chart_rels() functions
  • ChartContext in docx.rs: Maps body child index to charts using raw ZIP scanning (docx-rs doesn't handle chart drawings)
  • IR types in elements.rs: Chart, ChartType (Bar/Column/Line/Pie/Area/Scatter/Other), ChartSeries
  • Codegen in typst_gen.rs: generate_chart() renders charts as #table() with category and series columns

Test plan

  • 4 chart parser unit tests (bar, pie, line with multiple series, no-title chart)
  • 2 scan tests (chart references in document.xml, chart relationships in .rels)
  • 3 codegen tests (chart with title/data, no-title chart, empty series chart)
  • 438 library tests pass
  • cargo clippy --workspace -- -D warnings clean
  • cargo fmt --all --check clean

🤖 Generated with Claude Code

developer0hye and others added 2 commits February 27, 2026 13:14
Parse embedded charts from DOCX files and render as data tables in PDF.
Supports bar, column, line, pie, area, and scatter chart types.

- Add Chart/ChartSeries/ChartType IR types
- Add chart.rs parser module for chart XML parsing
- Add ChartContext for raw ZIP scanning of chart references
- Render charts as Typst tables with title and series data
- 6 chart parser tests, 2 DOCX integration tests, 3 codegen tests

Signed-off-by: Yonghye Kwon <developer.0hye@gmail.com>

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Yonghye Kwon <developer.0hye@gmail.com>
Add chart parsing for embedded DOCX charts with data table rendering.
Parse chart*.xml files from DOCX ZIP for bar/column/line/pie/area/scatter
chart types. Extract title, category labels, and series data from
cached values. Render as Typst data tables with title and type labels.

Signed-off-by: Yonghye Kwon <developer.0hye@gmail.com>
@developer0hye
developer0hye merged commit 092ffe7 into main Feb 27, 2026
12 checks passed
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