Skip to content

docs: clarify LineWidth enum non-sequential style numbering#503

Merged
palewire merged 2 commits intochekos:mainfrom
palewire:main
Nov 3, 2025
Merged

docs: clarify LineWidth enum non-sequential style numbering#503
palewire merged 2 commits intochekos:mainfrom
palewire:main

Conversation

@palewire
Copy link
Copy Markdown
Collaborator

@palewire palewire commented Nov 3, 2025

Improve documentation for LineWidth enum to highlight that style numbers
do not correspond to line thickness in sequential order. Added warnings
and examples to prevent confusion where style3 is the thinnest (1px) and
style2 is the thickest (4px), contrary to what the numbering suggests.

Changes:

  • Enhanced docstring with clear attribute descriptions and warnings
  • Added inline comments on enum values showing pixel widths
  • Expanded Field description with concrete examples
  • Emphasized using enum values over raw strings to avoid confusion

This addresses potential developer confusion when using raw API values
where higher style numbers don't mean thicker lines.

Improve documentation for LineWidth enum to highlight that style numbers
do not correspond to line thickness in sequential order. Added warnings
and examples to prevent confusion where style3 is the thinnest (1px) and
style2 is the thickest (4px), contrary to what the numbering suggests.

Changes:
- Enhanced docstring with clear attribute descriptions and warnings
- Added inline comments on enum values showing pixel widths
- Expanded Field description with concrete examples
- Emphasized using enum values over raw strings to avoid confusion

This addresses potential developer confusion when using raw API values
where higher style numbers don't mean thicker lines.
@palewire palewire requested a review from Copilot November 3, 2025 19:27
@palewire palewire merged commit 2526de7 into chekos:main Nov 3, 2025
12 checks passed
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR enhances the documentation for the LineWidth enum to clearly warn users that the style numbers (style0-style3) don't increase with thickness, which is counterintuitive. The documentation is updated in both the enum definition and the Field description to prevent confusion.

  • Updated LineWidth enum docstring with warnings and clearer examples
  • Expanded Field description with inline examples and warnings about non-sequential style numbers
  • Added inline comments to enum values highlighting the counterintuitive numbering

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
datawrapper/charts/enums/line_width.py Enhanced enum docstring with warnings, restructured attributes section, and added inline comments to enum values
datawrapper/charts/line.py Expanded Field description with examples and warning about style number ordering

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

2 participants