Skip to content

AI turns documents or topics into real, native PowerPoint decks—with native shapes, transitions and animations, data-backed charts and tables on demand, audio narration from speaker notes, and support for your own .pptx templates. · by Hugo He

fix(scripts): chart parity honours number_format and exact ticks, checker tags export-blocking findings, list-groups names chrome ids, slice advises gutters

hugohe3824f8a634735
diff --git a/skills/ppt-master/scripts/slice_images.py b/skills/ppt-master/scripts/slice_images.py
index 5e442587..1641d445 100644
--- a/skills/ppt-master/scripts/slice_images.py
+++ b/skills/ppt-master/scripts/slice_images.py
@@ -584,6 +584,17 @@ def _log_keying_findings(
"effect crosses it. Regenerate with a clear key-only gutter; a "
"larger --tolerance would eat into the elements."
)
+ elif (
+ any("content reaches the" in finding for finding in findings)
+ and not any("boundary pixels stayed opaque" in finding for finding in findings)
+ ):
+ # Cells keyed cleanly; only element tips crossed a gutter.
+ _log(
+ " Content crosses a cell edge: no --bg/--tolerance rerun "
+ "can separate it. Regenerate with a wider key-only gutter "
+ "(each element about 65% of its cell, at least 10% key on "
+ "every side, tips and effects included)."
+ )
else:
pure = _nearest_pure_key(dominant)
if pure is not None:
diff --git a/skills/ppt-master/scripts/svg_to_pptx/animation_config.py b/skills/ppt-master/scripts/svg_to_pptx/animation_config.py
index 60a6fe48..6498938a 100644
--- a/skills/ppt-master/scripts/svg_to_pptx/animation_config.py
+++ b/skills/ppt-master/scripts/svg_to_pptx/animation_config.py
@@ -1693,10 +1693,16 @@ def build_group_listing(project_path: Path) -> tuple[list[str], list[str]]:
for slide_name, targets in targets_by_slide.items():
_require_unique_target_ids(slide_name, targets)
ids = [t.group_id for t in targets if not t.chrome]
+ chrome_ids = [t.group_id for t in targets if t.chrome]
if not ids:
- lines.append(f'{slide_name}: (no animatable groups)')
+ line = f'{slide_name}: (no animatable groups)'
else:
- lines.append(f'{slide_name}: {", ".join(ids)}')
+ line = f'{slide_name}: {", ".join(ids)}'
+ if chrome_ids:
+ # Name what was dropped so an id like ``takeaway-rule`` is seen
+ # as chrome-by-token rather than silently missing.
+ line += f' [chrome, not animatable: {", ".join(chrome_ids)}]'
+ lines.append(line)
return lines, anonymous
diff --git a/skills/ppt-master/scripts/svg_to_pptx/native_objects/__init__.py b/skills/ppt-master/scripts/svg_to_pptx/native_objects/__init__.py
index 824acabe..14ae437d 100644
--- a/skills/ppt-master/scripts/svg_to_pptx/native_objects/__init__.py
+++ b/skills/ppt-master/scripts/svg_to_pptx/native_objects/__init__.py
@@ -566,8 +566,12 @@ def validate_native_object_marker_with_warnings(
)
if kind in {"chart", "table"} else []
)
+ # The final checker reports these as warnings because activation is an
+ # export-time choice; ``--native-charts-and-tables`` refuses the same
+ # findings as errors, so say so where the author reads them.
warnings.extend(
- _projection_warnings_for_validated_marker(
+ f"{warning} (blocks --native-charts-and-tables export)"
+ for warning in _projection_warnings_for_validated_marker(
elem,
kind,
payload,
diff --git a/skills/ppt-master/scripts/svg_to_pptx/native_objects/chart_style.py b/skills/ppt-master/scripts/svg_to_pptx/native_objects/chart_style.py
index c2b86cbc..39a2741e 100644
--- a/skills/ppt-master/scripts/svg_to_pptx/native_objects/chart_style.py
+++ b/skills/ppt-master/scripts/svg_to_pptx/native_objects/chart_style.py
@@ -3,6 +3,7 @@
from __future__ import annotations
import math
+import re
from typing import Any
from xml.etree import ElementTree as ET
@@ -709,7 +710,9 @@ def _native_chart_style_color_warnings(
continue
warnings.append(
f"Native PPTX chart style.{field_name} #{payload_color} differs "
- f"from fallback dominant {field_name} #{fallback_color}"
+ f"from fallback dominant {field_name} #{fallback_color}; set "
+ f"style.{field_name} to #{fallback_color} or repaint the fallback "
+ f"so #{payload_color} is its dominant {field_name}"
)
return warnings
@@ -841,11 +844,65 @@ def _chart_projection_text_variants(value: Any) -> set[str]:
return variants
+_NUMBER_FORMAT_RE = re.compile(r"^(#,##|#|0)?(0*)(?:\.(0+))?(%?)$")
+
+
+def _format_number_like_excel(number: float, number_format: str) -> str | None:
+ """Render ``number`` the way PowerPoint shows a plain Excel format code.
+
+ Covers the codes a chart payload realistically writes — ``0``, ``0.0``,
+ ``0.00``, ``#,##0``, ``#,##0.0``, and their ``%`` forms. Anything else
+ returns ``None`` so the caller keeps only the literal variants.
+ """
+ match = _NUMBER_FORMAT_RE.match(number_format.strip())
+ if match is None:
+ return None
+ grouping, _integers, decimals, percent = match.groups()
+ value = number * 100 if percent else number
+ digits = len(decimals or "")
+ text = f"{value:,.{digits}f}" if grouping == "#,##" else f"{value:.{digits}f}"
+ return f"{text}%" if percent else text
+
+
+def _chart_number_formats(payload: dict[str, Any]) -> list[str]:
+ """Collect every ``number_format`` the payload applies to visible numbers."""
+ formats: list[str] = []
+
+ def add(container: Any) -> None:
+ if not isinstance(container, dict):
+ return
+ value = container.get("number_format")
+ if value is None:
+ value = container.get("numberFormat")
+ if isinstance(value, str) and value.strip() and value not in formats:
+ formats.append(value)
+
+ for labels in (payload.get("data_labels"), payload.get("dataLabels")):
+ add(labels)
+ if isinstance(labels, dict):
+ for point in labels.get("points") or []:
+ add(point)
+ for plot in payload.get("plots") or []:
+ if isinstance(plot, dict):
+ add(plot.get("data_labels"))
+ add(plot.get("dataLabels"))
+ for series in payload.get("series") or []:
+ if isinstance(series, dict):
+ add(series.get("data_labels"))
+ add(series.get("dataLabels"))
+ axes = payload.get("axes")
+ if isinstance(axes, dict):
+ for config in axes.values():
+ add(config)
+ return formats
+
+
def _chart_projected_texts(
payload: dict[str, Any],
chart_data: dict[str, Any],
) -> set[str]:
projected: set[str] = set()
+ number_formats = _chart_number_formats(payload)
def add(value: Any) -> None:
if isinstance(value, dict):
@@ -861,6 +918,13 @@ def _chart_projected_texts(
add(item)
return
projected.update(_chart_projection_text_variants(value))
+ numeric = _maybe_number(value)
+ if numeric is None:
+ return
+ for number_format in number_formats:
+ formatted = _format_number_like_excel(numeric, number_format)
+ if formatted:
+ projected.add(formatted)
for key in ("categories", "levels", "plots", "series", "values"):
add(chart_data.get(key))
@@ -893,12 +957,14 @@ def _chart_projected_texts(
or major_unit <= 0
):
continue
- value = minimum
- for _ in range(1000):
+ # Build each tick from the index, not by accumulating ``major_unit``:
+ # repeated float addition turns the top tick 5.6 into
+ # 5.6000000000000005 and the fallback's "5.6" is then reported missing.
+ for index in range(1000):
+ value = round(minimum + index * major_unit, 10)
if value > maximum + major_unit * 1e-6:
break
- projected.update(_chart_projection_text_variants(value))
- value += major_unit
+ add(value)
return projected