Skip to content

Pie template clean: PR for heroku review app#613

Open
artoonie wants to merge 30 commits intomainfrom
pie-template-clean
Open

Pie template clean: PR for heroku review app#613
artoonie wants to merge 30 commits intomainfrom
pie-template-clean

Conversation

@artoonie
Copy link
Copy Markdown
Owner

No description provided.

skaphan added 17 commits March 20, 2026 18:11
Add embedded pie chart web component, templates, static assets,
and pie_chart_no_cache setting. Store raw JSON on graph for pie
chart data access.
The pie chart was the only visualization reading graph._raw_JSON directly,
bypassing config filters like excludeFinalWinnerAndEliminatedCandidate.
New converter in visualizer/pie/graphToRCtab.py builds RCTab-compatible
JSON from the same processed Graph that bar chart and sankey use.

Co-Authored-By: Claude Opus 4.6
- Pass textForWinner and excludeFinalWinnerAndEliminatedCandidate
- Set currentRound to numRounds so pie loads on last round
- Rebuilt standalone component with new props

Co-Authored-By: Claude Opus 4.6
Following the hideSankey/hideTabular pattern: model field, config JS
variable, settings checkbox, and tab hiding in hideTabsBasedOnConfig().

Co-Authored-By: Claude Opus 4.6
Covers structure validation, tally correctness, eliminations, multi-winner
surplus, inactive ballots, no-threshold elections, excludeFinalWinner flag,
and the _stringify helper.

Co-Authored-By: Claude Opus 4.6
Co-Authored-By: Claude Opus 4.6
Use a coprime stride near N/2 to reorder the color palette so that
visually similar colors are spread apart around the pie chart.

Co-Authored-By: Claude Opus 4.6
Replace color scramble with tally interleaving: alternate largest and
smallest candidates so small slices always have a large neighbor,
reducing label overlap. Inactive Ballots always last.

Fix color generation to use actual tally entry count instead of
config.numCandidates, which excluded Inactive Ballots and caused
color wrapping on large elections.

Co-Authored-By: Claude Opus 4.6
Per-round reordering broke D3 pie animation because candidate positions
shifted between rounds. Now the interleave order is stable across all
rounds, just dropping eliminated candidates.

Co-Authored-By: Claude Opus 4.6
Tests pie vistype rendering, embedly redirect, hidePie config toggle,
and cloudflare cache purge including pie URLs. Tests graphToRCtab with
candidate names containing HTML, quotes, and other special characters.

Co-Authored-By: Claude Opus 4.6
Set firstRoundDeterminesPercentages=false so percentages use active
votes per round as denominator. Inactive Ballots shows count only.
Animation button cycles Eliminate/Transfer/Consolidate labels.

Co-Authored-By: Claude Opus 4.6
…hart

Tooltip now positions near mouse cursor with viewport clamping.
Pie chart centered (removed stale margin-right). Bubble visualization
references removed.

Co-Authored-By: Claude Opus 4.6
Set aspect-ratio and max-width on pie-body container so the
browser allocates space before the custom element renders.
Reduces Cumulative Layout Shift from 0.753 to 0.014.

Co-Authored-By: Claude Opus 4.6
skaphan added 4 commits March 24, 2026 18:03
- Make pie_chart_no_cache conditional on DEBUG
- Remove TODO comment from pie.css
- Renumber hidePie migration to 0034 (avoids conflict with caching PR)
- Move _stringify to common.stringify (public API)
- Improve testGraphToRCtab docstring explaining its purpose
- Remove scripts/reset-db.sh from .gitignore
- Add pie chart round-change Selenium test

Co-Authored-By: Claude Opus 4.6
@artoonie artoonie force-pushed the pie-template-clean branch from 25c9746 to 49e52dd Compare March 25, 2026 19:32
@artoonie artoonie temporarily deployed to rcvis-pr-613 March 25, 2026 19:32 Inactive
@artoonie artoonie force-pushed the pie-template-clean branch from 1c99b8a to 32a8386 Compare April 6, 2026 17:44
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 6, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.07%. Comparing base (0b93708) to head (c94fd8a).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #613      +/-   ##
==========================================
+ Coverage   95.48%   96.07%   +0.58%     
==========================================
  Files         131      133       +2     
  Lines        6141     6349     +208     
==========================================
+ Hits         5864     6100     +236     
+ Misses        277      249      -28     
Files with missing lines Coverage Δ
common/cloudflare.py 97.50% <ø> (ø)
common/viewUtils.py 100.00% <ø> (ø)
rcvis/settings.py 75.64% <ø> (ø)
visualizer/graph/graph.py 100.00% <100.00%> (ø)
visualizer/graph/readRCVRCJSON.py 94.73% <100.00%> (+0.03%) ⬆️
visualizer/migrations/0034_jsonconfig_hidepie.py 100.00% <100.00%> (ø)
visualizer/serializers.py 99.15% <100.00%> (+0.01%) ⬆️
visualizer/tests/testLiveBrowserHeadless.py 99.43% <100.00%> (+0.01%) ⬆️
visualizer/tests/testSimple.py 100.00% <100.00%> (ø)

... and 3 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0b93708...c94fd8a. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants