Charts: add radar charts (chartType "radar")

Đang mở
#621 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@tridev-tej đang làm issue này rồi.

Từ ngày 13/11/2026.

  • #623 của @tridev-tej — đang mở

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
25/100
Loại issue
Tính năng
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
python
Lĩnh vực
backend

Hướng nghiên cứu

A linked open pull request (#623) is already working on this issue, so check its changes before taking it on. The issue names sdpm/sdpm/engine/builder/elements/chart.py, sdpm/sdpm/engine/converter/chart.py, sdpm/sdpm/engine/schema/lint.py, and the chart guides and tests. Done means radar charts build and round-trip with markers and data intact, lint accepts the type, and the listed lint and pytest commands pass.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

enhancement good first issue
What problem would this solve?

Native charts support chartType bar, line, pie and donut only. Radar (spider) charts are a common way to compare options across several criteria (vendor evaluation, skill maps, Well-Architected pillar scores), and python-pptx builds them natively (XL_CHART_TYPE.RADAR, RADAR_MARKERS). Today an agent has to approximate them with a bar chart, and a radar chart imported with pptx_to_json is read as a bar chart that only its _chartXml keeps (_chartRebuildable: false).

Proposed solution

Add chartType: "radar". It uses the same category data as line, and the existing markers flag:

{
  "type": "chart", "chartType": "radar",
  "x": 192, "y": 216, "width": 1000, "height": 700,
  "categories": ["Cost", "Performance", "Security", "Reliability", "Operations"],
  "series": [
    {"name": "Option A", "values": [4, 3, 5, 4, 2], "color": "#FF9900"},
    {"name": "Option B", "values": [2, 5, 3, 3, 4], "color": "#41B3FF"}
  ],
  "markers": true,
  "legend": true,
  "valueAxis": {"min": 0, "max": 5, "majorUnit": 1}
}
  • markers: true (default, as for line) → XL_CHART_TYPE.RADAR_MARKERS, markers: false → XL_CHART_TYPE.RADAR. The filled variant (RADAR_FILLED) is out of scope and stays non-rebuildable.
  • Series color is the line (and marker) colour, as for line; style.lineWidth / style.markerSize apply.
  • valueAxis (min / max / majorUnit / gridlines) sets the radial scale.

Files to touch:

  • sdpm/sdpm/engine/builder/elements/chart.py (_add_chart): the type_map; the series colour branch (elif chart_type == "line" — radar series are lines too); check that the "Axis & gridline styling (bar/line only)" block works on a radar chart's axes, or skip the parts that do not apply.
  • sdpm/sdpm/engine/converter/chart.py (extract_chart_element): map RADAR / RADAR_MARKERS in type_map (and markers: false for plain RADAR, like LINE), so the chart reads back as radar and becomes rebuildable.
  • sdpm/sdpm/engine/schema/lint.py: add radar to _CHART_TYPES and update the "Specify bar, line, pie, or donut" message.
  • Docs: the chart section of sdpm/references/guides/slide-json-media.md (chartType list and guide list), and a new sdpm/references/guides/chart-radar.md modelled on chart-line.md (when to use it: few series, 3–8 criteria on the same scale). If you add the guide, also add it next to chart-bar / chart-line / chart-pie in sdpm/references/guides/slide-json-spec.md and sdpm/references/workflows/composer.md.
  • CHANGELOG.md: an entry under [Unreleased] → Added.

Done when

  • chartType: "radar" builds a c:radarChart (with and without markers), and pptx_to_json reads it back as chartType: "radar" with markers, categories, series names, values and colours intact.
  • An edited radar chart is rebuilt from its JSON: drop "radar" from the kind list of TestChartsTheJsonCannotDescribe::test_edited_chart_keeps_its_type in tests/test_chart_roundtrip.py.
  • Lint accepts radar and still rejects unknown types.
  • make lint and uv run pytest tests/test_chart_roundtrip.py -v pass.

Tests to copy: TestChartTypes::test_line_markers and TestColors::test_line_series_color in tests/test_chart_roundtrip.py (they use _one_chart / _built_chart, no LibreOffice needed).

Which area?

Slide generation / engine (layouts, elements, charts)

🤖 Created by Kiro Crew

Ngôn ngữ chính
Python
Star
136
Fork
13
Merge trung bình
7 giờ 36 phút
Pull request đã merge (30 ngày)
175

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của aws-samples/sample-spec-driven-presentation-maker

Tất cả issue của aws-samples/sample-spec-driven-presentation-maker

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.