chore: archive update-candle-colors change
This commit is contained in:
parent
cce55c63c1
commit
4dad24845e
6 changed files with 9 additions and 8 deletions
|
|
@ -0,0 +1,2 @@
|
|||
schema: spec-driven
|
||||
created: 2026-02-12
|
||||
|
|
@ -0,0 +1,51 @@
|
|||
## Context
|
||||
|
||||
The candlestick chart is rendered using the lightweight-charts library in `CandleChart.tsx`. Currently, the chart uses green (`#10b981`) for up candles and red (`#ef4444`) for down candles, with matching wick colors. This change updates the color scheme to a classic black/white pattern.
|
||||
|
||||
The lightweight-charts library configures candlestick colors through the `addCandlestickSeries` options, specifically:
|
||||
- `upColor`: Interior fill color for bullish candles
|
||||
- `downColor`: Interior fill color for bearish candles
|
||||
- `wickUpColor`: Wick color for bullish candles
|
||||
- `wickDownColor`: Wick color for bearish candles
|
||||
- `borderUpColor`: Border color for bullish candles
|
||||
- `borderDownColor`: Border color for bearish candles
|
||||
- `borderVisible`: Whether to show borders
|
||||
|
||||
## Goals / Non-Goals
|
||||
|
||||
**Goals:**
|
||||
- Update up candles to white interior with black outline
|
||||
- Update down candles to solid black
|
||||
- Maintain visual clarity and readability of the chart
|
||||
|
||||
**Non-Goals:**
|
||||
- Adding user-configurable color themes
|
||||
- Changing annotation or marker colors
|
||||
- Modifying any chart behavior beyond visual appearance
|
||||
|
||||
## Decisions
|
||||
|
||||
### Decision 1: Color Values
|
||||
- **Up candles**: `upColor: '#ffffff'`, `borderUpColor: '#000000'`, `wickUpColor: '#000000'`, `borderVisible: true`
|
||||
- **Down candles**: `downColor: '#000000'`, , `borderDownColor: '#000000'`, `wickDownColor: '#000000'`
|
||||
|
||||
**Rationale**: Pure white (`#ffffff`) and pure black (`#000000`) provide maximum contrast and match traditional financial charting conventions. Borders must be visible for up candles to show the black outline.
|
||||
|
||||
**Alternatives considered**:
|
||||
- Using slightly off-white or gray tones: Rejected as it reduces clarity
|
||||
- Making borders visible for both up and down candles: Unnecessary for down candles since they're solid black
|
||||
|
||||
### Decision 2: Implementation Location
|
||||
Update the `addCandlestickSeries` configuration in the chart initialization effect in `CandleChart.tsx`.
|
||||
|
||||
**Rationale**: This is the single location where candlestick series styling is configured.
|
||||
|
||||
**Alternatives considered**:
|
||||
- Creating a separate color configuration object: Overkill for a simple color change
|
||||
- Using CSS or theme variables: Not supported by lightweight-charts API for series colors
|
||||
|
||||
## Risks / Trade-offs
|
||||
|
||||
**[Risk]** White candles may have reduced visibility on light backgrounds → **Mitigation**: Black borders ensure visibility; background color is already `#ffffff`
|
||||
|
||||
**[Trade-off]** Deviating from common green/red convention → **Benefit**: More professional appearance and better for users with color vision deficiencies
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
## Why
|
||||
|
||||
The current candlestick chart uses green and red colors which may not provide optimal visual contrast or match the desired aesthetic. Updating to a classic black/white color scheme will improve readability and provide a more traditional financial chart appearance.
|
||||
|
||||
## What Changes
|
||||
|
||||
- Update up candles (bullish) to display with white interior and black outline
|
||||
- Update down candles (bearish) to display as completely black
|
||||
- Modify wick colors to match the new color scheme
|
||||
|
||||
## Capabilities
|
||||
|
||||
### New Capabilities
|
||||
<!-- No new capabilities being introduced -->
|
||||
|
||||
### Modified Capabilities
|
||||
- `chart-canvas`: Updating the candlestick series color configuration to use black/white scheme instead of green/red
|
||||
|
||||
## Impact
|
||||
|
||||
- Affects `src/components/CandleChart.tsx` where candlestick series colors are configured
|
||||
- Visual change only - no API or data structure changes
|
||||
- No breaking changes to functionality
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
## MODIFIED Requirements
|
||||
|
||||
### Requirement: Candlestick chart rendering
|
||||
The system SHALL render candle data as a candlestick chart using the `lightweight-charts` library (v4). The chart MUST display OHLC data with candlestick visuals using a black and white color scheme. Bullish candles SHALL have a white interior with black outline and black wicks. Bearish candles SHALL be completely black (black fill and black wicks). The chart SHALL be a client-side React component.
|
||||
|
||||
#### Scenario: Chart renders candle data
|
||||
- **WHEN** candle data exists in the database and the page loads
|
||||
- **THEN** the chart renders all candles as a candlestick series with correct open/high/low/close values
|
||||
|
||||
#### Scenario: Empty state
|
||||
- **WHEN** no candle data exists in the database
|
||||
- **THEN** the chart area displays an empty chart with a prompt to upload CSV data
|
||||
|
||||
#### Scenario: Bullish candle appearance
|
||||
- **WHEN** a candle's close price is higher than its open price (bullish)
|
||||
- **THEN** the candle displays with white interior, black border, and black wick
|
||||
|
||||
#### Scenario: Bearish candle appearance
|
||||
- **WHEN** a candle's close price is lower than its open price (bearish)
|
||||
- **THEN** the candle displays as completely black (black fill and black wick)
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
## 1. Update Candlestick Color Configuration
|
||||
|
||||
- [x] 1.1 Update the `addCandlestickSeries` configuration in `src/components/CandleChart.tsx` to set `upColor: '#ffffff'` for bullish candles
|
||||
- [x] 1.2 Set `borderUpColor: '#000000'` to add black outline to bullish candles
|
||||
- [x] 1.3 Set `wickUpColor: '#000000'` to make bullish wicks black
|
||||
- [x] 1.4 Set `borderVisible: true` to enable borders for candlesticks
|
||||
- [x] 1.5 Set `downColor: '#000000'` for bearish candles to make them solid black
|
||||
- [x] 1.6 Set `wickDownColor: '#000000'` to make bearish wicks black
|
||||
|
||||
## 2. Verification
|
||||
|
||||
- [x] 2.1 Test the chart with sample data to verify bullish candles display with white interior and black outline
|
||||
- [x] 2.2 Verify bearish candles display as completely black
|
||||
- [x] 2.3 Confirm chart remains readable and visually clear with the new color scheme
|
||||
Loading…
Add table
Add a link
Reference in a new issue