Skip to content

docs: plan — PPTX round 2 (table styles, charts, EMF fallbacks)#38

Closed
karthikmudunuri wants to merge 1 commit into
mainfrom
karthikmudunuri/plan-pptx-tables-charts-emf
Closed

docs: plan — PPTX round 2 (table styles, charts, EMF fallbacks)#38
karthikmudunuri wants to merge 1 commit into
mainfrom
karthikmudunuri/plan-pptx-tables-charts-emf

Conversation

@karthikmudunuri
Copy link
Copy Markdown
Member

Planning PR — no code changes. This is a scoping document for the next round of PPTX importer work, opened so the architecture and ordering can be reviewed before implementation starts.

What's in this PR

A single file at `docs/plans/pptx-tables-charts-emf.md` proposing three deferred-from-#36 items as the next round:

  1. Table styles — parse `ppt/tableStyles.xml` and resolve `<a:tblPr><a:tableStyleId>` so styled tables stop rendering with default flat fills. Smallest item, ships first.
  2. Charts — render the cached PNG that PowerPoint embeds alongside every `<c:chart>` so bar / pie / line / column charts appear (visually accurate, not live-editable). Live chart rendering becomes a follow-up PR if editability inside Slidewise is needed.
  3. EMF / WMF fallback — when a `<p:pic>` references EMF/WMF and a raster sibling is shipped in the deck, render the raster. True EMF→SVG decoding stays deferred (needs a WASM port; multi-day project).

What this isn't

  • Live chart rendering (parse series, draw via ECharts) — flagged as a separate follow-up.
  • A true EMF/WMF decoder — flagged as a separate WASM project.
  • Embedded TTCOMPRESSED fonts, animations, SmartArt — all explicitly out of scope.

Open questions raised in the doc

  1. Are we OK with cached-image charts (faithful but read-only) as the first step, or should we land live rendering directly?
  2. Should the EMF fallback path expose a host hook (`onMissingMedia(rId)`) so apps that process decks server-side can supply pre-rasterised replacements?
  3. Do we need to honour `<a:tableStyleList def="…">` when a table has no `tableStyleId`?

How to proceed from here

  • Comment on the plan with thoughts on the open questions.
  • Once aligned, close this PR (it's docs-only and the implementation PR will subsume it) or merge it as a permanent planning artefact under `docs/plans/`.
  • Implementation work happens on a new branch off main targeting one PR per the three commits, releasing as 1.10.0.

Test plan

Doc-only change, no tests to run.

Proposed scope for the next PPTX importer PR following the round-one
work that shipped in @textcortex/slidewise@1.9.0. Covers:

- Table styles via ppt/tableStyles.xml + tableStyleId resolution.
- Charts rendered via the cached-image fallback PowerPoint embeds (live
  chart rendering deferred to its own follow-up PR).
- EMF / WMF fallback to a sibling raster blip when the deck ships one;
  true EMF→SVG decoding stays deferred (separate WASM project).

Document is a planning artefact only — no code changes. Pushing as a
PR so the scope, ordering, and open questions can be reviewed before
implementation starts.
karthikmudunuri added a commit that referenced this pull request May 13, 2026
…backs (#42)

Implements the round-2 plan from #38. Three deferred items from #36 land
together so real-world decks (e.g. Dickinson sample) stop dropping
recognisable content.

- Table styles: parse ppt/tableStyles.xml, resolve <a:tableStyleId>,
  apply header/banded/firstCol/lastRow fills with cell-level overrides
  winning. TableElement gains rowAltFill / firstColFill / lastColFill /
  lastRowFill / hasHeader / bandRows / per-region text-colour fields.
- Charts: emit ImageElement when the chart part ships a cached preview,
  otherwise parse <c:barChart>/<c:lineChart>/<c:pieChart>/etc. into a
  new ChartElement and render live via a lazy-loaded ECharts import.
  Source <p:graphicFrame> OOXML preserved on the element for round-trip.
- EMF / WMF: prefer raster siblings (alt blip / extra rels / same-basename
  PNG); fall back to decoding the metafile in-browser via emf-converter.
  Headless environments without Canvas keep the legacy diagnostic-skip.
- Bonus fix: tint / shade modifiers now operate per-RGB-channel per
  ECMA-376 §20.1.2.3 instead of as an HSL-luminance shift, so pastel
  Office accents (Medium Style 2 banded rows, etc.) stop coming out
  oversaturated.

Adds emf-converter + echarts as runtime deps. Tests: 35 passing, including
new round-2 fixtures for each item.
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