filter_breaks_to_range cannot filter temporal breaks, so out-of-domain ticks survive
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 554
- Forks
- 30
- Avg merge
- 17h 27m
- Merged PRs (30d)
- 8
Description
This issue was surfaced during the Hephaestus writer work
Summary
filter_breaks_to_range (src/plot/scale/breaks.rs:292) returns the break list unchanged unless both range endpoints are ArrayElement::Number, and inside the predicate it explicitly keeps any break that is not a Number. A Date / DateTime / Time scale therefore never gets filtered: a calendar-aligned major computed outside the resolved domain survives, and both writers place a tick off-panel.
Reproduction
VISUALISE Date AS x, Temp AS y FROM ggsql:airquality
DRAW line
SCALE x SETTING breaks => '2 months'
domain: ['1973-04-23', '1973-10-07']
values: ['1973-04-01', '1973-06-01', '1973-08-01', '1973-10-01', '1973-12-01']
1973-04-01 and 1973-12-01 are both outside the resolved domain.
Suggested fix
Filter on ArrayElement::to_f64() for the range endpoints and the breaks alike — which is exactly what the minor breaks path already does — falling back to the current pass-through only when a value has no numeric projection.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in src/plot/scale/breaks.rs at filter_breaks_to_range around line 292, then compare its numeric handling with the minor-breaks path's use of ArrayElement::to_f64(). Done means temporal breaks outside the resolved domain are removed while values without a numeric projection retain the current pass-through behavior; verify with the Date scale reproduction in the issue.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- data-visualization
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 82/100