docs: clarify LineWidth enum non-sequential style numbering#503
Merged
palewire merged 2 commits intochekos:mainfrom Nov 3, 2025
Merged
docs: clarify LineWidth enum non-sequential style numbering#503palewire merged 2 commits intochekos:mainfrom
palewire merged 2 commits intochekos:mainfrom
Conversation
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.
Contributor
There was a problem hiding this comment.
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
LineWidthenum 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
This addresses potential developer confusion when using raw API values
where higher style numbers don't mean thicker lines.