Charts: axis c:spPr is appended out of OOXML schema order
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
从 sdpm/sdpm/engine/builder/elements/chart.py 中 _add_chart 的“Axis lines”代码块开始,根据坐标轴架构的顺序检查其他 c:spPr 插入位置。创建柱状图和折线图,然后验证在 c:valAx 和 c:catAx 中,c:spPr 位于 c:txPr 和 c:crossAx 之前;运行 ruff 和 pytest sdpm/tests/test_chart_roundtrip.py,并在 CHANGELOG.md 的 [Unreleased] 下添加一条 Fixed 条目。
由索引模型根据 Issue 内容生成。
描述
Summary
When the chart builder styles the axis line, it adds the axis c:spPr with etree.SubElement(ax_el, qn('c:spPr')). That appends it as the last child of c:valAx / c:catAx. In the OOXML schema (CT_ValAx / CT_CatAx), c:spPr belongs after c:tickLblPos and before c:txPr / c:crossAx. So the generated chart XML is out of schema order.
Where
sdpm/sdpm/engine/builder/elements/chart.py, the "Axis lines" block in _add_chart (two places: the themed default and the valueAxis.line == "none" branch). The same pattern may apply to other SubElement(..., 'c:spPr') calls in that function; worth checking each against the schema.
Why it matters
As far as I know, PowerPoint accepts this today, so it is a latent problem rather than a visible one. I have not tested every Office version. Strict consumers and validators can reject it, and it will bite when a new chart type (see #620, #621, #622) reuses this code.
Expected
Insert c:spPr at its schema position instead of appending. For example, insert it before the first existing c:txPr, c:crossAx or c:crosses child, or immediately after c:tickLblPos when present.
Done when
- A helper (for example
_insert_in_order) putsc:spPrin the right place forc:valAxandc:catAx. - A test builds a bar and a line chart (the types that have axes) and checks that, in
c:valAxandc:catAx,c:spPrcomes beforec:txPrandc:crossAx. -
CHANGELOG.md[Unreleased]has aFixedentry. -
ruffandpytest sdpm/tests/test_chart_roundtrip.pypass.
This is a good first issue: one file, one helper, one test.
🤖 Created by Kiro Crew
- 主要语言
- Python
- 星标
- 136
- 派生
- 13
- 平均合并
- 7 小时 43 分钟
- 30 天内合并 PR
- 180
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
aws-samples/sample-spec-driven-presentation-maker 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
aws-samples/sample-spec-driven-presentation-maker#646 ·
维护者通常 1 天内回复
-
Charts: setting `valueAxis` skips theme styling of axis labels and axis lines可能已有人在做 @ShotaroKataoka 于 1 天前认领。 未关闭bug
难度 3/5 1-2 天 新手友好度 67/100
aws-samples/sample-spec-driven-presentation-maker#630 ·
维护者通常 1 天内回复
-
enhancement
难度 4/5 3-5 天 新手友好度 50/100
aws-samples/sample-spec-driven-presentation-maker#627 ·
维护者通常 1 天内回复
-
enhancement good first issue
难度 4/5 3-5 天 新手友好度 68/100
aws-samples/sample-spec-driven-presentation-maker#622 ·
维护者通常 1 天内回复
-
Charts: add radar charts (chartType "radar")可能已有人在做 @tridev-tej 于 4 天前认领。 未关闭enhancement good first issue
难度 4/5 3-5 天 新手友好度 25/100
aws-samples/sample-spec-driven-presentation-maker#621 ·
维护者通常 1 天内回复
查看 aws-samples/sample-spec-driven-presentation-maker 的全部 Issue
相似的 Issue
-
firestore: enable live window.yaml pipeline system tests once add_window_fields is in production未关闭
难度 1/5 1 小时以内 新手友好度 64/100
googleapis/google-cloud-python#19115 ·
维护者通常 2 天内回复
-
enhancement
难度 2/5 1-3 小时 新手友好度 62/100
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 75/100
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
bug prov-json
难度 2/5 1-3 小时 新手友好度 87/100
维护者通常 1 天内回复