-
Notifications
You must be signed in to change notification settings - Fork 0
feat(ooxml): Add conditional formatting support #136
Copy link
Copy link
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Summary
Add support for conditional formatting rules.
Syntax
# Highlight cells > 100
xl -f file.xlsx -s Sheet1 -o out.xlsx cond-format B2:B100 \
--rule ">100" --bg green --fg white
# Data bars
xl -f file.xlsx -s Sheet1 -o out.xlsx cond-format B2:B100 \
--rule "data-bars" --color blue
# Color scale (gradient)
xl -f file.xlsx -s Sheet1 -o out.xlsx cond-format B2:B100 \
--rule "color-scale" --min red --max green
# Icon sets
xl -f file.xlsx -s Sheet1 -o out.xlsx cond-format B2:B100 \
--rule "icon-set" --icons "3-arrows"Rule Types
- Cell Value:
">100","<0","=X" - Data Bars: Visual bars showing relative values
- Color Scale: Gradient based on values
- Icon Sets: Arrows, traffic lights, etc.
- Formulas: Custom formula-based rules
OOXML Implementation
Requires writing <conditionalFormatting> elements to worksheet.xml:
<conditionalFormatting sqref="B2:B100">
<cfRule type="cellIs" operator="greaterThan" priority="1">
<formula>100</formula>
<dxf>
<fill><patternFill><bgColor rgb="FF00FF00"/></patternFill></fill>
</dxf>
</cfRule>
</conditionalFormatting>Complexity
This is a significant feature requiring:
- New OOXML writer for conditionalFormatting
- Differential formatting (dxf) support
- Multiple rule type handlers
- Priority management for overlapping rules
Acceptance Criteria
- Basic cell value rules work
- Formatting appears correctly in Excel
- Data bars work (simpler case)
- Multiple rules on same range work
Priority
Low - Complex OOXML feature
Milestone
v0.8.0+
Related
- Mentioned in GH#90 (WYSIWYG rendering)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request