You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
chart: series without values take no span entries in cartesian rendering - #3300
What was wrong: series_spans filled one entry per category for every series, including empty ones; 255 empty series over 20,000 categories is 5.1 million entries (~117 MiB).
What changed: a series with no values gets an empty span row. Rows are read with get(), so consumers already tolerate short rows. Series with values are unchanged.
Blast radius: Cartesian charts (column, bar, line, area and combos) that contain an empty series.
Behavior changes: an empty stacked area/line series no longer draws its zero-thickness line along the stack top.
Checks run: cargo fmt --check; cargo clippy -p gridcraft-chart --all-targets -D warnings; cargo test -p gridcraft-chart (new test).
Not run: workspace tests.
Summary by CodeRabbit
Bug Fixes
Empty chart series no longer create placeholder spans, while populated series retain their expected spans.
Reviewing files that changed from the base of the PR and between 109c31d and 80c456d.
You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.
Use the checkbox below for a quick retry:
Trigger review
No actionable comments were generated in the recent review.
Walkthrough
series_spans now skips span generation for empty series. A test checks that empty series produce zero spans and populated series retain MAX_CATS spans.
Changes: Series span handling
Layer / File(s)
Summary
Skip spans for empty series crates/chart/src/render/cartesian.rs
series_spans skips the category loop when a series has no values. The test checks zero spans for an empty series and MAX_CATS spans for a populated series.
storytold/gridcraft#1147 reports memory growth from per-point allocations, including stack spans. This change reduces span entries for empty series but does not implement the issue’s point-budget, trendline, or moving-average changes.
Suggested reviewers:neilcawse
Merge Risk: Minimal · previous review 109c3
The empty-series optimization is safe and ready to merge.
Pre-merge checks: 4 · 1
Failed checks: 1 warning
Check name
Status
Explanation
Resolution
Docstring Coverage
Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed checks: 4 passed
Check name
Status
Explanation
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
The title clearly and concisely describes the main change: empty series no longer create span entries during Cartesian rendering.
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage
Explanation
Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 1 functions across 1 files.
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
Finishing Touches
Generate docstrings
Commit to this branch
Create a new PR
Generate unit tests (beta)
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Reviewing files that changed from the base of the PR and between df137b8 and 109c31d.
Files selected for processing: 1
crates/chart/src/render/cartesian.rs
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 1 remain after this review.
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
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.
What was wrong: series_spans filled one entry per category for every series, including empty ones; 255 empty series over 20,000 categories is 5.1 million entries (~117 MiB).
What changed: a series with no values gets an empty span row. Rows are read with get(), so consumers already tolerate short rows. Series with values are unchanged.
Blast radius: Cartesian charts (column, bar, line, area and combos) that contain an empty series.
Behavior changes: an empty stacked area/line series no longer draws its zero-thickness line along the stack top.
Checks run: cargo fmt --check; cargo clippy -p gridcraft-chart --all-targets -D warnings; cargo test -p gridcraft-chart (new test).
Not run: workspace tests.
Summary by CodeRabbit